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

Discount catalog with promotion api #4476

Merged
merged 121 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
84726b4
Generate flag
poulch Nov 10, 2023
06ea61b
Init new discounts create and details view
poulch Nov 10, 2023
2071378
Merge branch 'main' into 4232-discount-catalog-feature-flag
poulch Nov 13, 2023
7118aa9
Update params types
poulch Nov 13, 2023
f5f6146
Merge branch 'main' into 4232-discount-catalog-feature-flag
poulch Nov 13, 2023
e78cb9a
Discount page components
poulch Nov 13, 2023
8bf4ff0
Merge branch 'main' into 4232-discount-catalog-feature-flag
poulch Nov 13, 2023
1fc1a48
Add discount rules and metadata
poulch Nov 13, 2023
2ddac4a
Add react-hook-form
poulch Nov 14, 2023
4183e09
Update types
poulch Nov 14, 2023
14a3c84
Handle form using RHF
poulch Nov 14, 2023
4b51f50
Selecting channel and showing currency code
poulch Nov 14, 2023
d1d4f54
Merge branch 'main' into 4232-discount-catalog-feature-flag
poulch Nov 15, 2023
4a40127
Connect rules conditon to rhf
poulch Nov 15, 2023
bb3b260
Rename Inputs to CreateDiscoutFormData
poulch Nov 15, 2023
4e2028d
DiscountDetailsPage and handle submit and edit rule
poulch Nov 16, 2023
6475bf0
Bump macaw ui
poulch Nov 16, 2023
153d5e5
Merge branch 'main' into 4232-discount-catalog-feature-flag
poulch Nov 16, 2023
3913ad3
Improve structure and typing
poulch Nov 16, 2023
2bcb879
Add changeset
poulch Nov 16, 2023
f40b8b8
Add stories
poulch Nov 16, 2023
dd37109
Extract messages
poulch Nov 16, 2023
50a54cf
Fix CR comments
poulch Nov 17, 2023
53174d0
createPromotin mutation and types
poulch Nov 18, 2023
021ef7b
Create promotion and display details
poulch Nov 20, 2023
ee0ea43
Merge branch 'main' into 4232-discount-catalog-api
poulch Nov 20, 2023
a733918
Fix loading description text
poulch Nov 20, 2023
d59863e
Fetch condition row
poulch Nov 20, 2023
b528681
Merge branch 'main' into 4232-discount-catalog-api
poulch Nov 21, 2023
9115713
Handle fetch more and fix fetch with query
poulch Nov 21, 2023
a8e76b4
Send coditions during create
poulch Nov 21, 2023
867bb1c
Handle display condition in details
poulch Nov 21, 2023
74c1a46
Refactor create promotion handler
poulch Nov 21, 2023
1fe457a
Fix some types
poulch Nov 21, 2023
bc093c6
Merge branch 'main' into 4232-discount-catalog-api
poulch Nov 23, 2023
a847872
Introduct RuleDTO
poulch Nov 23, 2023
74dd29e
Add variant search
poulch Nov 23, 2023
ee2528e
Category type fix
poulch Nov 23, 2023
2be908e
Fetch condition options labels names
poulch Nov 23, 2023
8b5240a
Add fetch condition option in discount detail
poulch Nov 23, 2023
967ff45
Handle promotion details update
poulch Nov 23, 2023
ac7c7aa
Handle submit rules update/create using single button submit
poulch Nov 24, 2023
62bb29e
Fix some ts strict null
poulch Nov 25, 2023
1beac6e
Move condition fetch options to component
poulch Nov 25, 2023
a9cadcd
Extract messages
poulch Nov 25, 2023
5dc858e
Add changeset
poulch Nov 25, 2023
b36b9d8
Merge branch 'main' into 4232-discount-catalog-api
poulch Nov 25, 2023
ec2f012
Improve condition option fetch
poulch Nov 27, 2023
94454f1
Fix input bg color on rule and showing when selected channels
poulch Nov 27, 2023
1956bc2
Handle disable state, fix description in rule
poulch Nov 27, 2023
46366e0
Set percantage reward type when no currency
poulch Nov 27, 2023
71aac5b
Show rule name when rule not collapsed
poulch Nov 27, 2023
4a676bb
Merge branch 'main' into 4232-discount-catalog-api
poulch Nov 27, 2023
d2fa192
Merge branch 'main' into 4232-discount-catalog-api
poulch Nov 28, 2023
3fe1609
Bump macaw ui
poulch Nov 28, 2023
f380609
Fix discount switch to use value
poulch Nov 28, 2023
3ce4363
Error handling
poulch Nov 29, 2023
4218955
Introduce RuleSummary
poulch Nov 30, 2023
9812e9a
Improve fetch conditions options details
poulch Nov 30, 2023
7f6a1bf
Remove rules, show rules list summaries
poulch Nov 30, 2023
41f5488
RuleModal, show rule on create page in modal
poulch Dec 1, 2023
8fc6998
Handle edit/add rule inside modal on details promotion page
poulch Dec 1, 2023
643ce97
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 1, 2023
d37fcc7
Two column rules grid
poulch Dec 4, 2023
a68c0a2
Handle delete rule
poulch Dec 4, 2023
f67cd49
Show text when no channels selected
poulch Dec 4, 2023
43d5424
Client side rule form validation
poulch Dec 4, 2023
a5827e5
Adjust size of reward
poulch Dec 4, 2023
ccad6a0
Introduce rule edit button
poulch Dec 4, 2023
a7aec50
Fix showing ids instead of labels
poulch Dec 4, 2023
060e98a
Always show reward, handle loading during rule deletion
poulch Dec 5, 2023
cc9989b
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 5, 2023
0bba923
Fix ruleRewardValue number, move option fetch higher, fix fetch label…
poulch Dec 5, 2023
d2f1e04
Single channel, fetch option labels when promotion change
poulch Dec 5, 2023
8e37d41
Fetch condition option only when channel
poulch Dec 5, 2023
e3083fd
Improve validation schema
poulch Dec 5, 2023
f8640b6
Name and channel in one row
poulch Dec 5, 2023
16e133e
Fix rule index conditions, fix hasEndDate checkbox change handling
poulch Dec 6, 2023
5b0ebc0
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 6, 2023
036ba69
Fix clearing conditions on channel change
poulch Dec 6, 2023
7745550
Improve rule summary conditions values disply
poulch Dec 6, 2023
0b4e810
Temp fix rule modal overflow
poulch Dec 7, 2023
2d0124a
Fix clear values when change condition type
poulch Dec 7, 2023
3774665
Fix tests
poulch Dec 7, 2023
f11a179
Fix ts errors
poulch Dec 7, 2023
793ffbc
Update tests
poulch Dec 7, 2023
05555b4
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 7, 2023
0d5ed0a
Fix theme colors vars
poulch Dec 7, 2023
edb71dd
Bump macaw version
poulch Dec 8, 2023
cc90664
DiscountRules tests
poulch Dec 8, 2023
dedfc14
Improve rule summary colors and add button
poulch Dec 11, 2023
96d6b34
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 11, 2023
0ee3770
Test RuleModal
poulch Dec 12, 2023
7612846
Improve summary chips colors
poulch Dec 12, 2023
4ac0a52
Fix scroll issue
poulch Dec 12, 2023
d4f1384
Fix multiple conditions
poulch Dec 12, 2023
8cc8d64
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 12, 2023
83e50b1
Restore usePreviousValue
poulch Dec 12, 2023
c06e9c1
Improve types
poulch Dec 12, 2023
94e21a9
Update changeset to patch
poulch Dec 13, 2023
62b1c1b
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 14, 2023
5b1a695
Use sparate urls for discounts
poulch Dec 14, 2023
58cf7d8
Refactor dto into view models
poulch Dec 14, 2023
11d6efa
Fix tests with empty rule during rule creation
poulch Dec 14, 2023
37a1f98
Form refactor
poulch Dec 15, 2023
1e5c551
Test DiscountRules, update props
poulch Dec 15, 2023
fe5189c
Update index type from string to number
poulch Dec 15, 2023
6b2dfe7
Validation schema for discount form
poulch Dec 15, 2023
4859d4c
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 15, 2023
d2ea84b
Fix description in init form values
poulch Dec 15, 2023
a49d652
Update mocks and fixures
poulch Dec 15, 2023
d3ea37a
Add mocks to storybook
poulch Dec 15, 2023
27b46a9
Update test
poulch Dec 15, 2023
768c19e
Update description type
poulch Dec 15, 2023
d21f7ee
Add fromFormValues methods to Rule and Conditon
poulch Dec 15, 2023
8c8ed81
Fix rule delete and update handlers
poulch Dec 17, 2023
9e14ebc
CR fixes
poulch Dec 18, 2023
6c08614
Fix zod import
poulch Dec 18, 2023
d331e9c
Remove any types
poulch Dec 18, 2023
340e5cf
Merge branch 'main' into 4232-discount-catalog-api
poulch Dec 18, 2023
b2edd7e
Fix is translation
poulch Dec 18, 2023
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
5 changes: 5 additions & 0 deletions .changeset/eleven-dolls-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Use new promotion API to create and update discounts
2 changes: 1 addition & 1 deletion .changeset/empty-falcons-boil.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"saleor-dashboard": minor
"saleor-dashboard": patch
---

Introduce intial component for catalog discounts
45 changes: 45 additions & 0 deletions locale/defaultMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,9 @@
"context": "references attribute type",
"string": "References"
},
"5dOOAB": {
"string": "Successfully created discount"
},
"5elC9k": {
"context": "taxes section name",
"string": "Taxes"
Expand Down Expand Up @@ -1327,6 +1330,9 @@
"context": "attribute value deleted",
"string": "Value deleted"
},
"7Hdiw2": {
"string": "Rule name is required"
},
"7J1ZKs": {
"context": "button",
"string": "Back to apps list"
Expand Down Expand Up @@ -1614,6 +1620,9 @@
"context": "cancel button",
"string": "Cancel order"
},
"9d24PR": {
"string": "Create rule"
},
"9eC0MZ": {
"context": "collection",
"string": "Hidden"
Expand Down Expand Up @@ -1681,6 +1690,9 @@
"context": "product discount removed title",
"string": "{productName} discount was removed by"
},
"A7W4KO": {
"string": "Catalog rule"
},
"A9QSur": {
"context": "area units type",
"string": "Area"
Expand Down Expand Up @@ -1819,6 +1831,9 @@
"context": "pint unit",
"string": "pint"
},
"B0fwAj": {
"string": "and {itemsLength} more"
},
"B2LE7A": {
"context": "menu item loading",
"string": "working..."
Expand Down Expand Up @@ -1993,6 +2008,9 @@
"context": "card header title",
"string": "Country list"
},
"CFlmRP": {
"string": "Rule reword value is required"
},
"CG+awx": {
"context": "dialog content",
"string": "Which address would you like to use as shipping address for selected customer:"
Expand Down Expand Up @@ -3179,6 +3197,9 @@
"context": "delete attribute value",
"string": "Are you sure you want to delete \"{name}\" value?"
},
"JyaQcP": {
"string": "Rule reword value must be less than 100"
},
"K+vjtE": {
"string": "Search Variants"
},
Expand Down Expand Up @@ -3495,6 +3516,9 @@
"context": "customers section name",
"string": "Customers"
},
"MdFdbd": {
"string": "Delete rule"
},
"MewrtN": {
"context": "section header",
"string": "Fulfillment"
Expand Down Expand Up @@ -3628,6 +3652,9 @@
"context": "order line discount updated title",
"string": "{productName} discount was updated by"
},
"NgRa6m": {
"string": "Discount of {value} on the purchase of {items} through the {channel}"
},
"NhQboB": {
"context": "dialog header",
"string": "Saleor couldn’t cancel order"
Expand Down Expand Up @@ -5118,6 +5145,9 @@
"context": "section header",
"string": "All Media"
},
"XVuPMw": {
"string": "Are you sure you want to delete this rule?"
},
"XWGZLL": {
"context": "transaction reference subtitle",
"string": "Transaction reference"
Expand Down Expand Up @@ -6178,6 +6208,9 @@
"context": "table head",
"string": "Category Name"
},
"fXdkiI": {
"string": "is"
},
"fbH51z": {
"context": "Amount error message",
"string": "Amount cannot be bigger than max refund"
Expand All @@ -6186,6 +6219,9 @@
"context": "order history message",
"string": "Products were deleted from an order"
},
"fg8dzN": {
"string": "Add condition"
},
"fgHLXc": {
"context": "attribute value",
"string": "Value"
Expand Down Expand Up @@ -8358,6 +8394,9 @@
"v1pNHW": {
"string": "Attribute Class"
},
"v1vJ77": {
"string": "Edit rule"
},
"v2+u4c": {
"context": "card subtitle",
"string": "Assign and sort warehouses that will be used in this channel (warehouses can be assigned in multiple channels)."
Expand Down Expand Up @@ -8534,6 +8573,9 @@
"w6kcxY": {
"string": "What happens if I approve?"
},
"w7jT4W": {
"string": "No channels selected"
},
"w9xgN9": {
"context": "see error log label in notification",
"string": "See error log"
Expand Down Expand Up @@ -8974,6 +9016,9 @@
"context": "attribute type",
"string": "Content Attribute"
},
"zehNKT": {
"string": "Rule has error, open rule to see details"
},
"zf48rQ": {
"context": "sum of captured amount of all transactions",
"string": "Total captured"
Expand Down
28 changes: 22 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@graphiql/plugin-explorer": "^0.1.12",
"@graphiql/react": "^0.15.0",
"@graphiql/toolkit": "^0.8.0",
"@hookform/resolvers": "^3.3.2",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@material-ui/lab": "^4.0.0-alpha.61",
Expand Down Expand Up @@ -100,7 +101,8 @@
"tslib": "^2.4.1",
"url-join": "^4.0.1",
"use-react-router": "^1.0.7",
"uuid": "^9.0.1"
"uuid": "^9.0.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@babel/cli": "^7.5.5",
Expand Down
Loading
Loading