diff --git a/content-webapp/src/main/webapp/skin/less/newsDetails.less b/content-webapp/src/main/webapp/skin/less/newsDetails.less index 5dc4961f8..57dc2375f 100644 --- a/content-webapp/src/main/webapp/skin/less/newsDetails.less +++ b/content-webapp/src/main/webapp/skin/less/newsDetails.less @@ -198,13 +198,8 @@ } .article-views { - position: relative; top: -5px } - - .article-views-icon { - color: #707070!important; - } .no-updater-info { margin-left: 54px ~'!important; /** orientation=lt */ '; diff --git a/content-webapp/src/main/webapp/vue-app/news-activity-composer-app/components/ContentRichEditor.vue b/content-webapp/src/main/webapp/vue-app/news-activity-composer-app/components/ContentRichEditor.vue index e2354901a..c591b3b18 100644 --- a/content-webapp/src/main/webapp/vue-app/news-activity-composer-app/components/ContentRichEditor.vue +++ b/content-webapp/src/main/webapp/vue-app/news-activity-composer-app/components/ContentRichEditor.vue @@ -42,8 +42,11 @@ :save-button-icon="saveButtonIcon" :save-button-disabled="disableSaveButton" :editor-icon="editorIcon" - :space-id="spaceId" - :can-publish="canScheduleArticle" + :publication-params="{ + spaceId: spaceId, + canPublish: canScheduleArticle, + allowedTargets: allowedTargets + }" :images-download-folder="'DRIVE_ROOT_NODE/News/images'" @editor-closed="editorClosed" @open-treeview="openTreeView" @@ -128,7 +131,8 @@ export default { isSpaceMember: false, spacePrettyName: null, editorExtensions: null, - autosaveProcessedFromEditorExtension: false + autosaveProcessedFromEditorExtension: false, + allowedTargets: [] }; }, watch: { @@ -188,6 +192,7 @@ export default { this.getAvailableLanguages(); this.initDataPropertiesFromUrl(); this.getArticle(); + this.getAllowedTargets(); this.refreshTranslationExtensions(); document.addEventListener('automatic-translation-extensions-updated', () => { this.refreshTranslationExtensions(); @@ -556,11 +561,15 @@ export default { postAndPublish(editMode, publicationSettings) { if (editMode) { this.article.activityPosted = publicationSettings?.post; + this.article.published = publicationSettings?.publish; + this.article.targets = publicationSettings?.selectedTargets; + this.article.audience = publicationSettings?.selectedAudience; this.updateAndPostArticle(); return; } this.postingNews = true; - this.postArticle(null, null, false, publicationSettings?.post); + this.postArticle(null, null, publicationSettings?.publish, publicationSettings?.post, + publicationSettings?.selectedTargets, publicationSettings?.selectedAudience); }, postArticleActions(publicationSettings) { if (this.newPublicationDrawerEnabled) { @@ -762,6 +771,18 @@ export default { refreshTranslationExtensions() { this.editorExtensions = extensionRegistry.loadExtensions('contentEditor', 'translation-extension'); }, + getAllowedTargets() { + this.$newsTargetingService.getAllowedTargets() + .then(targets => { + this.allowedTargets = targets.map(target => ({ + name: target.name, + label: target?.properties?.label, + tooltipInfo: `${target?.properties?.label}: ${target?.properties?.description || ''}`, + description: target?.properties?.description, + restrictedAudience: target?.restrictedAudience, + })); + }); + }, isEmptyDraft() { const isTitleEmpty = !this.article?.title; const isContentEmpty = !this.article?.content; diff --git a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetails.vue b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetails.vue index 880b9f385..e53865982 100644 --- a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetails.vue +++ b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetails.vue @@ -63,9 +63,14 @@ v-if="newPublicationDrawerEnabled" ref="publicationDrawer" :is-publishing="isPublishing" - :space-id="spaceId" + :params="{ + spaceId: spaceId, + allowedTargets: allowedTargets, + canPublish: news?.canPublish + }" :edit-mode="true" @publish="publishArticle" /> + { + this.allowedTargets = targets.map(target => ({ + name: target.name, + label: target?.properties?.label, + tooltipInfo: `${target?.properties?.label}: ${target?.properties?.description || ''}`, + description: target?.properties?.description, + restrictedAudience: target?.restrictedAudience, + })); + }); + }, publishArticle(publicationSettings) { this.isPublishing = true; this.news.activityPosted = publicationSettings?.post; + this.news.published = publicationSettings?.publish; + this.news.targets = publicationSettings?.selectedTargets; + this.news.audience = publicationSettings?.selectedAudience; return this.$newsServices.updateNews(this.news, false, this.$newsConstants.newsObjectType.ARTICLE, this.$newsConstants.newsUpdateType.POSTING_AND_PUBLISHING).then(() => { this.isPublishing = false; this.$root.$emit('alert-message', this.$t('news.composer.alert.success.UpdateTargets'), 'success'); diff --git a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsBody.vue b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsBody.vue index 09d96822f..fc91618d3 100644 --- a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsBody.vue +++ b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsBody.vue @@ -45,10 +45,10 @@ + class="ms-3 icon-default-color"> fas fa-eye - + {{ newsViews }} @@ -93,7 +93,7 @@