Skip to content

Commit a1cd410

Browse files
authored
Merge pull request ceph#58478 from rhcs-dashboard/carbon-forms-fs
mgr/dashboard: carbonize fs forms Reviewed-by: afreen23 <NOT@FOUND> Reviewed-by: ivoalmeida <NOT@FOUND> Reviewed-by: sayaleeraut <NOT@FOUND>
2 parents d74d2ba + 1091a9d commit a1cd410

File tree

73 files changed

+1752
-1683
lines changed

Some content is hidden

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

73 files changed

+1752
-1683
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export class ServicesPageHelper extends PageHelper {
107107
: cy.get('#count').clear().type(String(count));
108108
break;
109109
}
110+
cy.wait(1000);
110111
if (serviceType === 'snmp-gateway') {
111112
cy.get('cd-submit-button').dblclick();
112113
} else {

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { And, Then } from 'cypress-cucumber-preprocessor/steps';
66
* @param value Value that should be filled in the field.
77
*/
88
And('enter {string} {string}', (field: string, value: string) => {
9-
cy.get('.cd-col-form').within(() => {
10-
cy.get(`input[id=${field}]`).clear().type(value);
11-
});
9+
cy.get(`input[id=${field}]`).clear().type(value);
1210
});
1311

1412
/**
@@ -22,6 +20,17 @@ And('enter {string} {string} in the modal', (field: string, value: string) => {
2220
});
2321
});
2422

23+
/**
24+
* Fills in the given field using the value provided in carbon modal
25+
* @param field ID of the field that needs to be filled out.
26+
* @param value Value that should be filled in the field.
27+
*/
28+
And('enter {string} {string} in the carbon modal', (field: string, value: string) => {
29+
cy.get('cds-modal').within(() => {
30+
cy.get(`input[id=${field}]`).clear().type(value);
31+
});
32+
});
33+
2534
And('select options {string}', (labels: string) => {
2635
if (labels) {
2736
cy.get('a[data-testid=select-menu-edit]').click();

src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Feature: CephFS Snapshot Management
2323
When I expand the row "test_cephfs"
2424
And I go to the "Subvolumes" tab
2525
And I click on "Create" button from the expanded row
26-
And enter "subvolumeName" "test_subvolume" in the modal
26+
And enter "subvolumeName" "test_subvolume" in the carbon modal
2727
And I click on "Create Subvolume" button
2828
Then I should see a row with "test_subvolume" in the expanded row
2929

@@ -38,7 +38,7 @@ Feature: CephFS Snapshot Management
3838
When I expand the row "test_cephfs"
3939
And I go to the "Snapshots" tab
4040
And I click on "Create" button from the expanded row
41-
And enter "snapshotName" "test_snapshot" in the modal
41+
And enter "snapshotName" "test_snapshot" in the carbon modal
4242
And I click on "Create Snapshot" button
4343
Then I should see a row with "test_snapshot" in the expanded row
4444

@@ -48,7 +48,7 @@ Feature: CephFS Snapshot Management
4848
And I go to the "Snapshots" tab
4949
And I select a row "test_snapshot" in the expanded row
5050
And I click on "Clone" button from the table actions in the expanded row
51-
And enter "cloneName" "test_clone" in the modal
51+
And enter "cloneName" "test_clone" in the carbon modal
5252
And I click on "Create Clone" button
5353
Then I wait for "5" seconds
5454
And I go to the "Subvolumes" tab

src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Feature: CephFS Subvolume Group management
1717
When I expand the row "test_cephfs"
1818
And I go to the "Subvolume groups" tab
1919
And I click on "Create" button from the expanded row
20-
And enter "subvolumegroupName" "test_subvolume_group" in the modal
20+
And enter "subvolumegroupName" "test_subvolume_group" in the carbon modal
2121
And I click on "Create Subvolume group" button
2222
Then I should see a row with "test_subvolume_group" in the expanded row
2323

@@ -27,7 +27,7 @@ Feature: CephFS Subvolume Group management
2727
And I go to the "Subvolume groups" tab
2828
When I select a row "test_subvolume_group" in the expanded row
2929
And I click on "Edit" button from the table actions in the expanded row
30-
And enter "size" "1" in the modal
30+
And enter "size" "1" in the carbon modal
3131
And I click on "Edit Subvolume group" button
3232
Then I should see row "test_subvolume_group" of the expanded row to have a usage bar
3333

src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolumes.e2e-spec.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Feature: CephFS Subvolume management
1717
When I expand the row "test_cephfs"
1818
And I go to the "Subvolumes" tab
1919
And I click on "Create" button from the expanded row
20-
And enter "subvolumeName" "test_subvolume" in the modal
20+
And enter "subvolumeName" "test_subvolume" in the carbon modal
2121
And I click on "Create Subvolume" button
2222
Then I should see a row with "test_subvolume" in the expanded row
2323

@@ -27,7 +27,7 @@ Feature: CephFS Subvolume management
2727
And I go to the "Subvolumes" tab
2828
When I select a row "test_subvolume" in the expanded row
2929
And I click on "Edit" button from the table actions in the expanded row
30-
And enter "size" "1" in the modal
30+
And enter "size" "1" in the carbon modal
3131
And I click on "Edit Subvolume" button
3232
Then I should see row "test_subvolume" of the expanded row to have a usage bar
3333

src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/nfs/nfs-export.po.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class NFSPageHelper extends PageHelper {
1717
this.selectOption('fs_name', 'myfs');
1818
cy.get('#security_label').click({ force: true });
1919
} else {
20-
cy.get('input[data-testid=rgw_path]').type(rgwPath);
20+
cy.get('input[id=path]').type(rgwPath);
2121
}
2222

2323
cy.get('input[name=pseudo]').type(pseudo);
@@ -28,7 +28,7 @@ export class NFSPageHelper extends PageHelper {
2828
cy.get('input[name=addresses]').type(client['addresses']);
2929

3030
// Check if we can remove clients and add it again
31-
cy.get('span[name=remove_client]').click({ force: true });
31+
cy.get('[data-testid=remove_client]').click({ force: true });
3232
cy.get('button[name=add_client]').click({ force: true });
3333
cy.get('input[name=addresses]').type(client['addresses']);
3434

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ export abstract class PageHelper {
313313
.parent('[cdstablerow]')
314314
.find('[cdstabledata] [data-testid="table-action-btn"]')
315315
.click({ force: true });
316+
cy.wait(waitTime);
316317
cy.get(`button.${action}`).click({ force: true });
317318
}
318319

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<cds-text-label for="siteName"
2525
i18n
2626
cdRequiredField="Site Name"
27-
[invalid]="!importBootstrapForm.controls['siteName'].valid && (importBootstrapForm.controls['siteName'].dirty || importBootstrapForm.controls['siteName'].touched)"
27+
[invalid]="!importBootstrapForm.controls['siteName'].valid && importBootstrapForm.controls['siteName'].dirty"
2828
[invalidText]="siteNameError"
2929
i18n-invalidText>Site Name
3030
<input cdsText
@@ -33,7 +33,7 @@
3333
id="siteName"
3434
name="siteName"
3535
formControlName="siteName"
36-
[invalid]="importBootstrapForm.showError('siteName', formDir, 'required')"
36+
[invalid]="!importBootstrapForm.controls['siteName'].valid && importBootstrapForm.controls['siteName'].dirty"
3737
autofocus>
3838
</cds-text-label>
3939
<ng-template #siteNameError>
@@ -76,7 +76,7 @@
7676

7777
<div class="form-item">
7878
<cds-textarea-label for="token"
79-
[invalid]="importBootstrapForm.controls['token'].invalid && (importBootstrapForm.controls['token'].dirty || importBootstrapForm.controls['token'].touched)"
79+
[invalid]="importBootstrapForm.controls['token'].invalid && (importBootstrapForm.controls['token'].dirty)"
8080
[invalidText]="tokenError"
8181
cdRequiredField="Token"
8282
i18n>Token
@@ -87,7 +87,7 @@
8787
formControlName="token"
8888
cols="200"
8989
rows="5"
90-
[invalid]="importBootstrapForm.controls['token'].invalid && (importBootstrapForm.controls['token'].dirty || importBootstrapForm.controls['token'].touched)">
90+
[invalid]="importBootstrapForm.controls['token'].invalid && (importBootstrapForm.controls['token'].dirty)">
9191
</textarea>
9292
</cds-textarea-label>
9393
<ng-template #tokenError>

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
formControlName="mirrorMode"
2525
name="mirrorMode"
2626
id="mirrorMode"
27-
[invalid]="editModeForm.controls['mirrorMode'].invalid && (editModeForm.controls['mirrorMode'].dirty || editModeForm.controls['mirrorMode'].touched)"
27+
[invalid]="editModeForm.controls['mirrorMode'].invalid && (editModeForm.controls['mirrorMode'].dirty)"
2828
[invalidText]="mirrorModeError"
2929
cdRequiredField="Mode"
3030
i18n>

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<div class="form-item">
2525
<cds-text-label for="clusterName"
26-
[invalid]="editPeerForm.controls['clusterName'].invalid && (editPeerForm.controls['clusterName'].dirty || editPeerForm.controls['clusterName'].touched)"
26+
[invalid]="editPeerForm.controls['clusterName'].invalid && (editPeerForm.controls['clusterName'].dirty)"
2727
[invalidText]="clusterNameError"
2828
cdRequiredField="Cluster Name"
2929
i18n>Cluster Name
@@ -34,7 +34,7 @@
3434
id="clusterName"
3535
name="clusterName"
3636
formControlName="clusterName"
37-
[invalid]="editPeerForm.controls['clusterName'].invalid && (editPeerForm.controls['clusterName'].dirty || editPeerForm.controls['clusterName'].touched)"
37+
[invalid]="editPeerForm.controls['clusterName'].invalid && (editPeerForm.controls['clusterName'].dirty)"
3838
autofocus>
3939
</cds-text-label>
4040
<ng-template #clusterNameError>
@@ -49,7 +49,7 @@
4949

5050
<div class="form-item">
5151
<cds-text-label for="clientID"
52-
[invalid]="editPeerForm.controls['clientID'].invalid && (editPeerForm.controls['clientID'].dirty || editPeerForm.controls['clientID'].touched)"
52+
[invalid]="editPeerForm.controls['clientID'].invalid && (editPeerForm.controls['clientID'].dirty)"
5353
[invalidText]="clientIDError"
5454
cdRequiredField="CephX ID"
5555
i18n>CephX ID
@@ -60,7 +60,7 @@
6060
id="clientID"
6161
name="clientID"
6262
formControlName="clientID"
63-
[invalid]="editPeerForm.controls['clientID'].invalid && (editPeerForm.controls['clientID'].dirty || editPeerForm.controls['clientID'].touched)">
63+
[invalid]="editPeerForm.controls['clientID'].invalid && (editPeerForm.controls['clientID'].dirty)">
6464
</cds-text-label>
6565
<ng-template #clientIDError>
6666
<span class="invalid-feedback"
@@ -74,7 +74,7 @@
7474

7575
<div class="form-item">
7676
<cds-text-label for="monAddr"
77-
[invalid]="editPeerForm.controls['monAddr'].invalid && (editPeerForm.controls['monAddr'].dirty || editPeerForm.controls['monAddr'].touched)"
77+
[invalid]="editPeerForm.controls['monAddr'].invalid && (editPeerForm.controls['monAddr'].dirty)"
7878
[invalidText]="monAddrError"
7979
i18n>Monitor Addresses
8080
<input cdsText
@@ -84,7 +84,7 @@
8484
id="monAddr"
8585
name="monAddr"
8686
formControlName="monAddr"
87-
[invalid]="editPeerForm.controls['monAddr'].invalid && (editPeerForm.controls['monAddr'].dirty || editPeerForm.controls['monAddr'].touched)">
87+
[invalid]="editPeerForm.controls['monAddr'].invalid && (editPeerForm.controls['monAddr'].dirty)">
8888
</cds-text-label>
8989
<ng-template #monAddrError>
9090
<span class="invalid-feedback"
@@ -95,7 +95,7 @@
9595

9696
<div class="form-item">
9797
<cds-text-label for="key"
98-
[invalid]="editPeerForm.controls['key'].invalid && (editPeerForm.controls['key'].dirty || editPeerForm.controls['key'].touched)"
98+
[invalid]="editPeerForm.controls['key'].invalid && (editPeerForm.controls['key'].dirty)"
9999
[invalidText]="keyError"
100100
i18n>CephX Key
101101
<input cdsText
@@ -105,7 +105,7 @@
105105
id="key"
106106
name="key"
107107
formControlName="key"
108-
[invalid]="editPeerForm.controls['key'].invalid && (editPeerForm.controls['key'].dirty || editPeerForm.controls['key'].touched)">
108+
[invalid]="editPeerForm.controls['key'].invalid && (editPeerForm.controls['key'].dirty)">
109109
</cds-text-label>
110110
<ng-template #keyError>
111111
<span class="invalid-feedback"

0 commit comments

Comments
 (0)