diff --git a/js/src/types/actor/group.model.ts b/js/src/types/actor/group.model.ts index 7c90eeff4..6f6a2b073 100644 --- a/js/src/types/actor/group.model.ts +++ b/js/src/types/actor/group.model.ts @@ -18,6 +18,7 @@ export interface IGroup extends IActor { todoLists: Paginate; discussions: Paginate; organizedEvents: Paginate; + posts: Paginate; physicalAddress: IAddress; openness: Openness; visibility: GroupVisibility; diff --git a/js/src/views/Group/Group.vue b/js/src/views/Group/Group.vue index a36048337..e86923e1c 100644 --- a/js/src/views/Group/Group.vue +++ b/js/src/views/Group/Group.vue @@ -473,10 +473,10 @@ {{ $t("Upcoming events") }}
{{ $t("View all events") }}
{{ $t("Latest posts") }} -
+
@@ -510,7 +510,7 @@ { + return { + total: this.group.organizedEvents.total, + elements: this.group.organizedEvents.elements.filter((event: IEvent) => { + if (this.previewPublic) { + return !event.draft; // TODO when events get visibility access add visibility constraint like below for posts + } + return true; + }), + }; + } + + get posts(): Paginate { + return { + total: this.group.posts.total, + elements: this.group.posts.elements.filter((post: IPost) => { + if (this.previewPublic) { + return !(post.draft || post.visibility == PostVisibility.PRIVATE); + } + return true; + }), + }; + } }