From 7d3b683a621bb6151ce490a213ebe26c069ae2db Mon Sep 17 00:00:00 2001 From: garronej Date: Mon, 28 Aug 2023 19:25:55 +0200 Subject: [PATCH] Migrate to Keycloakify 8 --- package.json | 2 +- src/keycloak-theme/account/Template.tsx | 8 +++++--- src/keycloak-theme/login/Template.tsx | 11 +++++------ yarn.lock | 8 ++++---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index f533f03..5ecbedd 100755 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "evt": "^2.4.15", "jwt-decode": "^3.1.2", "keycloak-js": "^21.0.1", - "keycloakify": "^7.15.9", + "keycloakify": "8.0.0-rc.2", "powerhooks": "^0.26.8", "react": "18.1.0", "react-dom": "18.1.0", diff --git a/src/keycloak-theme/account/Template.tsx b/src/keycloak-theme/account/Template.tsx index ecf61ba..0c33a05 100644 --- a/src/keycloak-theme/account/Template.tsx +++ b/src/keycloak-theme/account/Template.tsx @@ -19,9 +19,11 @@ export default function Template(props: TemplateProps) { const { isReady } = usePrepareTemplate({ "doFetchDefaultThemeResources": doUseDefaultCss, - url, - "stylesCommon": ["node_modules/patternfly/dist/css/patternfly.min.css", "node_modules/patternfly/dist/css/patternfly-additions.min.css"], - "styles": ["css/account.css"], + "styles": [ + `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly.min.css`, + `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`, + `${url.resourcesPath}/css/account.css` + ], "htmlClassName": undefined, "bodyClassName": clsx("admin-console", "user", getClassName("kcBodyClass")) }); diff --git a/src/keycloak-theme/login/Template.tsx b/src/keycloak-theme/login/Template.tsx index 3e732e4..3b60e09 100644 --- a/src/keycloak-theme/login/Template.tsx +++ b/src/keycloak-theme/login/Template.tsx @@ -33,13 +33,12 @@ export default function Template(props: TemplateProps) { const { isReady } = usePrepareTemplate({ "doFetchDefaultThemeResources": doUseDefaultCss, - url, - "stylesCommon": [ - "node_modules/patternfly/dist/css/patternfly.min.css", - "node_modules/patternfly/dist/css/patternfly-additions.min.css", - "lib/zocial/zocial.css" + "styles": [ + `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly.min.css`, + `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`, + `${url.resourcesCommonPath}/lib/zocial/zocial.css`, + `${url.resourcesPath}/css/login.css` ], - "styles": ["css/login.css"], "htmlClassName": getClassName("kcHtmlClass"), "bodyClassName": undefined }); diff --git a/yarn.lock b/yarn.lock index 9042a06..0b55aa1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9768,10 +9768,10 @@ keycloak-js@^21.0.1: base64-js "^1.5.1" js-sha256 "^0.9.0" -keycloakify@^7.15.9: - version "7.15.9" - resolved "https://registry.yarnpkg.com/keycloakify/-/keycloakify-7.15.9.tgz#c41d06f57338a540edfe1b09884c357b51ba53f6" - integrity sha512-GANwtnKtEaer4EfZ1FkihfQK437Qk+aAA/8C1nQWh2JVNn28qkofk2cDl4wJCHr5u+7SxFXyA9H0FbR5qhMHnQ== +keycloakify@8.0.0-rc.2: + version "8.0.0-rc.2" + resolved "https://registry.yarnpkg.com/keycloakify/-/keycloakify-8.0.0-rc.2.tgz#748c16b538c89f8b2be9d309dea98d5fb4c8ada7" + integrity sha512-W9ImhiXCHGW8i1KP8zb5MZ0Ug1imro1mKsos8QBbFci51sDLrKM/ymmpsvkm+5mmXAjh4mVgBAn4mspvizo1WQ== dependencies: "@babel/generator" "^7.22.9" "@babel/parser" "^7.22.7"