From df1b03698cb531c712ea2f0c6bdd3593cfbd3f47 Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Mon, 21 Oct 2019 16:39:51 +0200 Subject: [PATCH] Adds filtering by collection as a new filter for the agenda --- client/src/app/site/agenda/models/view-item.ts | 9 +++++++++ .../site/agenda/services/agenda-filter-list.service.ts | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/client/src/app/site/agenda/models/view-item.ts b/client/src/app/site/agenda/models/view-item.ts index 408dbfa11..20aecfb05 100644 --- a/client/src/app/site/agenda/models/view-item.ts +++ b/client/src/app/site/agenda/models/view-item.ts @@ -43,5 +43,14 @@ export class ViewItem extends BaseViewModelWithContentObject choice.key === this.type); return type ? type.csvName : ''; } + + /** + * Returns the collection of the underlying content-object. + * + * @returns The collection as string. + */ + public get collection(): string { + return this.contentObjectData.collection; + } } export interface ViewItem extends Item {} diff --git a/client/src/app/site/agenda/services/agenda-filter-list.service.ts b/client/src/app/site/agenda/services/agenda-filter-list.service.ts index 5bedbe268..2e0d43fa3 100644 --- a/client/src/app/site/agenda/services/agenda-filter-list.service.ts +++ b/client/src/app/site/agenda/services/agenda-filter-list.service.ts @@ -47,6 +47,16 @@ export class AgendaFilterListService extends BaseFilterListService { { label: this.translate.instant('Open items'), condition: false }, { label: this.translate.instant('Closed items'), condition: true } ] + }, + { + label: 'Type', + property: 'collection', + options: [ + { label: this.translate.instant('Motions'), condition: 'motions/motion' }, + { label: this.translate.instant('Topics'), condition: 'topics/topic' }, + { label: this.translate.instant('Motion blocks'), condition: 'motions/motion-block' }, + { label: this.translate.instant('Elections'), condition: 'assignments/assignment' } + ] } ]; }