ui: fix considerlasthost for start vm#10602
Conversation
Fixes apache#10601 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@shwstppr a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
| } | ||
| for (const key in values) { | ||
| if (values[key]) { | ||
| if (values[key] || values[key] === false) { |
There was a problem hiding this comment.
Couldn't we simply remove this if condition? I don't see how a form's field value could be null or undefined here
There was a problem hiding this comment.
@bernardodemarco It may be there because some fields may have an empty value which we shouldn't pass to the API
There was a problem hiding this comment.
Okay. Specifically in this form, in which all fields are select components (except for the considerlasthost), the UI does not allow the values to be empty.
However, I think that's a great idea to keep the if statement how you proposed, since that we could, in the future, add more fields to the form that can accept empty/nullable values
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #10602 +/- ##
=========================================
Coverage 15.16% 15.16%
- Complexity 11326 11328 +2
=========================================
Files 5414 5414
Lines 474804 474811 +7
Branches 57909 57911 +2
=========================================
+ Hits 72002 72016 +14
+ Misses 394749 394743 -6
+ Partials 8053 8052 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
UI build: ✔️ |
There was a problem hiding this comment.
@shwstppr, I think that we should also tackle this bug when starting VMs through group actions.
I debugged the current behavior of the AutogenView component. On this block of code:
cloudstack/ui/src/views/AutogenView.vue
Lines 1443 to 1447 in 6c40a7b
The paramsList variable contains the considerlasthost parameter as undefined and, thus, it is not sent within the API request. To handle that, we could, in the following groupMap field:
cloudstack/ui/src/config/section/compute.js
Lines 116 to 124 in 6c40a7b
Check whether values.considerlasthost is undefined. If so, the considerlasthost field could be set as false.
Edit: The bug when starting VMs through group actions occurs when the form is opened, and the considerlasthost field is not changed. If the field is set to true and switched back to false, then the UI sets the considerlasthost parameter correctly to false.
weizhouapache
left a comment
There was a problem hiding this comment.
code lgtm
makes sense to pass the value "false" to API
good point. |
|
Thanks guys for group action pointers. Will check and update. |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@shwstppr a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
DaanHoogland
left a comment
There was a problem hiding this comment.
tested with devtools in qa , parameter is passed
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Description
Fixes #10601
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?