Additional template and style updates#8181
Merged
Merged
Conversation
This partial is for customizing the entire output of active_admin_comments_for method. This used to be a component but is now an Arbre::Element which outputs no root element where as component does. This way the user can control all that from the partial. We may want to consider extracting the comments resource to partials too so for now this is named as resource_comments to avoid confusion.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8181 +/- ##
==========================================
+ Coverage 99.01% 99.04% +0.03%
==========================================
Files 152 152
Lines 4243 4184 -59
==========================================
- Hits 4201 4144 -57
+ Misses 42 40 -2 ☔ View full report in Codecov by Sentry. |
239beae to
7e6cebc
Compare
This also renames the partial sidebar_section_block to sidebar_section, to follow same approach from elsewhere, e.g. action items. This adds default vertical spacing similar to what we had before and can now be customized by the host app. Since active-filters are implemented as a sidebar, we no longer need the CSS style to set spacing since it's now in the partial as a customizable default.
When ActiveAdmin was created, HTML data attributes and CSS even/odd selection was a new feature in some browsers that year. It was common to use class names for metadata since there wasn't any other means. This now removes any default class names so users can safely specify any Tailwind classes and rely on data attributes when needing to customize further based on that through plain CSS.
No need to manually change options like this since we can just use Arbre to add the default class name.
We mostly just test the default actions so this adds coverage for the edit branch of the id_column method.
No need to query for the SVG elements since we can just use the standard Tailwind modifiers to control which is visible from the HTML. Defaults to light mode.
No need for this to be in an Arbre partial. We only document link_to usage and we have noted in the upgrading guide to not use resource named methods here (e.g. post) and use the resource helper instead.
Add the status given as a data attribute instead of a class in the same format as before (underscore). This way the only class set by default is the status-tag class. Caller can provide any class they want.
To follow table_for, this now uses data attributes for metadata like column name so it can still be styled but not clash. This also changes the default class name to be attributes-table. No need for odd/even classes since CSS has long supported that query selector (started the year ActiveAdmin was created).
This also has no references
7e6cebc to
01e6c6a
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 partials for resource comments, index blank slate and index empty results, with styles now inlined so they can be fully customized. This also adds styles for some remaining elements that weren't converted yet. The
attributes_table,status_tag, andtable_forcomponents have been updated to use data attributes for metadata and no longer adds any default CSS class names, other than the component class name. Theindex_columnfrom index table has also been removed.