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 <pegonzal@redhat.com>
<span class="invalid-feedback"
*ngIf="bucketForm.showError('bucket_policy', frm, 'invalidJson')"
i18n>Invalid json text</span>
+ <button type="button"
+ id="clear-bucket-policy"
+ class="btn btn-light my-3"
+ (click)="clearBucketPolicy()"
+ i18n>
+ <i [ngClass]="[icons.destroy]"></i>
+ Clear
+ </button>
<div class="btn-group float-end"
role="group"
aria-label="bucket-policy-helpers">
window.open(url, '_blank');
}
+ clearBucketPolicy() {
+ this.bucketForm.get('bucket_policy').setValue('{}');
+ this.bucketForm.markAsDirty();
+ this.bucketForm.updateValueAndValidity();
+ }
+
openConfigModal() {
const modalRef = this.modalService.show(RgwConfigModalComponent, null, { size: 'lg' });
modalRef.componentInstance.configForm