Commit Graph

13 Commits

Author SHA1 Message Date
Joel Thiessen 3679f019bb
Adding attributes block to product block editor. (#38051) 2023-05-02 21:13:48 -07:00
Joel Thiessen fb12ad20fd
Replacing rest_namespace modification with middleware due to blocks issues (#37621) 2023-04-13 08:45:50 -07:00
Joel Thiessen b8416d7948
Replacing multiple components on the product page with a single hook. (#37283)
* Replacing multiple componments on the product page with a single hook.

* Adding changelog

* Removed the conditional hook logic, because of React rule - Don’t call Hooks inside loops, conditions, or nested functions.

* Use promise for receiving entity, and reload template on product change

* Add changelog

---------

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2023-03-22 04:48:55 -03:00
Joel Thiessen b825b51767
Moving useProductHelper and useVariationsOrder hooks to product editor package (#37006) 2023-03-06 09:11:54 -08:00
Joshua T Flowers 87d79f15a3
Move product editor utils to product editor package (#36730)
* Move product editor utils to product editor package

* Add changelog entries

* Move remaining utils

* Move util import/exports to separate index file
2023-02-23 09:48:49 -08:00
Joshua T Flowers 89438cf873
Remove variations logic from the AttributeControl component (#36563)
* Move attribute data changes out of attribute control

* Move dynamic text to props

* Add onModalOpen callback

* Add onModal close prop

* Add changelog entry

* Use closeModal for edit attribute modal

* Add onEdit callback

* Extract util to get unique attribute id

* Rename editingAttribute to currentAttribute

* Rename showAttributeModal to isNewModalVisible

* Rename AddAttributeModal to NewAttributeModal

* Fix up handle add attributes

* Add onRemove callback for attibutes

* Fix up modal styling classes

* Fix up closing edit modal

* Fix up modal title for options

* Handle PR feedback

* Separate handlers for edit and new modal callbacks

* Update event names to be option/attribute specific

* Use default callback functions

* Handle PR feedback
2023-02-02 13:04:32 -08:00
Joshua T Flowers ea64a98f54
Extract attribute filtering and fetching logic out of attribute components (#36354)
* Move attribution fetching to separate hook

* Add changelog entry

* Set all attributes on update of subset of attributes

* Move filtering logic to hook

* Remove tests that filter attribute by type inside the component

* Rename AttributeField to AttributeControl and props from attributes to value
2023-01-17 04:34:08 -04:00
Joshua T Flowers ad59769f25
Remove persisted query on return to parent product from variation (#36365)
* Remove persisted query on return to parent product from variation

* Add changelog entry
2023-01-12 09:20:46 -08:00
Fernando Marichal 230e79fbdf
Fix reordering items logic in attributes/options lists (#36296)
* Fix reordering list items bug

* Add tests

* Remove orphan comment

* Add changelog

* Rename const

* Update plugins/woocommerce-admin/client/products/fields/attribute-field/utils.ts

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Rename `objectKey` to `attributeKey`

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2023-01-06 08:53:03 -03:00
Joshua T Flowers df0ddb2dff
Fix navigation between variations and tab selection (#36239)
* Fix navigation between variations and tab selection

* Add changelog entry
2023-01-03 08:59:49 -08:00
Joshua T Flowers 3fe3710c51
Automatically generate product variations on option changes (#36188)
* Auto generate variations on option changes

* Add changelog entry

* Move product variation generation to hook

* Create product auto draft if not yet created

* Allow auto-draft and trash statuses for products

* Update form context with product ID to allow fetching variations

* Fix product ID usage in variations

* Reset form after initial product creation

* Use form value name for display instead of persisted name for auto drafts

* Add additional test around auto draft title
2022-12-30 13:12:09 -08:00
Maikel David Pérez Gómez bfa2d4f3a7
Product variation order should be persisted on save (#36109)
* Persist product variation order on product save

* Add batchUpdate to product variations datastore

* Add useVariationOrders hook to manage the ordering logic

* Add local ordering logic to variations field

* Persist variation orders on product save

* Add changelog file

* Add comments suggestions

* Add more comment seggestions
2022-12-22 16:01:51 -03:00
Maikel David Pérez Gómez 60e3adabd9
Add product variation navigation component (#36076)
* Add simple navigation component

* Add useProductVariationNavigation hook to manage navigation logic

* Integrate navigation component and hook in product variation form

* Add changelog file

* Add comment feedbacks
2022-12-20 18:02:25 -03:00