From 9911ecb683be4e42477794d09d22042e50cff2be Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Wed, 23 Oct 2024 20:42:21 +0530 Subject: [PATCH] mgr/dashboard: carbonize rgw user and bucket form Fixes: https://tracker.ceph.com/issues/70119 Signed-off-by: Nizamudeen A --- .../frontend/cypress/e2e/rgw/buckets.po.ts | 36 +- .../frontend/cypress/e2e/rgw/users.po.ts | 57 +- .../bucket-tag-modal.component.html | 128 +- .../bucket-tag-modal.component.ts | 13 +- .../rgw-bucket-form.component.html | 1212 ++++++++-------- .../rgw-bucket-form.component.spec.ts | 9 +- .../rgw-bucket-form.component.ts | 6 +- .../rgw-bucket-tiering-form.component.html | 9 +- .../rgw-rate-limit.component.html | 249 ++-- .../rgw-storage-class-form.component.html | 7 +- .../rgw-user-capability-modal.component.html | 112 +- ...gw-user-capability-modal.component.spec.ts | 6 +- .../rgw-user-capability-modal.component.ts | 13 +- .../rgw-user-form.component.html | 1255 ++++++++--------- .../rgw-user-form.component.spec.ts | 84 +- .../rgw-user-form/rgw-user-form.component.ts | 38 +- .../rgw-user-s3-key-modal.component.html | 220 ++- .../rgw-user-s3-key-modal.component.ts | 13 +- .../rgw-user-subuser-modal.component.html | 231 ++- .../rgw-user-subuser-modal.component.spec.ts | 6 +- .../rgw-user-subuser-modal.component.ts | 15 +- .../rgw-user-swift-key-modal.component.html | 90 +- .../rgw-user-swift-key-modal.component.ts | 7 +- .../frontend/src/app/ceph/rgw/rgw.module.ts | 10 +- .../shared/components/components.module.ts | 3 +- .../copy2clipboard-button.component.html | 16 +- .../help-text/help-text.component.html | 9 +- .../help-text/help-text.component.ts | 7 +- 28 files changed, 1871 insertions(+), 1990 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 9a44051f7b8..86dbe5c8a40 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 @@ -37,10 +37,9 @@ export class BucketsPageHelper extends PageHelper { cy.get('#owner').should('have.class', 'ng-valid'); if (isLocking) { - cy.get('#lock_enabled').click({ force: true }); + cy.get('#lock_enabled_input').click({ force: true }); // Select lock mode: this.selectLockMode('Compliance'); - cy.get('#lock_mode').should('have.class', 'ng-valid'); cy.get('#lock_retention_period_days').type('3'); } @@ -61,7 +60,7 @@ export class BucketsPageHelper extends PageHelper { // If object locking is enabled versioning shouldn't be visible if (isLocking) { - cy.get('input[id=versioning]').should('be.disabled'); + cy.get('input[name=versioning]').should('be.disabled'); cy.contains('button', 'Edit Bucket').click(); this.getTableCell(this.columnIndex.name, name) @@ -84,9 +83,9 @@ export class BucketsPageHelper extends PageHelper { return cy.get('@versioningValueCell').should('have.text', this.versioningStateEnabled); } // Enable versioning - cy.get('input[id=versioning]').should('not.be.checked'); - cy.get('label[for=versioning]').click(); - cy.get('input[id=versioning]').should('be.checked'); + cy.get('input[name=versioning]').should('not.be.checked'); + cy.get('label[for=versioning_input]').click(); + cy.get('input[name=versioning]').should('be.checked'); cy.contains('button', 'Edit Bucket').click(); // Check if the owner is updated @@ -110,8 +109,8 @@ export class BucketsPageHelper extends PageHelper { // Disable versioning: this.navigateEdit(name, false, true, null, true); - cy.get('label[for=versioning]').click(); - cy.get('input[id=versioning]').should('not.be.checked'); + cy.get('label[for=versioning_input]').click(); + cy.get('input[name=versioning]').should('not.be.checked'); cy.contains('button', 'Edit Bucket').wait(WAIT_TIMER).click(); // Check versioning suspended: @@ -136,10 +135,9 @@ export class BucketsPageHelper extends PageHelper { .and('have.class', 'ng-invalid'); // Check that error message was printed under name input field - cy.get('#bid + .invalid-feedback').should( - 'have.text', - 'Bucket names must be 3 to 63 characters long.' - ); + cy.get('cds-text-label[for=bid]') + .find('span.invalid-feedback') + .should('have.text', 'Bucket names must be 3 to 63 characters long.'); // Test invalid owner input // select some valid option. The owner drop down error message will not appear unless a valid user was selected at @@ -152,10 +150,12 @@ export class BucketsPageHelper extends PageHelper { cy.get('@nameInputField').click(); // Check that owner drop down field was marked invalid in the css - cy.get('#owner').should('have.class', 'ng-invalid'); + cy.get('cds-select[id=owner]').should('have.class', 'ng-invalid'); // Check that error message was printed under owner drop down field - cy.get('#owner + .invalid-feedback').should('have.text', 'This field is required.'); + cy.get('cds-select[id=owner]') + .find('.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 @@ -169,7 +169,7 @@ export class BucketsPageHelper extends PageHelper { testInvalidEdit(name: string) { this.navigateEdit(name, false, true, null, true); - cy.get('input[id=versioning]').should('exist').and('not.be.checked'); + cy.get('input[name=versioning]').should('exist').and('not.be.checked'); // Chooses 'Select a user' rather than a valid owner on Edit Bucket page // and checks if it's an invalid input @@ -180,10 +180,12 @@ export class BucketsPageHelper extends PageHelper { cy.contains('button', 'Edit Bucket').click(); // Check that owner drop down field was marked invalid in the css - cy.get('#owner').should('have.class', 'ng-invalid'); + cy.get('cds-select[id=owner]').should('have.class', 'ng-invalid'); // Check that error message was printed under owner drop down field - cy.get('#owner + .invalid-feedback').should('have.text', 'This field is required.'); + cy.get('cds-select[id=owner]') + .find('.invalid-feedback') + .should('have.text', 'This field is required.'); this.expectBreadcrumbText('Edit'); } diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts index bc37393092c..59062088a24 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts @@ -13,7 +13,7 @@ export class UsersPageHelper extends PageHelper { // Enter in user_id cy.get('#user_id').type(user_id); // Show Tenant - cy.get('#show_tenant').click({ force: true }); + cy.get('#show_tenant_input').click({ force: true }); // Enter in tenant cy.get('#tenant').type(tenant); // Enter in full name @@ -24,8 +24,8 @@ export class UsersPageHelper extends PageHelper { // Enter max buckets this.selectOption('max_buckets_mode', 'Custom'); - cy.get('#max_buckets').should('exist').should('have.value', '1000'); - cy.get('#max_buckets').click().clear().type(maxbuckets); + cy.get('input#max_buckets').should('exist').should('have.value', '1000'); + cy.get('input#max_buckets').click().clear().type(maxbuckets); // Click the create button and wait for user to be made cy.contains('button', 'Create User').click(); @@ -37,14 +37,14 @@ export class UsersPageHelper extends PageHelper { this.navigateEdit(name, false, true, null, true); // Change the full name field - cy.get('#display_name').click().clear().type(new_fullname); + cy.get('input#display_name').click().clear({ force: true }).type(new_fullname, { force: true }); // Change the email field cy.get('#email').click().clear().type(new_email); // Change the max buckets field this.selectOption('max_buckets_mode', 'Custom'); - cy.get('#max_buckets').click().clear().type(new_maxbuckets); + cy.get('input#max_buckets').click().clear().type(new_maxbuckets); cy.contains('button', 'Edit User').click(); @@ -71,13 +71,17 @@ export class UsersPageHelper extends PageHelper { .should('have.class', 'ng-invalid') // Try to give user already taken name. Should make field invalid. .type(uname); - cy.get('#show_tenant').click({ force: true }); + cy.get('#show_tenant_input').click({ force: true }); cy.get('#tenant').type(tenant).should('have.class', 'ng-invalid'); - cy.contains('#tenant + .invalid-feedback', 'The chosen user ID exists in this tenant.'); + cy.get('cds-text-label[for=tenant]') + .find('.invalid-feedback') + .should('have.text', 'The chosen user ID exists in this tenant.'); // check that username field is marked invalid if username has been cleared off cy.get('#user_id').clear().blur().should('have.class', 'ng-invalid'); - cy.contains('#user_id + .invalid-feedback', 'This field is required.'); + cy.get('cds-text-label[for=user_id]') + .find('.invalid-feedback') + .should('have.text', 'This field is required.'); // Full name cy.get('#display_name') @@ -88,16 +92,23 @@ export class UsersPageHelper extends PageHelper { .clear() .blur() .should('have.class', 'ng-invalid'); - cy.contains('#display_name + .invalid-feedback', 'This field is required.'); + cy.get('cds-text-label[for=display_name]') + .find('.invalid-feedback') + .should('have.text', 'This field is required.'); // put invalid email to make field invalid cy.get('#email').type('a').blur().should('have.class', 'ng-invalid'); - cy.contains('#email + .invalid-feedback', 'This is not a valid email address.'); + cy.get('cds-text-label[for=email]') + .find('.invalid-feedback') + .should('have.text', 'This is not a valid email address.'); // put negative max buckets to make field invalid this.expectSelectOption('max_buckets_mode', 'Custom'); - cy.get('#max_buckets').clear().type('-5').blur().should('have.class', 'ng-invalid'); - cy.contains('#max_buckets + .invalid-feedback', 'The entered value must be >= 1.'); + cy.get('input#max_buckets').clear().type('-5').blur(); + cy.get('#max_buckets').should('have.class', 'ng-invalid'); + cy.get('cds-number[for=max_buckets]') + .find('.invalid-feedback') + .should('have.text', 'The entered value must be >= 1.'); this.navigateTo(); this.delete(tenant + '$' + uname, null, null, true, true); @@ -119,19 +130,27 @@ export class UsersPageHelper extends PageHelper { .blur() .should('not.have.class', 'ng-pending') .should('have.class', 'ng-invalid'); - cy.contains('#email + .invalid-feedback', 'This is not a valid email address.'); + + cy.get('cds-text-label[for=email]') + .find('.invalid-feedback') + .should('have.text', 'This is not a valid email address.'); // empty the display name field making it invalid - cy.get('#display_name').clear().blur().should('have.class', 'ng-invalid'); - cy.contains('#display_name + .invalid-feedback', 'This field is required.'); + cy.get('#display_name').clear({ force: true }).blur().should('have.class', 'ng-invalid'); + cy.get('cds-text-label[for=display_name]') + .find('.invalid-feedback') + .should('have.text', 'This field is required.'); // put negative max buckets to make field invalid this.selectOption('max_buckets_mode', 'Disabled'); - cy.get('#max_buckets').should('not.exist'); + cy.get('input#max_buckets').should('not.exist'); this.selectOption('max_buckets_mode', 'Custom'); - cy.get('#max_buckets').should('exist').should('have.value', '50'); - cy.get('#max_buckets').clear().type('-5').blur().should('have.class', 'ng-invalid'); - cy.contains('#max_buckets + .invalid-feedback', 'The entered value must be >= 1.'); + cy.get('input#max_buckets').should('exist').should('have.value', '50'); + cy.get('input#max_buckets').clear().type('-5').blur(); + cy.get('#max_buckets').should('have.class', 'ng-invalid'); + cy.get('cds-number[for=max_buckets]') + .find('.invalid-feedback') + .should('have.text', 'The entered value must be >= 1.'); this.navigateTo(); this.delete(tenant + '$' + uname, null, null, true, true); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.html index 3e732e35568..fe4023f6dfe 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.html @@ -1,59 +1,75 @@ - - {{ getMode() }} Tag + - -
- + +
+ +
+ Key + + + + This field is required. + This key must be unique. + Length of the key must be maximum of 128 characters + +
- - - - + +
+ Value + + + + This field is required. + Length of the value must be a maximum of 128 characters + +
+ +
+ + + +
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.ts index 5135539e5d4..1f7a0418812 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Output } from '@angular/core'; import { Validators } from '@angular/forms'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { BaseModal } from 'carbon-components-angular'; import _ from 'lodash'; import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; @@ -12,7 +12,7 @@ import { CdValidators } from '~/app/shared/forms/cd-validators'; templateUrl: './bucket-tag-modal.component.html', styleUrls: ['./bucket-tag-modal.component.scss'] }) -export class BucketTagModalComponent { +export class BucketTagModalComponent extends BaseModal { @Output() submitAction = new EventEmitter(); @@ -21,11 +21,8 @@ export class BucketTagModalComponent { currentKeyTags: string[]; storedKey: string; - constructor( - private formBuilder: CdFormBuilder, - public activeModal: NgbActiveModal, - public actionLabels: ActionLabelsI18n - ) { + constructor(private formBuilder: CdFormBuilder, public actionLabels: ActionLabelsI18n) { + super(); this.createForm(); } @@ -62,7 +59,7 @@ export class BucketTagModalComponent { onSubmit() { this.submitAction.emit(this.form.value); - this.activeModal.close(); + this.closeModal(); } getMode() { 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 df6150d028a..71097b4527c 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 @@ -1,694 +1,630 @@ -
-
-
{{ action | titlecase }} {{ resource | upperFirst }}
-
- -
- -
- -
-
+
{{ action | titlecase }} {{ resource | upperFirst }}
- -
- -
- - This field is required. - Bucket names can only contain lowercase letters, numbers, periods and hyphens. - The chosen name is already in use. - Bucket names must not contain uppercase characters or underscores. - Each label must start and end with a lowercase letter or a number. - Bucket names cannot be formatted as IP address. - Bucket labels cannot be empty and can only contain lowercase letters, numbers and hyphens. - Bucket names must be 3 to 63 characters long. -
-
+ +
+ Id + + +
- -
- -
- - This field is - required. - The bucket is owned by an account. UI does not support changing the ownership of bucket owned by an account. - -
-
+ +
+ Name + + + + This field is required. + Bucket names can only contain lowercase letters, numbers, periods and hyphens. + The chosen name is already in use. + Bucket names must not contain uppercase characters or underscores. + Each label must start and end with a lowercase letter or a number. + Bucket names cannot be formatted as IP address. + Bucket labels cannot be empty and can only contain lowercase letters, numbers and hyphens. + Bucket names must be 3 to 63 characters long. + +
- -
- Versioning + +
+ Owner + + + + + + This field is required. + + + The bucket is owned by an account. UI does not support changing + the ownership of bucket owned by an account. + +
-
-
-
- - - - Enables versioning for the objects in the bucket. - -
-
-
-
+ +
+
+ Versioning - -
- - Multi-Factor Authentication + Enabled + + Enables versioning for the objects in the bucket. + + +
+
-
-
-
- - - - Enables MFA (multi-factor authentication) Delete, which requires additional authentication for changing the bucket versioning state. - -
-
-
-
- -
- - This field is required. -
-
-
- -
- - This field is required. -
-
- + +
+ +
+ Multi-Factor Authentication - -
- Object Locking - - 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. + Delete enabled + +
+
+ Token Serial Number + + + + This field is required. + +
+
+ Token PIN + + + + This field is required. + +
+
+ + +
+
+ + Object Locking + + 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. - - - -
- -
- - - Enables locking for the objects in the bucket. Locking can only be enabled while creating a bucket. - -
-
- -
- -
- - - In COMPLIANCE an object version cannot be overwritten or deleted for the duration of the period. - - In GOVERNANCE mode, users cannot overwrite or delete an object version or alter its lock settings unless they have special permissions. - - -
-
- -
- -
- - - The number of days that you want to specify for the default retention period that will be - applied to new objects placed in this bucket. - - The entered value must be a positive integer. - Retention Days must be a positive integer. -
-
- -
-
-
- - Bucket Versioning can't be disabled when Object Locking is enabled. - - - Enabling Object Locking will allow the configuration of GOVERNANCE or COMPLIANCE modes, which will help - ensure that an object version cannot be overwritten or deleted for the specified period. - -
-
-
+ + + + Enable - -
- Encryption -
- -
- - - Enables encryption for the objects in the bucket. - To enable encryption on a bucket you need to set the configuration values for SSE-S3 or SSE-KMS. - To set the configuration values - Click here - -
-
-
-
-
-
- - -
-
-
+ + Enables locking for the objects in the bucket. Locking can only be enabled while creating a bucket. + + +
-
-
-
- - -
-
-
+ +
+ + + + + + + In COMPLIANCE an object version cannot be overwritten or deleted for the duration of the period. + + + In GOVERNANCE mode, users cannot overwrite or delete an object version or alter its lock settings unless they have special permissions. + + +
+ +
+ + + The entered value must be a positive integer. + Retention Days must be a positive integer. + +
+ + + Bucket Versioning can't be disabled when Object Locking is enabled. + + + Enabling Object Locking will allow the configuration of GOVERNANCE or COMPLIANCE modes, which will help ensure that an object version cannot be overwritten or deleted for the specified period. + +
-
-
- -
- - This field is required. -
-
-
+ +
+
+ Encryption + Enable + + Enables encryption for the objects in the bucket. + To enable encryption on a bucket you need to set the configuration values for SSE-S3 or SSE-KMS. + To set the configuration values Click here + + +
-
-
- -
- - This field is required. -
-
-
-
- +
+
+ + SSE-S3 + Connect to an external key management service + +
- -
- Replication -
- -
- - - Enables replication for the objects in the bucket. - -
- - A bi-directional sync policy group will be created by the dashboard along with flows and pipes. - The pipe id will then be used for applying the replication policy to the bucket. - -
-
+
+
+ KMS Provider + + + + + + This field is required. +
-
- -
- Tags - Tagging provides a way to categorize storage - - - - - -
-
- Maximum of 20 tags reached - -
+
+ Key Id + + + + This field is required. +
-
+
+
+ - -
- Policies - -
-
-
+ +
+
+ Replication + + Enable + Enables replication for the objects in the bucket. + - - -
- - Invalid json text. - -
- - -
-
-
+ A bi-directional sync policy group will be created by the dashboard along with flows and pipes. + The pipe id will then be used for applying the replication policy to the bucket. + + +
+
- -
- -
- - Invalid json text. - Invalid xml text. - -
- -
-
-
+ +
+ Tags + Tagging provides a way to categorize storage + + + + -
+
+
+ + + +
+
+
- - -
-
- 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 - - - This field is required. -
-
-
- + +
+
+ Policies + + + + Bucket Policy + + + + Invalid json text. + +
+
+ + + + +
+
+ + +
-
+ + - - - -
- -
- - - - 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. - - -
+ +
+ Lifecycle + + JSON or XML formatted document + + + Invalid json text. + Invalid xml text. + +
+
+ + +
- +
+ + + +
+
+
+ +
- - + + ACL + Any changes to the ACL will overwrite previous one. + You can choose any of the available options to modify the spcified user group. + +
+
+ Grantee + + + + This field is required. + +
+
+ + + + + This field is required. + +
+
+ - + + + + + + +
-
+
- - + + + + + +
-
- Checking multi-site status... -
+ Checking multi-site status...
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts index 24090aba905..0de5bbdef56 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts @@ -19,6 +19,8 @@ import { RgwBucketMfaDelete } from '../models/rgw-bucket-mfa-delete'; import { RgwBucketVersioning } from '../models/rgw-bucket-versioning'; import { RgwBucketFormComponent } from './rgw-bucket-form.component'; import { RgwRateLimitComponent } from '../rgw-rate-limit/rgw-rate-limit.component'; +import { CheckboxModule, SelectModule } from 'carbon-components-angular'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; describe('RgwBucketFormComponent', () => { let component: RgwBucketFormComponent; @@ -36,8 +38,11 @@ describe('RgwBucketFormComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastrModule.forRoot() - ] + ToastrModule.forRoot(), + SelectModule, + CheckboxModule + ], + schemas: [NO_ERRORS_SCHEMA] }); beforeEach(() => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts index 53fdf5273b8..6aac20881e8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts @@ -23,7 +23,6 @@ import { CdForm } from '~/app/shared/forms/cd-form'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { CdValidators } from '~/app/shared/forms/cd-validators'; -import { ModalService } from '~/app/shared/services/modal.service'; import { NotificationService } from '~/app/shared/services/notification.service'; import { rgwBucketEncryptionModel } from '../models/rgw-bucket-encryption'; import { RgwBucketMfaDelete } from '../models/rgw-bucket-mfa-delete'; @@ -41,6 +40,7 @@ import { map, switchMap } from 'rxjs/operators'; import { TextAreaXmlFormatterService } from '~/app/shared/services/text-area-xml-formatter.service'; import { RgwRateLimitComponent } from '../rgw-rate-limit/rgw-rate-limit.component'; import { RgwRateLimitConfig } from '../models/rgw-rate-limit'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; @Component({ selector: 'cd-rgw-bucket-form', @@ -96,7 +96,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit, AfterViewC private formBuilder: CdFormBuilder, private rgwBucketService: RgwBucketService, private rgwSiteService: RgwSiteService, - private modalService: ModalService, + private modalService: ModalCdsService, private rgwUserService: RgwUserService, private notificationService: NotificationService, private textAreaJsonFormatterService: TextAreaJsonFormatterService, @@ -498,7 +498,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit, AfterViewC showTagModal(index?: number) { const modalRef = this.modalService.show(BucketTagModalComponent); - const modalComponent = modalRef.componentInstance as BucketTagModalComponent; + const modalComponent = modalRef as BucketTagModalComponent; modalComponent.currentKeyTags = this.tags.map((item) => item.key); if (_.isNumber(index)) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.html index 045896ee19a..e704670e829 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.html @@ -2,15 +2,12 @@ [open]="open" (overlaySelected)="closeModal()"> {{editing ? 'Edit' : 'Create'}} Tiering configuration + i18n>{{editing ? 'Edit' : 'Create'}} Tiering configuration + +
- - - All fields are required, except where marked optional. - - - + Rate Limit The User Rate Limit controls the max read/write operations and data per minute for each user. @@ -33,61 +34,45 @@
+ -
-
-
- - - Toggle to enable or disable the rate limit settings. -
-
+
+ + Enabled + Toggle to enable or disable the rate limit settings. +
- -
+
-
-
- - - Select this box to allow unlimited read operations. -
-
+ + Unlimited read ops + Select this box to allow unlimited read operations. +
- +
- -
- - Limits the number of read operations per minute for a user. + + + + Enter a positive number. -
+
+ -
-
-
- - - Select this box to allow unlimited write operations. -
-
+ + Unlimited write ops + Select this box to allow unlimited write operations. +
+
- -
- - Limits the number of write operations per minute for a user. + + + + Enter a positive number. -
+
+ -
-
-
- - - Select this box to allow unlimited read bytes. -
-
+ + Unlimited read bytes + Select this box to allow unlimited read bytes. +
+
- -
- - Limits the number of read bytes per minute for a user. + + + + + Enter a positive number. -
+
+ -
-
-
- - - Select this box to allow unlimited write bytes. -
-
+ + Unlimited write bytes + Select this box to allow unlimited write bytes. +
+
- -
- - Limits the number of write bytes per minute for a user. + + + + + This field is required. The value is not valid. Enter a positive number. -
+
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.html index 35710457f44..3d930d5bdc2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.html @@ -8,12 +8,9 @@
{{ action | titlecase }} {{ resource | upperFirst }} + +
- - - All fields are required, except where marked optional. - -
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html index d94e2b94497..2490fbdd175 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html @@ -1,70 +1,78 @@ - - {{ action | titlecase }} {{ resource | upperFirst }} + + +

{{ action | titlecase }} {{ resource | upperFirst }}

+ + +
-
-