2021-01-29 13:59:03 +00:00
|
|
|
import React from "react";
|
|
|
|
import { PageSection } from "@patternfly/react-core";
|
2020-11-12 12:55:52 +00:00
|
|
|
import { ViewHeader } from "../components/view-header/ViewHeader";
|
2021-01-29 13:59:03 +00:00
|
|
|
import { useAdminClient } from "../context/auth/AdminClient";
|
|
|
|
import { RolesList } from "./RolesList";
|
2020-09-09 09:07:17 +00:00
|
|
|
|
2020-09-10 18:04:03 +00:00
|
|
|
export const RealmRolesSection = () => {
|
2020-11-12 12:55:52 +00:00
|
|
|
const adminClient = useAdminClient();
|
2021-02-23 13:36:37 +00:00
|
|
|
|
2021-02-18 06:38:23 +00:00
|
|
|
const loader = async (first?: number, max?: number, search?: string) => {
|
2020-12-07 19:23:18 +00:00
|
|
|
const params: { [name: string]: string | number } = {
|
2021-02-18 06:38:23 +00:00
|
|
|
first: first!,
|
2020-12-07 19:23:18 +00:00
|
|
|
max: max!,
|
|
|
|
search: search!,
|
|
|
|
};
|
|
|
|
return await adminClient.roles.find(params);
|
|
|
|
};
|
2020-09-18 08:04:55 +00:00
|
|
|
return (
|
2020-10-07 15:47:03 +00:00
|
|
|
<>
|
|
|
|
<ViewHeader titleKey="roles:title" subKey="roles:roleExplain" />
|
2020-10-14 20:50:10 +00:00
|
|
|
<PageSection variant="light">
|
2021-01-29 13:59:03 +00:00
|
|
|
<RolesList loader={loader} />
|
2020-10-07 15:47:03 +00:00
|
|
|
</PageSection>
|
|
|
|
</>
|
2020-09-18 08:04:55 +00:00
|
|
|
);
|
2020-09-09 09:07:17 +00:00
|
|
|
};
|