diff --git a/client/src/app/domain/models/meeting-users/meeting-user.ts b/client/src/app/domain/models/meeting-users/meeting-user.ts index fe9fec6fb0..0ade42bb67 100644 --- a/client/src/app/domain/models/meeting-users/meeting-user.ts +++ b/client/src/app/domain/models/meeting-users/meeting-user.ts @@ -16,7 +16,7 @@ export class MeetingUser extends BaseDecimalModel { public user_id!: Id; public meeting_id!: Id; - public vote_delegated_to_id!: Id; // meeting_user/vote_delegations_from_ids; + public vote_delegated_to_ids!: Id[]; // meeting_user/vote_delegations_from_ids; public group_ids!: Id[]; // (group/meeting_user_ids)[]; public speaker_ids!: Id[]; // (speaker/meeting_user_id)[]; @@ -51,7 +51,7 @@ export class MeetingUser extends BaseDecimalModel { `speaker_ids`, `motion_supporter_ids`, `assignment_candidate_ids`, - `vote_delegated_to_id`, + `vote_delegated_to_ids`, `vote_delegations_from_ids`, `acting_ballot_ids`, `represented_ballot_ids`, diff --git a/client/src/app/domain/models/meetings/meeting.ts b/client/src/app/domain/models/meetings/meeting.ts index 861aa8d7a0..f4e3e50f77 100644 --- a/client/src/app/domain/models/meetings/meeting.ts +++ b/client/src/app/domain/models/meetings/meeting.ts @@ -144,6 +144,7 @@ export class Settings { public users_enable_presence_view!: boolean; public users_enable_vote_weight!: boolean; public users_enable_vote_delegations!: boolean; + public users_vote_delegations_max_amount: boolean; public users_allow_self_set_present!: boolean; public users_pdf_welcometitle!: string; public users_pdf_welcometext!: string; @@ -403,6 +404,7 @@ export class Meeting extends BaseModel { `users_email_subject`, `users_email_body`, `users_enable_vote_delegations`, + `users_vote_delegations_max_amount`, `users_forbid_delegator_in_list_of_speakers`, `users_forbid_delegator_as_submitter`, `users_forbid_delegator_as_supporter`, diff --git a/client/src/app/gateways/repositories/meeting_user/meeting-user-repository.service.ts b/client/src/app/gateways/repositories/meeting_user/meeting-user-repository.service.ts index 83eafc282f..311454a654 100644 --- a/client/src/app/gateways/repositories/meeting_user/meeting-user-repository.service.ts +++ b/client/src/app/gateways/repositories/meeting_user/meeting-user-repository.service.ts @@ -21,7 +21,7 @@ export class MeetingUserRepositoryService extends BaseMeetingRelatedRepository { const groupFields: TypedFieldset = [`group_ids`, `meeting_id`, `user_id`]; const participantListFieldsMinimal: TypedFieldset = groupFields.concat([ - `vote_delegated_to_id`, + `vote_delegated_to_ids`, `vote_delegations_from_ids`, `structure_level_ids`, `vote_weight`, @@ -49,7 +49,7 @@ export class MeetingUserRepositoryService extends BaseMeetingRelatedRepository { const update = typeof patch === `function` ? patch(user) : patch; const payload: any = { username: update.username, - vote_delegated_to_id: update.vote_delegated_to_id, + vote_delegated_to_ids: update.vote_delegated_to_ids, vote_delegations_from_ids: update.vote_delegations_from_ids, meeting_id: update.meeting_id ?? this.meetingUserRepo.getActiveMeetingId() }; diff --git a/client/src/app/infrastructure/definitions/relations/relations.ts b/client/src/app/infrastructure/definitions/relations/relations.ts index 74cabb41e9..ab66b32677 100644 --- a/client/src/app/infrastructure/definitions/relations/relations.ts +++ b/client/src/app/infrastructure/definitions/relations/relations.ts @@ -315,16 +315,16 @@ export const RELATIONS: Relation[] = [ OField: `users` }), // Vote delegations - // vote_delegated_to_id -> vote_delegations_from_ids + // vote_delegated_to_ids -> vote_delegations_from_ids { ownViewModels: [ViewMeetingUser], foreignViewModel: ViewMeetingUser, ownField: `vote_delegated_to`, - ownIdField: `vote_delegated_to_id`, - many: false, + ownIdField: `vote_delegated_to_ids`, + many: true, generic: false }, - // vote_delegations_from_ids -> vote_delegated_to_id + // vote_delegations_from_ids -> vote_delegated_to_ids { ownViewModels: [ViewMeetingUser], foreignViewModel: ViewMeetingUser, diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-manage-supporters/motion-manage-supporters.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-manage-supporters/motion-manage-supporters.component.ts index e14bf1d2ff..8ccc8bdabe 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-manage-supporters/motion-manage-supporters.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-manage-supporters/motion-manage-supporters.component.ts @@ -209,7 +209,7 @@ export class MotionManageSupportersComponent extends BaseComponent implements On return ( supporter.meeting_user?.groups?.filter(g => g.hasPermission(Permission.motionCanSupport)).length > 0 && !( - supporter.meeting_user?.vote_delegated_to_id && + supporter.meeting_user?.vote_delegated_to_ids?.length && this.activeMeetingService.meeting.users_forbid_delegator_as_supporter && this.activeMeetingService.meeting.users_enable_vote_delegations ) diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-edit/participant-detail-edit.component.html b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-edit/participant-detail-edit.component.html index b33b3defbd..797064ff46 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-edit/participant-detail-edit.component.html +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-edit/participant-detail-edit.component.html @@ -133,8 +133,8 @@

{{ 'Meeting specific information' | translate }}

{{ 'Voting right delegated to (proxy)' | translate }} this.repo.getViewModel(id).getMeetingUser().id) + .filter(id => !!id) + : [], vote_delegations_from_ids: this.personalInfoFormValue.vote_delegations_from_ids ? this.personalInfoFormValue.vote_delegations_from_ids .map(id => this.repo.getViewModel(id).getMeetingUser().id) diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts index f4eb4c1629..1f475abbe5 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts @@ -42,7 +42,7 @@ export class ParticipantDetailViewComponent extends BaseMeetingComponent { comment: [``], group_ids: [``], vote_delegations_from_ids: [``], - vote_delegated_to_id: [``], + vote_delegated_to_ids: [``], is_present: [``], locked_out: [``], home_committee_id: [``], diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/pages/participant-detail-manage/components/participant-create-wizard/participant-create-wizard.component.html b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/pages/participant-detail-manage/components/participant-create-wizard/participant-create-wizard.component.html index e46e1df93a..0b45dde4be 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/pages/participant-detail-manage/components/participant-create-wizard/participant-create-wizard.component.html +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/pages/participant-detail-manage/components/participant-create-wizard/participant-create-wizard.component.html @@ -239,7 +239,7 @@

{{ 'Meeting specific information' | translate }}

{{ 'Voting right delegated to (proxy)' | translate }} { const payload = { ...this.personalInfoFormValue, - vote_delegated_to_id: this.personalInfoFormValue.vote_delegated_to_id - ? this.repo.getViewModel(this.personalInfoFormValue.vote_delegated_to_id).getMeetingUser().id - : undefined, + vote_delegated_to_ids: this.personalInfoFormValue.vote_delegated_to_ids + ? this.personalInfoFormValue.vote_delegated_to_ids + .map((id: Id) => this.repo.getViewModel(id).getMeetingUser().id) + .filter((id: Id) => !!id) + : [], vote_delegations_from_ids: this.personalInfoFormValue.vote_delegations_from_ids ? this.personalInfoFormValue.vote_delegations_from_ids .map((id: Id) => this.repo.getViewModel(id).getMeetingUser().id) 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 1181b39756..9519804ee1 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 @@ -371,7 +371,7 @@ export class ParticipantListComponent extends BaseMeetingListViewComponent { @@ -379,9 +379,6 @@ export class ParticipantListComponent extends BaseMeetingListViewComponent
} @@ -57,7 +58,7 @@

[mat-dialog-close]="{ group_ids: infoDialog.group_ids, vote_delegations_from_ids: infoDialog.vote_delegations_from_ids, - vote_delegated_to_id: infoDialog.vote_delegated_to_id, + vote_delegated_to_ids: infoDialog.vote_delegated_to_ids, number: infoDialog.number, structure_level_ids: infoDialog.structure_level_ids }" diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/modules/participant-list-info-dialog/services/participant-list-info-dialog.service.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/modules/participant-list-info-dialog/services/participant-list-info-dialog.service.ts index 3ce644060c..e5efd42df3 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/modules/participant-list-info-dialog/services/participant-list-info-dialog.service.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-list/modules/participant-list-info-dialog/services/participant-list-info-dialog.service.ts @@ -41,7 +41,7 @@ export interface InfoDialog { /** * Transfer voting rights to */ - vote_delegated_to_id: number; + vote_delegated_to_ids: number[]; } @Service() diff --git a/client/src/app/site/pages/meetings/pages/participants/participants.subscription.ts b/client/src/app/site/pages/meetings/pages/participants/participants.subscription.ts index 6664a9606e..2a1fad80a9 100644 --- a/client/src/app/site/pages/meetings/pages/participants/participants.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/participants/participants.subscription.ts @@ -36,7 +36,7 @@ export const getParticipantVoteInfoSubscriptionConfig: SubscriptionConfigGenerat ] }, { - idField: `vote_delegated_to_id`, + idField: `vote_delegated_to_ids`, fieldset: [`meeting_id`], follow: [{ idField: `user_id`, fieldset: [`is_present_in_meeting_ids`] }] } diff --git a/client/src/app/site/pages/meetings/pages/participants/services/common/participant-controller.service/participant-controller.service.ts b/client/src/app/site/pages/meetings/pages/participants/services/common/participant-controller.service/participant-controller.service.ts index a416cab1d7..e8ca6445b2 100644 --- a/client/src/app/site/pages/meetings/pages/participants/services/common/participant-controller.service/participant-controller.service.ts +++ b/client/src/app/site/pages/meetings/pages/participants/services/common/participant-controller.service/participant-controller.service.ts @@ -46,7 +46,7 @@ export const MEETING_RELATED_FORM_CONTROLS = [ `comment`, `group_ids`, `vote_delegations_from_ids`, - `vote_delegated_to_id`, + `vote_delegated_to_ids`, `is_present`, `locked_out` ]; diff --git a/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts b/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts index 851736318a..54ea3bbf18 100644 --- a/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts @@ -37,7 +37,7 @@ export const pollModelRequest: BaseSimplifiedModelRequest = { follow: [ { idField: `meeting_user_id`, - fieldset: [...MeetingUserFieldsets.FullNameSubscription.fieldset, `vote_delegated_to_id`], + fieldset: [...MeetingUserFieldsets.FullNameSubscription.fieldset, `vote_delegated_to_ids`], follow: MeetingUserFieldsets.FullNameSubscription.follow } ] diff --git a/client/src/app/site/pages/meetings/view-models/view-user.ts b/client/src/app/site/pages/meetings/view-models/view-user.ts index 9a33d4a796..d98da009b9 100644 --- a/client/src/app/site/pages/meetings/view-models/view-user.ts +++ b/client/src/app/site/pages/meetings/view-models/view-user.ts @@ -236,12 +236,12 @@ export class ViewUser extends BaseViewModel /* implements Searchable */ { return this.getMeetingUser(meetingId)?.chat_message_ids; } - public vote_delegated_to_id(meetingId?: Id): Id { + public vote_delegated_to_ids(meetingId?: Id): Id { return this.getMeetingUser(meetingId)?.vote_delegated_to?.user_id; } - public vote_delegated_to_meeting_user_id(meetingId?: Id): Id { - return this.getMeetingUser(meetingId)?.vote_delegated_to_id; + public vote_delegated_to_meeting_user_ids(meetingId?: Id): Id[] { + return this.getMeetingUser(meetingId)?.vote_delegated_to_ids; } public vote_delegations_from_ids(meetingId?: Id): Id[] { @@ -303,7 +303,7 @@ export class ViewUser extends BaseViewModel /* implements Searchable */ { } public get isVoteRightDelegated(): boolean { - return !!this.vote_delegated_to_id(this.getEnsuredActiveMeetingId()); + return !!this.vote_delegated_to_ids(this.getEnsuredActiveMeetingId()); } public get voteWeight(): number { diff --git a/client/src/app/site/services/operator.service.ts b/client/src/app/site/services/operator.service.ts index 397cf9face..a94c3e8eaa 100644 --- a/client/src/app/site/services/operator.service.ts +++ b/client/src/app/site/services/operator.service.ts @@ -655,7 +655,7 @@ export class OperatorService { public isAllowedWithDelegation(...appliedSettings: DelegationSetting[]): boolean { return ( - !this.user.getMeetingUser(this.activeMeetingId)?.vote_delegated_to_id || + !this.user.getMeetingUser(this.activeMeetingId)?.vote_delegated_to_ids?.length || !appliedSettings.some(appliedSetting => this.meetingSettings.instant(appliedSetting as keyof Settings)) ); } @@ -833,7 +833,7 @@ export class OperatorService { fieldset: `all`, follow: [ { - idField: `vote_delegated_to_id`, + idField: `vote_delegated_to_ids`, fieldset: [`meeting_id`, `group_ids`], follow: [ { diff --git a/meta b/meta index b304f86d7d..77b9942566 160000 --- a/meta +++ b/meta @@ -1 +1 @@ -Subproject commit b304f86d7dc087d2f3facbc6c9e388a4496974f6 +Subproject commit 77b9942566adb27de0d4d6a249a286127e169006