Skip to content

Commit

Permalink
Add support for order promotion API (#4648)
Browse files Browse the repository at this point in the history
* Update schema

* Add checkout option to add button submenu

* Update rules

* Refactor Condition

* Split model to order and catalog

* Prepare context

* Store condtion type

* Support multiple inputs depend on condition type

* handleOpenModal

* Use rule union

* Fix create object from static methods

* Fix add new rule

* Refactor model

* Use BaseRule type in form

* Update schema and support field with new names

* Filter AddButton submenu by discount type

* Filter add button options by discount type

* Fix showing conditions

* Show saved conditions

* Fix catalog conditions

* Show base rule summary for order rules

* Bump macaw to fix select onChange prop

* Use Rule interface, add OrderRule tests

* Refactor types

* Refactor model

* Update scheme, add type to promotion query

* Handle discount type field

* Bump macaw

* Handle range input

* Fix order rule label on list

* Improve rule summary

* Show option label in summary instead of value

* Rename models

* Refactor rule summary

* Refactor rule summary

* Comment useEnrichConditions, fix validation schema

* Rename hooks, fix tests

* Model refactor

* Fix ts issues

* Fix tests

* Refactor to condition value

* Fix tests

* Remove hooks from context

* Keep hooks close to components

* Pass RuleForm as child

* Last improvments

* Refactor rule model

* Add changeset

* Add discount type component

* Add type to initial form values

* Bump macaw

* Refactor Add button

* Update test

* Refactor DiscountRule isLoaded

* Add type support

* Remve useeffect

* Add changeset

* Extract messages

* Init context

* Context intro

* Remove empty import

* Fix tests, fix useDiscountRulesContext imports

* Add changeset

* Support mutliple condition types

* Update label map after rule add

* Add sorting

* Extract messages

* Add changeset

* Refactor RuleList

* Refactor rule summary to support order conditions

* Update test

* Add changeset

* Update schema

* Changeset add

* Add test to order rule, update catalog rule test, add test ids

* Allow to change discount type at create page

* Update types

* Refactor useConditionNames

* Handle complex condition in promotion rule (#4667)

* Update schema with gifts

* Improve complex rule conditions calculations (#4668)

* Update src/discounts/models/helpers.test.ts

Co-authored-by: Renata <renata.gajzlerowicz@gmail.com>

---------

Co-authored-by: Renata <renata.gajzlerowicz@gmail.com>
  • Loading branch information
poulch and yellowee committed Feb 9, 2024
1 parent ce4eb48 commit 50404fc
Show file tree
Hide file tree
Showing 67 changed files with 3,461 additions and 443 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-baboons-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Handle complex condition in promotion rule
5 changes: 5 additions & 0 deletions .changeset/thirty-rocks-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Add support for order promotion API
Loading

0 comments on commit 50404fc

Please sign in to comment.