Skip to content

Commit ae36735

Browse files
committed
mgr/dashboard: remove bucket policy
add a button on the bucket form to clear the bucket policy Fixes: https://tracker.ceph.com/issues/64096 Signed-off-by: Pedro Gonzalez Gomez <[email protected]>
1 parent 8312655 commit ae36735

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@
430430
<span class="invalid-feedback"
431431
*ngIf="bucketForm.showError('bucket_policy', frm, 'invalidJson')"
432432
i18n>Invalid json text</span>
433+
<button type="button"
434+
id="clear-bucket-policy"
435+
class="btn btn-light my-3"
436+
(click)="clearBucketPolicy()"
437+
i18n>
438+
<i [ngClass]="[icons.destroy]"></i>
439+
Clear
440+
</button>
433441
<div class="btn-group float-end"
434442
role="group"
435443
aria-label="bucket-policy-helpers">

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ export class RgwBucketFormComponent extends CdForm implements OnInit, AfterViewC
385385
window.open(url, '_blank');
386386
}
387387

388+
clearBucketPolicy() {
389+
this.bucketForm.get('bucket_policy').setValue('{}');
390+
this.bucketForm.markAsDirty();
391+
this.bucketForm.updateValueAndValidity();
392+
}
393+
388394
openConfigModal() {
389395
const modalRef = this.modalService.show(RgwConfigModalComponent, null, { size: 'lg' });
390396
modalRef.componentInstance.configForm

0 commit comments

Comments
 (0)