Skip to content

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

Open
Borreg0 wants to merge 10 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 10 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
<mat-icon>edit</mat-icon>
<span>{{ 'Change your delegation' | translate }}</span>
</button>

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.

  1. remove also this line
  2. hide the three dot menu, it's currently only an empty field

return this.activeMeetingIdService.meetingId;
}

public get activeMeetingSetting(): 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.

rename to sth more specific or make function more generic with forwarded setting

put the subscription in a setter or the subscription in the constructor

stringForUserPresent = this.translate.instant(`Your account is not in this meeting.`);
}
return this.user.short_name + ': ' + stringForUserPresent;
return stringForUserPresent.replace(`{}`, this.user.short_name);

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
return stringForUserPresent.replace(`{}`, this.user.short_name);
return this.user.short_name + ': ' + stringForUserPresent;

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

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 hasActiveMeeting as first check

Comment on lines +252 to +265
if (
this.operator.hasPerms(Permission.userCanEditOwnDelegation) &&
!this.operator.hasPerms(Permission.userCanManage) &&
!this.operator.hasPerms(Permission.userCanUpdate)
) {
return this.operator.operatorId === user.id;
} else if (
this.operator.hasPerms(Permission.userCanManage) ||
this.operator.hasPerms(Permission.userCanUpdate)
) {
return true;
} else {
return false;
}

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.

this is a new place for this option
At this new place one you are be the user so the check in 257 is always true
You need to check
this.operator.hasPerms(Permission.userCanEditOwnDelegation) and if the operator is in the meeting
(Admins (including superadmin/etc.) automatically have this permission)

if (
!(
user.id === operator.operatorId &&
areGroupsDiminished(operator.user.group_ids(), result.group_ids, activeMeeting)

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.

why not use user.groups()?
if that is possible you can transmit the operator.operatorId directly and do not need to give the whole operator
also the operator is loaded in the service you do not need to transmit it at all

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

@@ -0,0 +1,3 @@
.margin {

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

Comment on lines 70 to 80
public constructor(
@Inject(MAT_DIALOG_DATA) public readonly infoDialog: InfoDialog,
private participantRepo: ParticipantControllerService,
private userSortService: ParticipantListSortService,
private groupRepo: GroupControllerService,
private structureLevelRepo: StructureLevelControllerService,
private meetingSettings: MeetingSettingsService,
private operator: OperatorService
protected participantRepo: ParticipantControllerService,
protected userSortService: ParticipantListSortService,
protected groupRepo: GroupControllerService,
protected structureLevelRepo: StructureLevelRepositoryService,
protected activeMeetingIdService: ActiveMeetingIdService,
protected meetingSettings: MeetingSettingsService,
protected operator: OperatorService,
protected userRepo: UserRepositoryService = inject(UserRepositoryService)
) {

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.

use inject outside of constructor
and change back to private if possible

protected structureLevelConfig: SubscriptionConfig<ViewStructureLevel>;
protected groupsSubscriptionConfig: SubscriptionConfig<ViewGroup>;

protected setting: SettingsInput = {} as SettingsInput;

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 setting
as far as I can see it's now used anywhere

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