From c339f6eef983433520427441b902ca080511382e Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Wed, 20 Apr 2022 07:17:59 +0530 Subject: [PATCH] ui: Fix bulk deletion of ssh key pairs (#6286) --- ui/src/config/section/compute.js | 4 ++-- ui/src/views/AutogenView.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index a5c21459cb5..48871b2ee21 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -622,9 +622,9 @@ export default { popup: true, groupMap: (selection, values, record) => { return selection.map(x => { - const data = record.filter(y => { return y.name === x }) + const data = record.filter(y => { return y.id === x }) return { - name: x, account: data[0].account, domainid: data[0].domainid + name: data[0].name, account: data[0].account, domainid: data[0].domainid } }) } diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index a03363a57f1..84781a203cc 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -590,7 +590,7 @@ export default { if (this.$route.path.includes('/template') || this.$route.path.includes('/iso')) { objIndex = selectedItems.findIndex(obj => (obj.zoneid === tempResource[r])) } else { - objIndex = selectedItems.findIndex(obj => (obj.id === tempResource[r] || obj.username === tempResource[r])) + objIndex = selectedItems.findIndex(obj => (obj.id === tempResource[r] || obj.username === tempResource[r] || obj.name === tempResource[r])) } if (state && objIndex !== -1) { this.selectedItems[objIndex].status = state @@ -1261,7 +1261,7 @@ export default { this.items.map(x => { itemsNameMap[x.id] = x.name || x.displaytext || x.id }) - const paramsList = this.currentAction.groupMap(this.selectedRowKeys, values) + const paramsList = this.currentAction.groupMap(this.selectedRowKeys, values, this.items) for (const params of paramsList) { var resourceName = itemsNameMap[params.id] // Using a method for this since it's an async call and don't want wrong prarms to be passed