Merge pull request #5084 from GabrielInTheWorld/filterAgenda

Adds filtering by collection as a new filter for the agenda
This commit is contained in:
Finn Stutzenstein 2019-10-24 10:23:14 +02:00 committed by GitHub
commit 8335662e9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -43,5 +43,14 @@ export class ViewItem extends BaseViewModelWithContentObject<Item, BaseViewModel
const type = ItemVisibilityChoices.find(choice => 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 {}

View File

@ -47,6 +47,16 @@ export class AgendaFilterListService extends BaseFilterListService<ViewItem> {
{ 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' }
]
}
];
}