From 63e554477d33d17415274f0f76e6700d85f7f81a Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Wed, 25 Sep 2024 10:43:46 +0200 Subject: [PATCH 1/4] Fix amount visibility of pts in the committee-list --- .../committee-list.component.html | 44 ++++++++++--------- .../committee-list.component.ts | 4 ++ 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.html b/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.html index 3d32ff7341..9c854ba547 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.html +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.html @@ -102,27 +102,29 @@

{{ 'Committees' | translate }}

} - @if (committee.memberAmount) { -
- - {{ committee.memberAmount }} - -
- } - @if (committee.managerAmount) { -
- - {{ committee.managerAmount }} - -
+ @if (canSeeMemberAmounts(committee)) { + @if (committee.memberAmount) { +
+ + {{ committee.memberAmount }} + +
+ } + @if (committee.managerAmount) { +
+ + {{ committee.managerAmount }} + +
+ } } diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.ts b/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.ts index bdc18065a4..e5b4851cb6 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.ts @@ -28,6 +28,10 @@ const COMMITTEE_LIST_STORAGE_INDEX = `committee_list`; styleUrls: [`./committee-list.component.scss`] }) export class CommitteeListComponent extends BaseListViewComponent { + public canSeeMemberAmounts(committee: ViewCommittee): boolean { + return this.operator.isAccountAdmin || committee.manager_ids?.includes(this.operator.operatorId); + } + private get messageForSpinner(): string { return this.translate.instant(`Agenda items are in process. Please wait ...`); } From a55dc0d5ef8d2f717da2d721745f6ba74d119a0b Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Wed, 25 Sep 2024 12:39:33 +0200 Subject: [PATCH 2/4] Update visibility of pts in committee-detail-view --- .../committees/committees.subscription.ts | 8 +++++- .../committee-meeting-preview.component.html | 26 ++++++++++--------- .../committee-meeting-preview.component.ts | 1 + .../committee-detail-view.component.html | 3 ++- .../committee-detail-view.component.ts | 9 +++++++ 5 files changed, 33 insertions(+), 14 deletions(-) diff --git a/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts b/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts index f61b7d8630..5b05ecadfa 100644 --- a/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts +++ b/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts @@ -62,7 +62,13 @@ export const getCommitteeDetailSubscriptionConfig: SubscriptionConfigGenerator = follow: [{ idField: `meeting_user_ids`, fieldset: `groups` }] }, { - idField: `meeting_ids` + idField: `meeting_ids`, + follow: [ + { + idField: `group_ids`, + fieldset: [`permissions`, `name`] + } + ] } ] }, diff --git a/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.html b/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.html index 2cc1e68136..17172b6cf9 100644 --- a/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.html +++ b/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.html @@ -80,18 +80,20 @@ - - + @if (showParticipants) { + + + } diff --git a/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.ts b/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.ts index 23d81a2c51..87bebc6b67 100644 --- a/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.ts @@ -20,6 +20,7 @@ export class CommitteeMeetingPreviewComponent { @Input() public meeting!: ViewMeeting; @Input() public committee!: ViewCommittee; @Input() public isCMAndRequireDuplicateFrom!: boolean; + @Input() public showParticipants!: boolean; public readonly OML = OML; public readonly CML = CML; diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.html b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.html index 4008772147..f3690ec842 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.html +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.html @@ -137,12 +137,13 @@

} - @for (meeting of getMeetingsSorted(committee); track meeting) { + @for (meeting of getMeetingsSorted(committee); track meeting.id) { } diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.ts b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.ts index 8a803dedd5..c2bb19a506 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.ts @@ -4,6 +4,7 @@ import { TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { Id } from 'src/app/domain/definitions/key-types'; import { CML, OML } from 'src/app/domain/definitions/organization-permission'; +import { Permission } from 'src/app/domain/definitions/permission'; import { Committee } from 'src/app/domain/models/comittees/committee'; import { ViewMeeting } from 'src/app/site/pages/meetings/view-models/view-meeting'; import { OrganizationSettingsService } from 'src/app/site/pages/organization/services/organization-settings.service'; @@ -38,6 +39,14 @@ export class CommitteeDetailViewComponent extends BaseUiComponent { return this.operator.hasCommitteePermissions(this.committeeId, CML.can_manage); } + public canSeeParticipantAmount(meeting: ViewMeeting): boolean { + return ( + this.operator.isOrgaManager || + this.canManageCommittee || + this.operator.hasPermsInMeeting(meeting.id, Permission.userCanSee) + ); + } + public constructor( private translate: TranslateService, private route: ActivatedRoute, From 17fa781754dc8b01f8d21b8650c817e741607893 Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Wed, 25 Sep 2024 13:03:54 +0200 Subject: [PATCH 3/4] Fix visibility of amount of pts in meeting-list --- .../pages/organization/organization.subscription.ts | 3 ++- .../meeting-list/meeting-list.component.html | 2 +- .../components/meeting-list/meeting-list.component.ts | 10 +++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/app/site/pages/organization/organization.subscription.ts b/client/src/app/site/pages/organization/organization.subscription.ts index f4748dca32..cb5e1fd2a5 100644 --- a/client/src/app/site/pages/organization/organization.subscription.ts +++ b/client/src/app/site/pages/organization/organization.subscription.ts @@ -58,7 +58,8 @@ function getMeetingListFollowConfig( idField: idField, follow: [ { idField: `committee_id`, fieldset: `name` }, - { idField: `organization_tag_ids`, fieldset: FULL_FIELDSET } + { idField: `organization_tag_ids`, fieldset: FULL_FIELDSET }, + { idField: `group_ids`, fieldset: [`name`, `permissions`] } ], fieldset: `list` }; diff --git a/client/src/app/site/pages/organization/pages/orga-meetings/pages/meeting-list/components/meeting-list/meeting-list.component.html b/client/src/app/site/pages/organization/pages/orga-meetings/pages/meeting-list/components/meeting-list/meeting-list.component.html index 36e2f5a324..f438c06cbe 100644 --- a/client/src/app/site/pages/organization/pages/orga-meetings/pages/meeting-list/components/meeting-list/meeting-list.component.html +++ b/client/src/app/site/pages/organization/pages/orga-meetings/pages/meeting-list/components/meeting-list/meeting-list.component.html @@ -147,7 +147,7 @@

{{ 'Meetings' | translate }}

> }
- @if (meeting.userAmount) { + @if (meeting.userAmount && showParticipantAmount(meeting)) {
{ } return this.translate.instant(`Navigate to meeting `) + meeting.name; } + + public showParticipantAmount(meeting: ViewMeeting): boolean { + return ( + this.operator.hasCommitteePermissions(meeting.committee_id, CML.can_manage) || + this.operator.hasPermsInMeeting(meeting.id, Permission.userCanSee) + ); + } } From f535d240a94eda90d27cffc41eec87dbd65809a5 Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Wed, 25 Sep 2024 13:11:21 +0200 Subject: [PATCH 4/4] Use other way to check CML --- .../components/committee-list/committee-list.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.ts b/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.ts index e5b4851cb6..fb7e7fa8ba 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-list/components/committee-list/committee-list.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { marker as _ } from '@colsen1991/ngx-translate-extract-marker'; import { TranslateService } from '@ngx-translate/core'; +import { CML } from 'src/app/domain/definitions/organization-permission'; import { Action } from 'src/app/gateways/actions'; import { BaseListViewComponent } from 'src/app/site/base/base-list-view.component'; import { SpinnerService } from 'src/app/site/modules/global-spinner'; @@ -29,7 +30,7 @@ const COMMITTEE_LIST_STORAGE_INDEX = `committee_list`; }) export class CommitteeListComponent extends BaseListViewComponent { public canSeeMemberAmounts(committee: ViewCommittee): boolean { - return this.operator.isAccountAdmin || committee.manager_ids?.includes(this.operator.operatorId); + return this.operator.isAccountAdmin || this.operator.hasCommitteePermissions(committee.id, CML.can_manage); } private get messageForSpinner(): string {