Skip to content

Commit 070cbc1

Browse files
davidjumaniyadvr
authored andcommitted
Prevent form from closing if validation fails (#651)
* Prevent form from closing if validation fails * Prevent closing on failure for custom forms * Fixing group actions Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 60551ae commit 070cbc1

52 files changed

Lines changed: 93 additions & 128 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ui/src/views/AutogenView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,13 +984,13 @@ export default {
984984
if (!hasJobId) {
985985
this.fetchData()
986986
}
987+
this.closeAction()
987988
}
988989
}).catch(error => {
989990
console.log(error)
990991
this.$notifyError(error)
991992
}).finally(f => {
992993
this.actionLoading = false
993-
this.closeAction()
994994
})
995995
})
996996
},

ui/src/views/compute/AssignInstance.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,12 @@ export default {
212212
this.$notification.success({
213213
message: this.$t('label.loadbalancerinstance')
214214
})
215-
this.loading = false
216215
this.$parent.$parent.close()
217216
this.parentFetchData()
218217
}).catch(error => {
219218
this.$notifyError(error)
220-
this.$parent.$parent.close()
221-
this.parentFetchData()
219+
}).finally(() => {
220+
this.loading = false
222221
})
223222
}
224223
}

ui/src/views/compute/AttachIso.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ export default {
135135
catchMessage: this.$t('error.fetching.async.job.result')
136136
})
137137
}
138+
this.closeAction()
138139
}).catch(error => {
139140
this.$notifyError(error)
140141
}).finally(() => {
141142
this.loading = false
142-
this.closeAction()
143143
})
144144
})
145145
}

ui/src/views/compute/ChangeAffinity.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ export default {
154154
this.parentFetchData()
155155
}).catch(error => {
156156
this.$notifyError(error)
157-
this.$parent.$parent.close()
158-
this.parentFetchData()
159157
}).finally(() => {
160158
this.loading = false
161159
})

ui/src/views/compute/CreateKubernetesCluster.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,12 @@ export default {
485485
this.$emit('refresh-data')
486486
}
487487
})
488+
this.closeAction()
489+
this.$emit('refresh-data')
488490
}).catch(error => {
489491
this.$notifyError(error)
490492
}).finally(() => {
491-
this.$emit('refresh-data')
492493
this.loading = false
493-
this.closeAction()
494494
})
495495
})
496496
},

ui/src/views/compute/DestroyVM.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ export default {
136136
catchMessage: this.$t('error.fetching.async.job.result'),
137137
successMessage: `${this.$t('message.success.delete.vm')} ${this.resource.name}`
138138
})
139+
this.parentFetchData()
140+
this.closeAction()
139141
}).catch(error => {
140142
this.$notifyError(error)
141143
}).finally(() => {
142144
this.loading = false
143-
this.parentFetchData()
144-
this.closeAction()
145145
})
146146
})
147147
},

ui/src/views/compute/ScaleKubernetesCluster.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ export default {
198198
this.$emit('refresh-data')
199199
}
200200
})
201+
this.closeAction()
202+
this.$emit('refresh-data')
201203
}).catch(error => {
202204
this.$notifyError(error)
203205
}).finally(() => {
204-
this.$emit('refresh-data')
205206
this.loading = false
206-
this.closeAction()
207207
})
208208
})
209209
},

ui/src/views/compute/ScaleVM.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ export default {
182182
this.parentFetchData()
183183
}).catch(error => {
184184
this.$notifyError(error)
185-
this.$parent.$parent.close()
186-
this.parentFetchData()
187185
}).finally(() => {
188186
this.loading = false
189187
})

ui/src/views/compute/UpgradeKubernetesCluster.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,12 @@ export default {
170170
this.$emit('refresh-data')
171171
}
172172
})
173+
this.$emit('refresh-data')
174+
this.closeAction()
173175
}).catch(error => {
174176
this.$notifyError(error)
175177
}).finally(() => {
176-
this.$emit('refresh-data')
177178
this.loading = false
178-
this.closeAction()
179179
})
180180
})
181181
},

ui/src/views/iam/AddAccount.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,10 @@ export default {
383383
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message,
384384
duration: 0
385385
})
386-
}).finally(() => {
387-
this.loading = false
388-
this.closeAction()
389386
})
390387
}
391388
}
389+
this.closeAction()
392390
}).catch(error => {
393391
this.$notification.error({
394392
message: this.$t('message.request.failed'),
@@ -397,7 +395,6 @@ export default {
397395
})
398396
}).finally(() => {
399397
this.loading = false
400-
this.closeAction()
401398
})
402399
})
403400
},

0 commit comments

Comments
 (0)