From a2cf1285449b88e8a053161ba8055891c51f94c2 Mon Sep 17 00:00:00 2001 From: Afreen Date: Fri, 1 Mar 2024 12:56:25 +0530 Subject: [PATCH] mgr/dashboard:Mark placement targets as non-required in bucket form Fixes https://tracker.ceph.com/issues/64708 - adds info text explaining about placement targets - adds fieldset to security, policy and tags for a11y - removes placement target as required field - when no placement target provided, request omits placement_target field - hides placement atrgets ection for edit form since its not possible to edit after creation - updates rgw-bucket.service.spec.ts unit test - minor cleanups related to unncesseary css present, and changes in help text for object locking - updated e2e tests for buckets to incorporate changes Signed-off-by: Afreen --- .../frontend/cypress/e2e/rgw/buckets.po.ts | 13 +- .../rgw-bucket-form.component.html | 277 +++++++++--------- .../rgw-bucket-form.component.ts | 2 +- .../app/shared/api/rgw-bucket.service.spec.ts | 4 +- .../src/app/shared/api/rgw-bucket.service.ts | 39 +-- 5 files changed, 163 insertions(+), 172 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts index d121608490f91..53756f0a2569a 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts @@ -41,7 +41,6 @@ export class BucketsPageHelper extends PageHelper { // Select bucket placement target: this.selectPlacementTarget(placementTarget); - cy.get('#placement-target').should('have.class', 'ng-valid'); if (isLocking) { cy.get('#lock_enabled').click({ force: true }); @@ -70,7 +69,8 @@ export class BucketsPageHelper extends PageHelper { edit(name: string, new_owner: string, isLocking = false) { this.navigateEdit(name); - cy.get('input[name=placement-target]').should('have.value', 'default-placement'); + // Placement target is not allowed to be edited and should be hidden + cy.get('input[name=placement-target]').should('not.exist'); this.selectOwner(new_owner); // If object locking is enabled versioning shouldn't be visible @@ -171,15 +171,6 @@ export class BucketsPageHelper extends PageHelper { // Check that error message was printed under owner drop down field cy.get('#owner + .invalid-feedback').should('have.text', 'This field is required.'); - // Check invalid placement target input - this.selectOwner(BucketsPageHelper.USERS[1]); - // The drop down error message will not appear unless a valid option is previously selected. - this.selectPlacementTarget('default-placement'); - this.selectPlacementTarget('-- Select a placement target --'); - cy.get('@nameInputField').click(); // Trigger validation - cy.get('#placement-target').should('have.class', 'ng-invalid'); - cy.get('#placement-target + .invalid-feedback').should('have.text', 'This field is required.'); - // Clicks the Create Bucket button but the page doesn't move. // Done by testing for the breadcrumb cy.contains('button', 'Create Bucket').click(); // Clicks Create Bucket button diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html index 41b7f11629779..108b1ba6ce569 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html @@ -95,38 +95,30 @@ -
+
- - - This field is required. - - - - + + + + When creating a bucket, a placement target can be provided as part of the LocationConstraint to override the default placement targets from the user and zonegroup. + +
@@ -218,8 +210,8 @@ Object Locking - - Store objects using a write-once-read-many (WORM) model to help you prevent objects from being deleted or overwritten for a fixed amount of time or indefinitely. + + Store objects using a write-once-read-many (WORM) model to prevent objects from being deleted or overwritten for a fixed amount of time or indefinitely. Object Locking works only in versioned buckets. @@ -316,6 +308,7 @@
+
Security @@ -423,135 +416,139 @@
- Tags - Tagging gives you a way to categorize storage - - - - +
+ Tags + Tagging gives you a way to categorize storage + + + + -
-
- Maximum of 20 tags reached - +
+
+ Maximum of 20 tags reached + +
-
+
- Policies - -
-
-
+
+ Policies + +
+
+
- - -
- - Invalid json text - -
- + + +
+ + Invalid json text +
+ + +
-
-
+
- - -
-
- Grantee - Select a grantee (user group) to modify it's permisions - - - This field is required. - Permissions - Select the permision to give to the selected grantee. - Regardless, the owner of the bucket will always have - FULL CONTROL access + + +
+
+ Grantee + Select a grantee (user group) to modify it's permisions - - This field is required. + + This field is required. + Permissions + Select the permision to give to the selected grantee. + Regardless, the owner of the bucket will always have + FULL CONTROL access + + + This field is required. +
-
- +
+