Copilot commented on code in PR #10790:
URL: https://github.com/apache/cloudstack/pull/10790#discussion_r2371168109
##########
ui/src/views/setting/ConfigurationValue.vue:
##########
@@ -275,6 +275,14 @@ export default {
if (configrecord.type === 'WhitespaceSeparatedListWithOptions') {
newValue = newValue.join(' ')
}
+
+ // The updateConfiguration API expects a blank string to clean up the
configuration value
+ if (
+ (['CSV', 'Order', 'WhitespaceSeparatedListWithOptions',
'String'].includes(configrecord.type) && newValue.length === 0)
Review Comment:
[nitpick] The condition on line 281 has unnecessary parentheses around the
array inclusion check. The outer parentheses should be removed for better
readability.
```suggestion
['CSV', 'Order', 'WhitespaceSeparatedListWithOptions',
'String'].includes(configrecord.type) && newValue.length === 0
```
##########
ui/src/views/setting/ConfigurationValue.vue:
##########
@@ -362,6 +370,17 @@ export default {
}
return 0
}
+
+ if (configrecord.value?.trim().length === 0) {
Review Comment:
[nitpick] This condition could be simplified to
`!configrecord.value?.trim()` which is more idiomatic and handles both empty
strings and whitespace-only strings.
```suggestion
if (!configrecord.value?.trim()) {
```
--
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]