From 51fa48940a4bd950f48cd2975a0b1281aae7e9f5 Mon Sep 17 00:00:00 2001 From: Raimund Renkert Date: Sat, 16 Sep 2023 10:58:57 +0200 Subject: [PATCH 1/6] Add filter for gender in participant list. --- client/src/app/domain/models/users/user.ts | 1 + .../participant-list-filter.service.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/client/src/app/domain/models/users/user.ts b/client/src/app/domain/models/users/user.ts index 4edac37618..95158d3e87 100644 --- a/client/src/app/domain/models/users/user.ts +++ b/client/src/app/domain/models/users/user.ts @@ -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. diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts index 9b7faa2cd1..78ad620edf 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts @@ -9,6 +9,7 @@ import { ViewUser } from 'src/app/site/pages/meetings/view-models/view-user'; import { GroupControllerService } from '../../../../modules/groups/services/group-controller.service'; import { ParticipantListServiceModule } from '../participant-list-service.module'; +import { GENDERS, GENDER_FITLERABLE } from 'src/app/domain/models/users/user'; @Injectable({ providedIn: ParticipantListServiceModule @@ -98,6 +99,16 @@ export class ParticipantListFilterService extends BaseMeetingFilterListService Date: Sat, 16 Sep 2023 11:05:48 +0200 Subject: [PATCH 2/6] Add option for 'unknown' --- .../participant-list-filter.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts index 78ad620edf..b9691c021b 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts @@ -106,7 +106,9 @@ export class ParticipantListFilterService extends BaseMeetingFilterListService Date: Sat, 16 Sep 2023 12:04:51 +0200 Subject: [PATCH 3/6] cleanup --- .../participant-list-filter.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts index b9691c021b..7a2fd360e2 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/services/participant-list-filter.service/participant-list-filter.service.ts @@ -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'; @@ -9,7 +10,6 @@ import { ViewUser } from 'src/app/site/pages/meetings/view-models/view-user'; import { GroupControllerService } from '../../../../modules/groups/services/group-controller.service'; import { ParticipantListServiceModule } from '../participant-list-service.module'; -import { GENDERS, GENDER_FITLERABLE } from 'src/app/domain/models/users/user'; @Injectable({ providedIn: ParticipantListServiceModule @@ -108,7 +108,6 @@ export class ParticipantListFilterService extends BaseMeetingFilterListService Date: Sun, 17 Sep 2023 20:07:42 +0200 Subject: [PATCH 4/6] Filter duplicated group ids in participant multiselect --- .../components/participant-list/participant-list.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts index 1cf96245a6..884cff47d6 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts @@ -269,7 +269,7 @@ export class ParticipantListComponent extends BaseMeetingListViewComponent this.activeMeeting.default_group_id !== id); return { id: user.id, - group_ids: nextGroupIds.concat(chosenGroupIds) + group_ids: nextGroupIds.concat(chosenGroupIds).filter((v,i,a)=>a.findIndex(v2=>(v2===v))===i) }; }, ...this.selectedRows) .resolve(); From db2d073ad8fb095207247de1ea4d257be3546e7c Mon Sep 17 00:00:00 2001 From: Raimund Renkert Date: Sun, 17 Sep 2023 20:25:41 +0200 Subject: [PATCH 5/6] cleanup --- .../components/participant-list/participant-list.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts index 884cff47d6..c744a883a7 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts @@ -269,7 +269,9 @@ export class ParticipantListComponent extends BaseMeetingListViewComponent this.activeMeeting.default_group_id !== id); return { id: user.id, - group_ids: nextGroupIds.concat(chosenGroupIds).filter((v,i,a)=>a.findIndex(v2=>(v2===v))===i) + group_ids: nextGroupIds + .concat(chosenGroupIds) + .filter((v, i, a) => a.findIndex(v2 => v2 === v) === i) }; }, ...this.selectedRows) .resolve(); From 26dd8ce7439e9652ef1985a09a9bf6dee77d7aa0 Mon Sep 17 00:00:00 2001 From: rrenkert Date: Wed, 27 Sep 2023 16:14:32 +0200 Subject: [PATCH 6/6] Use set instead of filter. Co-authored-by: luisa-beerboom <101706784+luisa-beerboom@users.noreply.github.com> --- .../components/participant-list/participant-list.component.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts index c744a883a7..e5b2cf2f70 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/components/participant-list/participant-list.component.ts @@ -269,9 +269,7 @@ export class ParticipantListComponent extends BaseMeetingListViewComponent this.activeMeeting.default_group_id !== id); return { id: user.id, - group_ids: nextGroupIds - .concat(chosenGroupIds) - .filter((v, i, a) => a.findIndex(v2 => v2 === v) === i) + group_ids: [...new Set(nextGroupIds.concat(chosenGroupIds))] }; }, ...this.selectedRows) .resolve();