From 2e571767ea2d2e7eff1ed2b928480ddc1806dd6f Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Thu, 19 Oct 2023 23:01:24 +0200 Subject: [PATCH] 107664: Normalized ePerson & group edit url and moved error message to translation file --- src/app/access-control/access-control-routing-paths.ts | 4 ++-- src/app/access-control/access-control-routing.module.ts | 4 ++-- .../epeople-registry/epeople-registry.component.ts | 2 +- src/assets/i18n/en.json5 | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/access-control/access-control-routing-paths.ts b/src/app/access-control/access-control-routing-paths.ts index c8b9e01793f..31f39f1c47d 100644 --- a/src/app/access-control/access-control-routing-paths.ts +++ b/src/app/access-control/access-control-routing-paths.ts @@ -8,7 +8,7 @@ export function getEPersonsRoute(): string { } export function getEPersonEditRoute(id: string): string { - return new URLCombiner(getEPersonsRoute(), id).toString(); + return new URLCombiner(getEPersonsRoute(), id, 'edit').toString(); } export const GROUP_PATH = 'groups'; @@ -18,5 +18,5 @@ export function getGroupsRoute() { } export function getGroupEditRoute(id: string) { - return new URLCombiner(getGroupsRoute(), id).toString(); + return new URLCombiner(getGroupsRoute(), id, 'edit').toString(); } diff --git a/src/app/access-control/access-control-routing.module.ts b/src/app/access-control/access-control-routing.module.ts index 4ef97cb5eab..97d049ad836 100644 --- a/src/app/access-control/access-control-routing.module.ts +++ b/src/app/access-control/access-control-routing.module.ts @@ -38,7 +38,7 @@ import { EPersonResolver } from './epeople-registry/eperson-resolver.service'; canActivate: [SiteAdministratorGuard], }, { - path: `${EPERSON_PATH}/:id`, + path: `${EPERSON_PATH}/:id/edit`, component: EPersonFormComponent, resolve: { breadcrumb: I18nBreadcrumbResolver, @@ -66,7 +66,7 @@ import { EPersonResolver } from './epeople-registry/eperson-resolver.service'; canActivate: [GroupAdministratorGuard] }, { - path: `${GROUP_PATH}/:groupId`, + path: `${GROUP_PATH}/:groupId/edit`, component: GroupFormComponent, resolve: { breadcrumb: I18nBreadcrumbResolver diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.ts b/src/app/access-control/epeople-registry/epeople-registry.component.ts index d2837a5317e..4596eec98e3 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.ts @@ -215,7 +215,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy { if (restResponse.hasSucceeded) { this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', {name: this.dsoNameService.getName(ePerson)})); } else { - this.notificationsService.error(`Error occurred when trying to delete EPerson with id: ${ePerson.id} with code: ${restResponse.statusCode} and message: ${restResponse.errorMessage}`); + this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { id: ePerson.id, statusCode: restResponse.statusCode, errorMessage: restResponse.errorMessage })); } }); } diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 2a552296163..94780b97683 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -334,7 +334,7 @@ "admin.access-control.epeople.form.goToGroups": "Add to groups", - "admin.access-control.epeople.notification.deleted.failure": "Failed to delete EPerson: \"{{name}}\"", + "admin.access-control.epeople.notification.deleted.failure": "Error occurred when trying to delete EPerson with id \"{{id}}\" with code: \"{{statusCode}}\" and message: \"{{restResponse.errorMessage}}\"", "admin.access-control.epeople.notification.deleted.success": "Successfully deleted EPerson: \"{{name}}\"",