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

Adjust the implementation to the new Twig Hooks version #16173

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4e73cf3
Adjust the configuration to the new Twig Hooks version
jakubtobiasz Apr 23, 2024
e286f8c
Start using Twig Hooks autoprefixing in the Dashboard templates
jakubtobiasz Apr 23, 2024
9dd1ce3
Start using Twig Hooks autoprefixing in the Admin User templates
jakubtobiasz Apr 23, 2024
019719e
Start using Twig Hooks autoprefixing in the Catalog Promotion templates
jakubtobiasz Apr 23, 2024
e9758c0
Fix the dashboard view
jakubtobiasz Apr 24, 2024
5461ad1
Start using Twig Hooks autoprefixing in the Channel templates
jakubtobiasz Apr 24, 2024
f1551b1
Start using Twig Hooks autoprefixing in the Country templates
jakubtobiasz Apr 25, 2024
991eb4b
Start using Twig Hooks autoprefixing in the Customer templates
jakubtobiasz Apr 25, 2024
5429d39
Clean up the Dashboard templates
jakubtobiasz Apr 25, 2024
c25f053
Start using Twig Hooks autoprefixing in the Inventory templates
jakubtobiasz Apr 25, 2024
62f5a33
Start using Twig Hooks autoprefixing in the Product Association Type …
jakubtobiasz Apr 25, 2024
930f387
Start using Twig Hooks autoprefixing in the Product Variant templates
jakubtobiasz Apr 25, 2024
5814a2f
Start using Twig Hooks autoprefixing in the Promotion templates
jakubtobiasz Apr 25, 2024
a550b8d
Start using Twig Hooks autoprefixing in the Taxon templates
jakubtobiasz Apr 25, 2024
57f2081
Start using Twig Hooks autoprefixing in the Tax Rate templates
jakubtobiasz Apr 25, 2024
b2db5b8
Start using Twig Hooks autoprefixing in the Order templates
jakubtobiasz Apr 25, 2024
fabd87f
Start using Twig Hooks autoprefixing in the Product templates
jakubtobiasz Apr 25, 2024
eb8d217
Temporarily set the twig-hooks package version constraint to dev-main
jakubtobiasz Apr 25, 2024
367b17c
Prepare for renaming shared twig hooks to common twig hooks
jakubtobiasz Apr 25, 2024
e913e9e
Start using Twig Hooks autoprefixing in the Product Variant related t…
jakubtobiasz Apr 29, 2024
563b1db
Remove left-overs after the old Twig Hooks implementation
jakubtobiasz Apr 29, 2024
5db9ca8
Replace the old `HookableComponentTrait` with the new `HookableLiveCo…
jakubtobiasz Apr 29, 2024
f25a8bd
Fix minor errors causing failing Behat scenarios
jakubtobiasz Apr 29, 2024
9738134
Replace `get_hookable_*` twig functions with `hookable_metadata.*`
jakubtobiasz Apr 29, 2024
5199283
Remove the parentMainHook and parentFallbackHook props
jakubtobiasz Apr 29, 2024
e964f5c
Try to stabilize scenarios checking notifications
jakubtobiasz Apr 29, 2024
bad4d63
Remove debugging left-overs
jakubtobiasz Apr 30, 2024
a4ced77
Add passing form to the form-related hooks to make sure the form_them…
jakubtobiasz Apr 30, 2024
1c75329
Remove redundant Then step
jakubtobiasz Apr 30, 2024
d627142
Fix breadcrumbs on the dashboard index
jakubtobiasz Apr 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove the parentMainHook and parentFallbackHook props
  • Loading branch information
jakubtobiasz committed Apr 29, 2024
commit 5199283cf53623b11f8e969759c3bb7ce97333b5
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ twig_hooks:
props:
resource: '@=_context.resource'
form: '@=_context.form'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'

'sylius_admin.catalog_promotion.create.content.form':
sections:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ twig_hooks:
props:
resource: '@=_context.resource'
form: '@=_context.form'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'
configuration:
method: 'PUT'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ twig_hooks:
props:
channel: '@=_context.resource'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add the way of passing the resource to components/templates to our convention, now it's either the resource name or simply resource

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by the way the we will stick out to the resource name rather than simply resource ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With templates in mind we could just add both, that's basically in line with how those variables were in the templates before.
With components, it makes meagre sense since it needs to be added as a live prop (probably will be ignored otherwise, though I have not checked), in that case, I'd go w/ the resource name (stuff like public ?Product $resource = null; etc. imo looks weird).

Either way we gotta talk it through and decide what's the better option.

form: '@=_context.form'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'

'sylius_admin.channel.create.content.form':
sections:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ twig_hooks:
props:
channel: '@=_context.resource'
form: '@=_context.form'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'
configuration:
method: 'PUT'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ twig_hooks:
component: 'SyliusAdmin.Customer.Show.OrderStatistics'
props:
customerId: '@=_context.resource.getId()'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'
details:
template: '@SyliusAdmin/Customer/Show/Content/Sections/_details.html.twig'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ twig_hooks:
props:
order: '@=_context.resource'
form: '@=_context.form'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'

sylius_admin.order.update.content.form:
billing_address:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ twig_hooks:
props:
form: '@=_context.form'
resource: '@=_context.resource'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'
isSimple: '@=_context.resource.isSimple()'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the property accessor take care of these expressions would be great, then we could go

@=context.resource.isSimple

or just

@=context.resource.simple

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to do it in Twig Hooks v0.3.


'sylius_admin.product.create.content.form':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ twig_hooks:
props:
resource: '@=_context.resource'
form: '@=_context.form'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'

'sylius_admin.product.generate_variants.content.header':
breadcrumbs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ twig_hooks:
props:
resource: '@=_context.resource'
form: '@=_context.form'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'
configuration:
render_rest: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ twig_hooks:
props:
resource: '@=_context.resource'
form: '@=_context.form'
parentMainHook: '@=_context.parent_main_hook'
parentFallbackHook: '@=_context.parent_fallback_hook'
configuration:
method: 'PUT'

Expand Down
Loading