Fix some errors in base account v1 theme
This commit is contained in:
parent
bd25621b2c
commit
75c54df109
@ -26,6 +26,51 @@ export async function downloadBuiltinKeycloakTheme(params: { keycloakVersion: st
|
||||
"preCacheTransform": {
|
||||
"actionCacheId": "npm install and build",
|
||||
"action": async ({ destDirPath }) => {
|
||||
fix_account_css: {
|
||||
const accountCssFilePath = pathJoin(destDirPath, "keycloak", "account", "resources", "css", "account.css");
|
||||
|
||||
if (!fs.existsSync(accountCssFilePath)) {
|
||||
break fix_account_css;
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
accountCssFilePath,
|
||||
Buffer.from(fs.readFileSync(accountCssFilePath).toString("utf8").replace("top: -34px;", "top: -34px !important;"), "utf8")
|
||||
);
|
||||
}
|
||||
|
||||
fix_account_topt: {
|
||||
const totpFtlFilePath = pathJoin(destDirPath, "base", "account", "totp.ftl");
|
||||
|
||||
if (!fs.existsSync(totpFtlFilePath)) {
|
||||
break fix_account_topt;
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
totpFtlFilePath,
|
||||
Buffer.from(
|
||||
fs
|
||||
.readFileSync(totpFtlFilePath)
|
||||
.toString("utf8")
|
||||
.replace(
|
||||
[
|
||||
" <#list totp.policy.supportedApplications as app>",
|
||||
" <li>${app}</li>",
|
||||
" </#list>"
|
||||
].join("\n"),
|
||||
[
|
||||
" <#if totp.policy.supportedApplications?has_content>",
|
||||
" <#list totp.policy.supportedApplications as app>",
|
||||
" <li>${app}</li>",
|
||||
" </#list>",
|
||||
" </#if>"
|
||||
].join("\n")
|
||||
),
|
||||
"utf8"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
install_common_node_modules: {
|
||||
const commonResourcesDirPath = pathJoin(destDirPath, "keycloak", "common", "resources");
|
||||
|
||||
|
@ -38,7 +38,22 @@ export async function bringInAccountV1(params: { buildOptions: BuildOptionsLike
|
||||
|
||||
const commonResourceFilePaths = [
|
||||
"node_modules/patternfly/dist/css/patternfly.min.css",
|
||||
"node_modules/patternfly/dist/css/patternfly-additions.min.css"
|
||||
"node_modules/patternfly/dist/css/patternfly-additions.min.css",
|
||||
"node_modules/patternfly/dist/css/patternfly-additions.min.css",
|
||||
...[
|
||||
"OpenSans-Light-webfont.woff2",
|
||||
"OpenSans-Regular-webfont.woff2",
|
||||
"OpenSans-Bold-webfont.woff2",
|
||||
"OpenSans-Semibold-webfont.woff2",
|
||||
"OpenSans-Bold-webfont.woff",
|
||||
"OpenSans-Light-webfont.woff",
|
||||
"OpenSans-Regular-webfont.woff",
|
||||
"OpenSans-Semibold-webfont.woff",
|
||||
"OpenSans-Regular-webfont.ttf",
|
||||
"OpenSans-Light-webfont.ttf",
|
||||
"OpenSans-Semibold-webfont.ttf",
|
||||
"OpenSans-Bold-webfont.ttf"
|
||||
].map(path => `node_modules/patternfly/dist/fonts/${path}`)
|
||||
];
|
||||
|
||||
for (const relativeFilePath of commonResourceFilePaths.map(path => pathJoin(...path.split("/")))) {
|
||||
@ -49,7 +64,7 @@ export async function bringInAccountV1(params: { buildOptions: BuildOptionsLike
|
||||
fs.cpSync(pathJoin(builtinKeycloakThemeTmpDirPath, "keycloak", "common", "resources", relativeFilePath), destFilePath);
|
||||
}
|
||||
|
||||
const resourceFilePaths = ["css/account.css"];
|
||||
const resourceFilePaths = ["css/account.css", "img/icon-sidebar-active.png", "img/logo.png"];
|
||||
|
||||
for (const relativeFilePath of resourceFilePaths.map(path => pathJoin(...path.split("/")))) {
|
||||
const destFilePath = pathJoin(accountV1DirPath, "resources", relativeFilePath);
|
||||
@ -69,7 +84,7 @@ export async function bringInAccountV1(params: { buildOptions: BuildOptionsLike
|
||||
"",
|
||||
"locales=ar,ca,cs,da,de,en,es,fr,fi,hu,it,ja,lt,nl,no,pl,pt-BR,ru,sk,sv,tr,zh-CN",
|
||||
"",
|
||||
"styles=" + [...resourceFilePaths, ...commonResourceFilePaths.map(path => `resources_common/${path}`)].join(" "),
|
||||
"styles=" + [...resourceFilePaths, ...commonResourceFilePaths.map(path => `resources-common/${path}`)].join(" "),
|
||||
"",
|
||||
"##### css classes for form buttons",
|
||||
"# main class used for all buttons",
|
||||
|
Loading…
x
Reference in New Issue
Block a user