-
Notifications
You must be signed in to change notification settings - Fork 209
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
Fix various uses of the is_admin helper in templates #1879
Conversation
…Script that resulted in empty lists, because the helper returns a Perl boolean value instead of a JavaScript boolean
Changed the title since you're saying it is still WIP. But it looks already good. (Beside the fact that the admin table code isn't a very nice place.) |
@@ -2,7 +2,7 @@ | |||
% title 'Test suites'; | |||
|
|||
% content_for 'ready_function' => begin | |||
populate_admin_table(<%= is_admin %>, true); | |||
populate_admin_table(<%= is_admin ? 'true' : 'false' %>, true); |
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.
as you put the same code now in 3 places, this sounds like a good helper candidate
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.
Sure, do you have a preferred naming convention for js generating helpers?
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.
Otherwise i suppose is_admin_js
or js_is_admin
would work. Not sure which i prefer.
Ok, this should be ready now. I've added a new helper and test. |
I re-triggered the failing test because it looks unrelated. If I remember correctly, I have already seen this failure before.
|
Yea, that test failure can't be related to this pull request. |
Codecov Report
@@ Coverage Diff @@
## master #1879 +/- ##
==========================================
+ Coverage 90.56% 90.68% +0.11%
==========================================
Files 148 148
Lines 10250 10249 -1
==========================================
+ Hits 9283 9294 +11
+ Misses 967 955 -12
Continue to review full report at Codecov.
|
The
is_admin
helper returns a Perl boolean, but was used to generate JavaScript booleans directly here. There was one more use of<%= is_admin %>
forsetupJobTemplates
, but that function does not actually use that argument at all, so i opted to remove it.While the fix was very simple, i'm still trying to find a good place to test this and am learning Selenium in the process. So please consider this pull request a work in progress for now.
Progress issue: https://progress.opensuse.org/issues/44039