-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 list with promotion api #4530
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andrzejewsky
previously approved these changes
Dec 18, 2023
Droniu
requested changes
Dec 18, 2023
|
||
<Text> | ||
<FormattedMessage | ||
defaultMessage="Are you sure you want to delete this discount" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick
Suggested change
defaultMessage="Are you sure you want to delete this discount" | |
defaultMessage="Are you sure you want to delete this discount?" |
Comment on lines
61
to
72
case "startDate": | ||
return readonlyTextCell( | ||
rowData.startDate | ||
? moment(rowData.startDate).locale(locale).format("lll") | ||
: PLACEHOLDER, | ||
); | ||
case "endDate": | ||
return readonlyTextCell( | ||
rowData.endDate | ||
? moment(rowData.endDate).locale(locale).format("lll") | ||
: PLACEHOLDER, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: We should only use new date cells for consistency. See
src/components/Datagrid/customCells/DateCell.tsx
and #4220
Droniu
approved these changes
Dec 18, 2023
poulch
added a commit
that referenced
this pull request
Dec 19, 2023
* Generate flag * Init new discounts create and details view * Update params types * Discount page components * Add discount rules and metadata * Add react-hook-form * Update types * Handle form using RHF * Selecting channel and showing currency code * Connect rules conditon to rhf * Rename Inputs to CreateDiscoutFormData * DiscountDetailsPage and handle submit and edit rule * Bump macaw ui * Improve structure and typing * Add changeset * Add stories * Extract messages * Fix CR comments * createPromotin mutation and types * Create promotion and display details * Fix loading description text * Fetch condition row * Handle fetch more and fix fetch with query * Send coditions during create * Handle display condition in details * Refactor create promotion handler * Fix some types * Introduct RuleDTO * Add variant search * Category type fix * Fetch condition options labels names * Add fetch condition option in discount detail * Handle promotion details update * Handle submit rules update/create using single button submit * Fix some ts strict null * Move condition fetch options to component * Extract messages * Add changeset * Improve condition option fetch * Fix input bg color on rule and showing when selected channels * Handle disable state, fix description in rule * Set percantage reward type when no currency * Show rule name when rule not collapsed * Bump macaw ui * Fix discount switch to use value * Error handling * Introduce RuleSummary * Improve fetch conditions options details * Remove rules, show rules list summaries * RuleModal, show rule on create page in modal * Handle edit/add rule inside modal on details promotion page * Two column rules grid * Handle delete rule * Show text when no channels selected * Client side rule form validation * Adjust size of reward * Introduce rule edit button * Fix showing ids instead of labels * Always show reward, handle loading during rule deletion * Fix ruleRewardValue number, move option fetch higher, fix fetch labels for selected options * Single channel, fetch option labels when promotion change * Fetch condition option only when channel * Improve validation schema * Name and channel in one row * Fix rule index conditions, fix hasEndDate checkbox change handling * Fix clearing conditions on channel change * Improve rule summary conditions values disply * Temp fix rule modal overflow * Fix clear values when change condition type * Fix tests * Fix ts errors * Update tests * Fix theme colors vars * Bump macaw version * DiscountRules tests * Improve rule summary colors and add button * Test RuleModal * Improve summary chips colors * Fix scroll issue * Fix multiple conditions * Restore usePreviousValue * Improve types * List promotions init * Remove row selection * Handle delete discount * Add changeset * Fix props and ts issues * Update changeset to patch * Cleanup discount list * Implement query search * Implement filter presets * Fix types * Update stories * Remove not used fukes * Remove mui import * Use sparate urls for discounts * Refactor dto into view models * Fix tests with empty rule during rule creation * Form refactor * Test DiscountRules, update props * Update index type from string to number * Validation schema for discount form * Fix description in init form values * Update mocks and fixures * Add mocks to storybook * Update test * Update description type * Add fromFormValues methods to Rule and Conditon * Fix rule delete and update handlers * Prevent details from to be submited when not dirty * Improbe disabled input when loading, fix handlers error types * remove not used hooks * Remove not used utils * Update copy * Use date cell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #4527
To switch on/off feature flag, run this code in browser console
Screenshots
Pull Request Checklist
data-test-id
are added for new elementsTest environment config
API_URI=https://automation-dashboard.staging.saleor.cloud/graphql/
APPS_MARKETPLACE_API_URI=https://apps.staging.saleor.io/api/v2/saleor-apps
Do you want to run more stable tests?
To run all tests, just select the stable checkbox. To speed up tests, increase the number of containers. Tests will be re-run only when the "run e2e" label is added.
CONTAINERS=2