Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Add SKU list create and update pages #2

Merged
merged 13 commits into from
Mar 11, 2024
Merged

Add SKU list create and update pages #2

merged 13 commits into from
Mar 11, 2024

Conversation

pfferrari
Copy link
Contributor

@pfferrari pfferrari commented Feb 28, 2024

What I did

Added the form related pages of the app to manage SKU list creation and update.

This task was completed by:

  • creating a shared form component along with a valid zod schema able to manage both manual and automatic SKUs management ways used in sku_lists resources
  • defining dedicated hooks based on the same approach to manage create and update procedure

More in detail create and update actions share the same UI but need a slightly different treatment:

  • When a sku_lists resource is saved for creation at first it is created by saving its own data (like name, manual and sku_code_regex (if manual is set to false)). Then, once the creation is ok, it is necessary to create related
    sku_list_items only if manual prop is set to true.
  • When a sku_lists resource is saved for update its related sku_list_items, if present, need a particular treatment in order to remove the ones that are anymore need, update the ones that are changed and create the ones that were not existing.
    This two procedures were managed in useCreateSkuList and useUpdateSkuList hooks for a better readability and at the same time to keep separated the two tasks.
Screenshot 2024-02-28 alle 17 14 34 Screenshot 2024-02-28 alle 17 14 57 Screenshot 2024-02-28 alle 17 16 14 Screenshot 2024-02-28 alle 17 17 00 Screenshot 2024-02-28 alle 17 15 51 Screenshot 2024-02-28 alle 17 18 06 Screenshot 2024-02-28 alle 17 18 39

Improvements

  • Filter the Pick a SKU page to remove items the are already selected [waiting for new app-elements version to have the fix]
  • Add the proper link to the hint of Automatic regex field
  • Add documentation to all methods defined
  • Fix a bug related to the input spinner + - quantity selector visible when the items are added and then deleted

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests).
  • Make sure to add/update documentation regarding your changes.
  • You are NOT deprecating/removing a feature.

@pfferrari pfferrari self-assigned this Feb 28, 2024
@pfferrari pfferrari added the enhancement New feature or request label Feb 28, 2024
gciotola
gciotola previously approved these changes Mar 11, 2024
@pfferrari pfferrari merged commit ce1b571 into main Mar 11, 2024
4 checks passed
@pfferrari pfferrari deleted the feat/add-forms branch March 11, 2024 15:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants