Skip to content

Commit

Permalink
feat: Add open in notes in article details - EXO-73044 - Meeds-io/MIP…
Browse files Browse the repository at this point in the history
…s#161

Add open in notes in article details of referred or published articles from existing notes.
  • Loading branch information
hakermi committed Dec 13, 2024
1 parent 18a98bb commit 7ef933f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
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 @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,27 @@
:activity-id="activityId"
:icon-size="20"
class="pull-right mt-1 me-2" />
<v-tooltip
v-if="canOpenInNotes"
bottom>
<template #activator="{ on, attrs }">
<v-btn
v-on="on"
v-bind="attrs"
:href="articlePageUrl"
:aria-label="$t('content.article.open.in.notes')"
class="pull-right me-2"
link
icon>
<v-icon
size="20"
class="icon-default-color">
fas fa-external-link-alt
</v-icon>
</v-btn>
</template>
{{ $t('content.article.open.in.notes') }}
</v-tooltip>
</div>
</template>

Expand Down Expand Up @@ -111,6 +132,10 @@ export default {
showReferButton: {
type: Boolean,
default: false
},
articlePageUrl: {
type: String,
default: null
}
},
data() {
Expand Down Expand Up @@ -142,6 +167,9 @@ export default {
},
displayFavoriteButton() {
return this.currentUser !== '' && this.publicationState !== 'staged';
},
canOpenInNotes() {
return this.news?.referred || this.news?.fromExternalPage;
}
},
methods: {
Expand Down

0 comments on commit 7ef933f

Please sign in to comment.