From 0fdd9e75a6c639e46966d812cb80f4865a743a2f Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 14:21:09 +0100 Subject: [PATCH 01/51] Fix the helper type that enable to extend the KcContext --- src/account/kcContext/getKcContext.ts | 2 +- .../kcContext/getKcContextFromWindow.ts | 2 +- src/account/kcContext/kcContextMocks.ts | 2 +- src/tools/AndByDiscriminatingKey.ts | 6 +- test/lib/tools/AndByDiscriminatingKey.type.ts | 126 ++++++++++-------- 5 files changed, 80 insertions(+), 58 deletions(-) diff --git a/src/account/kcContext/getKcContext.ts b/src/account/kcContext/getKcContext.ts index ed793333..79e224f1 100644 --- a/src/account/kcContext/getKcContext.ts +++ b/src/account/kcContext/getKcContext.ts @@ -1,4 +1,3 @@ -import { kcContextMocks, kcContextCommonMock } from "./kcContextMocks"; import type { DeepPartial } from "keycloakify/tools/DeepPartial"; import { deepAssign } from "keycloakify/tools/deepAssign"; import type { ExtendKcContext } from "./getKcContextFromWindow"; @@ -7,6 +6,7 @@ import { pathJoin } from "keycloakify/bin/tools/pathJoin"; import { pathBasename } from "keycloakify/tools/pathBasename"; import { mockTestingResourcesCommonPath } from "keycloakify/bin/mockTestingResourcesPath"; import { symToStr } from "tsafe/symToStr"; +import { kcContextMocks, kcContextCommonMock } from "keycloakify/account/kcContext/kcContextMocks"; export function getKcContext(params?: { mockPageId?: ExtendKcContext["pageId"]; diff --git a/src/account/kcContext/getKcContextFromWindow.ts b/src/account/kcContext/getKcContextFromWindow.ts index 799dad34..dc221d39 100644 --- a/src/account/kcContext/getKcContextFromWindow.ts +++ b/src/account/kcContext/getKcContextFromWindow.ts @@ -1,6 +1,6 @@ -import type { KcContext } from "./KcContext"; import type { AndByDiscriminatingKey } from "keycloakify/tools/AndByDiscriminatingKey"; import { ftlValuesGlobalName } from "keycloakify/bin/keycloakify/ftlValuesGlobalName"; +import type { KcContext } from "./KcContext"; export type ExtendKcContext = [KcContextExtension] extends [never] ? KcContext diff --git a/src/account/kcContext/kcContextMocks.ts b/src/account/kcContext/kcContextMocks.ts index 7915006d..cc1b2fdc 100644 --- a/src/account/kcContext/kcContextMocks.ts +++ b/src/account/kcContext/kcContextMocks.ts @@ -1,8 +1,8 @@ import "minimal-polyfills/Object.fromEntries"; -import type { KcContext } from "./KcContext"; import { mockTestingResourcesCommonPath, mockTestingResourcesPath } from "keycloakify/bin/mockTestingResourcesPath"; import { pathJoin } from "keycloakify/bin/tools/pathJoin"; import { id } from "tsafe/id"; +import type { KcContext } from "./KcContext"; const PUBLIC_URL = process.env["PUBLIC_URL"] ?? "/"; diff --git a/src/tools/AndByDiscriminatingKey.ts b/src/tools/AndByDiscriminatingKey.ts index 637ab87d..630c6d13 100644 --- a/src/tools/AndByDiscriminatingKey.ts +++ b/src/tools/AndByDiscriminatingKey.ts @@ -10,7 +10,11 @@ export declare namespace AndByDiscriminatingKey { U1, U1Again extends Record, U2 extends Record - > = U1 extends Pick ? Tf2 : U1; + > = U1 extends Pick + ? Tf2 + : U1Again[DiscriminatingKey] & U2[DiscriminatingKey] extends never + ? U1 | U2 + : U1; export type Tf2< DiscriminatingKey extends string, diff --git a/test/lib/tools/AndByDiscriminatingKey.type.ts b/test/lib/tools/AndByDiscriminatingKey.type.ts index 919662dc..f45e897f 100644 --- a/test/lib/tools/AndByDiscriminatingKey.type.ts +++ b/test/lib/tools/AndByDiscriminatingKey.type.ts @@ -2,72 +2,90 @@ import { AndByDiscriminatingKey } from "../../../src/tools/AndByDiscriminatingKe import { assert } from "tsafe/assert"; import type { Equals } from "tsafe"; -type Base = { pageId: "a"; onlyA: string } | { pageId: "b"; onlyB: string } | { pageId: "only base"; onlyBase: string }; +{ + type Base = { pageId: "a"; onlyA: string } | { pageId: "b"; onlyB: string } | { pageId: "only base"; onlyBase: string }; -type Extension = { pageId: "a"; onlyExtA: string } | { pageId: "b"; onlyExtB: string } | { pageId: "only ext"; onlyExt: string }; + type Extension = { pageId: "a"; onlyExtA: string } | { pageId: "b"; onlyExtB: string } | { pageId: "only ext"; onlyExt: string }; -type Got = AndByDiscriminatingKey<"pageId", Extension, Base>; + type Got = AndByDiscriminatingKey<"pageId", Extension, Base>; -type Expected = - | { pageId: "a"; onlyA: string; onlyExtA: string } - | { pageId: "b"; onlyB: string; onlyExtB: string } - | { pageId: "only base"; onlyBase: string } - | { pageId: "only ext"; onlyExt: string }; + type Expected = + | { pageId: "a"; onlyA: string; onlyExtA: string } + | { pageId: "b"; onlyB: string; onlyExtB: string } + | { pageId: "only base"; onlyBase: string } + | { pageId: "only ext"; onlyExt: string }; -assert>(); + assert>(); -const x: Got = null as any; + const x: Got = null as any; -if (x.pageId === "a") { - x.onlyA; - x.onlyExtA; + if (x.pageId === "a") { + x.onlyA; + x.onlyExtA; - //@ts-expect-error - x.onlyB; + //@ts-expect-error + x.onlyB; - //@ts-expect-error - x.onlyBase; + //@ts-expect-error + x.onlyBase; - //@ts-expect-error - x.onlyExt; + //@ts-expect-error + x.onlyExt; + } + + if (x.pageId === "b") { + x.onlyB; + x.onlyExtB; + + //@ts-expect-error + x.onlyA; + + //@ts-expect-error + x.onlyBase; + + //@ts-expect-error + x.onlyExt; + } + + if (x.pageId === "only base") { + x.onlyBase; + + //@ts-expect-error + x.onlyA; + + //@ts-expect-error + x.onlyB; + + //@ts-expect-error + x.onlyExt; + } + + if (x.pageId === "only ext") { + x.onlyExt; + + //@ts-expect-error + x.onlyA; + + //@ts-expect-error + x.onlyB; + + //@ts-expect-error + x.onlyBase; + } } -if (x.pageId === "b") { - x.onlyB; - x.onlyExtB; +{ + type Base = { pageId: "a"; onlyA: string } | { pageId: "b"; onlyB: string } | { pageId: "only base"; onlyBase: string }; - //@ts-expect-error - x.onlyA; + type Extension = { pageId: "only ext"; onlyExt: string }; - //@ts-expect-error - x.onlyBase; + type Got = AndByDiscriminatingKey<"pageId", Extension, Base>; - //@ts-expect-error - x.onlyExt; -} - -if (x.pageId === "only base") { - x.onlyBase; - - //@ts-expect-error - x.onlyA; - - //@ts-expect-error - x.onlyB; - - //@ts-expect-error - x.onlyExt; -} - -if (x.pageId === "only ext") { - x.onlyExt; - - //@ts-expect-error - x.onlyA; - - //@ts-expect-error - x.onlyB; - - //@ts-expect-error - x.onlyBase; + type Expected = + | { pageId: "a"; onlyA: string } + | { pageId: "b"; onlyB: string } + | { pageId: "only base"; onlyBase: string } + | { pageId: "only ext"; onlyExt: string }; + + assert>(); } From 8937d19891970fa1ccdf2b3e71d5653d8e6bf5e4 Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 14:21:27 +0100 Subject: [PATCH 02/51] Release candidate --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 471b6e20..03297e20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.0-rc.10", + "version": "7.0.0-rc.11", "description": "Create Keycloak themes using React", "repository": { "type": "git", From 0c5b100dd96a92a39b4200da412435ca71da0284 Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 15:16:23 +0100 Subject: [PATCH 03/51] Update post build instructions --- src/bin/keycloakify/keycloakify.ts | 32 +++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/bin/keycloakify/keycloakify.ts b/src/bin/keycloakify/keycloakify.ts index 38ede8c9..bc821fdd 100644 --- a/src/bin/keycloakify/keycloakify.ts +++ b/src/bin/keycloakify/keycloakify.ts @@ -1,6 +1,6 @@ import { generateKeycloakThemeResources } from "./generateKeycloakThemeResources"; import { generateJavaStackFiles } from "./generateJavaStackFiles"; -import { join as pathJoin, relative as pathRelative, basename as pathBasename } from "path"; +import { join as pathJoin, relative as pathRelative, basename as pathBasename, sep as pathSep } from "path"; import * as child_process from "child_process"; import { generateStartKeycloakTestingContainer } from "./generateStartKeycloakTestingContainer"; import * as fs from "fs"; @@ -42,7 +42,7 @@ export async function main() { "reactAppBuildDirPath": pathJoin(reactProjectDirPath, "build"), buildOptions, //We have to leave it at that otherwise we break our default theme. - //Problem is that we can't guarantee that the the old resources + //Problem is that we can`t guarantee that the the old resources //will still be available on the newer keycloak version. "keycloakVersion": "11.0.3" }); @@ -121,19 +121,27 @@ export async function main() { "", `To test your theme locally you can spin up a Keycloak ${containerKeycloakVersion} container image with the theme pre loaded by running:`, "", - `👉 $ ./${pathRelative(reactProjectDirPath, pathJoin(keycloakThemeBuildingDirPath, generateStartKeycloakTestingContainer.basename))} 👈`, + `👉 $ .${pathSep}${pathRelative( + reactProjectDirPath, + pathJoin(keycloakThemeBuildingDirPath, generateStartKeycloakTestingContainer.basename) + )} 👈`, "", - "Test with different Keycloak versions by editing the .sh file. see available versions here: https://quay.io/repository/keycloak/keycloak?tab=tags", - "", - "Once your container is up and running: ", + `Test with different Keycloak versions by editing the .sh file. see available versions here: https://quay.io/repository/keycloak/keycloak?tab=tags`, + ``, + `Once your container is up and running: `, "- Log into the admin console 👉 http://localhost:8080/admin username: admin, password: admin 👈", - '- Create a realm named "myrealm"', - '- Create a client with ID: "myclient", "Root URL": "https://www.keycloak.org/app/" and "Valid redirect URIs": "https://www.keycloak.org/app/*"', - `- Select Login Theme: ${buildOptions.themeName} (don't forget to save at the bottom of the page)`, + `- Create a realm named "myrealm"`, + `- Create a client with ID: "myclient"`, + ` Root URL: https://www.keycloak.org/app/`, + ` Valid redirect URIs: https://www.keycloak.org/app* http://localhost* (localhost isn't necessary here but it will be once you'll want to test the integration with your app)`, + ` Valid post logout redirect URIs: https://www.keycloak.org/app* http://localhost*`, + ` Web origins: *`, + ` Login Theme: ${buildOptions.themeName}`, + ` Click save at the bottom of the page.`, `- Go to 👉 https://www.keycloak.org/app/ 👈 Click "Save" then "Sign in". You should see your login page`, - "", - "Video demoing this process: https://youtu.be/N3wlBoH4hKg", - "" + ``, + `Video demoing this process: https://youtu.be/N3wlBoH4hKg`, + `` ].join("\n") ); } From b31fff9c2b7f8129b594acb7c9b4ae2936cfd371 Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 15:16:37 +0100 Subject: [PATCH 04/51] Release candidate --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 03297e20..c6ef7ba2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.0-rc.11", + "version": "7.0.0-rc.12", "description": "Create Keycloak themes using React", "repository": { "type": "git", From 8b101e5043aa7b48e454f88b3774a8150ee58fda Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 16:47:30 +0100 Subject: [PATCH 05/51] Fix error in log related to getLogoUrl --- ...ftl_object_to_js_code_declaring_an_object.ftl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl index 192bb648..a87fdbaa 100644 --- a/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +++ b/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -110,14 +110,16 @@ } }; - out["pageId"] = "${pageId}"; + <#if account??> + out["url"]["getLogoutUrl"] = function () { + <#attempt> + return "${url.getLogoutUrl()}"; + <#recover> + + }; + - out["url"]["getLogoutUrl"] = function () { - <#attempt> - return "${url.getLogoutUrl()}"; - <#recover> - - }; + out["pageId"] = "${pageId}"; return out; From 09543400cabd7ad854823d0f6561b7e3ba49f897 Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 16:47:58 +0100 Subject: [PATCH 06/51] Relase candidate --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c6ef7ba2..e9e302a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.0-rc.12", + "version": "7.0.0-rc.13", "description": "Create Keycloak themes using React", "repository": { "type": "git", From 2e4d722d7f367c3b6618712b6ca50f5ccd397085 Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 18:32:00 +0100 Subject: [PATCH 07/51] Return undefined if the context dosen't match the theme --- src/account/kcContext/getKcContext.ts | 4 ++++ src/login/kcContext/getKcContext.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/account/kcContext/getKcContext.ts b/src/account/kcContext/getKcContext.ts index 79e224f1..76dce92d 100644 --- a/src/account/kcContext/getKcContext.ts +++ b/src/account/kcContext/getKcContext.ts @@ -62,6 +62,10 @@ export function getKcContext Date: Tue, 21 Mar 2023 18:32:21 +0100 Subject: [PATCH 08/51] Relase candidate --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e9e302a2..8fad0fd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.0-rc.13", + "version": "7.0.0-rc.14", "description": "Create Keycloak themes using React", "repository": { "type": "git", From dd75d0ece7784ee057750122247d0ca675d8a785 Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 19:44:01 +0100 Subject: [PATCH 09/51] Account theme specific instructions --- src/bin/keycloakify/keycloakify.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/keycloakify/keycloakify.ts b/src/bin/keycloakify/keycloakify.ts index bc821fdd..029941b0 100644 --- a/src/bin/keycloakify/keycloakify.ts +++ b/src/bin/keycloakify/keycloakify.ts @@ -131,6 +131,7 @@ export async function main() { `Once your container is up and running: `, "- Log into the admin console 👉 http://localhost:8080/admin username: admin, password: admin 👈", `- Create a realm named "myrealm"`, + `- Enable the Account theme: Realm settings -> tab Themes -> Account theme, select ${buildOptions.themeName} `, `- Create a client with ID: "myclient"`, ` Root URL: https://www.keycloak.org/app/`, ` Valid redirect URIs: https://www.keycloak.org/app* http://localhost* (localhost isn't necessary here but it will be once you'll want to test the integration with your app)`, @@ -139,8 +140,7 @@ export async function main() { ` Login Theme: ${buildOptions.themeName}`, ` Click save at the bottom of the page.`, `- Go to 👉 https://www.keycloak.org/app/ 👈 Click "Save" then "Sign in". You should see your login page`, - ``, - `Video demoing this process: https://youtu.be/N3wlBoH4hKg`, + `- Got to 👉 http://localhost:8080/realms/myrealm/account 👈 to see your account theme`, `` ].join("\n") ); From 93385af675a814cf37448d5fce91c6524a329d01 Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 19:44:16 +0100 Subject: [PATCH 10/51] Release candidate --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8fad0fd7..2408dc79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.0-rc.14", + "version": "7.0.0-rc.15", "description": "Create Keycloak themes using React", "repository": { "type": "git", From d951a9ba020f86a6c5992c268d24b3a09b79189f Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 23:21:30 +0100 Subject: [PATCH 11/51] Improve post build instructions --- src/bin/keycloakify/keycloakify.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/bin/keycloakify/keycloakify.ts b/src/bin/keycloakify/keycloakify.ts index 029941b0..b8e3d711 100644 --- a/src/bin/keycloakify/keycloakify.ts +++ b/src/bin/keycloakify/keycloakify.ts @@ -130,16 +130,18 @@ export async function main() { ``, `Once your container is up and running: `, "- Log into the admin console 👉 http://localhost:8080/admin username: admin, password: admin 👈", - `- Create a realm named "myrealm"`, - `- Enable the Account theme: Realm settings -> tab Themes -> Account theme, select ${buildOptions.themeName} `, - `- Create a client with ID: "myclient"`, + `- Create a realm: myrealm`, + `- Enable registration: Realm settings -> Login tab -> User registration: on`, + `- Enable the Account theme: Realm settings -> Themes tab -> Account theme, select ${buildOptions.themeName} `, + `- Create a client id myclient`, ` Root URL: https://www.keycloak.org/app/`, - ` Valid redirect URIs: https://www.keycloak.org/app* http://localhost* (localhost isn't necessary here but it will be once you'll want to test the integration with your app)`, + ` Valid redirect URIs: https://www.keycloak.org/app* http://localhost* (localhost is optional)`, ` Valid post logout redirect URIs: https://www.keycloak.org/app* http://localhost*`, ` Web origins: *`, - ` Login Theme: ${buildOptions.themeName}`, - ` Click save at the bottom of the page.`, - `- Go to 👉 https://www.keycloak.org/app/ 👈 Click "Save" then "Sign in". You should see your login page`, + ` Login Theme: ${buildOptions.themeName}`, + ` Save (button at the bottom of the page)`, + ``, + `- Go to 👉 https://www.keycloak.org/app/ 👈 Click "Save" then "Sign in". You should see your login page`, `- Got to 👉 http://localhost:8080/realms/myrealm/account 👈 to see your account theme`, `` ].join("\n") From 2fc9c03430e02babcb0267fd80bf1c33b18dc54e Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 21 Mar 2023 23:39:40 +0100 Subject: [PATCH 12/51] Relase candidate --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2408dc79..a9e7c456 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.0-rc.15", + "version": "7.0.0-rc.16", "description": "Create Keycloak themes using React", "repository": { "type": "git", From 5f43f1afc624aed935fef3703e2922b7d015605e Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 01:46:05 +0100 Subject: [PATCH 13/51] Shot a new post build tutorial video --- src/bin/keycloakify/keycloakify.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/keycloakify/keycloakify.ts b/src/bin/keycloakify/keycloakify.ts index b8e3d711..357d3582 100644 --- a/src/bin/keycloakify/keycloakify.ts +++ b/src/bin/keycloakify/keycloakify.ts @@ -143,6 +143,8 @@ export async function main() { ``, `- Go to 👉 https://www.keycloak.org/app/ 👈 Click "Save" then "Sign in". You should see your login page`, `- Got to 👉 http://localhost:8080/realms/myrealm/account 👈 to see your account theme`, + ``, + `Video tutorial: https://youtu.be/WMyGZNHQkjU`, `` ].join("\n") ); From 3e18a7390ce08453633251ca0522cb107f9a00e3 Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 01:55:49 +0100 Subject: [PATCH 14/51] =?UTF-8?q?Bump=20version:=20Release=20v7=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d8a588e9..602c17a7 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,12 @@ # Changelog highlights +## 7.0 🍾 + +- Account theme support 🚀 +- It's much easier to customize pages at the CSS level, you can now see in the browser dev tool the customizable classes. +- New interactive CLI tool `npx eject-keycloak-page`, that enables to select the page you want to customize at the component level. + ## 6.13 - Build work behind corporate proxies, [see issue](https://github.com/InseeFrLab/keycloakify/issues/257). diff --git a/package.json b/package.json index a9e7c456..2a6bbd0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.0-rc.16", + "version": "7.0.0", "description": "Create Keycloak themes using React", "repository": { "type": "git", From 6ae1d8938ab4d6f3e50b91353bc3e7754b8dec15 Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 03:00:44 +0100 Subject: [PATCH 15/51] Fix eslint --- src/account/Template.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/account/Template.tsx b/src/account/Template.tsx index beb69689..2ee5538d 100644 --- a/src/account/Template.tsx +++ b/src/account/Template.tsx @@ -43,6 +43,7 @@ export default function Template(props: TemplateProps) { {realm.internationalizationEnabled && (assert(locale !== undefined), true) && locale.supported.length > 1 && (
  • + {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} {labelBySupportedLanguageTag[currentLanguageTag]} From da577ea3cca69c3f8c503a6ffe53683440559637 Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 03:02:44 +0100 Subject: [PATCH 16/51] Add stateChecker to password context --- src/account/kcContext/KcContext.ts | 1 + src/account/pages/Password.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/account/kcContext/KcContext.ts b/src/account/kcContext/KcContext.ts index f722390e..53db5157 100644 --- a/src/account/kcContext/KcContext.ts +++ b/src/account/kcContext/KcContext.ts @@ -64,6 +64,7 @@ export declare namespace KcContext { password: { passwordSet: boolean; }; + stateChecker: string; }; export type Account = Common & { diff --git a/src/account/pages/Password.tsx b/src/account/pages/Password.tsx index c92b4d19..b583c082 100644 --- a/src/account/pages/Password.tsx +++ b/src/account/pages/Password.tsx @@ -15,7 +15,7 @@ export default function LogoutConfirm(props: PageProps )} - +
    From 9fcf692cb869b33a1984d62634640cdac6cc0852 Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 03:03:24 +0100 Subject: [PATCH 17/51] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2a6bbd0f..b6f99bd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.0", + "version": "7.0.1", "description": "Create Keycloak themes using React", "repository": { "type": "git", From 0e21f3eab6cb62489a05c3f870517c139d5ef98a Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 03:07:33 +0100 Subject: [PATCH 18/51] Add missing mock --- src/account/kcContext/kcContextMocks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/account/kcContext/kcContextMocks.ts b/src/account/kcContext/kcContextMocks.ts index cc1b2fdc..2857514d 100644 --- a/src/account/kcContext/kcContextMocks.ts +++ b/src/account/kcContext/kcContextMocks.ts @@ -154,7 +154,8 @@ export const kcContextMocks: KcContext[] = [ "pageId": "password.ftl", "password": { "passwordSet": true - } + }, + "stateChecker": "state checker" }), id({ ...kcContextCommonMock, From 3294aaed3bc0d3ec45d41a4c6b2c4df96b3ae516 Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 03:34:44 +0100 Subject: [PATCH 19/51] Pefrorm Keycloak theme download in paralel --- src/bin/download-builtin-keycloak-theme.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/bin/download-builtin-keycloak-theme.ts b/src/bin/download-builtin-keycloak-theme.ts index e1e1515f..62ea29bc 100644 --- a/src/bin/download-builtin-keycloak-theme.ts +++ b/src/bin/download-builtin-keycloak-theme.ts @@ -10,15 +10,17 @@ import { getLogger } from "./tools/logger"; export async function downloadBuiltinKeycloakTheme(params: { keycloakVersion: string; destDirPath: string; isSilent: boolean }) { const { keycloakVersion, destDirPath, isSilent } = params; - for (const ext of ["", "-community"]) { - await downloadAndUnzip({ - "destDirPath": destDirPath, - "url": `https://github.com/keycloak/keycloak/archive/refs/tags/${keycloakVersion}.zip`, - "pathOfDirToExtractInArchive": `keycloak-${keycloakVersion}/themes/src/main/resources${ext}/theme`, - "cacheDirPath": pathJoin(keycloakThemeBuildingDirPath, ".cache"), - isSilent - }); - } + await Promise.all( + ["", "-community"].map(ext => + downloadAndUnzip({ + "destDirPath": destDirPath, + "url": `https://github.com/keycloak/keycloak/archive/refs/tags/${keycloakVersion}.zip`, + "pathOfDirToExtractInArchive": `keycloak-${keycloakVersion}/themes/src/main/resources${ext}/theme`, + "cacheDirPath": pathJoin(keycloakThemeBuildingDirPath, ".cache"), + isSilent + }) + ) + ); } if (require.main === module) { From 87ebad7efbca72378a251cef443345642ca4d446 Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 03:34:59 +0100 Subject: [PATCH 20/51] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b6f99bd4..9772ed26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.1", + "version": "7.0.2", "description": "Create Keycloak themes using React", "repository": { "type": "git", From 6e4b4173b5165a42557f5558ffb66e346ec89b68 Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 03:46:30 +0100 Subject: [PATCH 21/51] Add link to storybook #274 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 602c17a7..4c1ee32a 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ - Documentation - + Storybook + - Starter project

    From 7ebbb0417a302366505b73e6fbd530b8d6630fb0 Mon Sep 17 00:00:00 2001 From: William Will <10997562+willwill96@users.noreply.github.com> Date: Tue, 21 Mar 2023 19:30:44 -0700 Subject: [PATCH 22/51] feat(login context): improve login typings --- src/login/kcContext/KcContext.ts | 5 +++-- src/login/kcContext/kcContextMocks.ts | 8 ++------ src/login/pages/Login.tsx | 2 +- src/login/pages/LoginUsername.tsx | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/login/kcContext/KcContext.ts b/src/login/kcContext/KcContext.ts index 6cd40f73..ec45d087 100644 --- a/src/login/kcContext/KcContext.ts +++ b/src/login/kcContext/KcContext.ts @@ -101,7 +101,8 @@ export declare namespace KcContext { registrationDisabled: boolean; login: { username?: string; - rememberMe?: boolean; + rememberMe?: string; + password?: string; }; usernameEditDisabled: boolean; social: { @@ -219,7 +220,7 @@ export declare namespace KcContext { registrationDisabled: boolean; login: { username?: string; - rememberMe?: boolean; + rememberMe?: string; }; usernameHidden?: boolean; social: { diff --git a/src/login/kcContext/kcContextMocks.ts b/src/login/kcContext/kcContextMocks.ts index f72b2ce4..9c9e211b 100644 --- a/src/login/kcContext/kcContextMocks.ts +++ b/src/login/kcContext/kcContextMocks.ts @@ -260,9 +260,7 @@ export const kcContextMocks: KcContext[] = [ "displayInfo": true }, "usernameEditDisabled": false, - "login": { - "rememberMe": false - }, + "login": {}, "registrationDisabled": false }), ...(() => { @@ -376,9 +374,7 @@ export const kcContextMocks: KcContext[] = [ "displayInfo": true }, "usernameHidden": false, - "login": { - "rememberMe": false - }, + "login": {}, "registrationDisabled": false }), id({ diff --git a/src/login/pages/Login.tsx b/src/login/pages/Login.tsx index c15af59d..f85049c3 100644 --- a/src/login/pages/Login.tsx +++ b/src/login/pages/Login.tsx @@ -124,7 +124,7 @@ export default function Login(props: PageProps Date: Wed, 22 Mar 2023 03:48:21 +0100 Subject: [PATCH 23/51] Mention storybook in the changelog --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c1ee32a..55061771 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ - Account theme support 🚀 - It's much easier to customize pages at the CSS level, you can now see in the browser dev tool the customizable classes. - New interactive CLI tool `npx eject-keycloak-page`, that enables to select the page you want to customize at the component level. +- There is [a Storybook](https://storybook.keycloakify.dev) ## 6.13 From c4f8879cda657f6c0178b2a7ed01c73c7b7cb5fb Mon Sep 17 00:00:00 2001 From: garronej Date: Wed, 22 Mar 2023 04:49:30 +0100 Subject: [PATCH 24/51] Bump version --- README.md | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 55061771..e55397fb 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ - It's much easier to customize pages at the CSS level, you can now see in the browser dev tool the customizable classes. - New interactive CLI tool `npx eject-keycloak-page`, that enables to select the page you want to customize at the component level. - There is [a Storybook](https://storybook.keycloakify.dev) +- [Remember me is fixed](https://github.com/InseeFrLab/keycloakify/pull/272) ## 6.13 diff --git a/package.json b/package.json index 9772ed26..31e1f58b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "7.0.2", + "version": "7.0.3", "description": "Create Keycloak themes using React", "repository": { "type": "git", From 49e4e361847209115aab5bb4357a0043e034fc39 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Wed, 22 Mar 2023 21:33:41 +0100 Subject: [PATCH 25/51] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e55397fb..2455330f 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,9 @@

    -> 🗣 V6 have been released 🎉 -> [It features major improvements](https://github.com/InseeFrLab/keycloakify#600). -> Checkout [the migration guide](https://docs.keycloakify.dev/v5-to-v6). +> 🗣 V7 have been released 🎉 +> [It features major improvements](https://github.com/InseeFrLab/keycloakify#70-). +> Checkout [the migration guide](https://docs.keycloakify.dev/migration-guides/v6-greater-than-v7). # Changelog highlights From 160f12d7d36d706bb57af348d74de36fb1219707 Mon Sep 17 00:00:00 2001 From: garronej Date: Fri, 24 Mar 2023 04:12:52 +0100 Subject: [PATCH 26/51] Rename UserProfileCommon to UserProfileFormFields --- src/login/pages/IdpReviewUserProfile.tsx | 2 +- src/login/pages/RegisterUserProfile.tsx | 2 +- src/login/pages/UpdateUserProfile.tsx | 2 +- .../{UserProfileCommons.tsx => UserProfileFormFields.tsx} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename src/login/pages/shared/{UserProfileCommons.tsx => UserProfileFormFields.tsx} (100%) diff --git a/src/login/pages/IdpReviewUserProfile.tsx b/src/login/pages/IdpReviewUserProfile.tsx index a6d2fbdf..9afaa8ba 100644 --- a/src/login/pages/IdpReviewUserProfile.tsx +++ b/src/login/pages/IdpReviewUserProfile.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { clsx } from "keycloakify/tools/clsx"; -import { UserProfileFormFields } from "keycloakify/login/pages/shared/UserProfileCommons"; +import { UserProfileFormFields } from "keycloakify/login/pages/shared/UserProfileFormFields"; import type { PageProps } from "keycloakify/login/pages/PageProps"; import { useGetClassName } from "keycloakify/login/lib/useGetClassName"; import type { KcContext } from "../kcContext"; diff --git a/src/login/pages/RegisterUserProfile.tsx b/src/login/pages/RegisterUserProfile.tsx index a5ed80cf..1e9d7f6c 100644 --- a/src/login/pages/RegisterUserProfile.tsx +++ b/src/login/pages/RegisterUserProfile.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { clsx } from "keycloakify/tools/clsx"; -import { UserProfileFormFields } from "./shared/UserProfileCommons"; +import { UserProfileFormFields } from "./shared/UserProfileFormFields"; import type { PageProps } from "keycloakify/login/pages/PageProps"; import { useGetClassName } from "keycloakify/login/lib/useGetClassName"; import type { KcContext } from "../kcContext"; diff --git a/src/login/pages/UpdateUserProfile.tsx b/src/login/pages/UpdateUserProfile.tsx index 18983f3f..1051022a 100644 --- a/src/login/pages/UpdateUserProfile.tsx +++ b/src/login/pages/UpdateUserProfile.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { clsx } from "keycloakify/tools/clsx"; -import { UserProfileFormFields } from "keycloakify/login/pages/shared/UserProfileCommons"; +import { UserProfileFormFields } from "keycloakify/login/pages/shared/UserProfileFormFields"; import type { PageProps } from "keycloakify/login/pages/PageProps"; import { useGetClassName } from "keycloakify/login/lib/useGetClassName"; import type { KcContext } from "../kcContext"; diff --git a/src/login/pages/shared/UserProfileCommons.tsx b/src/login/pages/shared/UserProfileFormFields.tsx similarity index 100% rename from src/login/pages/shared/UserProfileCommons.tsx rename to src/login/pages/shared/UserProfileFormFields.tsx From 05163f22cb9d2c32149461aaafc714e7904ee172 Mon Sep 17 00:00:00 2001 From: garronej Date: Fri, 24 Mar 2023 04:14:41 +0100 Subject: [PATCH 27/51] Rename InseeFrLab to Keycloakify --- README.md | 36 +++++++++---------- package.json | 2 +- ..._object_to_js_code_declaring_an_object.ftl | 6 ++-- test/bin/setupSampleReactProject.ts | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 2455330f..be9db628 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ - + @@ -37,7 +37,7 @@

    > 🗣 V7 have been released 🎉 -> [It features major improvements](https://github.com/InseeFrLab/keycloakify#70-). +> [It features major improvements](https://github.com/keycloakify/keycloakify#70-). > Checkout [the migration guide](https://docs.keycloakify.dev/migration-guides/v6-greater-than-v7). # Changelog highlights @@ -48,11 +48,11 @@ - It's much easier to customize pages at the CSS level, you can now see in the browser dev tool the customizable classes. - New interactive CLI tool `npx eject-keycloak-page`, that enables to select the page you want to customize at the component level. - There is [a Storybook](https://storybook.keycloakify.dev) -- [Remember me is fixed](https://github.com/InseeFrLab/keycloakify/pull/272) +- [Remember me is fixed](https://github.com/keycloakify/keycloakify/pull/272) ## 6.13 -- Build work behind corporate proxies, [see issue](https://github.com/InseeFrLab/keycloakify/issues/257). +- Build work behind corporate proxies, [see issue](https://github.com/keycloakify/keycloakify/issues/257). ## 6.12 @@ -65,13 +65,13 @@ Massive improvement in the developer experience: ## 6.11.4 -- You no longer need to have Maven installed to build the theme. Thanks to @lordvlad, [see PR](https://github.com/InseeFrLab/keycloakify/pull/239). +- You no longer need to have Maven installed to build the theme. Thanks to @lordvlad, [see PR](https://github.com/keycloakify/keycloakify/pull/239). - Feature new build options: [`bundler`](https://docs.keycloakify.dev/build-options#keycloakify.bundler), [`groupId`](https://docs.keycloakify.dev/build-options#keycloakify.groupid), [`artifactId`](https://docs.keycloakify.dev/build-options#keycloakify.artifactid), [`version`](https://docs.keycloakify.dev/build-options#version). Theses options can be user to customize the output name of the .jar. You can use environnement variables to overrides the values read in the package.json. Thanks to @lordvlad. ## 6.10.0 -- Widows compat (thanks to @lordvlad, [see PR](https://github.com/InseeFrLab/keycloakify/pull/226)). WSL is no longer required 🎉 +- Widows compat (thanks to @lordvlad, [see PR](https://github.com/keycloakify/keycloakify/pull/226)). WSL is no longer required 🎉 ## 6.8.4 @@ -81,19 +81,19 @@ Massive improvement in the developer experience: - It is now possible to pass a custom `