Skip to content

Commit 7769a6e

Browse files
authored
Merge pull request ceph#62543 from rhcs-dashboard/smb-carbonize-tabs
mgr/dashboard: carbonize smb tabs Reviewed-by: Nizamudeen A <[email protected]>
2 parents ec76428 + 06b161d commit 7769a6e

File tree

10 files changed

+34
-70
lines changed

10 files changed

+34
-70
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-cluster-list/smb-cluster-list.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<ng-container *ngIf="smbClusters$ | async as smbClusters">
22
<cd-table
3+
headerTitle="Clusters"
4+
headerDescription="Logical management units that may map to one or more managed Samba service"
35
[data]="smbClusters"
46
columnMode="flex"
57
[columns]="columns"
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
<ng-container *ngIf="selection">
2-
<cds-tabs
3-
type="contained"
4-
followFocus="true"
5-
isNavigation="true"
6-
cacheActive="true">
7-
<cds-tab
8-
heading="Shares"
9-
i18n-heading>
10-
<cd-smb-share-list
11-
[clusterId]="selection.cluster_id"
12-
></cd-smb-share-list>
13-
</cds-tab>
14-
</cds-tabs>
2+
<cd-smb-share-list
3+
[clusterId]="selection.cluster_id"
4+
></cd-smb-share-list>
155
</ng-container>
Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
22

33
import { SmbClusterTabsComponent } from './smb-cluster-tabs.component';
4-
import { CLUSTER_RESOURCE, SMBCluster } from '../smb.model';
5-
import { By } from '@angular/platform-browser';
64

75
describe('SmbClusterTabsComponent', () => {
86
let component: SmbClusterTabsComponent;
@@ -21,29 +19,4 @@ describe('SmbClusterTabsComponent', () => {
2119
it('should create', () => {
2220
expect(component).toBeTruthy();
2321
});
24-
25-
it('should not render anything if selection is falsy', () => {
26-
component.selection = null;
27-
fixture.detectChanges();
28-
29-
const tabsElement = fixture.debugElement.query(By.css('cds-tabs'));
30-
expect(tabsElement).toBeNull();
31-
});
32-
33-
const selectedSmbCluster = (clusterId: string) => {
34-
const smbCluster: SMBCluster = {
35-
resource_type: CLUSTER_RESOURCE,
36-
cluster_id: clusterId,
37-
auth_mode: 'user'
38-
};
39-
return smbCluster;
40-
};
41-
42-
it('should render cds-tabs if selection is truthy', () => {
43-
component.selection = selectedSmbCluster('fooBar');
44-
fixture.detectChanges();
45-
46-
const tabsElement = fixture.debugElement.query(By.css('cds-tabs'));
47-
expect(tabsElement).toBeTruthy();
48-
});
4922
});

src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-join-auth-list/smb-join-auth-list.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<cd-table
2+
headerTitle="Active directory access resources"
3+
headerDescription="Logical management units for authorization on active directory (AD) servers"
24
[data]="joinAuth$ | async"
35
columnMode="flex"
46
[columns]="columns"

src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-list/smb-share-list.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<ng-container *ngIf="smbShares$ | async as smbShares">
22
<cd-table
3+
headerTitle="Shares"
4+
headerDescription="Logical unit hosted by the cluster that maps to the given CephFS volume and path"
35
[data]="smbShares"
46
columnMode="flex"
57
[columns]="columns"

src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.html

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,3 @@
1-
<legend
2-
*ngIf="selectedTab == Tabs.clusters"
3-
i18n
4-
>
5-
Clusters
6-
<cd-help-text>
7-
Logical management units that may map to one or more managed Samba service
8-
</cd-help-text>
9-
</legend>
10-
11-
<legend
12-
*ngIf="selectedTab == Tabs.joinAuths"
13-
i18n
14-
>
15-
Active directory access resources
16-
<cd-help-text>
17-
Logical management units for authorization on active directory (AD) servers
18-
</cd-help-text>
19-
</legend>
20-
21-
<legend
22-
*ngIf="selectedTab == Tabs.usersgroups"
23-
i18n
24-
>
25-
Standalone access resources
26-
<cd-help-text>
27-
Logical management units for authorization on Standalone servers
28-
</cd-help-text>
29-
</legend>
30-
311
<cds-tabs
322
type="contained"
333
followFocus="true"

src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-usersgroups-list/smb-usersgroups-list.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<ng-container *ngIf="usersGroups$ | async as usersGroups">
22
<cd-table
3+
headerTitle="Standalone access resoruces"
4+
headerDescription="Logical management units for authorization on Standalone servers"
35
[data]="usersGroups"
46
columnMode="flex"
57
[columns]="columns"

src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<cds-table-container [cdsLayer]="layer"
22
[cdsTheme]="theme"
33
class="content-theme">
4+
<cds-table-header *ngIf="headerTitle">
5+
<h4 cdsTableHeaderTitle
6+
i18n>
7+
{{headerTitle}}
8+
</h4>
9+
<p cdsTableHeaderDescription
10+
i18n
11+
*ngIf="headerDescription">
12+
{{headerDescription}}
13+
</p>
14+
</cds-table-header>
415
<cds-table-toolbar #toolbar
516
*ngIf="toolHeader"
617
(cancel)="onBatchActionsCancel()"

src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
8989
@ContentChild(TableDetailDirective) rowDetail!: TableDetailDirective;
9090
@ContentChild(TableActionsComponent) tableActions!: TableActionsComponent;
9191

92+
@Input()
93+
headerTitle: string;
94+
@Input()
95+
headerDescription: string;
9296
// This is the array with the items to be shown.
9397
@Input()
9498
data: any[];

src/pybind/mgr/dashboard/frontend/src/styles/_carbon-defaults.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Tooltip
157157
.cds--tooltip-content {
158158
background-color: theme.$layer-02;
159159
}
160+
160161
/******************************************
161162
Carbon Popover
162163
******************************************/
@@ -165,3 +166,10 @@ Carbon Popover
165166
max-height: layout.$spacing-13;
166167
overflow: auto;
167168
}
169+
170+
/******************************************
171+
Tabs
172+
******************************************/
173+
.cds--tab-content {
174+
background: var(--cds-layer-01);
175+
}

0 commit comments

Comments
 (0)