Extract layout and pages to partials#8172
Merged
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
b1fb13f to
cd12d08
Compare
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.
cd12d08 to
36aeffa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_factoryandrenderer_forsince 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.