ui: Fix bulk deletion of ssh key pairs (#6286)

This commit is contained in:
Pearl Dsilva 2022-04-20 07:17:59 +05:30 committed by GitHub
parent 4313c3def7
commit c339f6eef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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
}
})
}

View File

@ -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