2023-03-21 05:27:31 +01:00
|
|
|
import type { PageProps } from "keycloakify/login/pages/PageProps";
|
2024-06-05 21:13:58 +02:00
|
|
|
import type { KcContext } from "../KcContext";
|
2024-06-09 11:20:45 +02:00
|
|
|
import type { I18n } from "../i18n";
|
2021-03-06 14:42:56 +01:00
|
|
|
|
2024-06-09 11:20:45 +02:00
|
|
|
export default function Info(props: PageProps<Extract<KcContext, { pageId: "info.ftl" }>, I18n>) {
|
|
|
|
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
2022-10-13 11:58:31 +02:00
|
|
|
|
2024-07-10 22:18:24 +02:00
|
|
|
const { advancedMsgStr, msg } = i18n;
|
2022-10-13 11:58:31 +02:00
|
|
|
|
|
|
|
const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Template
|
2024-06-09 08:27:07 +02:00
|
|
|
kcContext={kcContext}
|
2024-06-09 11:20:45 +02:00
|
|
|
i18n={i18n}
|
2024-06-09 08:27:07 +02:00
|
|
|
doUseDefaultCss={doUseDefaultCss}
|
|
|
|
classes={classes}
|
2022-10-13 11:58:31 +02:00
|
|
|
displayMessage={false}
|
2024-07-04 19:53:57 +02:00
|
|
|
headerNode={
|
|
|
|
<span
|
|
|
|
dangerouslySetInnerHTML={{
|
|
|
|
__html: messageHeader ?? message.summary
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
}
|
2023-03-21 02:36:13 +01:00
|
|
|
>
|
|
|
|
<div id="kc-info-message">
|
2024-07-04 19:53:57 +02:00
|
|
|
<p
|
|
|
|
className="instruction"
|
|
|
|
dangerouslySetInnerHTML={{
|
|
|
|
__html: (() => {
|
|
|
|
let html = message.summary;
|
|
|
|
|
|
|
|
if (requiredActions) {
|
|
|
|
html += "<b>";
|
|
|
|
|
2024-07-10 22:18:24 +02:00
|
|
|
html += requiredActions.map(requiredAction => advancedMsgStr(`requiredAction.${requiredAction}`)).join(",");
|
2024-07-04 19:53:57 +02:00
|
|
|
|
|
|
|
html += "</b>";
|
|
|
|
}
|
|
|
|
|
|
|
|
return html;
|
|
|
|
})()
|
|
|
|
}}
|
|
|
|
/>
|
2024-05-11 00:18:18 +02:00
|
|
|
{(() => {
|
|
|
|
if (skipLink) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pageRedirectUri) {
|
|
|
|
return (
|
|
|
|
<p>
|
|
|
|
<a href={pageRedirectUri}>{msg("backToApplication")}</a>
|
|
|
|
</p>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if (actionUri) {
|
|
|
|
return (
|
|
|
|
<p>
|
|
|
|
<a href={actionUri}>{msg("proceedWithAction")}</a>
|
|
|
|
</p>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (client.baseUrl) {
|
|
|
|
return (
|
|
|
|
<p>
|
|
|
|
<a href={client.baseUrl}>{msg("backToApplication")}</a>
|
|
|
|
</p>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
})()}
|
2023-03-21 02:36:13 +01:00
|
|
|
</div>
|
|
|
|
</Template>
|
2022-10-13 11:58:31 +02:00
|
|
|
);
|
2023-02-25 18:11:23 +01:00
|
|
|
}
|