Skip to content

Commit

Permalink
feat: Add open in notes article action menu option - EXO-73044 - Meed…
Browse files Browse the repository at this point in the history
…s-io/MIPs#161

Add open in notes article action menu option
  • Loading branch information
hakermi committed Dec 9, 2024
1 parent ca79d5c commit 1713a70
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
:show-edit-button="showEditButton"
:show-publish-button="showPublishButton"
:show-refer-button="showReferButton"
:show-open-in-notes="showOpenInNotes"
:show-delete-button="showDeleteButton"
:translations="translations"
:selected-translation="selectedTranslation"
Expand Down Expand Up @@ -44,6 +45,7 @@ export default {
showPublishButton: false,
showDeleteButton: false,
showReferButton: false,
showOpenInNotes: false,
selectedTranslation: {value: eXo.env.portal.language},
translations: [],
languages: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
:show-publish-button="showPublishButton"
:show-copy-link-button="showCopyLinkButton"
:show-refer-button="showReferButton"
:show-open-in-notes="showOpenInNotes"
@delete-article="deleteConfirmDialog"
@edit-article="editLink"
@open-publication-drawer="openPublicationDrawer" />
Expand Down Expand Up @@ -140,6 +141,10 @@ export default {
type: Boolean,
default: false
},
showOpenInNotes: {
type: Boolean,
default: false
},
translations: {
type: Array,
default: () => {
Expand Down Expand Up @@ -211,6 +216,7 @@ export default {
});
this.$root.$on('open-edit-publishing-drawer', this.openPublicationDrawer);
this.$root.$on('refer-article-to-note', this.referArticle);
this.$root.$on('open-in-notes', this.openInNotes);
this.$root.$on('move-page', this.moveArticlePage);
},
methods: {
Expand Down Expand Up @@ -247,6 +253,9 @@ export default {
this.$refs.noteTreeview.open(this.articlePage, 'movePage');
}
},
openInNotes() {
window.open(this.articlePage.url, '_blank');
},
openPublicationDrawer() {
if (this.newPublicationDrawerEnabled) {
this.$refs?.publicationDrawer?.open(this.news);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
:show-delete-button="showDeleteButton"
:show-copy-link-button="true"
:show-refer-button="showReferButton"
:show-open-in-notes="showOpenNotes"
:translations="translations"
:selected-translation="selectedTranslation" />
</template>
Expand Down Expand Up @@ -80,6 +81,9 @@ export default {
showReferButton() {
return eXo?.env?.portal?.referArticleEnabled && this.news?.canRefer;
},
showOpenNotes() {
return this.news?.referred || this.news?.fromExternalPage;
},
showPublishButton() {
return this.news?.canPublish || this.news?.canSchedule;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
:show-publish-button="showPublishButton"
:show-copy-link-button="showCopyLinkButton"
:show-refer-button="showReferButton"
:show-open-in-notes="showOpenInNotes"
@delete-article="$emit('delete-article')"
@edit-article="$emit('edit-article')" />
<v-btn
Expand Down Expand Up @@ -111,6 +112,10 @@ export default {
showReferButton: {
type: Boolean,
default: false
},
showOpenInNotes: {
type: Boolean,
default: false
}
},
data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
:show-resume-button="showResumeButton"
:show-share-button="showShareButton"
:show-refer-button="showReferButton"
:show-open-in-notes="showOpenInNotes"
@copy-link="copyLink"
@edit-article="$emit('edit-article', news)"
@delete-article="$emit('delete-article')" />
Expand Down Expand Up @@ -103,6 +104,10 @@ export default {
showReferButton: {
type: Boolean,
default: false
},
showOpenInNotes: {
type: Boolean,
default: false
}
},
data: () => ({
Expand Down Expand Up @@ -164,6 +169,7 @@ export default {
showPublishButton: this.showPublishButton,
showCopyLinkButton: this.showCopyLinkButton,
showReferButton: this.showReferButton,
showOpenInNotes: this.showOpenInNotes,
currentApp: this.currentApp
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@
{{ $t('news.details.header.menu.copy.link') }}
</span>
</v-list-item>
<v-list-item
v-if="showOpenInNotes"
class="ps-2 pe-4 action-menu-item d-flex align-center"
@click="$root.$emit('open-in-notes')">
<v-icon
size="16"
class="clickable icon-menu">
fas fa-external-link-alt
</v-icon>
<span class="pt-1 text-color">
{{ $t('content.article.open.in.notes') }}
</span>
</v-list-item>
<v-list-item
v-if="showEditButton"
class="ps-2 pe-4 action-menu-item d-flex align-center"
Expand Down Expand Up @@ -161,6 +174,10 @@ export default {
showReferButton: {
type: Boolean,
default: false
},
showOpenInNotes: {
type: Boolean,
default: false
}
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
:show-resume-button="showResumeButton"
:show-share-button="showShareButton"
:show-refer-button="showReferButton"
:show-open-in-notes="showOpenInNotes"
@copy-link="copyLink"
@edit-article="$emit('edit-article', news)"
@delete-article="$emit('delete-article', news)" />
Expand All @@ -53,7 +54,8 @@ export default {
showPublishButton: false,
currentApp: null,
showCopyLinkButton: false,
showReferButton: false
showReferButton: false,
showOpenInNotes: false
};
},
computed: {
Expand All @@ -78,6 +80,7 @@ export default {
this.showPublishButton = config.showPublishButton;
this.showCopyLinkButton = config.showCopyLinkButton;
this.showReferButton = config.showReferButton;
this.showOpenInNotes = config.showOpenInNotes;
this.currentApp = config.currentApp;
this.$refs.newsMobileActionMenu.open();
},
Expand Down

0 comments on commit 1713a70

Please sign in to comment.