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

Fixes #12843 - lookup values are hidden when creating them if lookup key is hidden #2981

Closed
wants to merge 1 commit into from

Conversation

orrabin
Copy link
Member

@orrabin orrabin commented Dec 16, 2015

No description provided.

@@ -40,7 +40,8 @@ def use_puppet_default_help link_title = nil, title = _("Use Puppet default")
end

def hidden_value_field(f, field, value, disabled, options = {})
if f.object.hidden_value?
hidden = options.delete(:hidden_value)
if f.object.hidden_value? || hidden
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would switch the order of this || in case the option is passed explicitly to save checking the form object.

@orrabin
Copy link
Member Author

orrabin commented Dec 17, 2015

@tbrisker I fixed all of your comments

@@ -40,7 +40,8 @@ def use_puppet_default_help link_title = nil, title = _("Use Puppet default")
end

def hidden_value_field(f, field, value, disabled, options = {})
if f.object.hidden_value?
hidden = options.delete(:hidden_value)
if hidden || f.object.hidden_value?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if hidden==false, this will still check f.object.hidden_value?.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f.object.hidden_value? will have the same value as hidden or it will be nil so if hidden is false the whole condition will be false anyway so that's fine.

@orrabin
Copy link
Member Author

orrabin commented Dec 24, 2015

@tbrisker I fixed one comment and answered the rest.

@tbrisker
Copy link
Member

👍 LGTM.

@dLobatog dLobatog self-assigned this Dec 28, 2015
@theforeman-bot
Copy link
Member

@orrabin, this pull request is currently not mergeable. Please rebase against the develop branch and push again.

If you have a remote called 'upstream' that points to this repository, you can do this by running:

    $ git pull --rebase upstream develop

This message was auto-generated by Foreman's prprocessor

@orrabin
Copy link
Member Author

orrabin commented Jan 7, 2016

[test]

@orrabin
Copy link
Member Author

orrabin commented Jan 14, 2016

@dLobatog can you take a look? I fixed all the comments and the test failures are unrelated.

@dLobatog
Copy link
Member

@orrabin Thanks. It fixes the behavior the bug describes, but now unticking hidden_value leaves matcher values and default value hidden. All fields should be visible when it's unticked. That's for an already hidden smart class parameter.

file

If I try to hide a smart class parameter, still all fields are shown on the clear and cannot be hidden until I save it:

file

@orrabin
Copy link
Member Author

orrabin commented Jan 19, 2016

@dLobatog I fixed it and rebased.

@orrabin
Copy link
Member Author

orrabin commented Jan 20, 2016

[test]

@dLobatog
Copy link
Member

Test failure is the usual integration test, not related with this.

@dLobatog
Copy link
Member

Merged as 505c259, thanks @orrabin!

@dLobatog dLobatog closed this Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants