From 7dc2b0c166b4abcbdfa7e308ee2d166ce430502b Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Thu, 30 Aug 2018 15:27:14 +0200 Subject: [PATCH] mgr/dashboard: Fix notifications in user list The notification message title and text were inverted. Signed-off-by: Volker Theile --- .../src/app/core/auth/user-form/user-form.component.ts | 6 ++---- .../src/app/core/auth/user-list/user-list.component.ts | 10 +++------- .../src/app/shared/services/notification.service.ts | 3 ++- 3 files changed, 7 insertions(+), 12 deletions(-) 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 02ff0340b3aeb..aba99b025186e 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 4e8df0287734c..e4bbf9ff3e0bb 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 9c03095ac119d..6c2650147868a 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. -- 2.39.5