From: Volker Theile Date: Thu, 30 Aug 2018 13:27:14 +0000 (+0200) Subject: mgr/dashboard: Fix notifications in user list X-Git-Tag: v14.0.1~407^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7dc2b0c166b4abcbdfa7e308ee2d166ce430502b;p=ceph.git mgr/dashboard: Fix notifications in user list The notification message title and text were inverted. Signed-off-by: Volker Theile --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts index 02ff0340b3ae..aba99b025186 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts @@ -132,8 +132,7 @@ export class UserFormComponent implements OnInit { () => { this.notificationService.show( NotificationType.success, - `User "${userFormModel.username}" has been created.`, - 'Create User' + `Created user "${userFormModel.username}"` ); this.router.navigate(['/users']); }, @@ -209,8 +208,7 @@ export class UserFormComponent implements OnInit { } else { this.notificationService.show( NotificationType.success, - `User "${userFormModel.username}" has been updated.`, - 'Edit User' + `Updated user "${userFormModel.username}"` ); this.router.navigate(['/users']); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts index 4e8df0287734..e4bbf9ff3e0b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts @@ -81,11 +81,7 @@ export class UserListComponent implements OnInit { () => { this.getUsers(); this.modalRef.hide(); - this.notificationService.show( - NotificationType.success, - `User "${username}" has been deleted.`, - 'Delete User' - ); + this.notificationService.show(NotificationType.success, `Deleted user "${username}"`); }, () => { this.modalRef.content.stopLoadingSpinner(); @@ -99,8 +95,8 @@ export class UserListComponent implements OnInit { if (sessionUsername === username) { this.notificationService.show( NotificationType.error, - `You are currently authenticated with user "${username}".`, - 'Cannot Delete User' + `Failed to delete user "${username}"`, + `You are currently logged in as "${username}".` ); return; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts index 9c03095ac119..6c2650147868 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts @@ -67,7 +67,8 @@ export class NotificationService { * Method for showing a notification. * @param {NotificationType} type toastr type * @param {string} title - * @param {string} [message] + * @param {string} [message] The message to be displayed. Note, use this field + * for error notifications only. * @param {*} [options] toastr compatible options, used when creating a toastr * @memberof NotificationService * @returns The timeout ID that is set to be able to cancel the notification.