Skip to content

Commit

Permalink
DXCDT-689: Fix branding template body path parsing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalshit27 committed Aug 13, 2024
1 parent 6381ce6 commit 7399dde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/context/yaml/handlers/branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ async function parse(context: YAMLContext): Promise<ParsedBranding> {

const parsedTemplates: BrandingTemplate[] = templates.map(
(templateDefinition: BrandingTemplate): BrandingTemplate => {
const brandingTemplatesFolder = path.join(
context.basePath,
constants.BRANDING_TEMPLATES_YAML_DIRECTORY
);
const file = `${templateDefinition.template}.html`;
const markupFile = path.join(brandingTemplatesFolder, file);
const normalizedPathSplit = path.normalize(templateDefinition.body).split(path.sep);
const markupFile = path.join(context.basePath, ...normalizedPathSplit);
return {
template: templateDefinition.template,
body: loadFileAndReplaceKeywords(markupFile, {
Expand Down
1 change: 0 additions & 1 deletion test/context/yaml/branding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ describe('#YAML context branding templates', () => {

const config = { AUTH0_INPUT_FILE: yamlFile, AUTH0_KEYWORD_REPLACE_MAPPINGS: { foo: 'bar' } };
const context = new Context(config, mockMgmtClient());
context.basePath = baseDir;
await context.loadAssetsFromLocal();
expect(context.assets.branding).to.deep.equal({
colors: {
Expand Down

0 comments on commit 7399dde

Please sign in to comment.