From 82fe7eea4b5884b5feec85b75ff7a74bf7532764 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 25 Sep 2019 15:51:15 +0200 Subject: [PATCH] Adds amendment filter types to motion list Adds the possibility to filter if a motion has amendments or is an amendment --- .../app/site/motions/models/view-motion.ts | 33 +++++++++++++++++++ .../services/motion-filter-list.service.ts | 16 ++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/motions/models/view-motion.ts b/client/src/app/site/motions/models/view-motion.ts index 665da9e9a..f5a75fa5f 100644 --- a/client/src/app/site/motions/models/view-motion.ts +++ b/client/src/app/site/motions/models/view-motion.ts @@ -40,6 +40,11 @@ export enum ChangeRecoMode { ModifiedFinal = 'modified_final_version' } +export enum AmendmentType { + Amendment = 1, + Parent +} + export const verboseChangeRecoMode = { original: 'Original version', changed: 'Changed version', @@ -340,6 +345,34 @@ export class ViewMotion extends BaseViewModelWithAgendaItemAndListOfSpeakers { ] }; + public AmendmentFilterOption: OsFilter = { + property: 'amendmentType', + label: 'Amendment', + options: [ + { condition: AmendmentType.Amendment, label: this.translate.instant('Is amendment') }, + { condition: AmendmentType.Parent, label: this.translate.instant('Has amendment') } + ] + }; + public personalNoteFilterOptions = [ { property: 'star', @@ -226,9 +235,14 @@ export class MotionFilterListService extends BaseFilterListService { filterDefinitions.push(this.hasSpeakerOptions); } + if (this.showAmendmentsInMainTable) { + filterDefinitions.push(this.AmendmentFilterOption); + } + if (!this.operator.isAnonymous) { filterDefinitions = filterDefinitions.concat(this.personalNoteFilterOptions); } + return filterDefinitions; }