fix: added in applications.ftl story and fixed issue with double comma when realmRolesAvailable and resourceRolesAvailable both present
This commit is contained in:
parent
c7d47f128e
commit
5d1695ada8
@ -62,7 +62,6 @@ export default function Applications(props: PageProps<Extract<KcContext, { pageI
|
|||||||
{index < application.realmRolesAvailable.length - 1 && ", "}
|
{index < application.realmRolesAvailable.length - 1 && ", "}
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
{!isArrayWithEmptyObject(application.realmRolesAvailable) && application.resourceRolesAvailable && ", "}
|
|
||||||
{application.resourceRolesAvailable &&
|
{application.resourceRolesAvailable &&
|
||||||
Object.keys(application.resourceRolesAvailable).map(resource => (
|
Object.keys(application.resourceRolesAvailable).map(resource => (
|
||||||
<span key={resource}>
|
<span key={resource}>
|
||||||
|
80
stories/account/pages/Applications.stories.tsx
Normal file
80
stories/account/pages/Applications.stories.tsx
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
import React from "react";
|
||||||
|
import type { Meta, StoryObj } from "@storybook/react";
|
||||||
|
import { createKcPageStory } from "../KcPageStory";
|
||||||
|
|
||||||
|
const { KcPageStory } = createKcPageStory({ pageId: "applications.ftl" });
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: "account/applications.ftl",
|
||||||
|
component: KcPageStory
|
||||||
|
} satisfies Meta<typeof KcPageStory>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Default: Story = {
|
||||||
|
render: () => (
|
||||||
|
<KcPageStory
|
||||||
|
kcContext={{
|
||||||
|
pageId: "applications.ftl",
|
||||||
|
applications: {
|
||||||
|
applications: [
|
||||||
|
{
|
||||||
|
realmRolesAvailable: [
|
||||||
|
{
|
||||||
|
name: "realmRoleName1",
|
||||||
|
description: "realm role description 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "realmRoleName2",
|
||||||
|
description: "realm role description 2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
resourceRolesAvailable: {
|
||||||
|
resource1: [
|
||||||
|
{
|
||||||
|
roleName: "Resource Role Name 1",
|
||||||
|
roleDescription: "Resource role 1 description",
|
||||||
|
clientName: "Client Name 1",
|
||||||
|
clientId: "client1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
resource2: [
|
||||||
|
{
|
||||||
|
roleName: "Resource Role Name 2",
|
||||||
|
clientName: "Client Name 1",
|
||||||
|
clientId: "client1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
additionalGrants: ["grant1", "grant2"],
|
||||||
|
clientScopesGranted: ["scope1", "scope2"],
|
||||||
|
effectiveUrl: "#",
|
||||||
|
client: {
|
||||||
|
clientId: "application1",
|
||||||
|
name: "Application 1",
|
||||||
|
consentRequired: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
realmRolesAvailable: [
|
||||||
|
{
|
||||||
|
name: "Realm Role Name 1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
resourceRolesAvailable: {},
|
||||||
|
additionalGrants: [],
|
||||||
|
clientScopesGranted: [],
|
||||||
|
effectiveUrl: "#",
|
||||||
|
client: {
|
||||||
|
clientId: "application2",
|
||||||
|
name: "Application 2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user