Copilot commented on code in PR #13187:
URL: https://github.com/apache/cloudstack/pull/13187#discussion_r3504097087
##########
ui/src/views/compute/AutoScaleVmProfile.vue:
##########
@@ -468,13 +480,22 @@ export default {
this.loading = false
})
},
- getTemplateName (templateid) {
- for (const template of this.templatesList) {
- if (template.id === templateid) {
- return template.name
- }
+ fetchTemplate (templateid) {
+ if (!templateid) return
+ const params = {
+ id: templateid,
+ templatefilter: 'executable'
Review Comment:
`fetchTemplate` can leave a stale template name in the UI: it never clears
`templateName`, it doesn’t handle API errors, and it can apply an out-of-date
response if `templateid` changes while the request is in flight. This can cause
the template name to be incorrect after switching profiles or after edits.
##########
ui/src/views/compute/AutoScaleVmProfile.vue:
##########
@@ -604,6 +629,7 @@ export default {
this.$pollJob({
jobId: response.updateautoscalevmprofileresponse.jobid,
successMethod: (result) => {
+ this.closeModal()
Review Comment:
`updateAutoScaleVmProfile` sets `loading=false` as soon as the initial API
call returns (job submitted), which re-enables the update action while the
async job is still running. Also, calling `closeModal()` here triggers an
immediate `fetchData()` and then `closeModal` will be invoked again via the
modal’s `afterClose`, causing duplicate refreshes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]