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

Merge Meeds-io/MIPs#161 #4147

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
:activity-types="activityTypes"
:activity-type-extension="activityTypeExtension" />
<activity-comments-preview
v-if="!extendedComponent.overrideComments"
v-if="activityReactionEnabled && !extendedComponent.overrideComments"
:activity="activity"
:comment-types="commentTypes"
:comment-actions="commentActions"
Expand Down Expand Up @@ -75,6 +75,7 @@
:activity-types="activityTypes"
:activity-type-extension="activityTypeExtension" />
<activity-comments-preview
v-if="activityReactionEnabled"
:activity="activity"
:comment-types="commentTypes"
:comment-actions="commentActions"
Expand Down Expand Up @@ -211,6 +212,9 @@ export default {
},
showLastComments() {
return this.hasNewComment || this.isActivityDetail;
},
activityReactionEnabled() {
return this.activityTypeExtension?.reactionEnabled?.(this.activity) ?? true;
}
},
watch: {
Expand Down
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, {0: this.activityViews?.originalViewsCount});
},
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:activity-types="activityTypes"
class="no-border-bottom mb-0 pa-3" />
<div
v-if="activityReactionEnabled"
:class="actionBarBorderClass"
class="mb-0 d-flex flex-wrap flex-column flex-lg-row align-lg-center">
<activity-reactions
Expand Down Expand Up @@ -66,6 +67,9 @@ export default {
isDesktop() {
return this.$vuetify && this.$vuetify.breakpoint && this.$vuetify.breakpoint.name !== 'xs' && this.$vuetify.breakpoint.name !== 'sm' && this.$vuetify.breakpoint.name !== 'md';
},
activityReactionEnabled() {
return this.activityTypeExtension?.reactionEnabled?.(this.activity) ?? true;
}
},
created() {
this.$root.$on('activity-comment-created', this.checkCommentsSize);
Expand Down