Skip to content

Commit 0d04bd6

Browse files
authored
ui: fix tags selection for add disk offering (#4665)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent f5a44b3 commit 0d04bd6

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

ui/src/views/offering/AddDiskOffering.vue

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@
334334
:loading="storageTagLoading"
335335
:placeholder="this.$t('label.tags')"
336336
v-if="this.isAdmin()">
337-
<a-select-option v-for="(opt) in this.storageTags" :key="opt.name">
338-
{{ opt.name || opt.description }}
337+
<a-select-option v-for="(opt) in this.storageTags" :key="opt">
338+
{{ opt }}
339339
</a-select-option>
340340
</a-select>
341341
</a-form-item>
@@ -530,13 +530,10 @@ export default {
530530
params.listAll = true
531531
this.storageTagLoading = true
532532
api('listStorageTags', params).then(json => {
533-
const tags = json.liststoragetagsresponse.storagetag
534-
if (this.arrayHasItems(tags)) {
535-
for (var i in tags) {
536-
var tag = {}
537-
tag.id = tags[i].name
538-
tag.name = tags[i].name
539-
this.storageTags.push(tag)
533+
const tags = json.liststoragetagsresponse.storagetag || []
534+
for (const tag of tags) {
535+
if (!this.storageTags.includes(tag.name)) {
536+
this.storageTags.push(tag.name)
540537
}
541538
}
542539
}).finally(() => {

0 commit comments

Comments
 (0)