Skip to content

Extract layout and pages to partials#8172

Merged
javierjulio merged 11 commits into
masterfrom
layout-partials-extraction
Dec 15, 2023
Merged

Extract layout and pages to partials#8172
javierjulio merged 11 commits into
masterfrom
layout-partials-extraction

Conversation

@javierjulio

Copy link
Copy Markdown
Member

This extracts the layout and page classes to Rails partials which allows us to maintain these as they now reload without requiring server restart and for users to customize them. With this, we can remove the redundant view_factory and renderer_for since that predates Arbre builder methods which is how we document users should create components. We need to clean up the index template and try to add some request specs.

@javierjulio javierjulio self-assigned this Dec 14, 2023
@codecov

codecov Bot commented Dec 14, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (320cb34) 99.03% compared to head (36aeffa) 99.01%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8172      +/-   ##
==========================================
- Coverage   99.03%   99.01%   -0.03%     
==========================================
  Files         162      152      -10     
  Lines        4458     4243     -215     
==========================================
- Hits         4415     4201     -214     
+ Misses         43       42       -1     

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

@javierjulio javierjulio force-pushed the layout-partials-extraction branch 7 times, most recently from b1fb13f to cd12d08 Compare December 15, 2023 05:14
Should be able to handle the site, page and combined titles for both layout files.

Consolidate title helper into layout helper.
Known issue with show action when declaring a member_action to render a page, no page title is rendered.

We won't include the body tag data attributes since we don't utilize that and since there's no need now as users can customize.
Now that we've extracted all pages, this has no references.
This predates Arbre builder method which is how we create components. This may have been used to override views entirely but with partials we provide a simpler, more Rails like way to customize the admin while minimizing the library footprint and maintainance.

Note that we use the method_or_proc_helper throughout but mysteriously this is defined in view helpers but at the root level module. We already require and include the module elsewhere, e.g. menu item and scopes, so requiring it in filters/forms isn't abnormal. With the view factory removal, the test suite starting failing here but now all green.
This moves sidebar to top level. The action item and sidebar block templates now go into "shared" directory. This also removes an unnecessary head partial since we'll just include the html head defaults directly into the layout file now that we have that extracted.
@javierjulio javierjulio force-pushed the layout-partials-extraction branch from cd12d08 to 36aeffa Compare December 15, 2023 05:53
@javierjulio javierjulio merged commit 9cee0e0 into master Dec 15, 2023
@javierjulio javierjulio deleted the layout-partials-extraction branch December 15, 2023 05:57
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