Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discount catalog with promotion api (#4476)
* 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 * Update changeset to patch * 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 * CR fixes * Fix zod import * Remove any types * Fix is translation
- Loading branch information