Enable possiblity to support custom pages (without forking keycloakify)
This commit is contained in:
@ -6,7 +6,6 @@ import * as child_process from "child_process";
|
||||
import { generateDebugFiles, containerLaunchScriptBasename } from "./generateDebugFiles";
|
||||
import { URL } from "url";
|
||||
|
||||
|
||||
const reactProjectDirPath = process.cwd();
|
||||
|
||||
const doUseExternalAssets = process.argv[2]?.toLowerCase() === "--external-assets";
|
||||
@ -19,6 +18,8 @@ export function main() {
|
||||
|
||||
console.log("🔏 Building the keycloak theme...⌚");
|
||||
|
||||
const extraPagesId: string[] = (parsedPackageJson as any)["keycloakify"]?.["extraPages"] ?? [];
|
||||
|
||||
generateKeycloakThemeResources({
|
||||
keycloakThemeBuildingDirPath,
|
||||
"reactAppBuildDirPath": pathJoin(reactProjectDirPath, "build"),
|
||||
@ -53,7 +54,8 @@ export function main() {
|
||||
|
||||
};
|
||||
|
||||
})()
|
||||
})(),
|
||||
extraPagesId
|
||||
});
|
||||
|
||||
const { jarFilePath } = generateJavaStackFiles({
|
||||
|
@ -136,7 +136,7 @@ export function generateFtlFilesCodeFactory(
|
||||
|
||||
function generateFtlFilesCode(
|
||||
params: {
|
||||
pageId: PageId;
|
||||
pageId: string;
|
||||
}
|
||||
): { ftlCode: string; } {
|
||||
|
||||
|
@ -22,10 +22,14 @@ export function generateKeycloakThemeResources(
|
||||
urlPathname: string;
|
||||
//If urlOrigin is not undefined then it means --externals-assets
|
||||
urlOrigin: undefined | string;
|
||||
extraPagesId: string[];
|
||||
}
|
||||
) {
|
||||
|
||||
const { themeName, reactAppBuildDirPath, keycloakThemeBuildingDirPath, urlPathname, urlOrigin } = params;
|
||||
const {
|
||||
themeName, reactAppBuildDirPath, keycloakThemeBuildingDirPath,
|
||||
urlPathname, urlOrigin, extraPagesId
|
||||
} = params;
|
||||
|
||||
const themeDirPath = pathJoin(keycloakThemeBuildingDirPath, "src", "main", "resources", "theme", themeName, "login");
|
||||
|
||||
@ -92,7 +96,7 @@ export function generateKeycloakThemeResources(
|
||||
urlOrigin
|
||||
});
|
||||
|
||||
pageIds.forEach(pageId => {
|
||||
[...pageIds, ...extraPagesId].forEach(pageId => {
|
||||
|
||||
const { ftlCode } = generateFtlFilesCode({ pageId });
|
||||
|
||||
|
Reference in New Issue
Block a user