Skip to content

Commit 6c25635

Browse files
committed
mgr/dashboard: carbon datatable minor bug fixes
- fixes empty white spaces in the table - fixes some tables detail component where it didn't had carbon table - fix the multi-site details view table not showing up - fix the nvmeof modals like namespace deletion not getting opened - fix the cached reload button status not showing correctly in rgw table - fix show button in the rgw users detail page broken - fix the multi-cluster list component issue where details component is not following carbon attributes - fixing the configuration page where it does a page reload on form submit. instead doing a table refresh - additionally fixed a validation issue in the service form fixes the test failures Fixes: https://tracker.ceph.com/issues/67788 Fixes: https://tracker.ceph.com/issues/67552 Signed-off-by: Nizamudeen A <[email protected]>
1 parent 2c345e1 commit 6c25635

35 files changed

+226
-125
lines changed

src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.po.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class ImagesPageHelper extends PageHelper {
3838
cy.get('[data-cy=submitBtn]').click();
3939

4040
this.getExpandCollapseElement(newName).click();
41-
cy.get('.table.table-striped.table-bordered').contains('td', newSize);
41+
cy.get('[data-testid=rbd-details-table]').contains('td', newSize);
4242
}
4343

4444
// Selects RBD image and moves it to the trash,

src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/configuration.po.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class ConfigurationPageHelper extends PageHelper {
7575
values.forEach((value) => {
7676
// iterates through list of values and
7777
// checks if the value appears in details with the correct number attatched
78-
cy.contains('.table.table-striped.table-bordered', `${value[0]}\: ${value[1]}`);
78+
cy.contains('[data-testid=config-details-table]', `${value[0]}\: ${value[1]}`);
7979
});
8080
}
8181
}

src/pybind/mgr/dashboard/frontend/cypress/e2e/multi-cluster/multi-cluster.e2e-spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ describe('Muti-cluster management page', () => {
2121
it('should authenticate the second cluster', () => {
2222
multiCluster.auth(url, alias, username, password);
2323
multiCluster.existTableCell(alias);
24+
multiCluster.checkConnectionStatus(alias, 'CONNECTED');
2425
});
2526

2627
it('should switch to the second cluster and back to hub', () => {
28+
multiCluster.checkConnectionStatus(alias, 'CONNECTED');
2729
dashboard.navigateTo();
2830
cy.get('[data-testid="selected-cluster"]').click();
2931
cy.get('[data-testid="select-a-cluster"]').contains(alias).click();
@@ -38,16 +40,19 @@ describe('Muti-cluster management page', () => {
3840
});
3941

4042
it('should reconnect the second cluster', () => {
43+
multiCluster.checkConnectionStatus(alias, 'CONNECTED');
4144
multiCluster.reconnect(alias, password);
4245
multiCluster.existTableCell(alias);
4346
});
4447

4548
it('should edit the second cluster', () => {
49+
multiCluster.checkConnectionStatus(alias, 'CONNECTED');
4650
multiCluster.edit(alias, editedAlias);
4751
multiCluster.existTableCell(editedAlias);
4852
});
4953

5054
it('should disconnect the second cluster', () => {
55+
multiCluster.checkConnectionStatus(editedAlias, 'CONNECTED');
5156
multiCluster.disconnect(editedAlias);
5257
multiCluster.existTableCell(editedAlias, false);
5358
});

src/pybind/mgr/dashboard/frontend/cypress/e2e/multi-cluster/multi-cluster.po.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ const WAIT_TIMER = 1000;
1010
export class MultiClusterPageHelper extends PageHelper {
1111
pages = pages;
1212

13+
columnIndex = {
14+
alias: 2,
15+
connection: 3
16+
};
17+
1318
auth(url: string, alias: string, username: string, password: string) {
1419
cy.contains('button', 'Connect').click();
1520
cy.get('cd-multi-cluster-form').should('exist');
@@ -49,4 +54,20 @@ export class MultiClusterPageHelper extends PageHelper {
4954
});
5055
cy.wait(WAIT_TIMER);
5156
}
57+
58+
checkConnectionStatus(alias: string, expectedStatus = 'CONNECTED', shouldReload = true) {
59+
let aliasIndex = this.columnIndex.alias;
60+
let statusIndex = this.columnIndex.connection;
61+
if (shouldReload) {
62+
cy.reload(true, { log: true, timeout: 5 * 1000 });
63+
}
64+
65+
this.getTableCell(aliasIndex, alias)
66+
.parent()
67+
.find(`[cdstabledata]:nth-child(${statusIndex}) .badge`)
68+
.should(($ele) => {
69+
const status = $ele.toArray().map((v) => v.innerText);
70+
expect(status).to.include(expectedStatus);
71+
});
72+
}
5273
}

src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ export abstract class PageHelper {
251251
* Grabs striped tables
252252
*/
253253
getStatusTables() {
254-
return cy.get('.table.table-striped');
254+
return cy.get(
255+
'.cds--data-table--sort.cds--data-table--no-border.cds--data-table.cds--data-table--md'
256+
);
255257
}
256258

257259
filterTable(name: string, option: string) {

src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class BucketsPageHelper extends PageHelper {
7676
this.getExpandCollapseElement(name).click();
7777

7878
// check its details table for edited owner field
79-
cy.get('.table.table-striped.table-bordered').first().as('bucketDataTable');
79+
cy.get('[data-testid="rgw-bucket-details"]').first().as('bucketDataTable');
8080

8181
// Check versioning enabled:
8282
cy.get('@bucketDataTable').find('tr').its(0).find('td').last().as('versioningValueCell');
@@ -102,7 +102,7 @@ export class BucketsPageHelper extends PageHelper {
102102
this.getExpandCollapseElement(name).click();
103103

104104
// Check versioning enabled:
105-
cy.get('.table.table-striped.table-bordered').first().as('bucketDataTable');
105+
cy.get('[data-testid="rgw-bucket-details"]').first().as('bucketDataTable');
106106
cy.get('@bucketDataTable').find('tr').its(0).find('td').last().as('versioningValueCell');
107107

108108
cy.get('@versioningValueCell').should('have.text', this.versioningStateEnabled);

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-initiators-list/nvmeof-initiators-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { FinishedTask } from '~/app/shared/models/finished-task';
1010
import { NvmeofSubsystemInitiator } from '~/app/shared/models/nvmeof';
1111
import { Permission } from '~/app/shared/models/permissions';
1212
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
13-
import { ModalService } from '~/app/shared/services/modal.service';
13+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
1414
import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
1515

1616
const BASE_URL = 'block/nvmeof/subsystems';
@@ -37,7 +37,7 @@ export class NvmeofInitiatorsListComponent implements OnInit, OnChanges {
3737
public actionLabels: ActionLabelsI18n,
3838
private authStorageService: AuthStorageService,
3939
private nvmeofService: NvmeofService,
40-
private modalService: ModalService,
40+
private modalService: ModalCdsService,
4141
private router: Router,
4242
private taskWrapper: TaskWrapperService
4343
) {

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-listeners-list/nvmeof-listeners-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { FinishedTask } from '~/app/shared/models/finished-task';
1111
import { NvmeofListener } from '~/app/shared/models/nvmeof';
1212
import { Permission } from '~/app/shared/models/permissions';
1313
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
14-
import { ModalService } from '~/app/shared/services/modal.service';
14+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
1515
import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
1616

1717
const BASE_URL = 'block/nvmeof/subsystems';
@@ -33,7 +33,7 @@ export class NvmeofListenersListComponent implements OnInit, OnChanges {
3333

3434
constructor(
3535
public actionLabels: ActionLabelsI18n,
36-
private modalService: ModalService,
36+
private modalService: ModalCdsService,
3737
private authStorageService: AuthStorageService,
3838
private taskWrapper: TaskWrapperService,
3939
private nvmeofService: NvmeofService,

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-list/nvmeof-namespaces-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe';
1313
import { IopsPipe } from '~/app/shared/pipes/iops.pipe';
1414
import { MbpersecondPipe } from '~/app/shared/pipes/mbpersecond.pipe';
1515
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
16-
import { ModalService } from '~/app/shared/services/modal.service';
16+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
1717
import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
1818

1919
const BASE_URL = 'block/nvmeof/subsystems';
@@ -36,7 +36,7 @@ export class NvmeofNamespacesListComponent implements OnInit, OnChanges {
3636
constructor(
3737
public actionLabels: ActionLabelsI18n,
3838
private router: Router,
39-
private modalService: ModalService,
39+
private modalService: ModalCdsService,
4040
private authStorageService: AuthStorageService,
4141
private taskWrapper: TaskWrapperService,
4242
private nvmeofService: NvmeofService,

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-details/rbd-details.component.html

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,47 @@
1111
<a ngbNavLink
1212
i18n>Details</a>
1313
<ng-template ngbNavContent>
14-
<table class="table table-striped table-bordered">
14+
<table class="cds--data-table--sort cds--data-table--no-border cds--data-table cds--data-table--md"
15+
data-testid="rbd-details-table">
1516
<tbody>
16-
<tr>
17+
<tr cdstablerow>
1718
<td i18n
18-
class="bold w-25">Name</td>
19+
class="bold w-25"
20+
cdstabledata>Name</td>
1921
<td class="w-75">{{ selection.name }}</td>
2022
</tr>
21-
<tr>
23+
<tr cdstablerow>
2224
<td i18n
23-
class="bold">Pool</td>
25+
class="bold"
26+
cdstabledata>Pool</td>
2427
<td>{{ selection.pool_name }}</td>
2528
</tr>
26-
<tr>
29+
<tr cdstablerow>
2730
<td i18n
2831
class="bold">Data Pool</td>
2932
<td>{{ selection.data_pool | empty }}</td>
3033
</tr>
31-
<tr>
34+
<tr cdstablerow>
3235
<td i18n
3336
class="bold">Created</td>
3437
<td>{{ selection.timestamp | cdDate }}</td>
3538
</tr>
36-
<tr>
39+
<tr cdstablerow>
3740
<td i18n
3841
class="bold">Size</td>
3942
<td>{{ selection.size | dimlessBinary }}</td>
4043
</tr>
41-
<tr>
44+
<tr cdstablerow>
4245
<td i18n
4346
class="bold">Objects</td>
4447
<td>{{ selection.num_objs | dimless }}</td>
4548
</tr>
46-
<tr>
49+
<tr cdstablerow>
4750
<td i18n
4851
class="bold">Object size</td>
4952
<td>{{ selection.obj_size | dimlessBinary }}</td>
5053
</tr>
51-
<tr>
54+
<tr cdstablerow>
5255
<td i18n
5356
class="bold">Features</td>
5457
<td>
@@ -57,7 +60,7 @@
5760
</span>
5861
</td>
5962
</tr>
60-
<tr>
63+
<tr cdstablerow>
6164
<td i18n
6265
class="bold">Provisioned</td>
6366
<td>
@@ -72,7 +75,7 @@
7275
</span>
7376
</td>
7477
</tr>
75-
<tr>
78+
<tr cdstablerow>
7679
<td i18n
7780
class="bold">Total provisioned</td>
7881
<td>
@@ -87,17 +90,17 @@
8790
</span>
8891
</td>
8992
</tr>
90-
<tr>
93+
<tr cdstablerow>
9194
<td i18n
9295
class="bold">Striping unit</td>
9396
<td>{{ selection.stripe_unit | dimlessBinary }}</td>
9497
</tr>
95-
<tr>
98+
<tr cdstablerow>
9699
<td i18n
97100
class="bold">Striping count</td>
98101
<td>{{ selection.stripe_count }}</td>
99102
</tr>
100-
<tr>
103+
<tr cdstablerow>
101104
<td i18n
102105
class="bold">Parent</td>
103106
<td>
@@ -106,17 +109,17 @@
106109
<span *ngIf="!selection.parent">-</span>
107110
</td>
108111
</tr>
109-
<tr>
112+
<tr cdstablerow>
110113
<td i18n
111114
class="bold">Block name prefix</td>
112115
<td>{{ selection.block_name_prefix }}</td>
113116
</tr>
114-
<tr>
117+
<tr cdstablerow>
115118
<td i18n
116119
class="bold">Order</td>
117120
<td>{{ selection.order }}</td>
118121
</tr>
119-
<tr>
122+
<tr cdstablerow>
120123
<td i18n
121124
class="bold">Format Version</td>
122125
<td>{{ selection.image_format }}</td>

0 commit comments

Comments
 (0)