mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
Merge pull request #56183 from rhcs-dashboard/fix-tags-null
mgr/dashboard: fix empty tags Reviewed-by: afreen23 <NOT@FOUND> Reviewed-by: Ankush Behl <cloudbehl@gmail.com> Reviewed-by: Nizamudeen A <nia@redhat.com>
This commit is contained in:
commit
cab8141bf1
@ -61,6 +61,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit, AfterViewC
|
||||
kmsVaultConfig = false;
|
||||
s3VaultConfig = false;
|
||||
tags: Record<string, string>[] = [];
|
||||
dirtyTags = false;
|
||||
tagConfig = [
|
||||
{
|
||||
attribute: 'key'
|
||||
@ -437,6 +438,7 @@ export class RgwBucketFormComponent extends CdForm implements OnInit, AfterViewC
|
||||
|
||||
deleteTag(index: number) {
|
||||
this.tags.splice(index, 1);
|
||||
this.dirtyTags = true;
|
||||
this.bucketForm.markAsDirty();
|
||||
this.bucketForm.updateValueAndValidity();
|
||||
}
|
||||
@ -447,11 +449,13 @@ export class RgwBucketFormComponent extends CdForm implements OnInit, AfterViewC
|
||||
} else {
|
||||
this.tags.push(tag);
|
||||
}
|
||||
this.dirtyTags = true;
|
||||
this.bucketForm.markAsDirty();
|
||||
this.bucketForm.updateValueAndValidity();
|
||||
}
|
||||
|
||||
private tagsToXML(tags: Record<string, string>[]): string {
|
||||
if (!this.dirtyTags && tags.length === 0) return '';
|
||||
let xml = '<Tagging><TagSet>';
|
||||
for (const tag of tags) {
|
||||
xml += '<Tag>';
|
||||
|
Loading…
Reference in New Issue
Block a user