Provide default message for the info page
This commit is contained in:
@ -229,6 +229,7 @@ export declare namespace KcContext {
|
|||||||
client: {
|
client: {
|
||||||
baseUrl?: string;
|
baseUrl?: string;
|
||||||
};
|
};
|
||||||
|
message: NonNullable<Common["message"]>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Error = Common & {
|
export type Error = Common & {
|
||||||
|
@ -212,6 +212,11 @@ export const kcContextMocks = [
|
|||||||
clientId: "myApp",
|
clientId: "myApp",
|
||||||
baseUrl: "#",
|
baseUrl: "#",
|
||||||
attributes: {}
|
attributes: {}
|
||||||
|
},
|
||||||
|
message: {
|
||||||
|
type: "info",
|
||||||
|
summary:
|
||||||
|
"This is the info message from the Keycloak server (in real environment, this message is localized)"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
id<KcContext.Error>({
|
id<KcContext.Error>({
|
||||||
@ -224,7 +229,8 @@ export const kcContextMocks = [
|
|||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
type: "error",
|
type: "error",
|
||||||
summary: "This is the error message"
|
summary:
|
||||||
|
"This is the error message from the Keycloak server (in real environment, this message is localized)"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
id<KcContext.LoginResetPassword>({
|
id<KcContext.LoginResetPassword>({
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { assert } from "keycloakify/tools/assert";
|
|
||||||
import type { PageProps } from "keycloakify/login/pages/PageProps";
|
import type { PageProps } from "keycloakify/login/pages/PageProps";
|
||||||
import type { KcContext } from "../KcContext";
|
import type { KcContext } from "../KcContext";
|
||||||
import type { I18n } from "../i18n";
|
import type { I18n } from "../i18n";
|
||||||
@ -8,11 +7,6 @@ export default function Info(props: PageProps<Extract<KcContext, { pageId: "info
|
|||||||
|
|
||||||
const { msgStr, msg } = i18n;
|
const { msgStr, msg } = i18n;
|
||||||
|
|
||||||
assert(
|
|
||||||
kcContext.message !== undefined,
|
|
||||||
"No message in kcContext.message, there will always be a message in production context, add it in your mock"
|
|
||||||
);
|
|
||||||
|
|
||||||
const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext;
|
const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user