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

[CatalogPromotions] "For taxons" scope in UI with dynamic form configurations #13175

Merged
merged 6 commits into from
Oct 8, 2021

Conversation

Zales0123
Copy link
Member

@Zales0123 Zales0123 commented Oct 6, 2021

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
License MIT

As we already have the second Catalog Promotions scope type, it's time for UI... which is always a pain in the back, when we need to struggle with dynamic form configurations in collections 💃 I decided, that our traditional approach to the topic (used, for example) for cart promotions, has a too big technical overhead (with all registries, abstract configuration forms, prototypes), that I would like to try something new 🚀

Such an approach definitely needs some polishing (especially in javascript, cc @kulczy 😄), but should be fairly easy to use and extend. Note: for the first time, I've added form extension in AdminBundle, as the choices attributes are needed only for our default templates and are not application logic. I believe we should follow the path to fully decouple CoreBundle from the UI, especially if we want to be fully headless one day 🤯

After this PR and the other one with validation refactoring, adding new scope would be mostly adding service, form type and validator with proper tags, as well as adding a template in the @SyliusAdmin/CatalogPromotion/Scope directory (could be parametrized, I suppose 🤔). It should definitely be included in the documentation 🏇 which will be provided in some of the next PRs

🖖

@Zales0123 Zales0123 added the Feature New feature proposals. label Oct 6, 2021
@Zales0123 Zales0123 requested a review from a team as a code owner October 6, 2021 11:27
@probot-autolabeler probot-autolabeler bot added the Admin AdminBundle related issues and PRs. label Oct 6, 2021
Copy link
Member

@GSadee GSadee left a comment

Choose a reason for hiding this comment

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

When we display the variants in the autocomplete, we display their name and code, but for the taxon only code, you could add the name there also to be consistent and more readable for administrators.

Before merge, could you check the taxon create/edit page in admin panel? Because during manual test, I came across strange behaviour that the tree with taxons disappeared. I've checked that also on master branch locally and it works. It looks like some problem with js on your branch, but I'm not sure 🤷🏻
image

'label' => 'sylius.ui.taxons',
'multiple' => true,
'required' => false,
'choice_name' => 'code',
Copy link
Member

Choose a reason for hiding this comment

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

I would be for displaying taxons by their names or names + codes to be consistent with for variants scope and more readable for administrators

@GSadee GSadee merged commit e2660ad into Sylius:master Oct 8, 2021
@GSadee
Copy link
Member

GSadee commented Oct 8, 2021

Thanks, Mateusz! 🎉

GSadee added a commit that referenced this pull request Oct 8, 2021
…Zales0123)

This PR was merged into the 1.11-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | master
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | introduced in #13175
| License         | MIT

Fixing [this comment](#13175 (review))

Before: 

<img width="548" alt="Zrzut ekranu 2021-10-8 o 08 03 32" src="https://user-images.githubusercontent.com/6212718/136506249-1bd4cf8d-5c94-4902-8479-6809135f81a0.png">

After:

<img width="512" alt="Zrzut ekranu 2021-10-8 o 08 02 29" src="https://user-images.githubusercontent.com/6212718/136506260-0a1318df-f833-47bd-9502-9ea4ac96a487.png">



Commits
-------

03b5fac [CatalogPromotions] Display taxons with names in scope
Zales0123 pushed a commit to Sylius/SyliusCoreBundle that referenced this pull request Dec 14, 2021
…Zales0123)

This PR was merged into the 1.11-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | master
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | introduced in Sylius/Sylius#13175
| License         | MIT

Fixing [this comment](Sylius/Sylius#13175 (review))

Before: 

<img width="548" alt="Zrzut ekranu 2021-10-8 o 08 03 32" src="https://user-images.githubusercontent.com/6212718/136506249-1bd4cf8d-5c94-4902-8479-6809135f81a0.png">

After:

<img width="512" alt="Zrzut ekranu 2021-10-8 o 08 02 29" src="https://user-images.githubusercontent.com/6212718/136506260-0a1318df-f833-47bd-9502-9ea4ac96a487.png">



Commits
-------

03b5fac46b25052d5dc68051e736f79685bdf6e9 [CatalogPromotions] Display taxons with names in scope
andrehoffmann30 added a commit to punktDeForks/Sylius that referenced this pull request Apr 19, 2022
coldic3 pushed a commit to coldic3/Sylius that referenced this pull request Nov 24, 2022
coldic3 pushed a commit to coldic3/Sylius that referenced this pull request Dec 5, 2022
coldic3 pushed a commit to coldic3/Sylius that referenced this pull request Dec 6, 2022
Rafikooo added a commit that referenced this pull request Dec 6, 2022
… and company name (andrehoffmann30, coldic3)

This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.11                 |
| Bug fix?        | yes                                                      |
| New feature?    | no                                                       |
| BC breaks?      | no                                                       |
| Deprecations?   | no |
| Related tickets | fixes #13176                      |
| License         | MIT                                                          |

Commits
-------

b50abea BUGFIX: #13176 add missing serialization configuration for phone number, company name
55b1b38 BUGFIX: #13175 move missing groups to defined attributes, remove duplication
97c70bc TASK: #13176 add unit test for address update on order
1370a9c TASK: #13176 use put api route to update order billing address
15fa6c5 BUGFIX: #13176 fix content type
d92fdf0 TASK: #13176 adjust serialization config and test
6181dee BUGFIX #13176 fix test
463c5eb [PHPUnit] Fix OrdersTest::it_allows_to_patch_orders_address
coldic3 added a commit that referenced this pull request Dec 7, 2022
* 1.11:
  [GitHub Actions] Restrict "Refactor" workflow to Sylius/Sylius repo
  Use MakerBundle instead of SensioGeneratorBundle
  [PHPUnit] Fix OrdersTest::it_allows_to_patch_orders_address
  BUGFIX #13176 fix test
  TASK: #13176 adjust serialization config and test
  BUGFIX: #13176 fix content type
  TASK: #13176 use put api route to update order billing address
  TASK: #13176 add unit test for address update on order
  BUGFIX: #13175 move missing groups to defined attributes, remove duplication
  BUGFIX: #13176 add missing serialization configuration for phone number, company name
coldic3 added a commit that referenced this pull request Dec 7, 2022
* 1.12:
  [GitHub Actions] Restrict "Refactor" workflow to Sylius/Sylius repo
  Use MakerBundle instead of SensioGeneratorBundle
  [Psalm] Skip deprecated in Symfony 6.2 class and interface
  [PHPUnit] Fix OrdersTest::it_allows_to_patch_orders_address
  BUGFIX #13176 fix test
  TASK: #13176 adjust serialization config and test
  BUGFIX: #13176 fix content type
  TASK: #13176 use put api route to update order billing address
  TASK: #13176 add unit test for address update on order
  BUGFIX: #13175 move missing groups to defined attributes, remove duplication
  BUGFIX: #13176 add missing serialization configuration for phone number, company name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin AdminBundle related issues and PRs. Feature New feature proposals.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants