-
Notifications
You must be signed in to change notification settings - Fork 39
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
Uncrispify ColumnsForm #3108
Uncrispify ColumnsForm #3108
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Test results 9 files 9 suites 8m 30s ⏱️ Results for commit 967abd4. ♻️ This comment has been updated with latest results. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3108 +/- ##
==========================================
- Coverage 60.47% 60.44% -0.03%
==========================================
Files 605 605
Lines 43773 43765 -8
Branches 48 48
==========================================
- Hits 26472 26455 -17
- Misses 17289 17298 +9
Partials 12 12 ☔ View full report in Codecov by Sentry. |
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.
I can confirm that this works (I even checked in the database that the value was actually changed).
python/nav/web/webfront/forms.py
Outdated
legend='Number of columns for widgets', | ||
fields=[ | ||
self['num_columns'], | ||
SubmitField(value='Save', css_classes='button small'), |
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.
The submit field already sets the css class button
, so this should be enough:
SubmitField(value='Save', css_classes='button small'), | |
SubmitField(value='Save', css_classes='small'), |
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.
Looks good!
reverse
is redundant since we do not process path name in python, instead we use url
in the form template to get url path when given name
{% if form.attrs.action %}action="{% url form.attrs.action %}"{% endif %} |
Have tested it manually and it works like the original implementation. Which to me seems broken given that it doesn't update the number of columns in the UI on success.
Also see @johannaengland comment about the class name.
5acf7b5
to
967abd4
Compare
Quality Gate passedIssues Measures |
Fixes #3100
Not sure if the
form_action
value is correct. tried to set it toreverse('webfront-preferences-setwidgetcolumns')
directly but that created some errors, but just giving the string without reversing seems to have worked fine?We dont have a separate uncrispy class for
NavSubmit
, but it seems aNavSubmit
button is pretty much just a smaller submit button using the css classesbutton small
, so I just used aSubmitField
with the additional css.Is it even necessary to include
button
as a class? It seems to look and behave exactly the same with justsmall