]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix notifications in user list 23797/head
authorVolker Theile <vtheile@suse.com>
Thu, 30 Aug 2018 13:27:14 +0000 (15:27 +0200)
committerVolker Theile <vtheile@suse.com>
Wed, 5 Sep 2018 07:23:21 +0000 (09:23 +0200)
The notification message title and text were inverted.

Signed-off-by: Volker Theile <vtheile@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts

index 02ff0340b3aeb6b59c33900632b590f7cf6025b8..aba99b025186e22ace6879c6fee2616e518de174 100644 (file)
@@ -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']);
         }
index 4e8df0287734c6523a2b1c0218987be1bce14add..e4bbf9ff3e0bb138686280fd8f20e8acc03c6256 100644 (file)
@@ -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;
     }
index 9c03095ac119de0978b5b8005b880d2a0df1f35e..6c2650147868a72bf027741414debd485d2486a1 100644 (file)
@@ -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.