Skip to content

Template and styles clean up#8197

Merged
javierjulio merged 15 commits into
masterfrom
template-and-style-updates
Jan 1, 2024
Merged

Template and styles clean up#8197
javierjulio merged 15 commits into
masterfrom
template-and-style-updates

Conversation

@javierjulio

@javierjulio javierjulio commented Dec 31, 2023

Copy link
Copy Markdown
Member

This includes minor clean up of templates and styles after review, to prep for a beta release.

Since we long removed jQuery and jQuery UI, this removes the date picker inputs as they are no longer needed. We default to the native HTML date input which users can override with their own custom date picker JS.

This adds a sorted icon to the table_for component as this was the final, missing UI piece for our data table styles. Some icons were not rendered correctly in RTL and have been fixed.

The resource generator now outputs the boilerplate by default with it uncommented so users are directed to configure their resource page rather than rely on defaults-rendering.

The main menu script now only toggles a data-open attribute. No need to set/remove CSS classes as we now use a Tailwind group modifier to hide/display the nested menu list and rotate the icon, for RTL as well.

These are no longer needed and have been replaced by the native HTML date input. The DatepickerInput was for jQuery UI but has since been removed. Formtastic already supports specifying `input_html` which will allow users to use a custom date picker if they want.
Since it was only used here. It was previously in the resource comments before partial extraction but no need there since the partial is meant to be copied and modified by host app.
This doesn't seem to have ever been completed but mongo should still be usable. We have introduced other ActiveRecord error handling so may be unavoidable.
@javierjulio javierjulio self-assigned this Dec 31, 2023
@javierjulio javierjulio changed the title Template and style clean up Template and styles clean up Dec 31, 2023
@codecov

codecov Bot commented Dec 31, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (74058cb) 99.03% compared to head (2b0cfd1) 99.03%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8197      +/-   ##
==========================================
- Coverage   99.03%   99.03%   -0.01%     
==========================================
  Files         151      149       -2     
  Lines        4150     4127      -23     
==========================================
- Hits         4110     4087      -23     
  Misses         40       40              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This inlines the previous boilerplate class into the generator since no need to hide this behind a flag. We want the generated boilerplate to be the default. It should be active (uncommented) so it can be tried out and modified. We want users to rely on declaring their resource pages rather than rely on defaults-rendering.
Originally, tried this but had some trouble. When applying RTL support for the nested menu icon, I looked up using group with data attribute and found this: tailwindlabs/tailwindcss#11768 (comment) With this applied the group class approach was working. This is ideal since now our JS is just toggling a simple data attribute and has no classes to set/remove. This also works with the RTL modifier. No need for additional Ruby here to set the class if its current, since we can just base it off the data attribute now.
@javierjulio javierjulio force-pushed the template-and-style-updates branch from b8dae7f to 9420329 Compare December 31, 2023 15:51
We need this in templates because when generating a dev app (rails_templates_with_data) if we enable authorization adapter for testing we receive errors regarding this model. Test suite is unaffected by this change.
@javierjulio javierjulio merged commit 9db27b6 into master Jan 1, 2024
@javierjulio javierjulio deleted the template-and-style-updates branch January 1, 2024 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant