Skip to content

Change "change your own delegation" option to account button - #6141

Open
Borreg0 wants to merge 18 commits into
OpenSlides:mainfrom
Borreg0:5967-change-own-delegation-menu
Open

Change "change your own delegation" option to account button#6141
Borreg0 wants to merge 18 commits into
OpenSlides:mainfrom
Borreg0:5967-change-own-delegation-menu

Conversation

@Borreg0

@Borreg0 Borreg0 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

closes #5967

@Borreg0 Borreg0 self-assigned this May 4, 2026
@Borreg0
Borreg0 marked this pull request as ready for review May 6, 2026 12:17
@Borreg0
Borreg0 requested review from Elblinator and bspekker May 6, 2026 12:17
@Borreg0 Borreg0 assigned bspekker and Elblinator and unassigned Borreg0 May 6, 2026

@bspekker bspekker left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Changing the own delegation doesn't work anymore for users with only "can change own delegation" permission:
Image
  1. The dialogue I can open from the user menu looks good, but the dialogue you can open in the participant list as admins by clicking on the column with groups, numbers, structure levels etc, should still be the old previous dialogue:

The column I mean:

Image

The dialogue that should still be available as is for everyone with more admin permissions than just "can change own delegation":

Image

@bspekker bspekker assigned Borreg0 and unassigned bspekker and Elblinator May 7, 2026
@Borreg0
Borreg0 requested a review from bspekker July 28, 2026 13:44
@Borreg0 Borreg0 removed their assignment Jul 28, 2026
this.router.navigate([userId, `edit`], { relativeTo: this.route });
}
}
export { areGroupsDiminished };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove bc it's unused
and such export should also be below the imports but above the main component/director/service

@Borreg0
Borreg0 requested a review from Elblinator August 3, 2026 08:03
@Borreg0 Borreg0 assigned bspekker and Elblinator and unassigned Borreg0 Aug 3, 2026

@Elblinator Elblinator left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally the wrong Id is used to select the delegations
Reproduction:

  1. in the default (dev) setup
  2. create a second meeting
  3. in the new meeting add 'a' as participant
  4. in the settings activate the delegations
  5. try to delegate from admin to a (or vidse versa)
  6. Error is thrown:
 Error: User(s) [2] delegation ids don't belong to meeting 2.

} @else if (hasActiveMeeting) {
@if (isPresent) {
@if (hasActiveMeeting) {
@if (isAllowedSelfSetPresent && hasActiveMeeting) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@if (isAllowedSelfSetPresent && hasActiveMeeting) {
@if (isAllowedSelfSetPresent) {

</div>
}
}
@if (isVoteDelegationEnabled && canEditOwnDelegation()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs to be in "hasActiveMeeting"

Comment on lines 68 to 75
@Inject(MAT_DIALOG_DATA) public readonly infoDialog: InfoDialog,
private participantRepo: ParticipantControllerService,
protected participantRepo: ParticipantControllerService,
private userSortService: ParticipantListSortService,
private groupRepo: GroupControllerService,
private structureLevelRepo: StructureLevelControllerService,
protected structureLevelRepo: StructureLevelRepositoryService,
private activeMeetingIdService: ActiveMeetingIdService,
private meetingSettings: MeetingSettingsService,
private operator: OperatorService

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also move to injects

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And sort public above, then protected, then private

isHidden: !canSeeItemMenu() && viewport.isMobileSubject
"
class="cell-slot"
[hidden]="!hasOptions()"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

canSeeItemMenu should be adjusted not [hidden] added

export function afterDialogClosed(
dialogRef: MatDialogRef<ParticipantListInfoDialogComponent, InfoDialog>,
user: ViewUser,
operator: OperatorInfo,

@Elblinator Elblinator Aug 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename. Operator is always the operator, do not use "operator"

return this.user.short_name + ': ' + stringForUserPresent;
}

public canEditOwnDelegation(): boolean {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can edit OWN delegation:
this.operator.hasPerms(Permission.userCanEditOwnDelegation) &&
this.activeMeeting.meeting.user_ids.includes(this.operator.operatorId)
is enough

changeOwnDel: this.operator.hasPerms(Permission.userCanEditOwnDelegation),
canUpdate: this.operator.hasPerms(Permission.userCanUpdate)
};
afterDialogClosed(dialogRef, user, operatorInfo, this.activeMeeting.meeting, this.participantRepo, this.prompt);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add afterDialogClosed as a function in this.infoDialog
subsequent changes for all afterDialogClosed bc they will be called diifferently

}
}

export function areGroupsDiminished(oldGroupIds: number[], newGroupIds: number[], activeMeeting: ViewMeeting): boolean {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also move into ParticipantListInfoDialogService and subsequent change the call of this function everywhere

if (!result.group_ids?.length) {
result.group_ids = [this.activeMeeting!.default_group_id];
}
if (result.vote_delegated_to_id === 0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (result.vote_delegated_to_id === 0) {
if (result.vote_delegated_to_id?.length === 0) {

do You mean this?
The id should never even try to be set to zero

);
}

export function afterDialogClosed(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either move this function into the operator and let also the participant-list use it (more work and I would not recommmendt this actually)
Or do not export this function implement the function per component.

If possible remove the OperatorInfo (including the interface)

@Elblinator Elblinator assigned Borreg0 and unassigned bspekker and Elblinator Aug 4, 2026
@Borreg0
Borreg0 marked this pull request as draft August 5, 2026 14:43
@Borreg0

Borreg0 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Additionally the wrong Id is used to select the delegations Reproduction:

1. in the default (dev) setup

2. create a second meeting

3. in the new meeting add 'a' as participant

4. in the settings activate the delegations

5. try to delegate from admin to a (or vidse versa)

6. Error is thrown:
 Error: User(s) [2] delegation ids don't belong to meeting 2.

I can reproduce it.

Furthermore, I found that if a new participant is created and the user tries to delegate the vote to him, a new error appears. I have been working on this but I cannot find the cause yet.

How to reproduce:

  1. In the second meeting, create a new participant
  2. In the settings activate the delegations
  3. Try to delegate from admin to the new participant (or viceversa)
  4. Error is thrown
Error: Model 'meeting_user/26' does not exist.  

@Borreg0
Borreg0 marked this pull request as ready for review August 31, 2026 14:12
@Borreg0
Borreg0 requested a review from Elblinator August 31, 2026 14:12
@Borreg0 Borreg0 assigned bspekker and Elblinator and unassigned Borreg0 Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve "change your own delegation" menu

3 participants