-
Notifications
You must be signed in to change notification settings - Fork 365
Fix single tag page bug #9622
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
base: master
Are you sure you want to change the base?
Fix single tag page bug #9622
Conversation
201f0e9
to
c42f2d1
Compare
c42f2d1
to
d71c57c
Compare
0233b99
to
6721a36
Compare
6721a36
to
2f88670
Compare
@elsamaryv Please review. |
5821d47
to
867a78e
Compare
867a78e
to
0cec088
Compare
@elsamaryv please review and test again when you have time |
params.each do |var, val| | ||
if var.starts_with?("check_") | ||
has_no_check = false | ||
else | ||
next | ||
end | ||
end |
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.
Simpler Ruby
params.each do |var, val| | |
if var.starts_with?("check_") | |
has_no_check = false | |
else | |
next | |
end | |
end | |
has_no_check = params.none? { |var, _val| var.starts_with?("check_") } |
also, then you don't have to have line 13 anymore because it will be set here.
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.
@Fryguy I tried this out and hit an error on .none?
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.
Oh then use ! with .any?
Though I'm surprised .none? isn't working since I thought that's in active support
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.
Oh I know the problem - the params hash isn't a "normal" hash. Try this:
params.each do |var, val| | |
if var.starts_with?("check_") | |
has_no_check = false | |
else | |
next | |
end | |
end | |
has_no_check = params.each_key.none? { |var| var.start_with?("check_") } |
@GilbertCherrie In doing this, I remembered that starts_with?
isn't a Ruby method, but should have been start_with?
. That tells me this code path isn't tested (neither manually nor with automated tests). Please add specs covering this if possible otherwise, manually test.
15bd667
to
9ed4b70
Compare
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.
LGTM
This pr fixes an issue with the tagging form. Also, this pr removes the checkboxes from the tagging form table.
Before:

Select multiple service catalog items then go to the Policy / Edit Tags form. Click cancel on the form. Then when selecting a single catalog item and going to the Edit Tags form from the summary screen still shows the multiple items being tagged on the form.
After:

Only the selected service catalog item from the summary screen will show up on the tagging form.