Skip to content

Commit

Permalink
feat: Enable publication drawer in content editor - EXO-72738 - Meeds…
Browse files Browse the repository at this point in the history
…-io/MIPs#161

Enable publication drawer in content editor
  • Loading branch information
hakermi committed Oct 7, 2024
1 parent ac7055d commit 9bc14dd
Showing 1 changed file with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
:form-title="contentFormTitle"
:suggester-space-url="spacePrettyName"
:app-name="appName"
:web-page-note="false"
:web-page-url="false"
:languages="languages"
:translations="translations"
:selected-language="selectedLanguage"
Expand All @@ -44,6 +42,7 @@
:save-button-icon="saveButtonIcon"
:save-button-disabled="disableSaveButton"
:editor-icon="editorIcon"
:publication-enabled="true"
:images-download-folder="'DRIVE_ROOT_NODE/News/images'"
@editor-closed="editorClosed"
@open-treeview="openTreeView"
Expand Down Expand Up @@ -140,6 +139,9 @@ export default {
this.autoSave();
}
},
postingNews() {
this.$refs.editor.setPublishing(this.postingNews);
}
},
computed: {
editMode() {
Expand Down Expand Up @@ -175,6 +177,9 @@ export default {
propertiesModified() {
return JSON.stringify(this.article?.properties) !== JSON.stringify(this.originalArticle?.properties);
},
newPublicationDrawerEnabled() {
return eXo?.env?.portal?.newPublicationDrawerEnabled;
}
},
created() {
this.getAvailableLanguages();
Expand Down Expand Up @@ -407,11 +412,7 @@ export default {
}
},
postArticle(schedulePostDate, postArticleMode, publish, isActivityPosted, selectedTargets, selectedAudience) {
if (typeof isActivityPosted === 'undefined') {
this.article.activityPosted = true;
} else {
this.article.activityPosted = isActivityPosted;
}
this.article.activityPosted = isActivityPosted;
this.article.published = publish;
this.article.targets = selectedTargets;
if (selectedAudience !== null) {
Expand Down Expand Up @@ -474,6 +475,7 @@ export default {
alertLinkText: this.$t('news.view.label'),
alertLink: this.isSpaceMember ? `${eXo.env.portal.context}/${eXo.env.portal.metaPortalName}/activity?id=${createdArticle.activityId}` : `${eXo.env.portal.context}/${eXo.env.portal.metaPortalName}/news-detail?newsId=${createdArticle.id}`
});
this.enableClickOnce();
}).catch(error => {
this.displayAlert({type: 'error', message: this.$t('news.save.error.message', error.message)});
this.enableClickOnce();
Expand Down Expand Up @@ -504,7 +506,19 @@ export default {
window.history.pushState('news', '', `${url.origin}${url.pathname}?${params.toString()}`);
},
postAndPublish(editMode) {
if (editMode) {
this.updateAndPostArticle();
return;
}
this.postingNews = true;
this.postArticle();
},
postArticleActions() {
if (this.newPublicationDrawerEnabled) {
this.postAndPublish(this.editMode);
return;
}
if (this.editMode) {
this.updateAndPostArticle();
return;
Expand All @@ -514,9 +528,7 @@ export default {
this.$root.$emit('open-schedule-drawer', this.scheduleMode);
this.postKey++;
} else {
this.postingNews = true;
this.postArticle();
this.enableClickOnce();
this.postAndPublish();
}
},
updateArticleData(article) {
Expand Down

0 comments on commit 9bc14dd

Please sign in to comment.