-
Notifications
You must be signed in to change notification settings - Fork 21
doc : Document new attributs, AsGrid and AsFilter #267
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
base: main
Are you sure you want to change the base?
Conversation
4d1a866
to
22e9c0d
Compare
@@ -40,57 +40,6 @@ $ bin/console make:grid | |||
|
|||
Now we can configure our first grid: | |||
|
|||
{% tabs %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure it's not too early to entirely remove these two tabs ? Couldn't we just mark them as "YAML (Legacy)" and "PHP (Legacy)" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with @loic425 , "your first grid" is king of a "get started" and should promote best practice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot we just put php service grid in the first place? Yaml/Php configs aren't event officially deprecated yet
Just a general note on how the page is structured: since we’re showing both the attribute-based and the legacy (configuration-based) approaches, I think it would be helpful to add a sentence at the very top of the page or just below each section title to make it clear that this is an either/or situation. Attributes`To create your custom filter, you can leverage Sylius’s #[AsFilter] attribute which provides a convenient, native way to configure filters directly in your code. Legacy wayThe legacy service-based approach is still documented below in case you're maintaining an older setup. |
Kindly ask for your insights @diimpp 🙏🏻 |
@@ -40,57 +40,6 @@ $ bin/console make:grid | |||
|
|||
Now we can configure our first grid: | |||
|
|||
{% tabs %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot we just put php service grid in the first place? Yaml/Php configs aren't event officially deprecated yet
|
||
{% code title="templates/Grid/Filter/suppliers_statistics.html.twig" lineNumbers="true" %} | ||
```twig | ||
{% form_theme form '@SyliusUi/Form/theme.html.twig' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a sylius v1 code, stack has it's own bootstrap form theme.
This one I think
https://github.com/Sylius/Stack/blob/main/src/BootstrapAdminUi/templates/shared/form_theme.html.twig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt @loic425 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this code is outdated. @diimpp is right.
public function buildForm(FormBuilderInterface $builder, array $options): void | ||
{ | ||
$builder->add( | ||
'stats', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand stats
existed in the examples before, but it's hard to read. Does it mean days, count, limit? A thought for future to improve it somehow.
Adds a new tab to the documentation showcasing how to define a grid using attributes. doc: adds a custom filter for Sylius Grid Adds a new custom filter for Sylius Grid, demonstrating how to create a filter class and its associated form type. Co-authored-by: Estelle Gaits <74190794+stlgaits@users.noreply.github.com> Co-authored-by: Dmitri Perunov <diimpp@gmail.com> Update
No description provided.