Skip to content

Commit

Permalink
fix: Save Edited Page Template - MEED-8460 - Meeds-io/meeds#2983 (#351)
Browse files Browse the repository at this point in the history
Prior to this change, when saving a page after editing it, the updates
aren't saved. This change ensure to use the generated content by editor
rather than resetting the original content coming from store.
  • Loading branch information
boubaker authored Feb 18, 2025
1 parent 3573846 commit 9fd7d84
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,15 @@ export default {
this.$root.$off('layout-page-template-drawer-open', this.open);
},
methods: {
async open(pageTemplate, duplicate, generateIllustration) {
this.templateId = pageTemplate.id || this.$root.pageTemplate?.id || null;
pageTemplate = await this.$pageTemplateService.getPageTemplate(this.templateId, true);
this.pageLayoutContent = pageTemplate.content;
async open(template, duplicate, generateIllustration) {
this.templateId = template.id || this.$root.pageTemplate?.id || null;
this.pageLayoutContent = template.content;
const pageTemplate = await this.$pageTemplateService.getPageTemplate(this.templateId, true);
this.description = pageTemplate?.description || '';
this.duplicate = duplicate;
if (this.duplicate) {
this.pageLayoutContent = pageTemplate.content;
}
if (generateIllustration) {
const parentElement = document.querySelector('.layout-sections-parent .layout-page-body').parentElement;
parentElement.querySelectorAll('.layout-add-application-button').forEach(el => el.style.display = 'none');
Expand Down

0 comments on commit 9fd7d84

Please # to comment.