49ef2bd665
* addd role mapping into the flow * added filter for clients that don't have roles * fixed types
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import React from "react";
|
|
import { Meta } from "@storybook/react";
|
|
import { Page } from "@patternfly/react-core";
|
|
|
|
import serverInfo from "../context/server-info/__tests__/mock.json";
|
|
import roles from "../realm-roles/__tests__/mock-roles.json";
|
|
import { ServerInfoContext } from "../context/server-info/ServerInfoProvider";
|
|
|
|
import { RoleMappingForm } from "../client-scopes/add/RoleMappingForm";
|
|
import { AdminClient } from "../context/auth/AdminClient";
|
|
import KeycloakAdminClient from "keycloak-admin";
|
|
|
|
export default {
|
|
title: "Role Mapping Form",
|
|
component: RoleMappingForm,
|
|
} as Meta;
|
|
|
|
export const RoleMappingFormExample = () => (
|
|
<ServerInfoContext.Provider value={serverInfo}>
|
|
<AdminClient.Provider
|
|
value={
|
|
({
|
|
setConfig: () => {},
|
|
roles: {
|
|
find: () => {
|
|
return roles;
|
|
},
|
|
},
|
|
clients: {
|
|
find: () => roles,
|
|
},
|
|
} as unknown) as KeycloakAdminClient
|
|
}
|
|
>
|
|
<Page>
|
|
<RoleMappingForm />
|
|
</Page>
|
|
</AdminClient.Provider>
|
|
</ServerInfoContext.Provider>
|
|
);
|