From e3ceb99e08d473083c49f6366f2c5f87b68ba5a1 Mon Sep 17 00:00:00 2001 From: Helmi Akermi Date: Wed, 11 Dec 2024 12:12:10 +0100 Subject: [PATCH] feat: Add open in notes in article details - EXO-73044 - Meeds-io/MIPs#161 Add open in notes in article details of referred or published articles from existing notes. --- .../locale/portlet/news/News_en.properties | 1 + .../locale/portlet/news/News_fr.properties | 1 + .../components/ExoNewsDetails.vue | 1 + .../components/ExoNewsDetailsToolBar.vue | 28 +++++++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/content-service/src/main/resources/locale/portlet/news/News_en.properties b/content-service/src/main/resources/locale/portlet/news/News_en.properties index eaac6361d..9d309c6f3 100644 --- a/content-service/src/main/resources/locale/portlet/news/News_en.properties +++ b/content-service/src/main/resources/locale/portlet/news/News_en.properties @@ -288,3 +288,4 @@ content.article.deRefer.label=Derefer the note content.article.referred.success=Article successfully referred content.article.referred.error=Error while referring article content.article.deReferred.success=Note dereferred successfully +content.article.open.in.notes=Open in Notes diff --git a/content-service/src/main/resources/locale/portlet/news/News_fr.properties b/content-service/src/main/resources/locale/portlet/news/News_fr.properties index c06ae5311..dcfd42dbe 100644 --- a/content-service/src/main/resources/locale/portlet/news/News_fr.properties +++ b/content-service/src/main/resources/locale/portlet/news/News_fr.properties @@ -288,3 +288,4 @@ content.article.deRefer.label=D\u00E9r\u00E9f\u00E9rencer la note content.article.referred.success=Article r\u00E9f\u00E9renc\u00E9 avec succ\u00E8s content.article.referred.error=Erreur lors de la r\u00E9f\u00E9rence de l'article content.article.deReferred.success=Note d\u00E9r\u00E9f\u00E9renc\u00E9e avec succ\u00E8s +content.article.open.in.notes=Ouvrir dans Notes 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 61ba902fd..f0c88c8ac 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 @@ -35,6 +35,7 @@ :show-publish-button="showPublishButton" :show-copy-link-button="showCopyLinkButton" :show-refer-button="showReferButton" + :article-page-url="articlePage.url" @delete-article="deleteConfirmDialog" @edit-article="editLink" @open-publication-drawer="openPublicationDrawer" /> diff --git a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsToolBar.vue b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsToolBar.vue index 7aaf6d1ab..609dc814b 100644 --- a/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsToolBar.vue +++ b/content-webapp/src/main/webapp/vue-app/news-details/components/ExoNewsDetailsToolBar.vue @@ -62,6 +62,27 @@ :activity-id="activityId" :icon-size="20" class="pull-right mt-1 me-2" /> + + + {{ $t('content.article.open.in.notes') }} + @@ -111,6 +132,10 @@ export default { showReferButton: { type: Boolean, default: false + }, + articlePageUrl: { + type: String, + default: null } }, data() { @@ -142,6 +167,9 @@ export default { }, displayFavoriteButton() { return this.currentUser !== '' && this.publicationState !== 'staged'; + }, + canOpenInNotes() { + return this.news?.referred || this.news?.fromExternalPage; } }, methods: {