diff --git a/client/src/app/gateways/presenter/get-user-related-models-presenter.service.ts b/client/src/app/gateways/presenter/get-user-related-models-presenter.service.ts index b2f974441a..164d224161 100644 --- a/client/src/app/gateways/presenter/get-user-related-models-presenter.service.ts +++ b/client/src/app/gateways/presenter/get-user-related-models-presenter.service.ts @@ -16,6 +16,7 @@ export interface GetUserRelatedModelsUser { motion_submitter_ids: Id[]; }[]; committees?: GetUserRelatedModelsCommittee[]; + name?: string; error?: string; // This is in case the presenter fails in an unpredicted way } diff --git a/client/src/app/site/modules/user-components/components/user-delete-dialog/user-delete-dialog.component.html b/client/src/app/site/modules/user-components/components/user-delete-dialog/user-delete-dialog.component.html index 7fe2929cd7..a468d36e0f 100644 --- a/client/src/app/site/modules/user-components/components/user-delete-dialog/user-delete-dialog.component.html +++ b/client/src/app/site/modules/user-components/components/user-delete-dialog/user-delete-dialog.component.html @@ -115,6 +115,11 @@
+ {{ 'The account is the operator and cannot be deleted' | translate }} +
+diff --git a/client/src/app/site/modules/user-components/components/user-delete-dialog/user-delete-dialog.component.ts b/client/src/app/site/modules/user-components/components/user-delete-dialog/user-delete-dialog.component.ts index 054e7083f4..851a6fd0ae 100644 --- a/client/src/app/site/modules/user-components/components/user-delete-dialog/user-delete-dialog.component.ts +++ b/client/src/app/site/modules/user-components/components/user-delete-dialog/user-delete-dialog.component.ts @@ -7,6 +7,7 @@ import { GetUserRelatedModelsUser } from 'src/app/gateways/presenter'; import { ViewUser } from 'src/app/site/pages/meetings/view-models/view-user'; +import { OperatorService } from 'src/app/site/services/operator.service'; interface UserDeleteDialogConfig { toRemove: ViewUser[]; @@ -50,7 +51,10 @@ export class UserDeleteDialogComponent implements OnInit { public selectedUser: GetUserRelatedModelsUser | ViewUser = null; - public constructor(@Inject(MAT_DIALOG_DATA) private data: UserDeleteDialogConfig) {} + public constructor( + @Inject(MAT_DIALOG_DATA) private data: UserDeleteDialogConfig, + private operator: OperatorService + ) {} public ngOnInit(): void { this.selectedUser = this.toDeleteUsers[0] || this.toRemoveUsers[0]; @@ -67,4 +71,8 @@ export class UserDeleteDialogComponent implements OnInit { public getManagedCommittees(user: GetUserRelatedModelsUser): GetUserRelatedModelsCommittee[] { return (user.committees || []).filter(committee => committee.cml === CML.can_manage); } + + public isOperator(user: GetUserRelatedModelsUser): boolean { + return user.name == this.operator.user.name; + } }