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

[webui] In /search, remove extra hidden form fields #4133

Merged
merged 2 commits into from
Feb 5, 2018
Merged

[webui] In /search, remove extra hidden form fields #4133

merged 2 commits into from
Feb 5, 2018

Conversation

andreasstieger
Copy link
Member

In /search, remove extra hidden form fields.

This also fixes the association of the labels with the checkboxes.

@mdeniz mdeniz added the Frontend Things related to the OBS RoR app label Nov 23, 2017
Copy link
Contributor

@mdeniz mdeniz left a comment

Choose a reason for hiding this comment

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

I guess that those hidden inputs are needed to send the default values, because the browser won't send any value if a checkbox is unchecked.

Is the intention of this PR to fix the label association? I haven't tried but maybe if you switch the order of the inputs it could work 🤔

@andreasstieger
Copy link
Member Author

Yes the goal is to fix the association with the check-boxes.

This form is submitted via GET, and all that the default parameters in the hidden fields are 0. The search does not break when they are missing, and any remaining parameters can be handled server-side. I have not found a function of these hidden fields.

@hennevogel
Copy link
Member

@andreasstieger please prefix your commit with one of our tags

@andreasstieger andreasstieger changed the title In /search, remove extra hidden form fields [webui] In /search, remove extra hidden form fields Nov 29, 2017
@hennevogel
Copy link
Member

@andreasstieger the commit, not the pull request :-)

@andreasstieger
Copy link
Member Author

tag added

@hennevogel
Copy link
Member

@mdeniz please re-review

@bgeuken
Copy link
Member

bgeuken commented Jan 4, 2018

The search controller is considering any value != nil as true (for these fields). So when you drop the hidden fields, you also have to adjust the controller code. Which then requires a small change in the search widget form (we have to provide the default search parameters).

I also tried having the default parameters defined in the controller, but that did not work because for empty checkboxes the form does not create a parameter key/value pair.

I did these changes here and did some testing. It seems that everything works like before.

Though someone else should review my changes and double check. @mdeniz @hennevogel ^?

Feel free to cherry pick or stash that commit into your changes:-)

@mdeniz
Copy link
Contributor

mdeniz commented Jan 19, 2018

Hey, @andreasstieger can you add what @bgeuken says? I will review it when done 👍

@hennevogel
Copy link
Member

@andreasstieger ping

Andreas Stieger and others added 2 commits February 2, 2018 13:17
This also fixes the association of the labels with the checkboxes.
This will allow us to drop some hidden fields from the search form
(5af7b8e).
Because of that change we have to add the default search parameters to
the form of the 'global-search-form'.
@andreasstieger
Copy link
Member Author

Added a6b2347. I do not know the code well enough to go deeper than this.

@codecov
Copy link

codecov bot commented Feb 2, 2018

Codecov Report

Merging #4133 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4133   +/-   ##
=======================================
  Coverage   88.11%   88.11%           
=======================================
  Files         352      352           
  Lines       18708    18708           
=======================================
  Hits        16485    16485           
  Misses       2223     2223
Flag Coverage Δ
#api 80.17% <0%> (ø) ⬆️
#rspec 70.84% <100%> (ø) ⬆️

@hennevogel
Copy link
Member

@bgeuken is this it?

@mdeniz mdeniz merged commit 3e24d3f into openSUSE:master Feb 5, 2018
@bgeuken
Copy link
Member

bgeuken commented Feb 6, 2018

Yep, just tested it. There seems to be a bug with searches via title. But this also happens with out the applied changes.
I am going to deploy now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants