]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tentacle mgr/dashboard: replace bootstrap badges with carbon tags 66350/head
authorpujaoshahu <pshahu@redhat.com>
Wed, 16 Oct 2024 15:57:58 +0000 (21:27 +0530)
committerpujashahu <pshahu@redhat.com>
Thu, 4 Dec 2025 07:59:12 +0000 (13:29 +0530)
Fixes: https://tracker.ceph.com/issues/68252
Signed-off-by: pujaoshahu <pshahu@redhat.com>
(cherry picked from commit a0da67cb7f0e6066cb1fd0ba164564dc13bb688b)

  Conflicts:
        src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.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/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/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/datatable/table/table.component.scss
        src/pybind/mgr/dashboard/frontend/src/styles.scss

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 eb620e028a5a72479f010690d686eb9f2318075a..a45e767f14358206cd7b88b5a09eeb177e3f6f0f 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 1eefd77f7c7242d07b5c16d7aa0a7cfe2a6b47fe..6240c0c9fea597c5dea5fc49c42ad27d21106c79 100644 (file)
@@ -60,7 +60,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 ba930c549865ca1a284002b5a9314235ab00b99e..66c0b781117aa9ddec2c76b9b4d4d6c4051e295b 100644 (file)
@@ -64,7 +64,8 @@ import {
   SelectModule,
   UIShellModule,
   TreeviewModule,
-  TabsModule
+  TabsModule,
+  TagModule
 } from 'carbon-components-angular';
 
 // Icons
@@ -99,7 +100,8 @@ import Reset from '@carbon/icons/es/reset/32';
     ModalModule,
     DatePickerModule,
     ComboBoxModule,
-    TabsModule
+    TabsModule,
+    TagModule
   ],
   declarations: [
     RbdListComponent,
index b137051d0ae42a0c347508dc9635583871b4c285..0a16fa280e9f44b6ea3c2d8fb985ab303c956037 100644 (file)
       <i [class]="node?.cdIcon"></i>
       <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 8b8b9c4e55179e5157634ef4c703fb68dc146c1c..94906d0e88a736df4e76db0381efabfea498a0a4 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 472a1cf32eaaaf9f58ed201b19209693cdd3dc81..256f0df1c0466c83c8bfeeb179cab0301fd49d24 100644 (file)
@@ -46,9 +46,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 bfe66c864b3785bec641d9176ac8923071da4d13..c5d46bb677012f2f40f017c0d442fde9bb469f4f 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 6a3c46ed10210b2b9e4f7c13fb2a84fcb2ab40c4..14970328e11b1bb129826dfaa69bedd292541636 100644 (file)
@@ -81,7 +81,6 @@ import { MultiClusterFormComponent } from './multi-cluster/multi-cluster-form/mu
 import { MultiClusterListComponent } from './multi-cluster/multi-cluster-list/multi-cluster-list.component';
 import { DashboardV3Module } from '../dashboard-v3/dashboard-v3.module';
 import { MultiClusterDetailsComponent } from './multi-cluster/multi-cluster-details/multi-cluster-details.component';
-import { TextLabelListComponent } from '~/app/shared/components/text-label-list/text-label-list.component';
 
 @NgModule({
   imports: [
@@ -115,8 +114,7 @@ import { TextLabelListComponent } from '~/app/shared/components/text-label-list/
     ListModule,
     ToggletipModule,
     IconModule,
-    TagModule,
-    TextLabelListComponent
+    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 95e51662b769f65856958284daec453b5b16749e..6fde1d6c86c1c48bf918e2cb5586d0df07e154da 100644 (file)
@@ -27,7 +27,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 670163dd909bec7982a79770f31ce0e27b0c51df..873d2e39749a84f9beb7c2aadb6f095bc2313b33 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 33505ac596efd8fce3ad30c0debc1edd1524427a..1fed1f924d40790d2cff3fc7d685c30e699aaa27 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 7ef576d4626baf0dfd091722ac9869039de3d86b..09675e5fa3d4498156161896241f8b34bbe3386f 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'">
       <i [ngClass]="[icons.infoCircle]"
          aria-hidden="true"></i>
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 19e0ba911dd3707dadaa6613124ee763c46a6655..9ab652fc52979277647bc819157b10c4a34573f5 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 d9dd45e87a40898c8581f3dcd4601dd466ba68f0..85bbc370944bb23f4280d00535d255cf02fb6ccb 100644 (file)
                 <i [ngClass]="node?.data?.icon"></i>
                 {{ 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 970a4d90a403631f8f28b0f0a402d3dd6ebf6450..0a2e72afcb0b2e205ab28341b4c671df1ade567c 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">
@@ -46,6 +47,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 5ec927071f8b3c588dd52161054eb65c6a16953e..c9d6e14a22fca33c48268dd51c77aa98a3fcf69c 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 f0e0457d944d87328cdd4a19940f096a3cc69f7b..fb98a0fdcb6e2a237005b1b6e711fea58c0fb6c5 100644 (file)
@@ -1,15 +1,39 @@
+
 <ul class="pb-5">
-  <li><i [ngClass]="[icons.large2x, icons.reweight]"
-         class="pt-2"></i></li>
-  <li class="badge badge-info mt-2">{{realm}}</li>
-  <li><i [ngClass]="[icons.large2x, icons.down]"
-         class="mt-2"></i></li>
-  <li><i [ngClass]="[icons.large2x, icons.cubes]"
-         class="mt-2"></i></li>
-  <p class="badge badge-info mt-2">{{zonegroup}}</p>
-  <li><i [ngClass]="[icons.large2x, icons.down]"
-         class="mt-2"></i></li>
-  <li><i [ngClass]="[icons.large2x, icons.deploy]"
-         class="mt-2"></i></li>
-  <li class="badge badge-info mt-2">{{zone}}</li>
+  <li>
+    <i [ngClass]="[icons.large2x, icons.reweight]"
+       class="pt-2"></i>
+  </li>
+
+  <li class="mt-2">
+    <cds-tag class="tag-info">{{ realm }}</cds-tag>
+  </li>
+
+  <li>
+    <i [ngClass]="[icons.large2x, icons.down]"
+       class="mt-2"></i>
+  </li>
+
+  <li>
+    <i [ngClass]="[icons.large2x, icons.cubes]"
+       class="mt-2"></i>
+  </li>
+
+  <li class="mt-2">
+    <cds-tag class="tag-info">{{ zonegroup }}</cds-tag>
+  </li>
+
+  <li>
+    <i [ngClass]="[icons.large2x, icons.down]"
+       class="mt-2"></i>
+  </li>
+
+  <li>
+    <i [ngClass]="[icons.large2x, icons.deploy]"
+       class="mt-2"></i>
+  </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 0b6eaa8d531b025468e56c6034c0182a31a0e656..994575f3b2fab98f88f111c241d059a8d3d0df14 100644 (file)
@@ -12,7 +12,8 @@ import {
   DialogModule,
   GridModule,
   BreadcrumbModule,
-  ModalModule
+  ModalModule,
+  TagModule
 } from 'carbon-components-angular';
 
 import { AppRoutingModule } from '~/app/app-routing.module';
@@ -61,7 +62,8 @@ import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
     DialogModule,
     GridModule,
     BreadcrumbModule,
-    ModalModule
+    ModalModule,
+    TagModule
   ],
   declarations: [
     AboutComponent,
index e81e5dad0ecffdf2291256a8ab3dc6bf116182cf..31160159b7832e4a6e0022bfeae0aeb57bb10133 100644 (file)
                             class="tc_submenuitem tc_submenuitem_block_mirroring">
             <span i18n>Mirroring
               <cds-tag *ngIf="summaryData?.rbd_mirroring?.warnings !== 0"
-                       class="tag-warning content-theme">
+                       class="tag-warning">
                 {{ summaryData?.rbd_mirroring?.warnings }}
               </cds-tag>
               <cds-tag *ngIf="summaryData?.rbd_mirroring?.errors !== 0"
-                       class="tag-danger content-theme">
+                       class="tag-danger">
                 {{ summaryData?.rbd_mirroring?.errors }}
               </cds-tag>
             </span>
             <span i18n>
               <ng-container>Alerts</ng-container>
               <cds-tag *ngIf="prometheusAlertService.activeCriticalAlerts > 0"
-                     class="tag-danger ms-1 content-theme">{{ prometheusAlertService.activeCriticalAlerts }}</cds-tag>
+                     class="tag-danger ms-1">{{ prometheusAlertService.activeCriticalAlerts }}</cds-tag>
               <cds-tag *ngIf="prometheusAlertService.activeWarningAlerts > 0"
-                     class="tag-warning ms-1 content-theme">{{ prometheusAlertService.activeWarningAlerts }}</cds-tag>
+                     class="tag-warning ms-1">{{ prometheusAlertService.activeWarningAlerts }}</cds-tag>
             </span>
           </cds-sidenav-item>
         </cds-sidenav-menu>
index 60c0af60306dcb6b5f0934a9fbb6766128c61877..deb4bc366f9bfb9b366b10b8c45b20faef8f14ef 100644 (file)
@@ -6,8 +6,10 @@
   </h4>
   <h4 *ngIf="cardType === 'zone'"
       class="text-center mt-4 mb-0">
-    <i [ngClass]="icons.deploy"></i>
-    <span class="badge badge-info">{{ cardTitle }}</span>
+    <svg [cdsIcon]="icons.deploy"
+         [size]="icons.size20"
+         ></svg>
+    <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 b0566c7319ccb2498639e7c0f41c1bb190cdf4fd..96f6d52fd9ef94190f037d20f6ae733b36fb9f2a 100644 (file)
@@ -36,7 +36,8 @@ import {
   SelectModule,
   ComboBoxModule,
   ProgressIndicatorModule,
-  InlineLoadingModule
+  InlineLoadingModule,
+  TagModule
 } from 'carbon-components-angular';
 
 import { MotdComponent } from '~/app/shared/components/motd/motd.component';
@@ -125,7 +126,8 @@ import { IconComponent } from './icon/icon.component';
     ComboBoxModule,
     ProgressIndicatorModule,
     BaseChartDirective,
-    InlineLoadingModule
+    InlineLoadingModule,
+    TagModule
   ],
   declarations: [
     SparklineComponent,
index 5351000836f7d16f10fe1787a23ecd3440ae2d3e..5c486f36bd76381f52e6516198c1ef0477d8d9fb 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"
-       (click)="cdSelect.removeItem(dataItem)">
-      <i [ngClass]="[icons.destroy]"
-         aria-hidden="true"></i>
+      <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 9c7981ff9a9cbbd06e24a8783575b28e50c98580..db4b5c1fb7c5042b932d08a64a178fab3cbaf6d2 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 c93fe19d84c9caeeaf01c287c1b994990d37e979..6919637d492fdb3098a0cb8bc968dbede87134f9 100644 (file)
@@ -102,3 +102,15 @@ $scrollbar-track-color: transparent;
 .scrollable-expanded-row::-webkit-scrollbar-track {
   background: transparent;
 }
+
+tr .edit-btn {
+  opacity: 0;
+}
+
+tr:hover .edit-btn {
+  opacity: 1;
+}
+
+.table-tag {
+  white-space: nowrap;
+}
index bf9240938f29a6cce2da9a8151014dbcaabce769..249607ea36ef199013fecdb693d3090b6cfb2643 100644 (file)
@@ -675,7 +675,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')
@@ -694,7 +694,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 aa0ba0f6aff7fdb454753aaaec3ebb155fcc0151..5209574f34d9850233990bc5aca356cf1b86acd8 100644 (file)
@@ -61,8 +61,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 })
@@ -829,7 +829,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 bda66f6004e6a44731cad177af3d87ac84dff18b..f7d11449e9275e41cae7b37e6a6774f3230b3c13 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 b45f6035561b691a4e469e9f78dd755750a70b32..5f4055d939b9c04c95c0ba7fea12bc28cada5e20 100644 (file)
@@ -1,5 +1,6 @@
 /* You can add global styles to this file, and also import other style files */
 @use './src/styles/defaults' as *;
+@use '@carbon/colors';
 @import './src/styles/carbon-defaults.scss';
 
 // Fork-Awesome
@@ -86,57 +87,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);
@@ -165,42 +167,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 32b13c08012b3e22f4eac686f561b9957467a9ef..1773658e78bde528ea258b77a1c8dd6d64d55680 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
 ******************************************/
@@ -67,6 +71,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;
 }