]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Use a unified quoting style
authorIshan Rai <ishanrai05@gmail.com>
Mon, 8 Jun 2020 06:53:57 +0000 (06:53 +0000)
committerIshan Rai <ishanrai05@gmail.com>
Tue, 16 Jun 2020 08:05:29 +0000 (08:05 +0000)
Use single quotes across all UI elements such as notifications

Fixes: https://tracker.ceph.com/issues/36070
Signed-off-by: Ishan Rai <ishanrai05@gmail.com>
13 files changed:
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts
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/tslint.json

index 327a4e1245bc21dbbce00ae9406241c32c5a2efe..c4041af1c5972449e7f0b192b40d70330044de9f 100644 (file)
@@ -82,7 +82,7 @@ export class CephfsClientsComponent implements OnInit {
         this.modalRef.hide();
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Evicted client "{{clientId}}"', { clientId: clientId })
+          this.i18n(`Evicted client '{{clientId}}'`, { clientId: clientId })
         );
       },
       () => {
index 25a64a3b01ec359278b0b9d613223eb973fc9ce2..bfb71ab0c4636cc5f0db0aeec466edec171b8582 100644 (file)
@@ -783,9 +783,9 @@ describe('CephfsDirectoriesComponent', () => {
 
         it('shows the right texts', () => {
           assert.quotaUpdateModalTexts(
-            "Update CephFS files quota for '/a/c/b'",
-            "The inherited files quota 10 from '/a' is the maximum value to be used.",
-            "Updated CephFS files quota for '/a/c/b'"
+            `Update CephFS files quota for '/a/c/b'`,
+            `The inherited files quota 10 from '/a' is the maximum value to be used.`,
+            `Updated CephFS files quota for '/a/c/b'`
           );
         });
       });
@@ -807,9 +807,9 @@ describe('CephfsDirectoriesComponent', () => {
 
         it('shows the right texts', () => {
           assert.quotaUpdateModalTexts(
-            "Update CephFS size quota for '/a/c/b'",
-            "The inherited size quota 1 KiB from '/a' is the maximum value to be used.",
-            "Updated CephFS size quota for '/a/c/b'"
+            `Update CephFS size quota for '/a/c/b'`,
+            `The inherited size quota 1 KiB from '/a' is the maximum value to be used.`,
+            `Updated CephFS size quota for '/a/c/b'`
           );
         });
       });
@@ -821,13 +821,13 @@ describe('CephfsDirectoriesComponent', () => {
           assert.quotaUpdateModalField('binary', 'Max size', 'max_bytes', 512, 1024);
         });
 
-        it("uses 'Set' action instead of 'Update' if the quota is not set (0)", () => {
+        it(`uses 'Set' action instead of 'Update' if the quota is not set (0)`, () => {
           mockLib.updateQuotaThroughModal('max_bytes', 0);
           mockLib.updateQuotaThroughModal('max_bytes', 200);
           assert.quotaUpdateModalTexts(
-            "Set CephFS size quota for '/a/c/b'",
-            "The inherited size quota 1 KiB from '/a' is the maximum value to be used.",
-            "Set CephFS size quota for '/a/c/b'"
+            `Set CephFS size quota for '/a/c/b'`,
+            `The inherited size quota 1 KiB from '/a' is the maximum value to be used.`,
+            `Set CephFS size quota for '/a/c/b'`
           );
         });
       });
@@ -847,9 +847,9 @@ describe('CephfsDirectoriesComponent', () => {
 
         it('shows the right texts', () => {
           assert.quotaUnsetModalTexts(
-            "Unset CephFS files quota for '/a/c/b'",
-            "Unset files quota 5 from '/a/c/b' in order to inherit files quota 10 from '/a'.",
-            "Unset CephFS files quota for '/a/c/b'"
+            `Unset CephFS files quota for '/a/c/b'`,
+            `Unset files quota 5 from '/a/c/b' in order to inherit files quota 10 from '/a'.`,
+            `Unset CephFS files quota for '/a/c/b'`
           );
         });
       });
@@ -867,9 +867,9 @@ describe('CephfsDirectoriesComponent', () => {
 
         it('shows the right texts', () => {
           assert.quotaUnsetModalTexts(
-            "Unset CephFS size quota for '/a/c/b'",
-            "Unset size quota 512 B from '/a/c/b' in order to inherit size quota 1 KiB from '/a'.",
-            "Unset CephFS size quota for '/a/c/b'"
+            `Unset CephFS size quota for '/a/c/b'`,
+            `Unset size quota 512 B from '/a/c/b' in order to inherit size quota 1 KiB from '/a'.`,
+            `Unset CephFS size quota for '/a/c/b'`
           );
         });
       });
@@ -879,19 +879,19 @@ describe('CephfsDirectoriesComponent', () => {
           mockLib.selectNode('/a');
           mockLib.unsetQuotaThroughModal('max_bytes');
           assert.quotaUnsetModalTexts(
-            "Unset CephFS size quota for '/a'",
-            "Unset size quota 1 KiB from '/a' in order to have no quota on the directory.",
-            "Unset CephFS size quota for '/a'"
+            `Unset CephFS size quota for '/a'`,
+            `Unset size quota 1 KiB from '/a' in order to have no quota on the directory.`,
+            `Unset CephFS size quota for '/a'`
           );
         });
 
         it('uses different Text if quota is already inherited', () => {
           mockLib.unsetQuotaThroughModal('max_bytes');
           assert.quotaUnsetModalTexts(
-            "Unset CephFS size quota for '/a/c/b'",
-            "Unset size quota 2 KiB from '/a/c/b' which isn't used because of the inheritance " +
-              "of size quota 1 KiB from '/a'.",
-            "Unset CephFS size quota for '/a/c/b'"
+            `Unset CephFS size quota for '/a/c/b'`,
+            `Unset size quota 2 KiB from '/a/c/b' which isn't used because of the inheritance ` +
+              `of size quota 1 KiB from '/a'.`,
+            `Unset CephFS size quota for '/a/c/b'`
           );
         });
       });
@@ -913,21 +913,21 @@ describe('CephfsDirectoriesComponent', () => {
       actions = component.quota.tableActions;
     });
 
-    it("shows 'Set' for empty and not set quotas", () => {
+    it(`shows 'Set' for empty and not set quotas`, () => {
       const isSetVisible = actions[0].visible;
       expect(isSetVisible(empty())).toBe(true);
       expect(isSetVisible(select(0))).toBe(true);
       expect(isSetVisible(select(1))).toBe(false);
     });
 
-    it("shows 'Update' for set quotas only", () => {
+    it(`shows 'Update' for set quotas only`, () => {
       const isUpdateVisible = actions[1].visible;
       expect(isUpdateVisible(empty())).toBeFalsy();
       expect(isUpdateVisible(select(0))).toBe(false);
       expect(isUpdateVisible(select(1))).toBe(true);
     });
 
-    it("only enables 'Unset' for set quotas only", () => {
+    it(`only enables 'Unset' for set quotas only`, () => {
       const isUnsetDisabled = actions[2].disable;
       expect(isUnsetDisabled(empty())).toBe(true);
       expect(isUnsetDisabled(select(0))).toBe(true);
index c715e5448ab995b2d505e04ec7ce125a8bbfc599..e9db99eed52ffb1b2c85f02356a4623b07b575f1 100644 (file)
@@ -434,7 +434,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
   }
 
   private getModalQuotaTitle(action: string, path: string): string {
-    return this.i18n("{{action}} CephFS {{quotaName}} quota for '{{path}}'", {
+    return this.i18n(`{{action}} CephFS {{quotaName}} quota for '{{path}}'`, {
       action,
       quotaName: this.getQuotaName(),
       path
@@ -450,7 +450,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
   }
 
   private getQuotaValueFromPathMsg(value: number, path: string): string {
-    return this.i18n("{{quotaName}} quota {{value}} from '{{path}}'", {
+    return this.i18n(`{{quotaName}} quota {{value}} from '{{path}}'`, {
       value: this.isBytesQuotaSelected() ? this.dimlessBinaryPipe.transform(value) : value,
       quotaName: this.getQuotaName(),
       path
@@ -526,7 +526,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
                 ? this.i18n('in order to inherit {{quotaValue}}', {
                     quotaValue: this.getQuotaValueFromPathMsg(nextMax.value, nextMax.path)
                   })
-                : this.i18n("which isn't used because of the inheritance of {{quotaValue}}", {
+                : this.i18n(`which isn't used because of the inheritance of {{quotaValue}}`, {
                     quotaValue: this.getQuotaValueFromPathMsg(nextMax.value, nextMax.path)
                   })
               : this.i18n('in order to have no quota on the directory')
@@ -556,7 +556,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
           this.cephfsService.mkSnapshot(this.id, path, values.name).subscribe((name) => {
             this.notificationService.show(
               NotificationType.success,
-              this.i18n('Created snapshot "{{name}}" for "{{path}}"', {
+              this.i18n(`Created snapshot '{{name}}' for '{{path}}'`, {
                 name: name,
                 path: path
               })
@@ -690,7 +690,7 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges {
       this.cephfsService.rmSnapshot(this.id, path, name).subscribe(() => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Deleted snapshot "{{name}}" for "{{path}}"', {
+          this.i18n(`Deleted snapshot '{{name}}' for '{{path}}'`, {
             name: name,
             path: path
           })
index f8474b1f04ae018ef0206ced7c67232980b57724..ea92c9fc550c9af4d380dda682d0c94ae59faa2a 100644 (file)
@@ -129,7 +129,7 @@ export class MgrModuleFormComponent extends CdForm implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Updated options for module "{{name}}".', { name: this.moduleName })
+          this.i18n(`Updated options for module '{{name}}'.`, { name: this.moduleName })
         );
         this.goToListView();
       },
index 850cdf66f3275f0619d0ae04d1096ff8ff938619..e9dfb0c29f320537e7c3bea84e154e3968cd47e9 100644 (file)
@@ -418,7 +418,7 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
           this.osdService.update(selectedOsd.id, values.deviceClass).subscribe(() => {
             this.notificationService.show(
               NotificationType.success,
-              this.i18n('Updated OSD "{{id}}"', {
+              this.i18n(`Updated OSD '{{id}}'`, {
                 id: selectedOsd.id
               })
             );
index f23430800e01a4d4478fcc2340b504368d891eb5..eaaa70a4bc356851b4dbdfb73a730b7b4249c9bf 100755 (executable)
@@ -224,7 +224,7 @@ export class OsdRecvSpeedModalComponent implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Updated OSD recovery speed priority "{{value}}"', {
+          this.i18n(`Updated OSD recovery speed priority '{{value}}'`, {
             value: this.osdRecvSpeedForm.getValue('priority')
           })
         );
index c7cb01402842bd5f8c4cf9e058ade9708e2a046e..acaecac88bae16cca7fe669c0a7d1f02f318ce14 100644 (file)
@@ -204,7 +204,7 @@ describe('RgwBucketFormComponent', () => {
       component.submit();
       expect(notificationService.show).toHaveBeenCalledWith(
         NotificationType.success,
-        'Created Object Gateway bucket ""'
+        `Created Object Gateway bucket ''`
       );
     });
 
@@ -215,7 +215,7 @@ describe('RgwBucketFormComponent', () => {
       component.submit();
       expect(notificationService.show).toHaveBeenCalledWith(
         NotificationType.success,
-        'Updated Object Gateway bucket "".'
+        `Updated Object Gateway bucket ''.`
       );
     });
   });
index 77ce8badcabd5daf952fe8f21745740501483828..21531ed73440017ca416b6b0d4e095a83b7384f8 100644 (file)
@@ -189,7 +189,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit {
           () => {
             this.notificationService.show(
               NotificationType.success,
-              this.i18n('Updated Object Gateway bucket "{{bid}}".', values)
+              this.i18n(`Updated Object Gateway bucket '{{bid}}'.`, values)
             );
             this.goToListView();
           },
@@ -215,7 +215,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit {
           () => {
             this.notificationService.show(
               NotificationType.success,
-              this.i18n('Created Object Gateway bucket "{{bid}}"', values)
+              this.i18n(`Created Object Gateway bucket '{{bid}}'`, values)
             );
             this.goToListView();
           },
index eb4a9619cf70fb8c32756e3a02a79b29db5b28a0..e297c330be08c2e298be33506ff5a2143d05dc6d 100644 (file)
@@ -296,7 +296,7 @@ describe('RgwUserFormComponent', () => {
       component.onSubmit();
       expect(notificationService.show).toHaveBeenCalledWith(
         NotificationType.success,
-        'Created Object Gateway user ""'
+        `Created Object Gateway user ''`
       );
     });
 
@@ -307,7 +307,7 @@ describe('RgwUserFormComponent', () => {
       component.onSubmit();
       expect(notificationService.show).toHaveBeenCalledWith(
         NotificationType.success,
-        'Updated Object Gateway user ""'
+        `Updated Object Gateway user ''`
       );
     });
   });
index faad689dbe6d5dc62e24ee60126243bd9702fba1..44d1e1eddc94ba68c3445e3234f29bf8f5bdc6b6 100644 (file)
@@ -250,12 +250,12 @@ export class RgwUserFormComponent extends CdForm implements OnInit {
         const args = this._getUpdateArgs();
         this.submitObservables.push(this.rgwUserService.update(uid, args));
       }
-      notificationTitle = this.i18n('Updated Object Gateway user "{{uid}}"', { uid: uid });
+      notificationTitle = this.i18n(`Updated Object Gateway user '{{uid}}'`, { uid: uid });
     } else {
       // Add
       const args = this._getCreateArgs();
       this.submitObservables.push(this.rgwUserService.create(args));
-      notificationTitle = this.i18n('Created Object Gateway user "{{uid}}"', { uid: uid });
+      notificationTitle = this.i18n(`Created Object Gateway user '{{uid}}'`, { uid: uid });
     }
     // Check if user quota has been modified.
     if (this._isUserQuotaDirty()) {
index e48bb99f5ce5bb1ee9a9950d048cc784390e264a..9bd83ac16758d27bbd5fdc474157902662133679 100644 (file)
@@ -209,7 +209,7 @@ export class UserFormComponent extends CdForm implements OnInit {
       () => {
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Created user "{{username}}"', { username: userFormModel.username })
+          this.i18n(`Created user '{{username}}'`, { username: userFormModel.username })
         );
         this.router.navigate(['/user-management/users']);
       },
@@ -284,7 +284,7 @@ export class UserFormComponent extends CdForm implements OnInit {
         } else {
           this.notificationService.show(
             NotificationType.success,
-            this.i18n('Updated user "{{username}}"', { username: userFormModel.username })
+            this.i18n(`Updated user '{{username}}'`, { username: userFormModel.username })
           );
           this.router.navigate(['/user-management/users']);
         }
index c9f4a0c8ec4646360f4560509d033b6eef6c9f66..9f2a6207f0702286cc10da878133c17d46341053 100644 (file)
@@ -137,7 +137,7 @@ export class UserListComponent implements OnInit {
         this.modalRef.hide();
         this.notificationService.show(
           NotificationType.success,
-          this.i18n('Deleted user "{{username}}"', { username: username })
+          this.i18n(`Deleted user '{{username}}'`, { username: username })
         );
       },
       () => {
@@ -152,8 +152,8 @@ export class UserListComponent implements OnInit {
     if (sessionUsername === username) {
       this.notificationService.show(
         NotificationType.error,
-        this.i18n('Failed to delete user "{{username}}"', { username: username }),
-        this.i18n('You are currently logged in as "{{username}}".', { username: username })
+        this.i18n(`Failed to delete user '{{username}}'`, { username: username }),
+        this.i18n(`You are currently logged in as '{{username}}'.`, { username: username })
       );
       return;
     }
index cc3f6582c779e42327edc294226858c3ea0728c5..59bc6bcd1790707d8954877d0bf5001b49774fbe 100644 (file)
@@ -45,7 +45,7 @@
     "object-literal-sort-keys": false,
     "one-line": [true, "check-open-brace", "check-catch", "check-else", "check-whitespace"],
     "prefer-const": true,
-    "quotemark": [true, "single", "avoid-escape"],
+    "quotemark": [true, "single"],
     "radix": true,
     "triple-equals": [true, "allow-null-check"],
     "typedef-whitespace": [