Skip to content

Commit

Permalink
Add motion list has identical motion filter (#3482)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianjoel authored and peb-adr committed Mar 26, 2024
1 parent 9964fcf commit d0be0d6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export const getMotionListSubscriptionConfig: SubscriptionConfigGenerator = (id:
`submitter_ids`,
`additional_submitter`,
`tag_ids`,
`title`
`title`,
`identical_motion_ids`
],
follow: [
{ idField: `list_of_speakers_id`, ...listOfSpeakersSpeakerCountSubscription },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ export class MotionListFilterService extends BaseMeetingFilterListService<ViewMo
]
};

private hasIdenticalMotionsOptions: OsFilter<ViewMotion> = {
property: `hasIdenticalMotions`,
label: _(`Identical motions`),
options: [
{ condition: true, label: _(`Has identical motions`) },
{ condition: [false, null], label: _(`Has no identical motions`) }
]
};

private amendmentFilterOption: OsFilter<ViewMotion> = {
property: `amendmentType`,
label: _(`Amendment`),
Expand Down Expand Up @@ -296,7 +305,8 @@ export class MotionListFilterService extends BaseMeetingFilterListService<ViewMo
this.recommendationFilterOptions,
this.motionCommentFilterOptions,
this.tagFilterOptions,
this.forwardingFilterOptions
this.forwardingFilterOptions,
this.hasIdenticalMotionsOptions
];

// only add the filter if the user has the correct permission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ export class ViewMotion extends BaseProjectableViewModel<Motion> {
return this.speakerAmount > 0;
}

public get hasIdenticalMotions(): boolean {
return !!this.identical_motion_ids?.length;
}

public get showPreamble(): boolean {
return !this.state?.isFinalState ?? true;
}
Expand Down

0 comments on commit d0be0d6

Please sign in to comment.