Skip to content

Commit 8ad480d

Browse files
authored
Merge pull request ceph#62476 from rhcs-dashboard/fix-70646-main
mgr/dashboard: fix bucket form encryption checkbox Reviewed-by: Nizamudeen A <[email protected]>
2 parents bb4d512 + c2e9c1e commit 8ad480d

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export class BucketsPageHelper extends PageHelper {
3535
// Select bucket owner
3636
this.selectOwner(owner);
3737
cy.get('#owner').should('have.class', 'ng-valid');
38+
cy.get('input[name=encryption_enabled]').should('be.disabled');
3839

3940
if (isLocking) {
4041
cy.get('#lock_enabled_input').click({ force: true });

src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.e2e-spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,10 @@ describe('RGW configuration page', () => {
3333
configurations.getDataTables().should('contain.text', 'https://localhost:9090');
3434
});
3535
});
36+
37+
describe('check bucket encryption checkbox', () => {
38+
it('should ensure encryption checkbox to be enabled in bucket form', () => {
39+
configurations.checkBucketEncryption();
40+
});
41+
});
3642
});

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { PageHelper } from '../page-helper.po';
2+
import { BucketsPageHelper } from './buckets.po';
3+
4+
const buckets = new BucketsPageHelper();
25

36
export class ConfigurationPageHelper extends PageHelper {
47
pages = {
@@ -46,4 +49,9 @@ export class ConfigurationPageHelper extends PageHelper {
4649
private selectSecretEngine(secret_engine: string) {
4750
return this.selectOption('secret_engine', secret_engine);
4851
}
52+
53+
checkBucketEncryption() {
54+
buckets.navigateTo('create');
55+
cy.get('input[name=encryption_enabled]').should('be.enabled');
56+
}
4957
}

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,8 @@ export class RgwBucketFormComponent extends CdForm implements OnInit, AfterViewC
190190

191191
this.kmsProviders = rgwBucketEncryptionModel.kmsProviders;
192192
this.rgwBucketService.getEncryptionConfig().subscribe((data) => {
193-
if (data['SSE_KMS']?.length > 0) {
194-
this.kmsConfigured = true;
195-
}
196-
if (data['SSE_S3']?.length > 0) {
197-
this.s3Configured = true;
198-
}
193+
this.s3Configured = data.s3 && Object.keys(data.s3).length > 0;
194+
this.kmsConfigured = data.kms && Object.keys(data.kms).length > 0;
199195
// Set the encryption type based on the configurations
200196
if (this.kmsConfigured && this.s3Configured) {
201197
this.bucketForm.get('encryption_type').setValue('');

0 commit comments

Comments
 (0)