Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter for gender in participant list and fix duplicated group ids in multiselect #2813

Merged
merged 6 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/src/app/domain/models/users/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type UserSortProperty = 'first_name' | 'last_name' | 'number';
* Iterable pre selection of genders
*/
export const GENDERS = [_(`female`), _(`male`), _(`diverse`), _(`non-binary`)];
export const GENDER_FITLERABLE = [`female`, `male`, `diverse`, `non-binary`];

/**
* Representation of a user in contrast to the operator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class ParticipantListComponent extends BaseMeetingListViewComponent<ViewU
const nextGroupIds = user.group_ids().filter(id => this.activeMeeting.default_group_id !== id);
return {
id: user.id,
group_ids: nextGroupIds.concat(chosenGroupIds)
group_ids: [...new Set(nextGroupIds.concat(chosenGroupIds))]
};
}, ...this.selectedRows)
.resolve();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { GENDER_FITLERABLE, GENDERS } from 'src/app/domain/models/users/user';
import { OsFilter, OsHideFilterSetting } from 'src/app/site/base/base-filter.service';
import { BaseMeetingFilterListService } from 'src/app/site/pages/meetings/base/base-meeting-filter-list.service';
import { MeetingActiveFiltersService } from 'src/app/site/pages/meetings/services/meeting-active-filters.service';
Expand Down Expand Up @@ -98,6 +99,17 @@ export class ParticipantListFilterService extends BaseMeetingFilterListService<V
{ condition: true, label: this.translate.instant(`Has unchanged vote weight`) }
]
},
{
property: `gender`,
label: this.translate.instant(`Gender`),
options: [
{ condition: GENDER_FITLERABLE[0], label: this.translate.instant(GENDERS[0]) },
{ condition: GENDER_FITLERABLE[1], label: this.translate.instant(GENDERS[1]) },
{ condition: GENDER_FITLERABLE[2], label: this.translate.instant(GENDERS[2]) },
{ condition: GENDER_FITLERABLE[3], label: this.translate.instant(GENDERS[3]) },
{ condition: null, label: this.translate.instant(`unknown`) }
]
},
{
property: `hasSamlId`,
label: this.translate.instant(`SSO`),
Expand Down