ui: Fix groupaction for nw cleanup and Notify when groupaction fails (#6333)

This commit is contained in:
David Jumani 2022-04-28 17:51:43 +05:30 committed by GitHub
parent 87a402cc2b
commit b85d5e491a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 14 deletions

View File

@ -114,9 +114,9 @@ export default {
label: 'label.restart.network',
message: 'message.restart.network',
dataView: true,
args: (record) => {
args: (record, store, isGroupAction) => {
var fields = []
if (record.vpcid == null) {
if (isGroupAction || record.vpcid == null) {
fields.push('cleanup')
}
fields.push('livepatch')

View File

@ -133,23 +133,25 @@ export const pollJobPlugin = {
if (name) {
desc = `(${name}) ${desc}`
}
let onClose = () => {}
if (!bulkAction) {
let countNotify = store.getters.countNotify
countNotify++
store.commit('SET_COUNT_NOTIFY', countNotify)
notification.error({
top: '65px',
message: errMessage,
description: desc,
key: jobId,
duration: 0,
onClose: () => {
let countNotify = store.getters.countNotify
countNotify > 0 ? countNotify-- : countNotify = 0
store.commit('SET_COUNT_NOTIFY', countNotify)
}
})
onClose = () => {
let countNotify = store.getters.countNotify
countNotify > 0 ? countNotify-- : countNotify = 0
store.commit('SET_COUNT_NOTIFY', countNotify)
}
}
notification.error({
top: '65px',
message: errMessage,
description: desc,
key: jobId,
duration: 0,
onClose: onClose
})
store.dispatch('AddHeaderNotice', {
key: jobId,
title,