]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: replace bootstrap badges with carbon tags
authorpujaoshahu <pshahu@redhat.com>
Wed, 16 Oct 2024 15:57:58 +0000 (21:27 +0530)
committerpujashahu <pshahu@redhat.com>
Fri, 10 Oct 2025 10:35:34 +0000 (16:05 +0530)
Fixes: https://tracker.ceph.com/issues/68252
Signed-off-by: pujaoshahu <pshahu@redhat.com>
81 files changed:
src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/osds.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/users.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/multi-cluster/multi-cluster.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/multisite.po.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/daemon-list/daemon-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirror-health-color.pipe.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirror-health-color.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-details/rbd-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-group/cephfs-subvolume-group.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-group/cephfs-subvolume-group.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-list/cephfs-subvolume-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-list/cephfs-subvolume-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-snapshots-list/cephfs-subvolume-snapshots-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-list/multi-cluster-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html
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/prometheus/active-alert-list/active-alert-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-tabs/prometheus-tabs.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/rules-list/rules-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-v3.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-notification-list/rgw-bucket-notification-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-policy/rgw-multisite-sync-policy.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-sync-data-info/rgw-sync-data-info.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-sync-data-info/rgw-sync-data-info.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-sync-metadata-info/rgw-sync-metadata-info.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-sync-metadata-info/rgw-sync-metadata-info.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-sync-primary-zone/rgw-sync-primary-zone.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-sync-primary-zone/rgw-sync-primary-zone.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/device-list/device-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation.module.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/card/card.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/cd-label/cd-label.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/cd-label/color-class-from-text.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select-badges/select-badges.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select-badges/select-badges.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/crud-table/crud-table.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/crud-table/crud-table.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/enum/cell-template.enum.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/octal-to-human-readable.pipe.ts
src/pybind/mgr/dashboard/frontend/src/styles.scss
src/pybind/mgr/dashboard/frontend/src/styles/_carbon-defaults.scss
src/pybind/mgr/dashboard/frontend/src/styles/ceph-custom/_buttons.scss

index bf3e0b36dfe90bd7f601a2b69487b6ae504c808b..2ebabe5bfb973a67b8ff37a614c5fece90bfb1ea 100644 (file)
@@ -48,7 +48,7 @@ export class MirroringPageHelper extends PageHelper {
     cy.get('cd-mirroring-pools').within(() => {
       this.getTableCell(this.poolsColumnIndex.name, poolName)
         .parent()
-        .find(`[cdstabledata]:nth-child(${this.poolsColumnIndex.health}) .badge`)
+        .find(`[cdstabledata]:nth-child(${this.poolsColumnIndex.health}) cds-tag`)
         .should(($ele) => {
           const newLabels = $ele.toArray().map((v) => v.innerText);
           expect(newLabels).to.include(status);
index 42da0ef2ed75591b11b0abbe96d147a28c739ac5..402662c2c46ff27ab2beee73b01c92e32b7152bd 100644 (file)
@@ -75,13 +75,13 @@ export class HostsPageHelper extends PageHelper {
     if (add) {
       cy.get('cd-modal').find('.select-menu-edit').click();
       for (const label of labels) {
-        cy.contains('cd-modal .badge', new RegExp(`^${label}$`)).should('not.exist');
+        cy.contains('cd-modal .tag', new RegExp(`^${label}$`)).should('not.exist');
         cy.get('.popover-body input').type(`${label}{enter}`);
       }
     } else {
       for (const label of labels) {
-        cy.contains('cd-modal .badge', new RegExp(`^${label}$`))
-          .find('.badge-remove')
+        cy.contains('cd-modal .tag', new RegExp(`^${label}$`))
+          .find('.tags-remove')
           .click();
       }
     }
@@ -95,7 +95,7 @@ export class HostsPageHelper extends PageHelper {
     this.getTableCell(this.columnIndex.hostname, hostname, true).as('row').click();
     cy.get('@row')
       .parent()
-      .find(`[cdstabledata]:nth-child(${this.columnIndex.labels}) .badge`)
+      .find(`[cdstabledata]:nth-child(${this.columnIndex.labels}) .tag`)
       .should(($ele) => {
         const newLabels = $ele.toArray().map((v) => v.innerText);
         for (const label of labels) {
@@ -120,7 +120,7 @@ export class HostsPageHelper extends PageHelper {
 
       this.getTableCell(this.columnIndex.hostname, hostname, true)
         .parent()
-        .find(`[cdstabledata]:nth-child(${this.columnIndex.status}) .badge`)
+        .find(`[cdstabledata]:nth-child(${this.columnIndex.status}) cds-tag`)
         .should(($ele) => {
           const status = $ele.toArray().map((v) => v.innerText);
           expect(status).to.include('maintenance');
@@ -150,7 +150,7 @@ export class HostsPageHelper extends PageHelper {
 
       this.getTableCell(this.columnIndex.hostname, hostname, true)
         .parent()
-        .find(`[cdstabledata]:nth-child(${this.columnIndex.status}) .badge`)
+        .find(`[cdstabledata]:nth-child(${this.columnIndex.status}) .tag`)
         .should(($ele) => {
           const status = $ele.toArray().map((v) => v.innerText);
           expect(status).to.include('maintenance');
index b35a94050a1addda1041a9a8ff9c86632d4805c3..a9c7c6e9a545c4929b7e91c32984e17717e6b823 100644 (file)
@@ -52,7 +52,7 @@ export class OSDsPageHelper extends PageHelper {
   checkStatus(id: number, status: string[]) {
     this.searchTable(id.toString());
     cy.wait(5 * 1000);
-    cy.get(`[cdstabledata]:nth-child(${this.columnIndex.status}) .badge`).should(($ele) => {
+    cy.get(`[cdstabledata]:nth-child(${this.columnIndex.status}) cds-tag`).should(($ele) => {
       const allStatus = $ele.toArray().map((v) => v.innerText);
       for (const s of status) {
         expect(allStatus).to.include(s);
index c546d5cc513a5aa4373bc1c03a0295a8fe634bfb..d5ed9c26b11eac418af7e2914b978eb7a0bc6119 100644 (file)
@@ -157,7 +157,7 @@ export class ServicesPageHelper extends PageHelper {
       cy.get('cd-service-daemon-list').within(() => {
         this.getTableCell(daemonNameIndex, daemon, true)
           .parent()
-          .find(`[cdstabledata]:nth-child(${statusIndex}) .badge`)
+          .find(`[cdstabledata]:nth-child(${statusIndex}) cds-tag`)
           .should(($ele) => {
             const status = $ele.toArray().map((v) => v.innerText);
             expect(status).to.include(expectedStatus);
index 2b1d198f236c20c474fba28a3f04034cf914efaf..dc57bd9dcd34ff818cdb62a505c8e2cc86228f50 100644 (file)
@@ -49,7 +49,7 @@ export class UsersPageHelper extends PageHelper {
     this.getTableCell(this.columnIndex.entity, entityName)
       .click()
       .parent()
-      .find(`[cdstabledata]:nth-child(${this.columnIndex.capabilities}) .badge`)
+      .find(`[cdstabledata]:nth-child(${this.columnIndex.capabilities}) cds-tag`)
       .should(($ele) => {
         const newCaps = $ele.toArray().map((v) => v.innerText);
         for (const cap of capabilities) {
index 25dc845cf187845dc35adb6b33999cd17af99eb6..91503335855ef200728f0ccc7afc15721c2e058a 100644 (file)
@@ -79,7 +79,7 @@ And('I should see row {string} have {string}', (row: string, options: string) =>
   if (options) {
     cy.get('.cds--search-input').first().clear().type(row);
     for (const option of options.split(',')) {
-      cy.contains(`[cdstablerow] [cdstabledata] .badge`, option).should('exist');
+      cy.contains(`[cdstablerow] [cdstabledata] .tag`, option).should('exist');
     }
   }
 });
@@ -96,7 +96,7 @@ And('I should see row {string} does not have {string}', (row: string, options: s
   if (options) {
     cy.get('.cds--search-input').first().clear().type(row);
     for (const option of options.split(',')) {
-      cy.contains(`[cdstablerow] [cdstabledata] .badge`, option).should('not.exist');
+      cy.contains(`[cdstablerow] [cdstabledata] .tag`, option).should('not.exist');
     }
   }
 });
index 5c683a947a696c04829976fde735f12c1b57a2b4..13856eefcbcd1e21193e32d0c635b2d2c7158491 100644 (file)
@@ -64,7 +64,7 @@ export class MultiClusterPageHelper extends PageHelper {
 
     this.getTableCell(aliasIndex, alias)
       .parent()
-      .find(`[cdstabledata]:nth-child(${statusIndex}) .badge`)
+      .find(`[cdstabledata]:nth-child(${statusIndex}) cds-tag`)
       .should(($ele) => {
         const status = $ele.toArray().map((v) => v.innerText);
         expect(status).to.include(expectedStatus);
index 5240c8364244a3be407abe2528d20598906b752d..e33957dd3db87d3d8560d4814c2b29e23ccb7210 100644 (file)
@@ -59,7 +59,7 @@ export class MultisitePageHelper extends PageHelper {
 
     this.searchTable(group_id);
     cy.get(`[cdstabledata]:nth-child(${this.columnIndex.status})`)
-      .find('.badge-warning')
+      .find('.tag-warning')
       .should('contain', status);
   }
 
index e3b600bafa90de40ad953237d35b1cb972b64a80..f309f8a29328049170efa27c2fbc214392c698e8 100644 (file)
@@ -64,7 +64,8 @@ import {
   SelectModule,
   UIShellModule,
   TreeviewModule,
-  TabsModule
+  TabsModule,
+  TagModule
 } from 'carbon-components-angular';
 
 // Icons
@@ -101,7 +102,8 @@ import ProgressBarRound from '@carbon/icons/es/progress-bar--round/32';
     ModalModule,
     DatePickerModule,
     ComboBoxModule,
-    TabsModule
+    TabsModule,
+    TagModule
   ],
   declarations: [
     RbdListComponent,
index 77d1cbc5667608e43652a66c6444eef836c3f653..29937e48cd25372e643efc33974cafc6a672ce03 100644 (file)
          ></svg>
       <span>{{ node?.name }}</span>
       &nbsp;
-      <span class="badge"
-            [ngClass]="{'badge-success': ['logged_in'].includes(node?.status), 'badge-danger': ['logged_out'].includes(node?.status)}">
+      <cds-tag [class]="{'tag-success': ['logged_in'].includes(node?.status), 'tag-danger': ['logged_out'].includes(node?.status)}">
         {{ node?.status }}
-      </span>
+      </cds-tag>
     </ng-template>
   </div>
 
index 89e4d7f3407b3ab5c3f01963fd2076e0d583dc63..787a6e389c21e9faf7ea2293a0208bc52cc659f4 100644 (file)
@@ -39,11 +39,11 @@ export class IscsiComponent implements OnInit {
         name: $localize`State`,
         prop: 'state',
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            up: { class: 'badge-success' },
-            down: { class: 'badge-danger' }
+            up: { class: 'tag-success' },
+            down: { class: 'tag-danger' }
           }
         }
       },
index 05226ed1a9340e445025cf06c0d843e9b17d0ea3..749b2b40595b08acd37d358bc3a33afcea954f84 100644 (file)
@@ -9,5 +9,5 @@
 <ng-template #healthTmpl
              let-row="data.row"
              let-value="data.value">
-  <span [ngClass]="row.health_color | mirrorHealthColor">{{ value }}</span>
+  <cds-tag [class]="row.health_color | mirrorHealthColor">{{ value }}</cds-tag>
 </ng-template>
index eac76dea64d8e4a9300142df1276b7ba356dafe0..77c03dd06ae3bd3d8839531101c6910df506eb7f 100644 (file)
 <ng-template #stateTmpl
              let-row="data.row"
              let-value="data.value">
-  <span [ngClass]="row.state_color | mirrorHealthColor">{{ value }}</span>
+
+<cds-tag size="sm"
+         [class]="row.state_color | mirrorHealthColor">{{ value }}</cds-tag>
+
 </ng-template>
 
 <ng-template #progressTmpl
index 52ff84be1043ac9a583ced02cfec342503bb75d7..8d2c2348f6e8fc3d630273991d35a92706b8729e 100644 (file)
@@ -8,18 +8,18 @@ describe('MirrorHealthColorPipe', () => {
   });
 
   it('transforms "warning"', () => {
-    expect(pipe.transform('warning')).toBe('badge badge-warning');
+    expect(pipe.transform('warning')).toBe('tag-warning');
   });
 
   it('transforms "error"', () => {
-    expect(pipe.transform('error')).toBe('badge badge-danger');
+    expect(pipe.transform('error')).toBe('tag-danger');
   });
 
   it('transforms "success"', () => {
-    expect(pipe.transform('success')).toBe('badge badge-success');
+    expect(pipe.transform('success')).toBe('tag-success');
   });
 
   it('transforms others', () => {
-    expect(pipe.transform('abc')).toBe('badge badge-info');
+    expect(pipe.transform('abc')).toBe('tag-info');
   });
 });
index 3c25d715e5e309de195691a3947b84296dfaa503..8817be5f4e157ebf520f27fdd85950cfc6c39e5e 100644 (file)
@@ -6,12 +6,12 @@ import { Pipe, PipeTransform } from '@angular/core';
 export class MirrorHealthColorPipe implements PipeTransform {
   transform(value: any): any {
     if (value === 'warning') {
-      return 'badge badge-warning';
+      return 'tag-warning';
     } else if (value === 'error') {
-      return 'badge badge-danger';
+      return 'tag-danger';
     } else if (value === 'success') {
-      return 'badge badge-success';
+      return 'tag-success';
     }
-    return 'badge badge-info';
+    return 'tag-info';
   }
 }
index 090da06869d103eef8db9964a95df19dc9e27c97..e4a32f26a30b28a1f281d96ac92eb9ff05284e83 100644 (file)
@@ -23,7 +23,8 @@ import {
   IconService,
   InputModule,
   ModalModule,
-  SelectModule
+  SelectModule,
+  TagModule
 } from 'carbon-components-angular';
 
 // Icons
@@ -49,7 +50,8 @@ import DocumentImportIcon from '@carbon/icons/es/document--import/16';
     SelectModule,
     GridModule,
     ButtonModule,
-    IconModule
+    IconModule,
+    TagModule
   ],
   declarations: [
     BootstrapCreateModalComponent,
index ffffe7fa687bc2ce591b780da536bba7803d6f51..f8aca866df3097b1cd45d51d93bd431d84ba0812 100644 (file)
@@ -18,7 +18,9 @@
 <ng-template #healthTmpl
              let-row="data.row"
              let-value="data.value">
-  <span [ngClass]="row.health_color | mirrorHealthColor">{{ value }}</span>
+  <cds-tag [class]="row.health_color | mirrorHealthColor">
+           {{ value }}
+  </cds-tag>
 </ng-template>
 <ng-template #localTmpl>
   <span i18n
index 4778764d97636ddc6ee1c4acdcd313a739643f5e..7da764d12029b7132cab2e909706d2aab2a448a1 100644 (file)
 
 <ng-template #statusTpl
              let-row="data.row">
-  <span class="badge"
-        [ngClass]="row | pipeFunction:getStatusClass">
+  <cds-tag [class]="row | pipeFunction:getStatusClass">
     {{ row.status_desc }}
-  </span>
+</cds-tag>
 </ng-template>
 
 <cds-tabs
index ea66250a348eb5bae0346ce6b4bfd64aff3c5b31..33764a87be56bd0272d8182fb651fdf4bf4de710 100644 (file)
@@ -81,12 +81,12 @@ export class NvmeofGatewayComponent implements OnInit {
   getStatusClass(row: Gateway): string {
     return _.get(
       {
-        '-1': 'badge-danger',
-        '0': 'badge-warning',
-        '1': 'badge-success'
+        '-1': 'tag-danger',
+        '0': 'tag-warning',
+        '1': 'tag-success'
       },
       row.status,
-      'badge-dark'
+      'tag-dark'
     );
   }
 
index 1e122199b80566e1602f5cd0d7247dd3e625e689..2e748ed4cb43e37ec517cad26bbe38ad2a524bbb 100644 (file)
@@ -56,7 +56,7 @@
                   class="bold">Features</td>
               <td>
                 <span *ngFor="let feature of selection.features_name">
-                  <span class="badge badge-dark me-2">{{ feature }}</span>
+                  <cds-tag class="tag-dark me-2">{{ feature }}</cds-tag>
                 </span>
               </td>
             </tr>
index 76fabd9c817f495946590237c234f1441e7cc8f1..ddd91a7ce44f8b6d64708d9df77b86718999a84c 100644 (file)
 <ng-template #mirroringTpl
              let-value="data.value"
              let-row="data.row">
-  <span *ngIf="value?.length === 3; else probb"
-        class="badge badge-info">{{ value[0] }}</span>&nbsp;
-  <span *ngIf="value?.length === 3"
-        class="badge badge-info">{{ value[1] }}</span>&nbsp;
-  <span *ngIf="row?.primary === true"
-        class="badge badge-info"
-        i18n>primary</span>
-  <span *ngIf="row?.primary === false"
-        class="badge badge-info"
-        i18n>secondary</span>
+  <cds-tag *ngIf="value?.length === 3; else probb"
+           class="tag-info">
+    {{ value[0] }}
+  </cds-tag>&nbsp;
+  <cds-tag *ngIf="value?.length === 3"
+           class="tag-info">
+    {{ value[1] }}
+  </cds-tag>&nbsp;
+  <cds-tag *ngIf="row?.primary === true"
+           class="tag-info"
+           i18n>
+    primary
+  </cds-tag>
+  <cds-tag *ngIf="row?.primary === false"
+           class="tag-info"
+           i18n>
+    secondary
+  </cds-tag>
   <ng-template #probb>
-    <span class="badge badge-info">{{ value }}</span>
+    <cds-tag class="tag-info">
+      {{ value }}
+    </cds-tag >
   </ng-template>
 </ng-template>
 
 <ng-template #ScheduleTpl
              let-value="data.value"
              let-row="data.row">
-  <span *ngIf="value?.length === 3"
-        class="badge badge-info">{{ value[2] | cdDate  }}</span>
+  <cds-tag *ngIf="value?.length === 3"
+           class="tag-info">
+  {{ value[2] | cdDate  }}
+  </cds-tag>
 </ng-template>
 
 <ng-template #flattenTpl
index 144d008867ae0fd801bf30b0251efedebe4575c3..53479d8d1a983c587d9029d82dede4114370d35a 100644 (file)
@@ -128,11 +128,11 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
         name: $localize`State`,
         prop: 'is_protected',
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            true: { value: $localize`PROTECTED`, class: 'badge-success' },
-            false: { value: $localize`UNPROTECTED`, class: 'badge-info' }
+            true: { value: $localize`PROTECTED`, class: 'tag-success' },
+            false: { value: $localize`UNPROTECTED`, class: 'tag-info' }
           }
         }
       },
index b224f6f2a7055f75da669860a12c4696e1b3883c..98630293b5ef1e4520439775d5b74d57fe909397 100644 (file)
@@ -42,9 +42,9 @@
 
 <ng-template #modeToHumanReadableTpl
              let-value="data.value">
-  <span *ngFor="let result of (value | octalToHumanReadable)"
-        [ngClass]="result.class"
-        [ngbTooltip]="result.toolTip">
+  <cds-tag *ngFor="let result of (value | octalToHumanReadable)"
+           [class]="result.class"
+           [ngbTooltip]="result.toolTip">
     {{ result.content }}
-  </span>
+</cds-tag>
 </ng-template>
index 9d68fd5c006262e5ae12e24a07dc0bd116ecded8..4cb7a1bc3123540f832e308770bcdd3c4a5c048d 100644 (file)
@@ -82,9 +82,9 @@ export class CephfsSubvolumeGroupComponent implements OnInit, OnChanges {
         name: $localize`Data Pool`,
         prop: 'info.data_pool',
         flexGrow: 0.7,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
-          class: 'badge-background-primary'
+          class: 'tag-background-primary'
         }
       },
       {
index a1e063e6d1bc6b4a98de65445beaf472e2517c73..afc8172b7775daa1d50e01168419f724872f736f 100644 (file)
 
 <ng-template #modeToHumanReadableTpl
              let-value="data.value">
-  <span *ngFor="let result of (value | octalToHumanReadable)"
-        [ngClass]="result.class"
-        [ngbTooltip]="result.toolTip">
+  <cds-tag *ngFor="let result of (value | octalToHumanReadable)"
+           [class]="result.class"
+           [ngbTooltip]="result.toolTip">
     {{ result.content }}
-  </span>
+</cds-tag>
 </ng-template>
 
 <ng-template #nameTpl
index ef929610b4daa342fae3e51a832dd2caa3f7c6f5..682413e968d84bad8943182e938de947427d72cd 100644 (file)
@@ -110,9 +110,9 @@ export class CephfsSubvolumeListComponent extends CdForm implements OnInit, OnCh
         name: $localize`Data Pool`,
         prop: 'info.data_pool',
         flexGrow: 0.7,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
-          class: 'badge-background-primary'
+          class: 'tag-background-primary'
         }
       },
       {
index eabcee6b2ed4ec93fa0ad095893a486525955f92..b63fc4d76c39e842582ad4cdc2b19f3675e0293a 100644 (file)
@@ -91,11 +91,11 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
         name: $localize`Pending Clones`,
         prop: 'info.has_pending_clones',
         flexGrow: 0.5,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            no: { class: 'badge-success' },
-            yes: { class: 'badge-info' }
+            no: { class: 'tag-success' },
+            yes: { class: 'tag-info' }
           }
         }
       }
index 045106ff62498464513d176189283ee462469151..ff2febe714cf6bb8fb79a355b9cf35d97713e7e6 100644 (file)
@@ -67,7 +67,7 @@
     <ng-container ngbNavItem="clients">
       <a ngbNavLink>
         <ng-container i18n>Clients</ng-container>
-        <span class="badge badge-pill badge-tab ms-1">{{ clients.data.length }}</span>
+        <cds-tag class="ms-1">{{ clients.data.length }}</cds-tag>
       </a>
       <ng-template ngbNavContent>
         <cd-cephfs-clients
index 7503f5f355c40aedaa0cf072ec998908a3d8bbec..2ccf7a4e4894adc43fb02dff1529ab2edbdde454 100644 (file)
@@ -16,7 +16,8 @@ import {
   ListModule,
   ToggletipModule,
   IconModule,
-  IconService
+  IconService,
+  TagModule
 } from 'carbon-components-angular';
 import Analytics from '@carbon/icons/es/analytics/16';
 import CloseFilled from '@carbon/icons/es/close--filled/16';
@@ -115,7 +116,8 @@ import { MultiClusterDetailsComponent } from './multi-cluster/multi-cluster-deta
     ModalModule,
     ListModule,
     ToggletipModule,
-    IconModule
+    IconModule,
+    TagModule
   ],
   declarations: [
     MonitorComponent,
index 8bcb15fb1d9a3b745a73ab43a547f9b044cc1f1b..ffd433dd63578a6bd776b49a6f09ba553c2370fc 100755 (executable)
         <td>
           <span *ngFor="let flag of selection.flags">
             <span title="{{ flags[flag] }}">
-              <span class="badge badge-dark me-2">{{ flag | uppercase }}</span>
+              <cds-tag class="tag-dark me-2">{{ flag | uppercase }}</cds-tag>
             </span>
           </span>
         </td>
       </tr>
       <tr>
         <td i18n
-            class="bold">Services</td>
+            class="bold">
+            Services
+        </td>
         <td>
           <span *ngFor="let service of selection.services">
-            <span class="badge badge-dark me-2">{{ service }}</span>
+            <cds-tag
+                 *ngIf="service"
+                 class="tag-dark me-2">
+            {{ service }}
+          </cds-tag>
           </span>
         </td>
       </tr>
index a6775dcee1750456d9237b4e4c1ca5406ca56b41..f1486969e07133c7db467fbb42b56177293dc51e 100644 (file)
           <div class="cd-col-form-input">
             <span *ngFor="let service of configForm.getValue('services')"
                   class="form-component-badge">
-              <span class="badge badge-dark">{{ service }}</span>
+              <cds-tag [size]="'md'"
+                       class="tag-dark">
+                {{ service }}
+              </cds-tag>
             </span>
           </div>
         </div>
index 108d39cad7438df0dd2aba0b3451c61f7006ffe8..9143272803599cfccb9e3beecfb2ac303d543af1 100644 (file)
                   </ng-container>
                 </cds-tree-node>
               </ng-template>
-              <ng-template #badge
+              <ng-template #tag
                            let-data>
-                <span *ngIf="data?.status"
-                      class="badge"
-                      [ngClass]="{'badge-success': ['in', 'up'].includes(data?.status), 'badge-danger': ['down', 'out', 'destroyed'].includes(data?.status)}">
-                  {{ data.status }}
-                </span>
+                <cds-tag *ngIf="data?.status"
+                         [class]="getStatusClasses(data.status)">
+                  {{ data?.status }}
+                </cds-tag>
                 <span>&nbsp;</span>
                 <span class="node-name"
                       [ngClass]="{'type-osd': data?.type === 'osd'}"
index 3828392b78216134dfdbced5f639b0ffc64d31b9..884c62d49ea796e86658a374f7851a6dd502df25 100644 (file)
@@ -41,7 +41,7 @@ export class CrushmapComponent implements OnDestroy, OnInit {
   private sub = new Subscription();
 
   @ViewChild('tree') tree: TreeViewComponent;
-  @ViewChild('badge') labelTpl: TemplateRef<any>;
+  @ViewChild('tag') labelTpl: TemplateRef<any>;
 
   icons = Icons;
   loadingIndicator = true;
@@ -134,4 +134,14 @@ export class CrushmapComponent implements OnDestroy, OnInit {
       delete this.metadataTitle;
     }
   }
+
+  getStatusClasses(status: string): string {
+    if (['in', 'up'].includes(status)) {
+      return 'tag-success ';
+    }
+    if (['down', 'out', 'destroyed'].includes(status)) {
+      return 'tag-danger';
+    }
+    return '';
+  }
 }
index 34bf44c683c928b5d8a269c179e00630b8c445ad..e29d31bc68c309d7457de9a7900a81cf686b84d8 100644 (file)
@@ -25,6 +25,7 @@ import {
   TableActionHelper
 } from '~/testing/unit-test-helper';
 import { HostsComponent } from './hosts.component';
+import { TagModule } from 'carbon-components-angular';
 
 class MockShowForceMaintenanceModal {
   showModal = false;
@@ -63,7 +64,8 @@ describe('HostsComponent', () => {
       RouterTestingModule,
       ToastrModule.forRoot(),
       CephModule,
-      CoreModule
+      CoreModule,
+      TagModule
     ],
     providers: [
       { provide: AuthStorageService, useValue: fakeAuthStorageService },
index 200ddba0b76a1cd886effc79826ead2362150ea0..cb237f768f2cc751ec926fcc2eacd41bf705ec50 100644 (file)
@@ -226,20 +226,20 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
         name: $localize`Labels`,
         prop: 'labels',
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
-          class: 'badge-dark'
+          class: 'tag-dark'
         }
       },
       {
         name: $localize`Status`,
         prop: 'status',
         flexGrow: 0.8,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            maintenance: { class: 'badge-warning' },
-            available: { class: 'badge-success' }
+            maintenance: { class: 'tag-warning' },
+            available: { class: 'tag-success' }
           }
         }
       },
index b377b28f29349663b42118560cb281b80ca03eac..1ed29e4126688aa546c2c91b590d828ca86f0644 100644 (file)
@@ -118,11 +118,11 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
         name: $localize`Type`,
         prop: 'human_readable_type',
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            hdd: { value: 'HDD', class: 'badge-hdd' },
-            ssd: { value: 'SSD', class: 'badge-ssd' }
+            hdd: { value: 'HDD', class: 'tag-hdd' },
+            ssd: { value: 'SSD', class: 'tag-ssd' }
           }
         }
       },
@@ -153,9 +153,9 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
         name: $localize`OSDs`,
         prop: 'osd_ids',
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
-          class: 'badge-dark',
+          class: 'tag-dark',
           prefix: 'osd.'
         }
       }
index a9ca408f4874fd7c3ab7c473e93006e7205189f8..91068122aa8457284bb2a8290502695146a0033f 100644 (file)
@@ -132,12 +132,12 @@ export class MultiClusterListComponent extends ListWithDetails implements OnInit
         prop: 'cluster_connection_status',
         name: $localize`Connection`,
         flexGrow: 2,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            1: { value: 'DISCONNECTED', class: 'badge-danger' },
-            0: { value: 'CONNECTED', class: 'badge-success' },
-            2: { value: 'CHECKING..', class: 'badge-info' }
+            1: { value: 'DISCONNECTED', class: 'tag-danger' },
+            0: { value: 'CONNECTED', class: 'tag-success' },
+            2: { value: 'CHECKING..', class: 'tag-info' }
           }
         }
       },
index 46e07885c5459326ddc7ce5463f9c7f04e81675c..02579680b852b75d4dc43d2b1bb50b22632649c0 100644 (file)
@@ -133,12 +133,12 @@ export class MultiClusterComponent implements OnInit, OnDestroy {
         prop: 'cluster_connection_status',
         name: $localize`Connection`,
         flexGrow: 2,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            1: { value: 'DISCONNECTED', class: 'badge-danger' },
-            0: { value: 'CONNECTED', class: 'badge-success' },
-            2: { value: 'CHECKING..', class: 'badge-info' }
+            1: { value: 'DISCONNECTED', class: 'tag-danger' },
+            0: { value: 'CONNECTED', class: 'tag-success' },
+            2: { value: 'CHECKING..', class: 'tag-info' }
           }
         }
       },
@@ -146,12 +146,12 @@ export class MultiClusterComponent implements OnInit, OnDestroy {
         prop: 'status',
         name: $localize`Status`,
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            1: { value: 'WARN', class: 'badge-warning' },
-            0: { value: 'OK', class: 'badge-success' },
-            2: { value: 'ERROR', class: 'badge-danger' }
+            1: { value: 'WARN', class: 'tag-warning' },
+            0: { value: 'OK', class: 'tag-success' },
+            2: { value: 'ERROR', class: 'tag-danger' }
           }
         }
       },
index e790cf0f3d43c4db1895723c2228c714c89cf40d..de55256de2bdf54970ad5ab9fa8c0f179b6f8cb3 100644 (file)
@@ -29,7 +29,7 @@
     <ng-template #blockClearDevices>
       <div class="pb-2 my-2 border-bottom">
         <span *ngFor="let filter of appliedFilters">
-          <span class="badge badge-dark me-2">{{ filter.name }}: {{ filter.value.formatted }}</span>
+          <cds-tag class="tag-dark me-2">{{ filter.name }}: {{ filter.value.formatted }}</cds-tag>
         </span>
         <a class="tc_clearSelections"
            href=""
index ab967eab4aecd3129bafc292c7a450842cc44bda..2f56dae1ed3faced757cf8bd8a0f76768642c1f5 100644 (file)
                         size="slim"
                         [showTitle]="false">
           <ng-container i18n>At least one of these filters must be applied in order to proceed:</ng-container>
-          <span *ngFor="let filter of requiredFilters"
-                class="badge badge-dark ms-2">
-            {{ filter }}
-          </span>
+          <cds-tag *ngFor="let filter of requiredFilters"
+                   class="tag-dark ms-2">
+              {{ filter }}
+          </cds-tag>
         </cd-alert-panel>
         <cd-inventory-devices #inventoryDevices
                               [devices]="devices"
index 0aff25409dea7584fd476bc5a0a64a8cdd0d3627..a91be0ea580f3051badf873093eb2b11c444eead 100644 (file)
                  [for]="flag.code"
                  ng-class="['tc_' + key]">
             <strong>{{ flag.name }}</strong>
-            <span class="badge badge-hdd ms-2"
-                  [ngbTooltip]="clusterWideTooltip"
-                  *ngIf="flag.clusterWide"
-                  i18n>Cluster-wide</span>
+            <cds-tag class="tag-hdd ms-2"
+                     [ngbTooltip]="clusterWideTooltip"
+                     *ngIf="flag.clusterWide"
+                     i18n>Cluster-wide</cds-tag>
             <br>
             <span class="form-text text-muted">{{ flag.description }}</span>
           </label>
index 72cebe8c03f96f8410a91449548b21f4220f43a6..4b42c0c261d4c951141e3fc9e19edd07aa3eb045 100644 (file)
 
 <ng-template #flagsTpl
              let-row="data.row">
-  <span *ngFor="let flag of row.cdClusterFlags;"
-        class="badge badge-hdd me-1">{{ flag }}</span>
-  <span *ngFor="let flag of row.cdIndivFlags;"
-        class="badge badge-info me-1">{{ flag }}</span>
+  <cds-tag *ngFor="let flag of row.cdClusterFlags;"
+           class="tag-hdd me-1">
+    {{ flag }}
+  </cds-tag>
+  <cds-tag *ngFor="let flag of row.cdIndivFlags;"
+           class="tag-info me-1">
+        {{ flag }}
+  </cds-tag>
 </ng-template>
 
 <ng-template #osdUsageTpl
index 386ef6e10813bc3e3e93fc4f9d36786b3ff56c75..010a01dbe6a76dec843e6c14cecfdc7071c70f13 100644 (file)
@@ -290,14 +290,14 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
         prop: 'collectedStates',
         name: $localize`Status`,
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            in: { class: 'badge-success' },
-            up: { class: 'badge-success' },
-            down: { class: 'badge-danger' },
-            out: { class: 'badge-danger' },
-            destroyed: { class: 'badge-danger' }
+            in: { class: 'tag-success' },
+            up: { class: 'tag-success' },
+            down: { class: 'tag-danger' },
+            out: { class: 'tag-danger' },
+            destroyed: { class: 'tag-danger' }
           }
         }
       },
@@ -305,11 +305,11 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
         prop: 'tree.device_class',
         name: $localize`Device class`,
         flexGrow: 1.2,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            hdd: { class: 'badge-hdd' },
-            ssd: { class: 'badge-ssd' }
+            hdd: { class: 'tag-hdd' },
+            ssd: { class: 'tag-ssd' }
           }
         }
       },
index 215e8ece48c6fffbfc53cf1c8a91dcd8c0598dea..f8fb572a5c711833ebae743dd7e9b9e579fa3bf0 100644 (file)
@@ -83,11 +83,11 @@ export class ActiveAlertListComponent extends PrometheusListHelper implements On
         name: $localize`Severity`,
         prop: 'labels.severity',
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            critical: { class: 'badge-danger' },
-            warning: { class: 'badge-warning' }
+            critical: { class: 'tag-danger' },
+            warning: { class: 'tag-warning' }
           }
         }
       },
@@ -95,12 +95,12 @@ export class ActiveAlertListComponent extends PrometheusListHelper implements On
         name: $localize`State`,
         prop: 'status.state',
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            active: { class: 'badge-info' },
-            unprocessed: { class: 'badge-warning' },
-            suppressed: { class: 'badge-dark' }
+            active: { class: 'tag-info' },
+            unprocessed: { class: 'tag-warning' },
+            suppressed: { class: 'tag-dark' }
           }
         }
       },
index 73ad9884a550133aecbc53e2165a3207b0506e76..fdf203aa38d2ba0ab207c4c907776de1ff4861bf 100644 (file)
@@ -6,10 +6,10 @@
        ariaCurrentWhenActive="page"
        [routerLinkActiveOptions]="{exact: true}"
        i18n>Active Alerts
-    <small *ngIf="prometheusAlertService.activeCriticalAlerts > 0"
-        class="badge badge-danger ms-1">{{ prometheusAlertService.activeCriticalAlerts }}</small>
-    <small *ngIf="prometheusAlertService.activeWarningAlerts > 0"
-        class="badge badge-warning ms-1">{{ prometheusAlertService.activeWarningAlerts }}</small></a>
+    <cds-tag *ngIf="prometheusAlertService.activeCriticalAlerts > 0"
+        class="tag-danger ms-1">{{ prometheusAlertService.activeCriticalAlerts }}</cds-tag>
+    <cds-tag *ngIf="prometheusAlertService.activeWarningAlerts > 0"
+        class="tag-warning ms-1">{{ prometheusAlertService.activeWarningAlerts }}</cds-tag></a>
   </li>
   <li class="nav-item">
     <a class="nav-link"
index 19b27a18edffe3c019d057331606e04f38a6be7b..ff67be1f8a45f1c1f1b0e2500fb1d7618aa3642d 100644 (file)
@@ -50,11 +50,11 @@ export class RulesListComponent extends PrometheusListHelper implements OnInit,
         prop: 'labels.severity',
         name: $localize`Severity`,
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            critical: { class: 'badge-danger' },
-            warning: { class: 'badge-warning' }
+            critical: { class: 'tag-danger' },
+            warning: { class: 'tag-warning' }
           }
         }
       },
@@ -62,7 +62,7 @@ export class RulesListComponent extends PrometheusListHelper implements OnInit,
         prop: 'group',
         name: $localize`Group`,
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge
+        cellTransformation: CellTemplate.tag
       },
       { prop: 'duration', name: $localize`Duration`, pipe: new DurationPipe(), flexGrow: 1 },
       { prop: 'query', name: $localize`Query`, isHidden: true, flexGrow: 1 },
index d83b49223b5c5d90a1eff4934d99ec86def63629..b5c9eed87aee9b9ff96b3bd9c2a490cb8c6fe7c6 100644 (file)
@@ -45,9 +45,9 @@ export class SilenceListComponent extends PrometheusListHelper {
   selection = new CdTableSelection();
   modalRef: NgbModalRef;
   customCss = {
-    'badge badge-danger': 'active',
-    'badge badge-warning': 'pending',
-    'badge badge-default': 'expired'
+    'tag-danger': 'active',
+    'tag-warning': 'pending',
+    'tag-default': 'expired'
   };
   sorts: CdSortPropDir[] = [{ prop: 'endsAt', dir: CdSortDirection.desc }];
   rules: PrometheusRule[];
@@ -126,7 +126,7 @@ export class SilenceListComponent extends PrometheusListHelper {
         name: $localize`Alerts Silenced`,
         prop: 'silencedAlerts',
         flexGrow: 3,
-        cellTransformation: CellTemplate.badge
+        cellTransformation: CellTemplate.tag
       },
       {
         name: $localize`Created by`,
index 582e750286763b9635224f6240802b5e99d48a0b..dc252a42cdac33e752a370d0094ec8386f4c413a 100644 (file)
 
 <ng-template #statusTpl
              let-row="data.row">
-  <span class="badge"
-        [ngClass]="row | pipeFunction:getStatusClass">
+  <cds-tag *ngIf="row.status_desc"
+           [class]="row | pipeFunction:getStatusClass">
     {{ row.status_desc }}
-  </span>
+</cds-tag>
 </ng-template>
 
 <ng-template #listTpl
@@ -50,7 +50,7 @@
     <li class="list-group-item"
         *ngFor="let event of events; trackBy:trackByFn">
       <b>{{ event.created | relativeDate }} - </b>
-      <span class="badge badge-info">{{ event.subject }}</span><br>
+      <cds-tag class="tag-info">{{ event.subject }}</cds-tag><br>
       <span *ngIf="event.level === 'INFO'">
         <svg [cdsIcon]="icons.infoCircle"
              [size]="icons.size16"
index a41d902dd10de257ea1bb1a4dc6db5f4772efed3..afb0521a67a1e7f71fdaeb35856202bb2f78cc5b 100644 (file)
@@ -237,12 +237,12 @@ export class ServiceDaemonListComponent implements OnInit, OnChanges, AfterViewI
   getStatusClass(row: Daemon): string {
     return _.get(
       {
-        '-1': 'badge-danger',
-        '0': 'badge-warning',
-        '1': 'badge-success'
+        '-1': 'tag-danger',
+        '0': 'tag-warning',
+        '1': 'tag-success'
       },
       row.status,
-      'badge-dark'
+      'tag-dark'
     );
   }
 
index e43c88e57bd6fc62171f46db63e2d71d5991658d..363c9b68eddcfd655049bab528cbf7f1dd6cce5b 100644 (file)
@@ -14,7 +14,7 @@ import { DashboardPieComponent } from './dashboard-pie/dashboard-pie.component';
 import { DashboardTimeSelectorComponent } from './dashboard-time-selector/dashboard-time-selector.component';
 import { DashboardV3Component } from './dashboard/dashboard-v3.component';
 import { PgSummaryPipe } from './pg-summary.pipe';
-import { InlineLoadingModule, ToggletipModule } from 'carbon-components-angular';
+import { InlineLoadingModule, ToggletipModule, TagModule } from 'carbon-components-angular';
 
 @NgModule({
   imports: [
@@ -29,7 +29,8 @@ import { InlineLoadingModule, ToggletipModule } from 'carbon-components-angular'
     SimplebarAngularModule,
     BaseChartDirective,
     ToggletipModule,
-    InlineLoadingModule
+    InlineLoadingModule,
+    TagModule
   ],
   declarations: [
     DashboardV3Component,
index b2b3d10f1603bb517afcb1b884217c3d6cdc7171..bc3bc26a68290cb5da96bb1e81df8978f2798dbb 100644 (file)
           </dd>
           <ng-container>
             <dt>Telemetry Dashboard
-              <span
-                class="badge"
-                [ngClass]="telemetryEnabled ? 'badge-success' : 'badge-secondary'"
-                [ngbTooltip]="getTelemetryText()" >
+              <cds-tag *ngIf="telemetryEnabled !== null"
+                       [class]="telemetryEnabled ? 'tag-success' : 'tag-secondary'"
+                       [size]="'md'"
+                       [ngbTooltip]="getTelemetryText()">
                 {{ telemetryEnabled ? 'Active' : 'Inactive' }}
-              </span>
+              </cds-tag>
             </dt>
             <dd>
               <a target="_blank"
index 6342897a7677ed67456182761bd513d3d0399dcd..4277b9bc289ed4b03d9fd85ed61dc36d016494d0 100644 (file)
@@ -128,18 +128,18 @@ export class PoolListComponent extends ListWithDetails implements OnInit {
       {
         prop: 'data_protection',
         name: $localize`Data Protection`,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
-          class: 'badge-background-gray'
+          class: 'tag-background-gray'
         },
         flexGrow: 1.3
       },
       {
         prop: 'application_metadata',
         name: $localize`Applications`,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
-          class: 'badge-background-primary'
+          class: 'tag-background-primary'
         },
         flexGrow: 1.5
       },
index dbbb5ecc3eaf3288ae72f0b8509ae91153d2a403..e53e6da02ad4e51012b3a6b044f80c361f325aa0 100644 (file)
@@ -34,7 +34,7 @@
           <div [cdsStack]="'horizontal'"
                *ngFor="let rule of item.value.FilterRule">
             <cds-tag size="sm"
-                     class="badge-background-gray">{{ rule.Name }}: {{ rule.Value }}</cds-tag>
+                     class="tag-background-gray">{{ rule.Name }}: {{ rule.Value }}</cds-tag>
           </div>
           <br>
         </ng-container>
@@ -46,7 +46,7 @@
   <ng-container *ngIf="events && events.length">
     <cds-tag *ngFor="let event of events"
              size="sm"
-             class="badge-background-primary">
+             class="tag-background-primary">
       {{ event }}
     </cds-tag>
   </ng-container>
index 68018154d53edda321431038bda4efc151ec7f4e..68d739629b8a70aafde5a8fad8342992539a6e13 100644 (file)
                      ></svg>
                 {{ node?.data?.name }}
               </span>
-              <span class="badge badge-success me-2"
-                    *ngIf="node?.data?.is_default">
+              <cds-tag class="tag-success me-2"
+                       *ngIf="node?.data?.is_default">
                   default
-              </span>
-              <span class="badge badge-warning me-2"
-                    *ngIf="node?.data?.is_master"> master </span>
-              <span class="badge badge-warning me-2"
-                    *ngIf="node?.data?.secondary_zone">
+            </cds-tag>
+              <cds-tag class="tag-warning me-2"
+                       *ngIf="node?.data?.is_master"> master </cds-tag>
+              <cds-tag class="tag-warning me-2"
+                       *ngIf="node?.data?.secondary_zone">
                 secondary-zone
-              </span>
+            </cds-tag>
             </div>
             <div class="btn-group align-inline-btns"
                  [ngStyle]="{'visibility': activeNodeId === node?.data?.id ? 'visible' : 'hidden'}"
index 80c6b033de759345f259a5bc28ab96f83a77a6ce..6f0bf535e276e057cb53d3594dda0c38019f0649 100644 (file)
@@ -74,10 +74,10 @@ export class RgwMultisiteSyncPolicyComponent extends ListWithDetails implements
         cellTransformation: CellTemplate.tooltip,
         customTemplateConfig: {
           map: {
-            Enabled: { class: 'badge-success', tooltip: 'sync is allowed and enabled' },
-            Allowed: { class: 'badge-info', tooltip: 'sync is allowed' },
+            Enabled: { class: 'tag-success', tooltip: 'sync is allowed and enabled' },
+            Allowed: { class: 'tag-info', tooltip: 'sync is allowed' },
             Forbidden: {
-              class: 'badge-warning',
+              class: 'tag-warning',
               tooltip:
                 'sync (as defined by this group) is not allowed and can override other groups'
             }
index 920a548f50b0428363f8a7b4ca52884f3a51a11f..bef3e5c67b6f95454381b4a191fd2061d386cb90 100644 (file)
@@ -1,7 +1,8 @@
 <ul class="me-2">
   <ng-template #upToDateTpl>
-    <li class="badge badge-success"
-        i18n>Up to Date</li>
+    <li i18n>
+      <cds-tag class="tag-success">Up to Date</cds-tag>
+    </li>
   </ng-template>
   <cds-toggletip  [dropShadow]="true"
                   [align]="align">
@@ -49,6 +50,9 @@
       i18n>
       Last Synced:
   </li>
-  <li class="badge badge-info"
-      *ngIf="zone.timestamp; else upToDateTpl">{{ zone.timestamp | relativeDate }}</li>
+  <li *ngIf="zone.timestamp; else upToDateTpl">
+    <cds-tag class="tag-info">
+      {{ zone.timestamp | relativeDate }}
+    </cds-tag>
+  </li>
 </ul>
index ebcb017ece4be3eb2c37e010dcc98999d9d344b0..94e886f148319d19e9d3f3b43f8bb668e6a49f4c 100644 (file)
@@ -30,7 +30,7 @@ describe('RgwSyncDataInfoComponent', () => {
       timestamp: null
     };
     fixture.detectChanges();
-    const upToDateBadge = fixture.debugElement.query(By.css('.badge-success'));
+    const upToDateBadge = fixture.debugElement.query(By.css('cds-tag.tag-success'));
     expect(upToDateBadge).toBeTruthy();
     expect(upToDateBadge.nativeElement.textContent).toEqual('Up to Date');
   });
@@ -44,8 +44,8 @@ describe('RgwSyncDataInfoComponent', () => {
 
     const lastSyncedElement = fixture.debugElement.query(By.css('li.mt-4.fw-bold'));
     expect(lastSyncedElement.nativeElement.textContent).toContain('Last Synced:');
-    const lastSyncedTimestamp = fixture.debugElement.query(By.css('.badge-info'));
-    expect(lastSyncedTimestamp.nativeElement.textContent).toEqual('10 minutes ago');
+    const lastSyncedTimestamp = fixture.debugElement.query(By.css('cds-tag.tag-info'));
+    expect(lastSyncedTimestamp.nativeElement.textContent.trim()).toEqual('10 minutes ago');
   }));
 
   it('should display sync status in the popover', () => {
index b32ca8a0ba0b51f378a96ee0c673e1255e0f1881..6f923e9eff06625c8205233c9e1bb43fa3ea27c5 100644 (file)
@@ -7,8 +7,11 @@
 <span *ngIf="metadataSyncInfo !== 'no sync (zone is master)'">
   <ul class="me-2">
     <ng-template #upToDateTpl>
-      <li class="badge badge-success"
-          i18n>Up to Date</li>
+      <li i18n>
+        <cds-tag class="tag-success">
+          Up to Date
+        </cds-tag>
+      </li>
     </ng-template>
     <cds-toggletip  [dropShadow]="true"
                     [align]="align">
         i18n>
         Last Synced:
     </li>
-    <li class="badge badge-info"
-        *ngIf="metadataSyncInfo.timestamp; else upToDateTpl">{{ metadataSyncInfo.timestamp | relativeDate }}</li>
+    <li *ngIf="metadataSyncInfo.timestamp; else upToDateTpl">
+      <cds-tag class="tag-info">
+        {{ metadataSyncInfo.timestamp | relativeDate }}
+      </cds-tag>
+    </li>
   </ul>
 </span>
index 0457fe2a98348fb8824989b79cb05a615b11fd95..1b4155a01a05ce95ca9e44fdb41a335392134f8a 100644 (file)
@@ -30,9 +30,10 @@ describe('RgwSyncMetadataInfoComponent', () => {
       timestamp: null
     };
     fixture.detectChanges();
-    const upToDateBadge = fixture.debugElement.query(By.css('.badge-success'));
+    const upToDateBadge = fixture.debugElement.query(By.css('cds-tag'));
     expect(upToDateBadge).toBeTruthy();
-    expect(upToDateBadge.nativeElement.textContent).toEqual('Up to Date');
+    expect(upToDateBadge.nativeElement.classList).toContain('tag-success');
+    expect(upToDateBadge.nativeElement.textContent.trim()).toEqual('Up to Date');
   });
 
   it('should display correct sync status and last synced time', () => {
@@ -47,8 +48,9 @@ describe('RgwSyncMetadataInfoComponent', () => {
 
     const lastSyncedElement = fixture.debugElement.query(By.css('li.mt-4.fw-bold'));
     expect(lastSyncedElement.nativeElement.textContent).toContain('Last Synced:');
-    const lastSyncedTimestamp = fixture.debugElement.query(By.css('.badge-info'));
-    expect(lastSyncedTimestamp.nativeElement.textContent).toEqual('10 minutes ago');
+    const lastSyncedTimestamp = fixture.debugElement.query(By.css('cds-tag'));
+    expect(lastSyncedTimestamp.nativeElement.classList).toContain('tag-info');
+    expect(lastSyncedTimestamp.nativeElement.textContent.trim()).toEqual('10 minutes ago');
   });
 
   it('should display sync status in the popover', () => {
index fe6e074b72df2554ecacd78302860fc776e8414b..658594f5d3e1dd618abfa76366a578ae7d8304a2 100644 (file)
@@ -4,7 +4,7 @@
          [size]="icons.size20"
          class="cds-icon--size-07"></svg>
   </li>
-  <li class="badge badge-info mt-2">{{realm}}</li>
+  <li class="mt-2"><cds-tag class="tag-info">{{realm}}</cds-tag></li>
   <li>
     <svg [cdsIcon]="icons.down"
          class=" cds-icon--size-07"></svg>
@@ -13,7 +13,7 @@
     <i [ngClass]="[icons.large2x, icons.cubes]"
        class="mt-2"></i>
   </li>
-  <p class="badge badge-info mt-2">{{zonegroup}}</p>
+  <p class="mt-2"> <cds-tag class="tag-info">{{zonegroup}}</cds-tag></p>
   <li>
     <svg [cdsIcon]="icons.down"
          class="cds-icon--size-07"></svg>
@@ -23,5 +23,5 @@
          [size]="icons.size20"
          class="cds-icon--size-07 cds-icon"></svg>
   </li>
-  <li class="badge badge-info mt-2">{{zone}}</li>
+  <li class="mt-2"><cds-tag class="tag-info">{{zone}}</cds-tag></li>
 </ul>
index 1bce83fcc5a6f0c2225e5ec75ff0e85d9a97bf2c..16d1ea68cb339ac61f8ec7adddf1aa438e2d923d 100644 (file)
@@ -28,10 +28,10 @@ describe('RgwSyncPrimaryZoneComponent', () => {
     component.zone = 'Zone';
     fixture.detectChanges();
 
-    const realmBadge = fixture.debugElement.query(By.css('li:nth-child(2)'));
+    const realmBadge = fixture.debugElement.query(By.css('cds-tag.tag-info'));
     expect(realmBadge.nativeElement.textContent).toContain('Realm');
 
-    const zonegroupBadge = fixture.debugElement.query(By.css('p'));
+    const zonegroupBadge = fixture.debugElement.queryAll(By.css('cds-tag.tag-info'))[1];
     expect(zonegroupBadge.nativeElement.textContent).toContain('Zonegroup');
 
     const zoneBadge = fixture.debugElement.query(By.css('li:nth-child(8)'));
index 509b869d7153c162c3ec1695acb7c02e88823b36..fbff353737d97c65344fb263fe6b92c1eff29fc8 100644 (file)
@@ -50,14 +50,14 @@ export class DeviceListComponent implements OnChanges, OnInit {
         prop: 'state',
         name: $localize`State of Health`,
         flexGrow: 1,
-        cellTransformation: CellTemplate.badge,
+        cellTransformation: CellTemplate.tag,
         customTemplateConfig: {
           map: {
-            good: { value: $localize`Good`, class: 'badge-success' },
-            warning: { value: $localize`Warning`, class: 'badge-warning' },
-            bad: { value: $localize`Bad`, class: 'badge-danger' },
-            stale: { value: $localize`Stale`, class: 'badge-info' },
-            unknown: { value: $localize`Unknown`, class: 'badge-dark' }
+            good: { value: $localize`Good`, class: 'tag-success' },
+            warning: { value: $localize`Warning`, class: 'tag-warning' },
+            bad: { value: $localize`Bad`, class: 'tag-danger' },
+            stale: { value: $localize`Stale`, class: 'tag-info' },
+            unknown: { value: $localize`Unknown`, class: 'tag-dark' }
           }
         }
       },
index 91b51d8682b2f7a3885944003c86cab91bc859be..7236662e7cc1642d222baac9eaa70daa4c97b86b 100644 (file)
@@ -15,7 +15,8 @@ import {
   ModalModule,
   ToggleModule,
   ButtonModule,
-  PlaceholderModule
+  PlaceholderModule,
+  TagModule
 } from 'carbon-components-angular';
 
 import { AppRoutingModule } from '~/app/app-routing.module';
@@ -70,7 +71,8 @@ import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
     ModalModule,
     ToggleModule,
     ButtonModule,
-    PlaceholderModule
+    PlaceholderModule,
+    TagModule
   ],
   declarations: [
     AboutComponent,
index 68c0f081c20248426a06068c8f345428d3e21835..d6d19b35f38b38d2c6d322a36180a94f8d7ab6c1 100644 (file)
                             *ngIf="permissions.rbdMirroring.read && enabledFeature.mirroring"
                             class="tc_submenuitem tc_submenuitem_block_mirroring">
             <span i18n>Mirroring
-              <small *ngIf="summaryData?.rbd_mirroring?.warnings !== 0"
-                     class="badge badge-warning">{{ summaryData?.rbd_mirroring?.warnings }}</small>
-              <small *ngIf="summaryData?.rbd_mirroring?.errors !== 0"
-                     class="badge badge-danger">{{ summaryData?.rbd_mirroring?.errors }}</small>
+              <cds-tag *ngIf="summaryData?.rbd_mirroring?.warnings !== 0"
+                       class="tag-warning">
+                {{ summaryData?.rbd_mirroring?.warnings }}
+              </cds-tag>
+              <cds-tag *ngIf="summaryData?.rbd_mirroring?.errors !== 0"
+                       class="tag-danger">
+                {{ summaryData?.rbd_mirroring?.errors }}
+              </cds-tag>
             </span>
           </cds-sidenav-item>
           <cds-sidenav-item route="/block/iscsi"
                             class="tc_submenuitem tc_submenuitem_observe_monitoring">
             <span i18n>
               <ng-container>Alerts</ng-container>
-              <small *ngIf="prometheusAlertService.activeCriticalAlerts > 0"
-                     class="badge badge-danger ms-1">{{ prometheusAlertService.activeCriticalAlerts }}</small>
-              <small *ngIf="prometheusAlertService.activeWarningAlerts > 0"
-                     class="badge badge-warning ms-1">{{ prometheusAlertService.activeWarningAlerts }}</small>
+              <cds-tag *ngIf="prometheusAlertService.activeCriticalAlerts > 0"
+                     class="tag-danger ms-1">{{ prometheusAlertService.activeCriticalAlerts }}</cds-tag>
+              <cds-tag *ngIf="prometheusAlertService.activeWarningAlerts > 0"
+                     class="tag-warning ms-1">{{ prometheusAlertService.activeWarningAlerts }}</cds-tag>
             </span>
           </cds-sidenav-item>
         </cds-sidenav-menu>
index 5732c38d204ad1a33a8e4bac84cfeaf4dcc5e240..deb4bc366f9bfb9b366b10b8c45b20faef8f14ef 100644 (file)
@@ -9,7 +9,7 @@
     <svg [cdsIcon]="icons.deploy"
          [size]="icons.size20"
          ></svg>
-    <span class="badge badge-info">{{ cardTitle }}</span>
+    <cds-tag class="tag-info">{{ cardTitle }}</cds-tag>
   </h4>
   <h5 *ngIf="cardType === 'syncCards'"
       class="text-center card-title">
index 1e92028823c3eb0e4b449dd8836811c704ec44b4..72819d55298458084b987cf7d8735d64ff6762df 100644 (file)
@@ -1,12 +1,12 @@
-<span *ngIf="!key; else key_value"
-      class="badge badge-{{value}}"
-      ngClass="{{value | colorClassFromText}}"
-      [ngbTooltip]="tooltipText">
+<cds-tag *ngIf="!key; else key_value"
+         class="tags-{{value}}"
+         ngClass="{{value | colorClassFromText}}"
+         [ngbTooltip]="tooltipText">
   {{ value }}
-</span>
+</cds-tag>
 
 <ng-template #key_value>
-  <span class="badge badge-background-primary badge-{{key}}-{{value}}">
+  <cds-tag class="tag-background-primary badge-{{key}}-{{value}}">
         {{ key }}: {{ value }}
-  </span>
+  </cds-tag>
 </ng-template>
index fcbf2f9a458452b8b2a1518e8eb4bd06d62b6e3d..5b6ce6cde104232c90ead04b9e986bfd8394a3e5 100644 (file)
@@ -5,12 +5,12 @@ import { Pipe, PipeTransform } from '@angular/core';
 })
 export class ColorClassFromTextPipe implements PipeTransform {
   readonly cssClasses: string[] = [
-    'badge-cd-label-green',
-    'badge-cd-label-cyan',
-    'badge-cd-label-purple',
-    'badge-cd-label-light-blue',
-    'badge-cd-label-gold',
-    'badge-cd-label-light-green'
+    'tag-cd-label-green',
+    'tag-cd-label-cyan',
+    'tag-cd-label-purple',
+    'tag-cd-label-light-blue',
+    'tag-cd-label-gold',
+    'tag-cd-label-light-green'
   ];
 
   transform(text: string): string {
index 022b086e0890ce5e6bf7f8c2ab867cac7fb5bf58..a01f806999d56554be6482cbcac6f92e81fae409 100644 (file)
@@ -40,7 +40,8 @@ import {
   LayoutModule,
   TilesModule,
   PopoverModule,
-  InlineLoadingModule
+  InlineLoadingModule,
+  TagModule
 } from 'carbon-components-angular';
 import EditIcon from '@carbon/icons/es/edit/20';
 import CodeIcon from '@carbon/icons/es/code/16';
@@ -142,7 +143,8 @@ import CloseIcon from '@carbon/icons/es/close/16';
     LayoutModule,
     TilesModule,
     PopoverModule,
-    InlineLoadingModule
+    InlineLoadingModule,
+    TagModule
   ],
   declarations: [
     SparklineComponent,
index 331b3004040c6319e0ec8c199884cea18d67c19c..55b8e564c646e7d152a9a40017b90db51de32293 100644 (file)
 </cd-select>
 
 <span *ngFor="let dataItem of data">
-  <span class="badge badge-dark me-2">
+  <cds-tag class="tag-dark me-2">
     <span class="me-2">{{ dataItem }}</span>
-      <a  class="badge-remove"
+      <a  class="tags-remove"
           (click)="cdSelect.removeItem(dataItem)">
       <svg [cdsIcon]="icons.destroy"
            [size]="icons.size20"
            class="cds-white"></svg>
     </a>
-  </span>
+  </cds-tag>
 </span>
index e5401c70d15c6ded883a041a3586369c1451fa92..4abcd7ca69a28ed1eb18d6359a457edbf651cbda 100644 (file)
   </cd-table>
 </ng-container>
 
-<ng-template #badgeDictTpl
+<ng-template #tagDictTpl
              let-value="data.value">
   <span *ngFor="let instance of value | keyvalue; last as isLast">
-    <span class="badge badge-background-primary" >{{ instance.key }}: {{ instance.value }}</span>
+    <cds-tag class="tag-background-primary" >{{ instance.key }}: {{ instance.value }}</cds-tag>
     <ng-container *ngIf="!isLast">&nbsp;</ng-container>
   </span>
 </ng-template>
index 5640b5f5364de92c041932bac8847d6430a5681d..29bad1ba9e4abf65aea56d45f68573add01cc176 100644 (file)
@@ -24,8 +24,8 @@ import { BaseModal } from 'carbon-components-angular';
   styleUrls: ['./crud-table.component.scss']
 })
 export class CRUDTableComponent implements OnInit {
-  @ViewChild('badgeDictTpl')
-  public badgeDictTpl: TemplateRef<any>;
+  @ViewChild('tagDictTpl')
+  public tagDictTpl: TemplateRef<any>;
   @ViewChild('dateTpl')
   public dateTpl: TemplateRef<any>;
   @ViewChild('durationTpl')
@@ -89,7 +89,7 @@ export class CRUDTableComponent implements OnInit {
         );
     this.permission = this.permissions[toCamelCase(meta.permissions[0])];
     const templates = {
-      badgeDict: this.badgeDictTpl,
+      badgeDict: this.tagDictTpl,
       date: this.dateTpl,
       duration: this.durationTpl
     };
index 4a52fde29d2b24430d6ea5237065fa6ac776af98..044f586aa754cb29f1b538b1f3f5a1607fd595d7 100644 (file)
   <span *ngIf="row.cdExecuting"
         [ngClass]="column?.customTemplateConfig?.executingClass ? column?.customTemplateConfig.executingClass : 'text-muted italic'">({{ row.cdExecuting }})</span>
 </ng-template>
-
 <ng-template #classAddingTpl
              let-value="data.value">
-  <span class="{{ value | pipeFunction:useCustomClass:this }}">{{ value }}</span>
+  <span *ngIf="value">
+    <span *ngIf="!(value=='active')||(value=='expired')||(value=='pending')">
+      {{ value }}
+    </span>
+    <cds-tag *ngIf="(value==='active')||(value=== 'expired')||(value=== 'pending')"
+             class="{{ value | pipeFunction:useCustomClass:this }}">
+       {{value}}
+    </cds-tag>
+  </span>
 </ng-template>
-
-<ng-template #badgeTpl
+<ng-template #tagTpl
              let-column="data.column"
              let-value="data.value">
   <span *ngFor="let item of (value | array); last as last">
-    <span class="badge"
-          [ngClass]="(column?.customTemplateConfig?.map && column?.customTemplateConfig?.map[item]?.class) ? column.customTemplateConfig.map[item].class : (column?.customTemplateConfig?.class ? column.customTemplateConfig.class : 'badge-primary')"
-          *ngIf="(column?.customTemplateConfig?.map && column?.customTemplateConfig?.map[item]?.value) ? column.customTemplateConfig.map[item].value : column?.customTemplateConfig?.prefix ? column.customTemplateConfig.prefix + item : item">
-      {{ (column?.customTemplateConfig?.map && column?.customTemplateConfig?.map[item]?.value) ? column.customTemplateConfig.map[item].value : column?.customTemplateConfig?.prefix ? column.customTemplateConfig.prefix + item : item }}
-    </span>
+    <cds-tag [size]="'md'"
+             class="table-tag"
+             [class]="(column?.customTemplateConfig?.map && column?.customTemplateConfig?.map[item]?.class) ? column.customTemplateConfig.map[item].class : (column?.customTemplateConfig?.class ? column.customTemplateConfig.class : 'tags-primary')"
+             *ngIf="(column?.customTemplateConfig?.map && column?.customTemplateConfig?.map[item]?.value) ? column.customTemplateConfig.map[item].value : column?.customTemplateConfig?.prefix ? column.customTemplateConfig.prefix + item : item">
+      {{(column?.customTemplateConfig?.map && column?.customTemplateConfig?.map[item]?.value) ? column.customTemplateConfig.map[item].value : column?.customTemplateConfig?.prefix ? column.customTemplateConfig.prefix + item : item }}
+    </cds-tag>
     <span *ngIf="!last">&nbsp;</span>
   </span>
 </ng-template>
              let-column="data.column"
              let-value="data.value">
   <span *ngFor="let item of (value | array);">
-    <span
+    <cds-tag
       i18n
       i18n-ngbTooltip
       class="{{(column?.customTemplateConfig?.map && column?.customTemplateConfig?.map[item]?.class) ? column.customTemplateConfig.map[item].class : ''}}"
       ngbTooltip="{{(column?.customTemplateConfig?.map && column?.customTemplateConfig?.map[item]?.tooltip) ? column.customTemplateConfig.map[item].tooltip : ''}}">
       {{value}}
-    </span>
+  </cds-tag>
   </span>
 </ng-template>
 
index d1a943d22730f76db073db5f02f01476f76efe5d..73f272639987a78b16a3ac3b88674394aab6d743 100644 (file)
@@ -107,3 +107,7 @@ tr .edit-btn {
 tr:hover .edit-btn {
   opacity: 1;
 }
+
+.table-tag {
+  white-space: nowrap;
+}
index 35afd964ae3cc85edcfd734f7f1ef2bdf947fe30..949ba54007297edc4506e70369e14ff063667453 100644 (file)
@@ -740,7 +740,7 @@ describe('TableComponent', () => {
   describe('useCustomClass', () => {
     beforeEach(() => {
       component.customCss = {
-        'badge badge-danger': 'active',
+        'tag-danger': 'active',
         'secret secret-number': 123.456,
         btn: (v) => _.isString(v) && v.startsWith('http'),
         secure: (v) => _.isString(v) && v.startsWith('https')
@@ -759,7 +759,7 @@ describe('TableComponent', () => {
     });
 
     it('should match a string and return the corresponding class', () => {
-      expect(component.useCustomClass('active')).toBe('badge badge-danger');
+      expect(component.useCustomClass('active')).toBe('tag-danger');
     });
 
     it('should match a number and return the corresponding class', () => {
index e1980a2798b1dbe818b857db59f556aadf56832b..86c105ec64b729f675c353083f0c220b8dfa3e1b 100644 (file)
@@ -64,8 +64,8 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
   executingTpl: TemplateRef<any>;
   @ViewChild('classAddingTpl', { static: true })
   classAddingTpl: TemplateRef<any>;
-  @ViewChild('badgeTpl', { static: true })
-  badgeTpl: TemplateRef<any>;
+  @ViewChild('tagTpl', { static: true })
+  tagTpl: TemplateRef<any>;
   @ViewChild('mapTpl', { static: true })
   mapTpl: TemplateRef<any>;
   @ViewChild('truncateTpl', { static: true })
@@ -854,7 +854,7 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
     this.cellTemplates.perSecond = this.perSecondTpl;
     this.cellTemplates.executing = this.executingTpl;
     this.cellTemplates.classAdding = this.classAddingTpl;
-    this.cellTemplates.badge = this.badgeTpl;
+    this.cellTemplates.tag = this.tagTpl;
     this.cellTemplates.map = this.mapTpl;
     this.cellTemplates.truncate = this.truncateTpl;
     this.cellTemplates.timeAgo = this.timeAgoTpl;
index 3edf3669ba057f1bf064d85773b1d41e8319eb12..15a409cccdd6b292439f09ea2d9c23169efdfd56 100644 (file)
@@ -20,7 +20,7 @@ export enum CellTemplate {
   // supports an optional custom configuration:
   // {
   //   ...
-  //   cellTransformation: CellTemplate.badge,
+  //   cellTransformation: CellTemplate.tag,
   //   customTemplateConfig: {
   //     class?: string; // Additional class name.
   //     prefix?: any;   // Prefix of the value to be displayed.
@@ -30,7 +30,7 @@ export enum CellTemplate {
   //     }
   //   }
   // }
-  badge = 'badge',
+  tag = 'tag',
   // Maps the value using the given dictionary.
   // {
   //   ...
index 54e72792126fe85a05eae345f2781962a52be29f..148272d946a13889bcf7548eeeae0542590ad4fe 100644 (file)
@@ -29,28 +29,28 @@ export class OctalToHumanReadablePipe implements PipeTransform {
     if (fileType !== 'directory') {
       permissionSummary.push({
         content: fileType,
-        class: 'badge-primary me-1'
+        class: 'tag-primary me-1'
       });
     }
 
     if (owner !== '---') {
       permissionSummary.push({
         content: `owner: ${owner}`,
-        class: 'badge-primary me-1'
+        class: 'tag-primary me-1'
       });
     }
 
     if (group !== '---') {
       permissionSummary.push({
         content: `group: ${group}`,
-        class: 'badge-primary me-1'
+        class: 'tag-primary me-1'
       });
     }
 
     if (others !== '---') {
       permissionSummary.push({
         content: `others: ${others}`,
-        class: 'badge-primary me-1'
+        class: 'tag-primary me-1'
       });
     }
 
@@ -58,7 +58,7 @@ export class OctalToHumanReadablePipe implements PipeTransform {
       return [
         {
           content: 'no permissions',
-          class: 'badge-warning me-1',
+          class: 'tag-warning me-1',
           toolTip: `owner: ${owner}, group: ${group}, others: ${others}`
         }
       ];
index cb38072b712a9c91ab14d60b4b92a26a5e2ab707..a3ea809897c1a09331a61da5fbda4676c41d7d46 100644 (file)
@@ -1,6 +1,7 @@
 /* You can add global styles to this file, and also import other style files */
 @use './src/styles/defaults' as *;
 @use '@carbon/charts/styles.css' as *;
+@use '@carbon/colors';
 
 @import './src/styles/carbon-defaults.scss';
 
@@ -87,57 +88,58 @@ $grid-breakpoints: (
   }
 }
 
-// Custom badges.
-.badge-background-gray,
-.badge-hdd {
-  background-color: $gray-600;
-  color: $white;
+// Custom tag.
+
+.tag-background-gray,
+.tag-hdd {
+  background-color: colors.$gray-60;
+  color: colors.$white;
 }
 
-.badge-background-primary,
-.badge-ssd {
+.tag-background-primary,
+.tag-ssd {
   background-color: $primary;
-  color: $white;
+  color: colors.$white;
 }
 
-.badge-tab {
+.tag-tab {
   background-color: $gray-200;
   color: $gray-700;
 }
 
-.badge-cd-label-green {
+.tag-cd-label-green {
   background-color: $green-300;
   color: $white;
 }
 
-.badge-cd-label-cyan {
+.tag-cd-label-cyan {
   background-color: $cyan-300;
   color: $white;
 }
 
-.badge-cd-label-purple {
+.tag-cd-label-purple {
   background-color: $purple-300;
   color: $white;
 }
 
-.badge-cd-label-light-blue {
+.tag-cd-label-light-blue {
   background-color: $light-blue-300;
   color: $white;
 }
 
-.badge-cd-label-gold {
+.tag-cd-label-gold {
   background-color: $gold-300;
   color: $white;
 }
 
-.badge-cd-label-light-green {
+.tag-cd-label-light-green {
   background-color: $light-green-300;
   color: $white;
   font-weight: bolder;
 }
 
 // Other
-tags-input .tags {
+tag-input .tag {
   border: 1px solid $gray-400;
   border-radius: 4px;
   box-shadow: inset 0 1px 1px rgba($black, 0.09);
@@ -166,42 +168,9 @@ a.btn-light {
   text-decoration: none;
 }
 
-// Overrides the badge to rounded-pill
-.badge {
-  @extend .badge, .mb-1;
-}
-
-// Overriding badges to match the class name of badges in Bootstrap v5
-.badge-primary {
-  @extend .badge, .bg-primary;
-}
-
-.badge-secondary {
-  @extend .badge, .bg-secondary;
-}
-
-.badge-success {
-  @extend .badge, .bg-success;
-}
-
-.badge-danger {
-  @extend .badge, .bg-danger;
-}
-
-.badge-info {
-  @extend .badge, .bg-primary;
-}
-
-.badge-warning {
-  @extend .badge, .bg-warning, .text-dark;
-}
-
-.badge-light {
-  @extend .badge, .bg-light, .text-dark;
-}
-
-.badge-dark {
-  @extend .badge, .bg-dark;
+// Overrides the tags to rounded-pill
+.tag {
+  @extend .tag, .mb-1;
 }
 
 formly-form {
index 2ddf98af8ea42588cfcaf7a20aa52dd426447228..a6bb37c823deafc79c7437c688643c976d2bf038 100644 (file)
@@ -38,6 +38,10 @@ Custom theme
 ******************************************/
 @forward './themes/content';
 
+//Importing carbon tags token
+
+@use '@carbon/styles/scss/components/tag/tokens' as tag-tokens;
+
 /******************************************
 Datatable
 ******************************************/
@@ -66,6 +70,54 @@ th {
   padding-block: 0 !important;
 }
 
+/******************************************
+ Tags
+******************************************/
+.tag-success {
+  background-color: theme.$support-success;
+  color: colors.$white;
+}
+
+.tag-warning {
+  background: theme.$support-warning;
+  color: colors.$white;
+}
+
+.tag-danger {
+  background: theme.$support-error;
+  color: colors.$white;
+}
+
+.tag-primary {
+  background: vv.$primary;
+  color: colors.$white;
+}
+
+.tag-secondary {
+  background: tag-tokens.$tag-color-warm-gray;
+  color: colors.$white;
+}
+
+.tag-info {
+  background-color: vv.$primary;
+  color: colors.$white;
+}
+
+.tag-light {
+  background: colors.$white;
+  border: tag-tokens.$tag-color-gray;
+}
+
+.tag-dark {
+  background: tag-tokens.$tag-color-cool-gray;
+  color: colors.$white;
+}
+
+.tag-default {
+  background: tag-tokens.$tag-border-gray;
+  color: colors.$white;
+}
+
 /******************************************
 Side nav
 ******************************************/
index 9e4d3794c0aee2e1f143ac3078fe06aefd66a9d7..715c8ede66de4011cdade7096991c8b8448eb38e 100644 (file)
@@ -80,7 +80,7 @@
   @extend .btn-light;
 }
 
-.btn-primary .badge {
+.btn-primary .tag {
   background-color: vv.$gray-200;
   color: vv.$primary;
 }