2020-10-27 11:25:54 +00:00
|
|
|
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";
|
2020-12-04 18:58:28 +00:00
|
|
|
import clients from "../clients/__tests__/mock-clients.json";
|
2020-10-27 11:25:54 +00:00
|
|
|
import { ServerInfoContext } from "../context/server-info/ServerInfoProvider";
|
|
|
|
|
|
|
|
import { RoleMappingForm } from "../client-scopes/add/RoleMappingForm";
|
2020-12-04 18:58:28 +00:00
|
|
|
import { MockAdminClient } from "./MockAdminClient";
|
2020-10-27 11:25:54 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
title: "Role Mapping Form",
|
|
|
|
component: RoleMappingForm,
|
|
|
|
} as Meta;
|
|
|
|
|
|
|
|
export const RoleMappingFormExample = () => (
|
|
|
|
<ServerInfoContext.Provider value={serverInfo}>
|
2020-12-04 18:58:28 +00:00
|
|
|
<MockAdminClient
|
|
|
|
mock={{
|
|
|
|
roles: {
|
|
|
|
find: () => roles,
|
|
|
|
},
|
|
|
|
clients: {
|
|
|
|
find: () => clients,
|
|
|
|
listRoles: () => roles,
|
|
|
|
},
|
|
|
|
}}
|
2020-10-27 11:25:54 +00:00
|
|
|
>
|
|
|
|
<Page>
|
2020-11-17 21:39:28 +00:00
|
|
|
<RoleMappingForm />
|
2020-10-27 11:25:54 +00:00
|
|
|
</Page>
|
2020-12-04 18:58:28 +00:00
|
|
|
</MockAdminClient>
|
2020-10-27 11:25:54 +00:00
|
|
|
</ServerInfoContext.Provider>
|
|
|
|
);
|