8000 Add form revert logic for tab providers by uzmamansoor09 · Pull Request #49331 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions js/apps/admin-ui/src/page/PageHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useAdminClient } from "../admin-client";
import { DynamicComponents } from "../components/dynamic/DynamicComponents";
import { useRealm } from "../context/realm-context/RealmContext";
import { useParams } from "../utils/useParams";
import { type PAGE_PROVIDER, TAB_PROVIDER } from "./constants";
import { PAGE_PROVIDER, TAB_PROVIDER } from "./constants";
import { toPage } from "./routes";

type PageHandlerProps = {
Expand Down Expand Up @@ -100,17 +100,28 @@ export const PageHandler = ({
<Button data-testid="save" type="submit">
{t("save")}
</Button>
<Button
variant="link"
component={(props) => (
<Link
{...props}
to={toPage({ realm: realmName, providerId: providerId! }) 8000 }
/>
)}
>
{t("cancel")}
</Button>
{providerType === PAGE_PROVIDER ? (
<Button
data-testid="cancel"
variant="link"
component={(props) => (
<Link
{...props}
to={toPage({ realm: realmName, providerId: providerId! })}
/>
)}
>
{t("cancel")}
</Button>
) : (
<Button
data-testid="cancel"
variant="link"
=> form.reset()}
>
{t("revert")}
</Button>
)}
</ActionGroup>
</Form>
</PageSection>
Expand Down
Loading
0