Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Display the activity views count - EXO-74854 - Meeds-io/MIPs#161 #4129

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: Display the the activity views count - EXO-74854 - Meeds-io/MIP…
sofyenne authored and azayati committed Oct 23, 2024
commit d206806448de885ce326ca91bbb64eeee7f22ec4
Original file line number Diff line number Diff line change
@@ -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"
@@ -122,6 +122,19 @@
@click="displayFullContent">
<span class="pl-6">{{ $t('UIActivity.label.seeMore') }}</span>
</v-btn>
<div
v-if="activityViews"
:title="activityViewsTooltip"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be v-tooltip instead IMO as it is done in news detail

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To follow the guidelines, we use the same navigator tooltip as the activity link title and summary, as confirmed by the PO!

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>
@@ -162,7 +175,8 @@ export default {
displayReadMoreButton: false,
useEmbeddedLinkView: true,
summaryLinesToDisplay: 2,
isLandscapeThumbnail: false
isLandscapeThumbnail: false,
activityViews: null
}),
computed: {
getTitle() {
@@ -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) {
@@ -360,6 +383,7 @@ export default {
}
}
}
this.activityViews = this.getActivityViews && this.getActivityViews(this.activity);
},
displayReadMore() {
const elem = this.$el?.querySelector?.('.rich-editor-content');