Skip to content

Commit

Permalink
feat: Display the the activity views count - EXO-74854 - Meeds-io/MIP…
Browse files Browse the repository at this point in the history
  • Loading branch information
sofyenne authored and azayati committed Oct 23, 2024
1 parent fa94163 commit d206806
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</v-avatar>
<div
:class="isMobile && 'mx-3' || ''"
class="my-2 position-relative">
class="my-2 position-relative d-flex flex-column width-full">
<dynamic-html-element
v-if="title"
:child="titleElement"
Expand All @@ -122,6 +122,19 @@
@click="displayFullContent">
<span class="pl-6">{{ $t('UIActivity.label.seeMore') }}</span>
</v-btn>
<div
v-if="activityViews"
:title="activityViewsTooltip"
class="d-flex justify-end mt-auto ms-auto width-fit-content me-3">
<v-icon
size="20"
class="icon-default-color">
fas fa-eye
</v-icon>
<span class="ms-1 text-subtitle">
{{ activityViewsCount }}
</span>
</div>
</div>
</template>
</dynamic-html-element>
Expand Down Expand Up @@ -162,7 +175,8 @@ export default {
displayReadMoreButton: false,
useEmbeddedLinkView: true,
summaryLinesToDisplay: 2,
isLandscapeThumbnail: false
isLandscapeThumbnail: false,
activityViews: null
}),
computed: {
getTitle() {
Expand Down Expand Up @@ -314,6 +328,15 @@ export default {
'min-height': '100%'
};
},
getActivityViews() {
return this.activityTypeExtension && this.activityTypeExtension.getActivityViews;
},
activityViewsTooltip() {
return this.activityViews?.tooltip && this.$t(this.activityViews.tooltip);
},
activityViewsCount() {
return this.activityViews?.viewsCount;
}
},
watch: {
activityTypeExtension(newVal, oldVal) {
Expand Down Expand Up @@ -360,6 +383,7 @@ export default {
}
}
}
this.activityViews = this.getActivityViews && this.getActivityViews(this.activity);
},
displayReadMore() {
const elem = this.$el?.querySelector?.('.rich-editor-content');
Expand Down

0 comments on commit d206806

Please sign in to comment.