Skip to content
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

Dialog editor: Make "Load Values on Init" independent of "Show Refresh Button" #376

Merged
merged 2 commits into from
Apr 9, 2019

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Mar 27, 2019

Depends on:

Dynamic dialog fields can load on init (once), by manually triggering a refresh button, or from "fields to refresh".

Before, when there was no refresh button, load on init was hardcoded to true on the model side and the switch was hidden.

This makes the "Load Values on Init" switch always visible, independent of "Show Refresh Button".

good

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

@himdel
Copy link
Contributor Author

himdel commented Mar 27, 2019

Cc @gmcculloug, @eclarizio ... an alternative to this would be to allow the user to actually disable both switches (so, no refresh button, and no loading on init), but I'm not sure how useful that would be.

(And would depend on backend changes, because...

app/models/dialog_field_sorted_item.rb
159-  def load_values_on_init?
160:    return true unless show_refresh_button
161-    load_values_on_init
162-  end

app/models/dialog_field_text_box.rb
88-  def load_values_on_init?
89:    return true unless show_refresh_button
90-    load_values_on_init
91-  end

)

EDIT: (this was written back when I tried to only show the switch, not making it possible to change)

@himdel
Copy link
Contributor Author

himdel commented Mar 27, 2019

EDIT: oh, never mind, turns out this is useful when you only want the field to update from "fields to refresh"

@miq-bot add_label wip

@miq-bot miq-bot changed the title Dialog editor: Show greyed out but enabled "Load Values on Init" when "Show Refresh Button" is off. [WIP] Dialog editor: Show greyed out but enabled "Load Values on Init" when "Show Refresh Button" is off. Mar 27, 2019
@miq-bot miq-bot added the wip label Mar 27, 2019
…h Button"

Before, load values on init was implied when show refresh button was false

Now, both can be set independently, allowing a field to only refresh because of "fields to refresh".

https://bugzilla.redhat.com/show_bug.cgi?id=1684575
@himdel himdel changed the title [WIP] Dialog editor: Show greyed out but enabled "Load Values on Init" when "Show Refresh Button" is off. [WIP] Dialog editor: Make "Load Values on Init" independent off "Show Refresh Button" Mar 27, 2019
@himdel
Copy link
Contributor Author

himdel commented Mar 27, 2019

@miq-bot remove_label wip

(but dependencies)

@miq-bot miq-bot changed the title [WIP] Dialog editor: Make "Load Values on Init" independent off "Show Refresh Button" Dialog editor: Make "Load Values on Init" independent off "Show Refresh Button" Mar 27, 2019
@miq-bot miq-bot removed the wip label Mar 27, 2019
@himdel
Copy link
Contributor Author

himdel commented Mar 27, 2019

@miq-bot add_label wip

TODO: make sure the default values still make sense

@miq-bot miq-bot changed the title Dialog editor: Make "Load Values on Init" independent off "Show Refresh Button" [WIP] Dialog editor: Make "Load Values on Init" independent off "Show Refresh Button" Mar 27, 2019
@miq-bot miq-bot added the wip label Mar 27, 2019
(since it really always has, except when show refresh button was enabled)
@miq-bot
Copy link
Member

miq-bot commented Mar 29, 2019

Checked commits https://github.com/himdel/ui-components/compare/114c60d16d2811acdf92df227d20222fc975f5ec~...3f98c7f91f7d26c4256b371918adfdacc2fd8566 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 🏆

@himdel
Copy link
Contributor Author

himdel commented Mar 29, 2019

@miq-bot remove_label wip

New fields should get load_values_on_init set to true by default.

@miq-bot miq-bot changed the title [WIP] Dialog editor: Make "Load Values on Init" independent off "Show Refresh Button" Dialog editor: Make "Load Values on Init" independent off "Show Refresh Button" Mar 29, 2019
@miq-bot miq-bot removed the wip label Mar 29, 2019
@himdel
Copy link
Contributor Author

himdel commented Mar 29, 2019

@miq-bot add_label hammer/no

(because ManageIQ/manageiq-schema#357 (comment))

@himdel himdel changed the title Dialog editor: Make "Load Values on Init" independent off "Show Refresh Button" Dialog editor: Make "Load Values on Init" independent of "Show Refresh Button" Apr 9, 2019
@martinpovolny martinpovolny merged commit 5b2611c into ManageIQ:master Apr 9, 2019
@martinpovolny martinpovolny self-assigned this Apr 9, 2019
@martinpovolny martinpovolny added this to the Sprint 109 Ending Apr 15, 2019 milestone Apr 9, 2019
@himdel himdel deleted the bz1684575 branch April 9, 2019 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants