-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting the default_value for TagControl dialog field #276
Conversation
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1559159 The problem is the default options Choose and None had no id, and so the default_value remained unset and so an empty option field was created. (https://stackoverflow.com/a/12654812) In the fix I'm setting a value of the default options to 0, and setting them as default.
@karelhala can you please take a look if the fix is OK? |
@miq-bot assign @karelhala |
*/ | ||
private setDefaultValue() { | ||
let defaultOption = _.find(this.dialogField.values, { id: null }) | ||
defaultOption.id = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there is no defaultOption? I guess leaving blank space as was before is good isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe there always should be one for tag control element: ManageIQ/manageiq@58d78df#diff-8e5736b945bd4233c1f577172ad458b3R58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karelhala updated. Thanks 👍
Checked commits romanblanco/ui-components@f49f9d3~...c7ab976 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@romanblanco @himdel FYI, this is marked as blocker for the next gaprindashvili release. |
@miq-bot add_label blocker |
Backported to gaprindashvili:
@miq-bot add_label gaprindashvili/backported |
Setting the default_value for TagControl dialog field (cherry picked from commit e9a7280)
Released in 1.0.28 |
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1559159
The problem is the default options
<Choose>
and<None>
had no id, and so thedefault_value
remained unset and so an empty option field was created. (https://stackoverflow.com/a/12654812)In the fix I'm setting a value of the default options to
0
, and setting them as default.