Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create ChainedTemplateEngine for combining engines #887

Merged
merged 1 commit into from Aug 3, 2021

Conversation

joachimvh
Copy link
Member

Closes #872 .

The title extraction is now done in the main IDP template, but after doing this I actually think it would be better to have a separate engine for this. That way we can reuse the root main.html.hbs template for the IDP (now we have 2 almost-identical main templates), and we can then also attach that to the templating engine used in the MarkdownToHtmlConverter, which now does its own title extraction.

But I already had this working version when I realized that so I thought I might as well already push this to hear a 2nd opinion on how needed this is. 馃槃

@joachimvh joachimvh added this to the v1.0.0 milestone Aug 2, 2021
Copy link
Member

@RubenVerborgh RubenVerborgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title extraction is now done in the main IDP template, but after doing this I actually think it would be better to have a separate engine for this. That way we can reuse the root main.html.hbs template for the IDP

I might be missing something, but why don't we use main.html.ejs as the main template of everything? (And remove the existing title-extracting code in MarkdownToHtmlConverter?)

config/identity/handler/default.json Outdated Show resolved Hide resolved
src/util/templates/ChainedTemplateEngine.ts Outdated Show resolved Hide resolved
src/util/templates/ChainedTemplateEngine.ts Outdated Show resolved Hide resolved
templates/identity/email-password/message.html.ejs Outdated Show resolved Hide resolved
templates/identity/main.html.ejs Outdated Show resolved Hide resolved
@joachimvh
Copy link
Member Author

I might be missing something, but why don't we use main.html.ejs as the main template of everything? (And remove the existing title-extracting code in some Markdown handler?)

Probably because I still have this "remove ejs" idea in my head. Yea that would work as well I think.

@@ -34,7 +34,7 @@ export class ResetPasswordHandler extends InteractionHandler {
assertPassword(password, confirmPassword);

await this.resetPassword(recordId, password);
return { type: 'response', details: { message: 'Your password was successfully reset.' }};
return { type: 'response', details: {}};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make details optional? (minor nit)

Copy link
Member

@RubenVerborgh RubenVerborgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!!

src/storage/conversion/MarkdownToHtmlConverter.ts Outdated Show resolved Hide resolved
src/util/templates/ChainedTemplateEngine.ts Outdated Show resolved Hide resolved
@joachimvh joachimvh merged commit 18a7103 into main Aug 3, 2021
@joachimvh joachimvh deleted the feat/chained-templates branch August 3, 2021 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid template duplication
2 participants