Skip to content
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

Allow sections to be styled as a Grid component instead of a Section #336

Merged
merged 4 commits into from
Jan 5, 2025

Conversation

holmesadam
Copy link
Contributor

The aim of this pull request is to allow forms to display a Grid instead of a Section. In some cases where forms are embedded, the sections are not aesthetically pleasing. An option has been added to the Section Visual Options

image

When using a Grid, some section options are removed:

image

Form output using Section and NOT Grid (the default):

image

Form output with Grid:

image

Copy link

what-the-diff bot commented Dec 13, 2024

PR Summary

  • Added "Grid" Option to Sections
    A new feature was added that allows sections to be displayed as a grid. This was achieved by including a new boolean field named "grid" in the sections table model.

  • Updated Language Files
    The language files for German, English, Spanish, and French have been updated to include translations for "Use Grid" and "Use a Grid instead of a Section". This will allow users of these languages to understand the usage and benefits of the new grid feature.

  • Updated Trait to Support Grids
    The existing Designer trait has been altered to support the rendering of a grid, which depends on the new "grid" property of the sections.

  • Adjusted Form Schema
    The form schema in the Schemata has been updated to conditionally show the grid toggle, based on the 'show-as' option. This means the grid option will be displayed only when appropriate, enhancing the user experience.

  • Test Coverage for Grid Property
    Several tests have been updated to handle the new grid property. This helps to ensure that the new feature works as intended and maintains consistency with the rest of the system.

  • Test Migration File Modification
    The test migration file was altered to accommodate the creation of the new grid column in the sections table. This ensures our testing environment accurately reflects the new structure of our database.

@atmonshi
Copy link
Member

I love it
but keeping in mind the end user (mostly) is a not a developer and wont get the diff between filament grid and sections :)
its a visual effect...
so other naming: hollow, borderless, container,... any suggestion?

and how about make it:
"section display type: (select or toggle): -container -without container"

also we need to hide the options that related to the Section like aside, icon, compact... etc

I can take over if you like, just let me know.

@holmesadam
Copy link
Contributor Author

Happy for you to take over. I thought I already made the fields disappear when grid was chosen though. I'd have to double check the code.

Regards naming. Borderless is certainly an option for grid. I think section still makes sense for the other because the you're adding a section to a form.

@atmonshi
Copy link
Member

atmonshi commented Jan 5, 2025

here is the final work:

the default look:
Screenshot 2025-01-05 at 9 20 03 AM

disable all unnecessary (not used) options:
Screenshot 2025-01-05 at 9 19 43 AM

the form:
Screenshot 2025-01-05 at 9 20 17 AM

thank you again @holmesadam

@atmonshi atmonshi merged commit 67147c1 into lara-zeus:3.x Jan 5, 2025
4 checks passed
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.

2 participants