Rename KcApp to KcPage
This commit is contained in:
@ -4,7 +4,7 @@ import { useI18n } from "./i18n";
|
||||
import type { KcContext } from "./KcContext";
|
||||
import Template from "../../dist/account/Template";
|
||||
|
||||
export default function KcApp(props: { kcContext: KcContext }) {
|
||||
export default function KcPage(props: { kcContext: KcContext }) {
|
||||
const { kcContext } = props;
|
||||
|
||||
const { i18n } = useI18n({ kcContext });
|
@ -3,7 +3,7 @@ import type { DeepPartial } from "../../dist/tools/DeepPartial";
|
||||
import type { KcContext } from "./KcContext";
|
||||
import { createGetKcContextMock } from "../../dist/account/KcContext";
|
||||
import type { KcContextExtension, KcContextExtensionPerPage } from "./KcContext";
|
||||
import KcApp from "./KcApp";
|
||||
import KcPage from "./KcPage";
|
||||
import { themeNames, kcEnvDefaults } from "../kc.gen";
|
||||
|
||||
const kcContextExtension: KcContextExtension = {
|
||||
@ -21,10 +21,10 @@ export const { getKcContextMock } = createGetKcContextMock({
|
||||
overridesPerPage: {}
|
||||
});
|
||||
|
||||
export function createPageStory<PageId extends KcContext["pageId"]>(params: { pageId: PageId }) {
|
||||
export function createKcPageStory<PageId extends KcContext["pageId"]>(params: { pageId: PageId }) {
|
||||
const { pageId } = params;
|
||||
|
||||
function PageStory(props: { kcContext?: DeepPartial<Extract<KcContext, { pageId: PageId }>> }) {
|
||||
function KcPageStory(props: { kcContext?: DeepPartial<Extract<KcContext, { pageId: PageId }>> }) {
|
||||
const { kcContext: overrides } = props;
|
||||
|
||||
const kcContextMock = getKcContextMock({
|
||||
@ -34,10 +34,10 @@ export function createPageStory<PageId extends KcContext["pageId"]>(params: { pa
|
||||
|
||||
return (
|
||||
<React.StrictMode>
|
||||
<KcApp kcContext={kcContextMock} />
|
||||
<KcPage kcContext={kcContextMock} />
|
||||
</React.StrictMode>
|
||||
);
|
||||
}
|
||||
|
||||
return { PageStory };
|
||||
return { KcPageStory };
|
||||
}
|
@ -1,18 +1,18 @@
|
||||
import React from "react";
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import { createPageStory } from "../PageStory";
|
||||
import { createKcPageStory } from "../KcPageStory";
|
||||
|
||||
const { PageStory } = createPageStory({ pageId: "account.ftl" });
|
||||
const { KcPageStory } = createKcPageStory({ pageId: "account.ftl" });
|
||||
|
||||
const meta = {
|
||||
title: "account/account.ftl",
|
||||
component: PageStory
|
||||
} satisfies Meta<typeof PageStory>;
|
||||
component: KcPageStory
|
||||
} satisfies Meta<typeof KcPageStory>;
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => <PageStory />
|
||||
render: () => <KcPageStory />
|
||||
};
|
||||
|
@ -1,25 +1,25 @@
|
||||
import React from "react";
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import { createPageStory } from "../PageStory";
|
||||
import { createKcPageStory } from "../KcPageStory";
|
||||
|
||||
const { PageStory } = createPageStory({ pageId: "federatedIdentity.ftl" });
|
||||
const { KcPageStory } = createKcPageStory({ pageId: "federatedIdentity.ftl" });
|
||||
|
||||
const meta = {
|
||||
title: "account/federatedIdentity.ftl",
|
||||
component: PageStory
|
||||
} satisfies Meta<typeof PageStory>;
|
||||
component: KcPageStory
|
||||
} satisfies Meta<typeof KcPageStory>;
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => <PageStory />
|
||||
render: () => <KcPageStory />
|
||||
};
|
||||
|
||||
export const NotConnected: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
pageId: "federatedIdentity.ftl",
|
||||
federatedIdentity: {
|
||||
|
@ -1,15 +1,15 @@
|
||||
import React from "react";
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import { createPageStory } from "../PageStory";
|
||||
import { createKcPageStory } from "../KcPageStory";
|
||||
|
||||
const { PageStory } = createPageStory({
|
||||
const { KcPageStory } = createKcPageStory({
|
||||
pageId: "log.ftl"
|
||||
});
|
||||
|
||||
const meta = {
|
||||
title: "account/log.ftl",
|
||||
component: PageStory
|
||||
} satisfies Meta<typeof PageStory>;
|
||||
component: KcPageStory
|
||||
} satisfies Meta<typeof KcPageStory>;
|
||||
|
||||
export default meta;
|
||||
|
||||
@ -17,7 +17,7 @@ type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
log: {
|
||||
events: [
|
||||
|
@ -1,25 +1,25 @@
|
||||
import React from "react";
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import { createPageStory } from "../PageStory";
|
||||
import { createKcPageStory } from "../KcPageStory";
|
||||
|
||||
const { PageStory } = createPageStory({ pageId: "password.ftl" });
|
||||
const { KcPageStory } = createKcPageStory({ pageId: "password.ftl" });
|
||||
|
||||
const meta = {
|
||||
title: "account/password.ftl",
|
||||
component: PageStory
|
||||
} satisfies Meta<typeof PageStory>;
|
||||
component: KcPageStory
|
||||
} satisfies Meta<typeof KcPageStory>;
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => <PageStory />
|
||||
render: () => <KcPageStory />
|
||||
};
|
||||
|
||||
export const WithMessage: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
message: { type: "success", summary: "This is a test message" }
|
||||
}}
|
||||
|
@ -1,13 +1,13 @@
|
||||
import React from "react";
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import { createPageStory } from "../PageStory";
|
||||
import { createKcPageStory } from "../KcPageStory";
|
||||
|
||||
const { PageStory } = createPageStory({ pageId: "sessions.ftl" });
|
||||
const { KcPageStory } = createKcPageStory({ pageId: "sessions.ftl" });
|
||||
|
||||
const meta = {
|
||||
title: "account/sessions.ftl",
|
||||
component: PageStory
|
||||
} satisfies Meta<typeof PageStory>;
|
||||
component: KcPageStory
|
||||
} satisfies Meta<typeof KcPageStory>;
|
||||
|
||||
export default meta;
|
||||
|
||||
@ -15,7 +15,7 @@ type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
sessions: {
|
||||
sessions: [
|
||||
@ -45,7 +45,7 @@ export const Default: Story = {
|
||||
|
||||
export const WithError: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
url: { passwordUrl: "/auth/realms/keycloakify/account/password" },
|
||||
stateChecker: "xQ7EOgFrLi4EvnJ8dbXKhwFGWk_bkOp0X89mhilt1os",
|
||||
|
@ -1,13 +1,13 @@
|
||||
import React from "react";
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import { createPageStory } from "../PageStory";
|
||||
import { createKcPageStory } from "../KcPageStory";
|
||||
|
||||
const { PageStory } = createPageStory({ pageId: "totp.ftl" });
|
||||
const { KcPageStory } = createKcPageStory({ pageId: "totp.ftl" });
|
||||
|
||||
const meta = {
|
||||
title: "account/totp.ftl",
|
||||
component: PageStory
|
||||
} satisfies Meta<typeof PageStory>;
|
||||
component: KcPageStory
|
||||
} satisfies Meta<typeof KcPageStory>;
|
||||
|
||||
export default meta;
|
||||
|
||||
@ -15,7 +15,7 @@ type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
totp: {
|
||||
enabled: false,
|
||||
@ -51,7 +51,7 @@ export const Default: Story = {
|
||||
|
||||
export const WithTotpEnabled: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
totp: {
|
||||
enabled: true,
|
||||
@ -98,7 +98,7 @@ export const WithTotpEnabled: Story = {
|
||||
|
||||
export const WithManualMode: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
mode: "manual",
|
||||
totp: {
|
||||
@ -136,7 +136,7 @@ export const WithManualMode: Story = {
|
||||
|
||||
export const MoreThanOneTotpProviders: Story = {
|
||||
render: () => (
|
||||
<PageStory
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
totp: {
|
||||
enabled: true,
|
||||
|
Reference in New Issue
Block a user