]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: carbonize smb tabs 62543/head
authorPedro Gonzalez Gomez <pegonzal@redhat.com>
Thu, 27 Mar 2025 10:46:04 +0000 (11:46 +0100)
committerPedro Gonzalez Gomez <pegonzal@redhat.com>
Wed, 2 Apr 2025 14:59:50 +0000 (16:59 +0200)
also removes share tab as was the only one in favour of title and description

Fixes: https://tracker.ceph.com/issues/70695
Signed-off-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-cluster-list/smb-cluster-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-cluster-tabs/smb-cluster-tabs.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-cluster-tabs/smb-cluster-tabs.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-join-auth-list/smb-join-auth-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-list/smb-share-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-usersgroups-list/smb-usersgroups-list.component.html
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.ts
src/pybind/mgr/dashboard/frontend/src/styles/_carbon-defaults.scss

index 269152a257ee6fb67eb882c10136461ad7d16c2e..3417d30adb62b57a343e66c9e594c12c3adc5f28 100644 (file)
@@ -1,5 +1,7 @@
 <ng-container *ngIf="smbClusters$ | async as smbClusters">
   <cd-table
+    headerTitle="Clusters"
+    headerDescription="Logical management units that may map to one or more managed Samba service"
     [data]="smbClusters"
     columnMode="flex"
     [columns]="columns"
index b729c89a847055a8ec66c761c27de5d2bb593d89..e57a5b92eeabfc09f0e7f28dc903e4adfe7e88d4 100644 (file)
@@ -1,15 +1,5 @@
 <ng-container *ngIf="selection">
-  <cds-tabs
-    type="contained"
-    followFocus="true"
-    isNavigation="true"
-    cacheActive="true">
-  <cds-tab
-    heading="Shares"
-    i18n-heading>
-    <cd-smb-share-list
-      [clusterId]="selection.cluster_id"
-    ></cd-smb-share-list>
-  </cds-tab>
-  </cds-tabs>
+  <cd-smb-share-list
+    [clusterId]="selection.cluster_id"
+  ></cd-smb-share-list>
 </ng-container>
index c9c8bb9c52423c4df853c008591c88fc20e48f04..0f1dc6cc8529d91b52fb0ca8b1ad74ebd3c11cd7 100644 (file)
@@ -1,8 +1,6 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { SmbClusterTabsComponent } from './smb-cluster-tabs.component';
-import { CLUSTER_RESOURCE, SMBCluster } from '../smb.model';
-import { By } from '@angular/platform-browser';
 
 describe('SmbClusterTabsComponent', () => {
   let component: SmbClusterTabsComponent;
@@ -21,29 +19,4 @@ describe('SmbClusterTabsComponent', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
-
-  it('should not render anything if selection is falsy', () => {
-    component.selection = null;
-    fixture.detectChanges();
-
-    const tabsElement = fixture.debugElement.query(By.css('cds-tabs'));
-    expect(tabsElement).toBeNull();
-  });
-
-  const selectedSmbCluster = (clusterId: string) => {
-    const smbCluster: SMBCluster = {
-      resource_type: CLUSTER_RESOURCE,
-      cluster_id: clusterId,
-      auth_mode: 'user'
-    };
-    return smbCluster;
-  };
-
-  it('should render cds-tabs if selection is truthy', () => {
-    component.selection = selectedSmbCluster('fooBar');
-    fixture.detectChanges();
-
-    const tabsElement = fixture.debugElement.query(By.css('cds-tabs'));
-    expect(tabsElement).toBeTruthy();
-  });
 });
index 56ee93b88da744ce0b612bacc7bdb64e491ef748..3f3da5e1e09eeda06c6c40458ebb4b55e7523361 100644 (file)
@@ -1,4 +1,6 @@
 <cd-table
+  headerTitle="Active directory access resources"
+  headerDescription="Logical management units for authorization on active directory (AD) servers"
   [data]="joinAuth$ | async"
   columnMode="flex"
   [columns]="columns"
index cc41f447ead59e462c306d35405c01e548e76ede..0363545f2291394e2b6c4a302867e4a910508c07 100644 (file)
@@ -1,5 +1,7 @@
 <ng-container *ngIf="smbShares$ | async as smbShares">
   <cd-table
+    headerTitle="Shares"
+    headerDescription="Logical unit hosted by the cluster that maps to the given CephFS volume and path"
     [data]="smbShares"
     columnMode="flex"
     [columns]="columns"
index bce02b277d0b06dd3a8ade35439ec6586256a4e5..03f2fbce5f806c365599388d5f0cc1a76a405789 100644 (file)
@@ -1,33 +1,3 @@
-<legend
-  *ngIf="selectedTab == Tabs.clusters"
-  i18n
->
-  Clusters
-  <cd-help-text>
-    Logical management units that may map to one or more managed Samba service
-  </cd-help-text>
-</legend>
-
-<legend
-  *ngIf="selectedTab == Tabs.joinAuths"
-  i18n
->
-  Active directory access resources
-  <cd-help-text>
-    Logical management units for authorization on active directory (AD) servers
-  </cd-help-text>
-</legend>
-
-<legend
-  *ngIf="selectedTab == Tabs.usersgroups"
-  i18n
->
-  Standalone access resources
-  <cd-help-text>
-    Logical management units for authorization on Standalone servers
-  </cd-help-text>
-</legend>
-
 <cds-tabs
   type="contained"
   followFocus="true"
index b0119dbe4392ae724bfd82012736506c4559a2ff..9d5ab9d98fe6dd285dad2efbb47cc6fa945ec72d 100644 (file)
@@ -1,5 +1,7 @@
 <ng-container *ngIf="usersGroups$ | async as usersGroups">
   <cd-table
+    headerTitle="Standalone access resoruces"
+    headerDescription="Logical management units for authorization on Standalone servers"
     [data]="usersGroups"
     columnMode="flex"
     [columns]="columns"
index 27750814d96fea693f1327fe1eda25c35621cc81..971bd96a4abffdb04f24d681307bb7edf348bf42 100644 (file)
@@ -1,6 +1,17 @@
 <cds-table-container [cdsLayer]="layer"
                      [cdsTheme]="theme"
                      class="content-theme">
+  <cds-table-header *ngIf="headerTitle">
+    <h4 cdsTableHeaderTitle
+        i18n>
+      {{headerTitle}}
+    </h4>
+    <p cdsTableHeaderDescription
+       i18n
+       *ngIf="headerDescription">
+      {{headerDescription}}
+    </p>
+  </cds-table-header>
   <cds-table-toolbar #toolbar
                      *ngIf="toolHeader"
                      (cancel)="onBatchActionsCancel()"
index 6ca4378b126c3fa8c27e0d42f2fe12ebba8fc82e..787d0417331240c2410063bee3df2f38d036a772 100644 (file)
@@ -89,6 +89,10 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
   @ContentChild(TableDetailDirective) rowDetail!: TableDetailDirective;
   @ContentChild(TableActionsComponent) tableActions!: TableActionsComponent;
 
+  @Input()
+  headerTitle: string;
+  @Input()
+  headerDescription: string;
   // This is the array with the items to be shown.
   @Input()
   data: any[];
index 1282af5daa0ef5ca267f3171a378c4f7aa592985..61ad991178a7a19375b75221ebb2dca469fb5253 100644 (file)
@@ -157,6 +157,7 @@ Tooltip
 .cds--tooltip-content {
   background-color: theme.$layer-02;
 }
+
 /******************************************
 Carbon Popover
 ******************************************/
@@ -165,3 +166,10 @@ Carbon Popover
   max-height: layout.$spacing-13;
   overflow: auto;
 }
+
+/******************************************
+Tabs
+******************************************/
+.cds--tab-content {
+  background: var(--cds-layer-01);
+}