Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
bccaddc2de | |||
97c12c8a12 | |||
b349a819ba | |||
792d4262c8 | |||
37a9046a40 | |||
5ad29d9f43 | |||
79a580b4a5 | |||
994f1f8d3d | |||
a2ea81b3b8 | |||
a0461e3ef0 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "keycloakify",
|
"name": "keycloakify",
|
||||||
"version": "11.3.15",
|
"version": "11.3.19",
|
||||||
"description": "Framework to create custom Keycloak UIs",
|
"description": "Framework to create custom Keycloak UIs",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -44,7 +44,12 @@ export function runFormat(params: { packageJsonFilePath: string }) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const scriptName of ["format", "lint"]) {
|
const scriptKeys = Object.keys(scripts);
|
||||||
|
const scriptNames = scriptKeys.filter(scriptKey =>
|
||||||
|
scriptKey.trim().match(/^(lint|format)/)
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const scriptName of scriptNames) {
|
||||||
if (!(scriptName in scripts)) {
|
if (!(scriptName in scripts)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,9 @@ import type { GenericI18n_noJsx } from "./GenericI18n_noJsx";
|
|||||||
|
|
||||||
export type KcContextLike = {
|
export type KcContextLike = {
|
||||||
themeName: string;
|
themeName: string;
|
||||||
|
realm: {
|
||||||
|
internationalizationEnabled: boolean;
|
||||||
|
};
|
||||||
locale?: {
|
locale?: {
|
||||||
currentLanguageTag: string;
|
currentLanguageTag: string;
|
||||||
supported: { languageTag: string; url: string; label: string }[];
|
supported: { languageTag: string; url: string; label: string }[];
|
||||||
@ -91,14 +94,16 @@ export function createGetI18n<
|
|||||||
return cachedResult;
|
return cachedResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const kcContextLocale = params.kcContext.realm.internationalizationEnabled ? params.kcContext.locale : undefined;
|
||||||
|
|
||||||
{
|
{
|
||||||
const currentLanguageTag = kcContext.locale?.currentLanguageTag ?? FALLBACK_LANGUAGE_TAG;
|
const currentLanguageTag = kcContextLocale?.currentLanguageTag ?? FALLBACK_LANGUAGE_TAG;
|
||||||
const html = document.querySelector("html");
|
const html = document.querySelector("html");
|
||||||
assert(html !== null);
|
assert(html !== null);
|
||||||
html.lang = currentLanguageTag;
|
html.lang = currentLanguageTag;
|
||||||
|
|
||||||
const isRtl = (() => {
|
const isRtl = (() => {
|
||||||
const { rtl } = kcContext.locale ?? {};
|
const { rtl } = kcContextLocale ?? {};
|
||||||
|
|
||||||
if (rtl !== undefined) {
|
if (rtl !== undefined) {
|
||||||
return rtl;
|
return rtl;
|
||||||
@ -154,11 +159,11 @@ export function createGetI18n<
|
|||||||
}
|
}
|
||||||
|
|
||||||
from_server: {
|
from_server: {
|
||||||
if (kcContext.locale === undefined) {
|
if (kcContextLocale === undefined) {
|
||||||
break from_server;
|
break from_server;
|
||||||
}
|
}
|
||||||
|
|
||||||
const supportedEntry = kcContext.locale.supported.find(entry => entry.languageTag === languageTag);
|
const supportedEntry = kcContextLocale.supported.find(entry => entry.languageTag === languageTag);
|
||||||
|
|
||||||
if (supportedEntry === undefined) {
|
if (supportedEntry === undefined) {
|
||||||
break from_server;
|
break from_server;
|
||||||
@ -180,7 +185,7 @@ export function createGetI18n<
|
|||||||
};
|
};
|
||||||
|
|
||||||
const currentLanguage: I18n["currentLanguage"] = (() => {
|
const currentLanguage: I18n["currentLanguage"] = (() => {
|
||||||
const languageTag = id<string>(kcContext.locale?.currentLanguageTag ?? FALLBACK_LANGUAGE_TAG) as LanguageTag;
|
const languageTag = id<string>(kcContextLocale?.currentLanguageTag ?? FALLBACK_LANGUAGE_TAG) as LanguageTag;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
languageTag,
|
languageTag,
|
||||||
@ -191,8 +196,8 @@ export function createGetI18n<
|
|||||||
const enabledLanguages: I18n["enabledLanguages"] = (() => {
|
const enabledLanguages: I18n["enabledLanguages"] = (() => {
|
||||||
const enabledLanguages: I18n["enabledLanguages"] = [];
|
const enabledLanguages: I18n["enabledLanguages"] = [];
|
||||||
|
|
||||||
if (kcContext.locale !== undefined) {
|
if (kcContextLocale !== undefined) {
|
||||||
for (const entry of kcContext.locale.supported ?? []) {
|
for (const entry of kcContextLocale.supported ?? []) {
|
||||||
const languageTag = id<string>(entry.languageTag) as LanguageTag;
|
const languageTag = id<string>(entry.languageTag) as LanguageTag;
|
||||||
|
|
||||||
enabledLanguages.push({
|
enabledLanguages.push({
|
||||||
|
@ -70,9 +70,9 @@ export default function LoginRecoveryAuthnCodeConfig(props: PageProps<Extract<Kc
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
id="kcRecoveryCodesConfirmationCheck"
|
id="kcRecoveryCodesConfirmationCheck"
|
||||||
name="kcRecoveryCodesConfirmationCheck"
|
name="kcRecoveryCodesConfirmationCheck"
|
||||||
onChange={function () {
|
onChange={event => {
|
||||||
//@ts-expect-error: This is code from the original theme, we trust it.
|
//@ts-expect-error: This is inherited from the original code
|
||||||
document.getElementById("saveRecoveryAuthnCodesBtn").disabled = !this.checked;
|
document.getElementById("saveRecoveryAuthnCodesBtn").disabled = !event.target.checked;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="kcRecoveryCodesConfirmationCheck">{msg("recovery-codes-confirmation-message")}</label>
|
<label htmlFor="kcRecoveryCodesConfirmationCheck">{msg("recovery-codes-confirmation-message")}</label>
|
||||||
|
@ -2,10 +2,10 @@ import React from "react";
|
|||||||
import type { Meta, StoryObj } from "@storybook/react";
|
import type { Meta, StoryObj } from "@storybook/react";
|
||||||
import { createKcPageStory } from "../KcPageStory";
|
import { createKcPageStory } from "../KcPageStory";
|
||||||
|
|
||||||
const { KcPageStory } = createKcPageStory({ pageId: "login-oauth2-device-verify-user-code.ftl" });
|
const { KcPageStory } = createKcPageStory({ pageId: "login-device-verify-user-code.ftl" });
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: "login/login-oauth2-device-verify-user-code.ftl",
|
title: "login/login-device-verify-user-code.ftl",
|
||||||
component: KcPageStory
|
component: KcPageStory
|
||||||
} satisfies Meta<typeof KcPageStory>;
|
} satisfies Meta<typeof KcPageStory>;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user