Skip to content

Commit 9f9be26

Browse files
authored
Merge pull request ceph#58239 from rhcs-dashboard/carbon-forms
mgr/dashboard: carbonize rbd forms Reviewed-by: Ankush Behl <[email protected]>
2 parents 938ff35 + 6efe049 commit 9f9be26

File tree

149 files changed

+2223
-1599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+2223
-1599
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Images page', () => {
1818
after(() => {
1919
// Deletes images test pool
2020
pools.navigateTo();
21-
pools.delete(poolName);
21+
pools.delete(poolName, null, null, true);
2222
pools.navigateTo();
2323
pools.existTableCell(poolName, false);
2424
});
@@ -58,7 +58,7 @@ describe('Images page', () => {
5858
});
5959

6060
it('should delete image', () => {
61-
images.delete(newImageName);
61+
images.delete(newImageName, null, null, true);
6262
});
6363
});
6464

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ export class ImagesPageHelper extends PageHelper {
7171
cy.contains('button', 'Restore').click();
7272

7373
// wait for pop-up to be visible (checks for title of pop-up)
74-
cy.get('cd-modal #name').should('be.visible');
74+
cy.get('cds-modal #name').should('be.visible');
7575

7676
// If a new name for the image is passed, it changes the name of the image
7777
if (newName !== undefined) {
7878
// click name box and send new name
79-
cy.get('cd-modal #name').clear().type(newName);
79+
cy.get('cds-modal #name').clear().type(newName);
8080
}
8181

8282
cy.get('[data-cy=submitBtn]').click();
@@ -95,7 +95,7 @@ export class ImagesPageHelper extends PageHelper {
9595
cy.contains('button', 'Purge Trash').click();
9696

9797
// Check for visibility of modal container
98-
cy.get('.modal-header').should('be.visible');
98+
cy.get('cds-modal').should('be.visible');
9999

100100
// If purging a specific pool, selects that pool if given
101101
if (pool !== undefined) {

src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('Mirroring page', () => {
7474
cy.get('.table-actions button.dropdown-toggle').first().click();
7575
cy.get('[aria-label="Import Bootstrap Token"]').click();
7676
cy.get('cd-bootstrap-import-modal').within(() => {
77-
cy.get(`label[for=${name}]`).click();
77+
cy.get(`input[name=${name}]`).click({ force: true });
7878
cy.get('textarea[id=token]').wait(100).type(bootstrapToken);
7979
cy.get('button[type=submit]').click();
8080
});
@@ -112,7 +112,7 @@ describe('Mirroring page', () => {
112112

113113
afterEach(() => {
114114
pools.navigateTo();
115-
pools.delete(poolName);
115+
pools.delete(poolName, null, null, true);
116116
});
117117
});
118118
});

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ export class MirroringPageHelper extends PageHelper {
2525
cy.contains('button', 'Edit Mode').click();
2626

2727
// Clicks the drop down in the edit pop-up, then clicks the Update button
28-
cy.get('.modal-content').should('be.visible');
28+
cy.get('cds-modal').should('be.visible');
2929
this.selectOption('mirrorMode', option);
3030

3131
// Clicks update button and checks if the mode has been changed
3232
cy.contains('button', 'Update').click();
33-
cy.contains('.modal-dialog', 'Edit pool mirror mode').should('not.exist');
33+
cy.contains('cds-modal').should('not.exist');
3434
const val = option.toLowerCase(); // used since entries in table are lower case
3535
this.getFirstTableCell(val).should('be.visible');
3636
}
@@ -39,7 +39,7 @@ export class MirroringPageHelper extends PageHelper {
3939
generateToken(poolName: string) {
4040
cy.get('[aria-label="Create Bootstrap Token"]').first().click();
4141
cy.get('cd-bootstrap-create-modal').within(() => {
42-
cy.get(`label[for=${poolName}]`).click();
42+
cy.get(`input[name=${poolName}]`).click({ force: true });
4343
cy.get('button[type=submit]').click();
4444
cy.get('textarea[id=token]').wait(200).invoke('val').as('token');
4545
cy.get('[aria-label="Back"]').click();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class HostsPageHelper extends PageHelper {
6161
}
6262

6363
remove(hostname: string) {
64-
super.delete(hostname, this.columnIndex.hostname, 'hosts');
64+
super.delete(hostname, this.columnIndex.hostname, 'hosts', true);
6565
}
6666

6767
// Add or remove labels on a host, then verify labels in the table
@@ -113,7 +113,7 @@ export class HostsPageHelper extends PageHelper {
113113
this.getTableCell(this.columnIndex.hostname, hostname, true).click();
114114
this.clickActionButton('enter-maintenance');
115115

116-
cy.get('cd-modal').within(() => {
116+
cy.get('cds-modal').within(() => {
117117
cy.contains('button', 'Continue').click();
118118
});
119119

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('Logs page', () => {
5454

5555
it('should delete pool and check audit logs reacted', () => {
5656
pools.navigateTo();
57-
pools.delete(poolname);
57+
pools.delete(poolname, null, null, true);
5858
logs.checkAuditForPoolFunction(poolname, 'delete', hour, minute);
5959
});
6060
});

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ export class ServicesPageHelper extends PageHelper {
198198
this.clickActionButton('delete');
199199

200200
// Confirms deletion
201-
cy.get('cd-modal .custom-control-label').click();
202-
cy.contains('cd-modal button', 'Delete').click();
201+
cy.get('cds-modal input#confirmation_input').click({ force: true });
202+
cy.contains('cds-modal button', 'Delete').click();
203203

204204
// Wait for modal to close
205-
cy.get('cd-modal').should('not.exist');
205+
cy.get('cds-modal').should('not.exist');
206206
this.checkExist(serviceName, false);
207207
}
208208

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('Cluster Ceph Users', () => {
4040
});
4141

4242
it('should delete a user', () => {
43-
users.delete(entityName);
43+
users.delete(entityName, null, null, true);
4444
});
4545
});
4646
});

src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,20 @@ Then('I check the tick box in modal', () => {
6060
cy.get('cd-modal input#confirmation').click();
6161
});
6262

63+
Then('I check the tick box in carbon modal', () => {
64+
cy.get('cds-modal input#confirmation_input').click({ force: true });
65+
});
66+
6367
And('I confirm to {string}', (action: string) => {
6468
cy.contains('cd-modal button', action).click();
6569
cy.get('cd-modal').should('not.exist');
6670
});
6771

72+
And('I confirm to {string} on carbon modal', (action: string) => {
73+
cy.contains('cds-modal button', action).click();
74+
cy.get('cds-modal').should('not.exist');
75+
});
76+
6877
Then('I should see an error in {string} field', (field: string) => {
6978
cy.get('cd-modal').within(() => {
7079
cy.get(`input[id=${field}]`).should('have.class', 'ng-invalid');

src/pybind/mgr/dashboard/frontend/cypress/e2e/common/global.feature.po.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,20 @@ Then('I should see the modal', () => {
2929
cy.get('cd-modal').should('exist');
3030
});
3131

32+
// @TODO: Replace with the existing (above one)
33+
// once carbon migration is completed
34+
Then('I should see the carbon modal', () => {
35+
cy.get('cds-modal').should('exist');
36+
});
37+
3238
Then('I should not see the modal', () => {
3339
cy.get('cd-modal').should('not.exist');
3440
});
3541

42+
Then('I should not see the carbon modal', () => {
43+
cy.get('cds-modal').should('not.exist');
44+
});
45+
3646
And('I go to the {string} tab', (names: string) => {
3747
for (const name of names.split(', ')) {
3848
cy.contains('.nav.nav-tabs a', name).click();

0 commit comments

Comments
 (0)