Skip to content

Commit e45f8ea

Browse files
authored
Merge pull request ceph#55241 from rhcs-dashboard/remove-bucket-policy
mgr/dashboard: Remove bucket policy Reviewed-by: Avan Thakkar <[email protected]> Reviewed-by: Ankush Behl <[email protected]> Reviewed-by: Nizamudeen A <[email protected]>
2 parents 7a04e9b + ae36735 commit e45f8ea

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)