[CatalogPromotion][API][UI] Fixed discount action#13325
Conversation
GSadee
commented
Nov 24, 2021
| Q | A |
|---|---|
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Related tickets | |
| License | MIT |
835dbf6 to
3478fe3
Compare
|
|
||
| /** @var CatalogPromotionActionInterface $value */ | ||
| if ($value->getType() !== CatalogPromotionActionInterface::TYPE_PERCENTAGE_DISCOUNT) { | ||
| if (!in_array($value->getType(), $this->actionTypes, true)) { |
There was a problem hiding this comment.
That's true, it looks the same with validators for scopes. What is your suggestion? The simplest one is probably to have a separate parameter that is an array of these types 🤔
There was a problem hiding this comment.
The parameter would be a good improvement. However, going deeper what would you say, that these consts would be defined by calculators themselves? Then we could tag them and use their const as a tag attribute and here use another tag iterator. Going further, we could define expectations for static method with the name, but I'm not sure if it makes sense to introduce it day before the end of sprint
ref. https://symfony.com/doc/current/service_container/tags.html#tagged-services-with-index
There was a problem hiding this comment.
I'm 👌🏻 for refactoring, but I would be for making it in a separate PR for both actions and scopes
fcd8898 to
50c9270
Compare
…new fixed discount action
…ew fixed discount action
ea5c411 to
f056098
Compare
f056098 to
969595a
Compare
|
Thanks, Grzegorz! 🥇 |
…tion on catalog show page (GSadee) 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 #13325 | License | MIT <!-- - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- 98c7cd3 [CatalogPromotion][Admin] Fix displaying fixed discount action on catalog show page
…reating a custom action + minor improvements (GSadee) This PR was merged into the 1.11 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.11 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | partially fixes ##13325 (comment) | License | MIT This PR contains a minor refactor of parameters with types of actions/scopes passed to validators. <!-- - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- 7f33db6 [CatalogPromotion] Create parameters with collections of scopes and actions types 08e9a0c [Documentation][CatalogPromotion] Add cookbook about creating a custom action c4816cd [Documentation][CatalogPromotion] Minor improvements to cookbook about creating a custom scope e45593d [Documentation][CatalogPromotion] Fixes to cookbooks about creating custom action and scope
