ManageIQ / ui-components

Angular UI Components for ManageIQ
Apache License 2.0
16 stars 52 forks source link

[WIP] Dialog Editor - reset default_value when changing dropdown type, values, or between single and multiselect #432

Closed himdel closed 4 years ago

himdel commented 4 years ago

When editing dropdown or tag control properties, changing the value type, single/multi, or the list of tags would not update the chosen defualt_value.

That leads to problems like integer multiselects having a default value of 1 (integer), causing the backend code to blow up trying to iterate over the chosen options.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1746211


wip - fixes the bug, but the reset method should be shared, and should pick the first value sometimes, (and maybe even preserve the original value if it still exists) and move the watch part of entries change to oninit too and check out the intent behind the relevant changes from https://github.com/ManageIQ/ui-components/pull/223 and convertValuesToArray should be merged into this code too

miq-bot commented 4 years ago

Checked commits https://github.com/himdel/ui-components/compare/b283597888d38610c772907730f730fb261c79cb~...07c9a2fea47f19cf887a94964ff9ba93d27154c3 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 0 files checked, 0 offenses detected Everything looks fine. :trophy:

miq-bot commented 4 years ago

This pull request is not mergeable. Please rebase and repush.