keycloak-scim/src/stories/RoleMappingForm.stories.tsx
Erik Jan de Wit 49ef2bd665
Add role mapping into the flow and filter the clients that don't have roles (#222)
* addd role mapping into the flow

* added filter for clients that don't have roles

* fixed types
2020-11-17 16:39:28 -05:00

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>
);