Commit Graph

710 Commits

Author SHA1 Message Date
Nathan Silveira 027f83f1fa
Remove Media Library menu item from Downloads section (#46490)
* Remove MediaLibraryMenuItem from downloads

* Add changelog
2024-04-12 11:03:10 -03:00
Fernando Marichal d8037dd154
Add menu item to Publish button with copy to draft (#46294)
* Add duplicate product store

* Add copyToDraft method

* Add copy to draft button

* Modify success notice

* Add changelogs

* Update name before saving product

* Add comment to code
2024-04-12 10:19:12 -03:00
Nathan Silveira 450b06a1e1
Always use productTemplateId when available and use editedRecord in useEntityRecord hooks (#46395)
* Use editedRecord instead of record

* Always use productTemplateId when available

* Change private methods to protected in ProductVariationTemplate

* Use editedRecord in hook useEntityRecord

* Update changelogs

* Restore attribute renamed by mistake

* Change useProductTemplate unit test
2024-04-12 10:16:35 -03:00
Damián Suárez 5db25ea616
[Product Block Editor]: expose __experimentalSectionActions component (#46515)
* add basic Readme.md file

* expose __experimentalSectionActions component

* changelog

* update readme example
2024-04-12 05:48:40 -04:00
Ron Rennick c6048b5c49
Add glob, rimraf, and uuid to Syncpack (#46278)
* add uuid to syncpack

* add rimraf to syncpack

* add glob to syncpack

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/product-editor, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/integrate-plugin, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/components, @woocommerce/block-templates, @woocommerce/ai, @woocommerce/admin-layout, @woocommerce/admin-e2e-tests, woocommerce

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-04-11 12:52:49 -03:00
Matt Sherman 4ba72b2258
Product Editor API: Add tooltip attribute to woocommerce/product-select-field block (#46447) 2024-04-11 07:20:57 -04:00
Nathan Silveira 3fb744313b
Add isSelectableByUser attribute to product templates (#46394)
* Add selectable attribute in product template to allow creation of product templates that do not appear on the "Change product type" UI

* Always use productTemplateId when available, otherwise fallback to standard-product-template

* Rename attribute

* Use editedRecord in hook useEntityRecord

* Revert "Always use productTemplateId when available, otherwise fallback to standard-product-template"

This reverts commit 2960fcd520.

* Revert "Use editedRecord in hook useEntityRecord"

This reverts commit c28e005e7b.

* Add changelogs

* Fix unit tests

* Increment changelog
2024-04-10 17:57:42 +00:00
Leif Singer 8ee74ede0e
Update Woo.com references to WooCommerce.com (#46259)
* replace capitalized Woo.com with WooCommerce.com

* replace http URLs

* replace https URLs

* replace developer.woo.com

* add missing version in `@since` tag

* unslash the HTTP_REFERER

* WordPress.Security.ValidatedSanitizedInput.InputNotSanitized

* add changelog file

* add more changelog files

* address linter errors

* address more linter errors

* fix test

* more linter errors
2024-04-09 09:50:15 +01:00
Fernando Marichal 931aec84e8
[Linked products] - Change number of 'choose products for me' to 4 (#46094)
* Add limit to "choose products for me"

* Add changelog
2024-04-05 11:35:59 -03:00
Damián Suárez df2ba716ef
[Product Block Editor]: disable TextArea RichText instance according to `disabled` attribute value (#46089)
* get ready to disable text-area block

* changelog

* update doc
2024-04-02 10:56:52 -04:00
Nathan Silveira e2eaa55b7d
Apply filter to add metadata for generated variations (#45953)
* Add meta_data parameter in generateProductVariations

* Apply filter to get meta_data to generate variations

* Add meta_data parameter in generate variations endpoint

* Update name and add documentation

* Fix useEntityRecord in blockEditor
2024-04-02 05:25:01 -03:00
Maikel Perez 75a563df58
Redirect to the edit product page after changing the product type and publishing it (#46092)
* Redirect to the edit product page after changing the product type and publishing it

* Add changelog file
2024-04-01 14:43:35 -03:00
Matt Sherman 468c5e61bf
Product Editor: Accessible label for text area block (#45968)
* Add aria-labelledby attribute to rich text component

* Handle label click to focus rich text

* Remove unneeded ts-ignore

* Pass in label ID explicitly instead of hardcoding knowledge of its naming pattern

* Changelog

* Add tooltip attribute to block.json

* Focus text area when clicking on label

* Remove Label id... not needed

* Set text area labelled by to label

* Add aria-required to rich text

* Hide required asterisks from aria
2024-03-28 05:24:16 -03:00
Fernando Marichal 89bbebe6b8
Change Tracks event name for Quick variations menu action (#45889)
* Rename tracks event

* Add changelog
2024-03-27 10:59:10 -03:00
Matt Sherman 9000fd764e
Product Editor: Only send edited properties when saving (#45958)
* Only send edited properties

* Changelog

* Rename const to match previous code

* Remove all the logic to look up the entity key... we know it is 'id' for products
2024-03-27 05:21:32 -03:00
Matt Sherman 37e58a982a
Product Editor: Show correct Publish/Schedule button label when timezone is behind UTC (UTC-1, UTC-4, UTC-9, etc.) (#45848)
* Use useProductScheduled to determine button label

* Changelog
2024-03-22 14:18:32 -04:00
Nathan Silveira ff79576cd3
Fix word break inside columns in product editor (#45687) 2024-03-22 14:42:15 -03:00
Maikel Perez 54476cb7f3
After Variations are created, disable the fields that don’t do anything (#45838)
* Disable woocommerce/product-regular-price-field when product type is variable

* Disable woocommerce/product-sale-price-field when product type is variable

* Disable woocommerce/product-sku-field when product type is variable

* Disable Track stock quantity toggle when product type is variable

* Disable woocommerce/product-radio-field when product type is variable

* Disable woocommerce/product-shipping-class-field when product type is variable

* Disable woocommerce/product-shipping-dimensions-fields when product type is variable

* Add changelog files

* Fix php linter
2024-03-22 13:52:42 -03:00
Damián Suárez 27124828e9
[Product Block Editor]: register `metadata` attribute for all blocks (#45657)
* register the `metadata` attribute for all blocks

* bind value attribute with the nane product entity

* changelog

* add a ToDo note

* rename edit component fn to NameBlockEdit

* changelog

* restore @ts-export line

* fix eslint issue

* fix eslint issue
2024-03-22 12:23:38 -04:00
Fernando Marichal 3842611975
Update copy of inventory management fields (#45801)
* Update copy of inventory management fields

* Add changelog

* Add changelog
2024-03-22 11:49:54 -03:00
Fernando Marichal 4a0d7f5822
Enable 'Publish' button when product status is draft (#45812)
* Enable publish button when draft

* Add changelog
2024-03-22 11:49:22 -03:00
Fernando Marichal dd550ddca4
Add an image to multiple variations using Quick updates (#45774)
* Add component

* Add utils

* Add styles

* Use utils in images block

* Add changelog

* Add tracks event

* Add mode upload by default

* Fix js tests

* Fix variation-actions-menus tests
2024-03-22 11:49:11 -03:00
Damián Suárez 72d2a39de2
[Product Block Editor]: document woocommerce/product-text-area-field field block (#45513)
* [Product Block Editor]: document `woocommerce/product-text-area-field` block

* changelog
2024-03-21 10:49:04 -04:00
Damián Suárez b357bdc593
[Product Block Editor]: introduce `woocommerce/entity-product` source handler (#45616)
* introduce woocommerce/entity-product source handler

* add test for product entity source handler

* add useSource value test

* changelog

* clean unused helper

* minor TS changes

* rename TS type
2024-03-21 09:00:23 -04:00
Fernando Marichal 50bec2d1b0
Change hidden tag behavior (#45766)
* Modify header hidden tag

* Modify visibility section hidden tag

* Add changelog
2024-03-20 15:34:33 -03:00
Matt Sherman 4272a782a6
Product Editor: Fix crash when uploading files from variations list Quick Update menu (#45748)
* Handle when downloads menu is passed an empty selection

* Changelog
2024-03-20 14:24:15 -04:00
Mahesh Bohara 6ce72a25ba
Add loading state functionality to Schedule button in the calendar (#45645)
* Add loading state functionality to Schedule button in the calendar

* Add changelog

* Updated changelog file
2024-03-19 14:45:27 -04:00
Lee Willis b88821f685
Introduce handleConfirm. Export handlePrompt & handleConfirm from product-editor (#44226)
* Introduce handleConfirm. Export handlePrompt, and handleConfirm from product-editor

* Change as requested

* Add changelog

* Fix onCancel behaviour

* Fix lint error

---------

Co-authored-by: Lee Willis <lee@ademti-software.co.uk>
Co-authored-by: Matt Sherman <matt@jam123.com>
2024-03-19 14:11:14 -04:00
Fernando Marichal 99853c19bf
Fix double scroll bar in pre-publish panel (#45671)
* Fix double scroll bar

# Conflicts:
#	packages/js/product-editor/src/components/prepublish-panel/style.scss

* Add changelog

* Add comment to styles
2024-03-19 15:06:30 -03:00
Fernando Marichal 298ed3c680
Fix section title styles in the pre-publish panel on WP 6.5 (#45689)
* Fix section title

* Add changelog
2024-03-19 13:21:29 -03:00
Maikel Perez c2f33b2f5b
Replace the Draft tag with a Scheduled tag in the product header (#45685)
* Show Scheduled product header tag when the product is been scheduled

* Fix the pre publish modal header message when to say scheduled when the product has a date in the future

* Add changelog file
2024-03-19 16:20:19 +00:00
Maikel Perez 617b49464e
Hidden tag inconsistency (#45679)
* Header tag Hidden now is aligned with the Visibility: Hidden from the pre publish modal

* Add changelog file
2024-03-19 16:16:34 +00:00
Fernando Marichal 506a8b0086
Fix publish dropdown visibility in new product after hiding pre-publish modal (#45682)
* Publish dropdown visible after hidding panel

* Add changelog

* Rename prop
2024-03-19 13:15:33 -03:00
Maikel Perez dea68ee3e3
Handle taxes not being enabled and customized tax classes (#45531)
* Create and register the woocommerce/product-select-field block

* Replace the tax class radio group block by woocommerce/product-select-field block

* Hide tax fields when taxes are disabled

* Hide tax fields when taxes are disabled in product variations

* Add changelog files

* Fix linter errors
2024-03-18 18:09:03 +00:00
Fernando Marichal ee044a7b50
Remove the "Always show pre-publish checks" from pre-publish panel (#45672)
* Remove "always show prepublish panel"

* Add changelog
2024-03-18 14:00:21 -04:00
Matt Sherman 52d300f2a9
Product Editor: Disable description full editor when using an incompatible version of Gutenberg (#45650)
* Check Gutenberg version and prevent full editor use if using a version that causes crash

* Changelog
2024-03-18 02:23:08 -04:00
Matt Sherman c658b1c163
Product Editor: Fix editor crash when clicking in editor margin when summary or description fields are focused (#45608)
* Revert dashboard size (changed in #44166)

* Hide toolbar on blur of text-area

* useClearSelectedBlockOnBlur hook

* Use useClearSelectedBlockOnBlur hook to hide toolbar

* Changelog

* Update packages/js/product-editor/src/hooks/use-clear-selected-block-on-blur/use-clear-selected-block-on-blur.ts

---------

Co-authored-by: Damián Suárez <rdsuarez@gmail.com>
2024-03-15 05:54:34 -04:00
Matt Sherman afe0e0724b
Product Editor: Handle loading of product editor when global settings are not available on initial render (#45490)
* Do not pass settings from global down to editor; let BlockEditor handle loading settings itself

* Changelog

* Changelog
2024-03-14 13:02:40 -04:00
Nathan Silveira 7fdaf53a88
Match template based on different attributes besides product types (#45454)
* Match template based on different attributes besides product types

* Do not hard-code postType

* Refactor code

* Handle isResolving from useEntityRecord

* Refactor useProductTemplate

* Handle null value in `useProductTemplate`
2024-03-14 10:51:42 -03:00
Maikel Perez 0fc75c5148
Remove Custom Fields for New Product Editor (#45493)
* Add remove custom field for the new product editor

* Add changelog file

* Show add button when the custom fields are empty

* Ensures to always convert the metas into a string array since it can be anything

* Add changelog file
2024-03-13 19:16:12 -03:00
Fernando Marichal 1c068ce3a4
Update Attributes tooltip copy (#45485)
* Change attributes tooltip copy

* Add changelogs
2024-03-12 12:58:49 -03:00
Maikel Perez 88f1187928
Add Custom Fields for New Product Editor (#45484)
* Create the Add new button

* Integrate the CreateModal with the CustomFields component to add fields

* Add validation utils

* Fix validation errors in the edit modal component

* Fix linter error

* Add changelog file
2024-03-12 10:02:24 -03:00
Nathan Silveira 1ad84aa6fe
Allow using woocommerce icons for product details section description (#45348)
* Allow using woocommerce icons for product details section description and add gift icon

* Use core components for SVG
2024-03-11 20:30:31 -03:00
Maikel Perez 277fa6b005
Edit Custom Fields for New Product Editor (#45396)
* Create edit modal

* Add update function to the useCustomFields hook

* Integrate the EditModal in the CustomFields component

* Add edition and validation logic to the custom field EditModal component

* Fix text control validation error styles

* Focus the name field when its invalid

* Fix linter error

* Fix edit modal min width and controls width

* Add changelog file

* Fix text overflow in custom fields table

* Remove non needed block style file
2024-03-11 15:28:51 -03:00
Fernando Marichal 7cc4094f4a
Set product status after publishing (#45436)
* Set product status after publishing

* Refactor save

* Add changelog

* Remove comment

* Rename select alias
2024-03-11 12:25:08 -03:00
Maikel Perez 3658ac2d0e
List Custom Fields for New Product Editor (#45360)
* Create woocommerce/product-custom-fields block

* Register woocommerce/product-custom-fields block

* Add product-custom-fields block to the simple product template

* Create useCustomFields hook

* Create empty state

* Create CustomFields component

* Add custom fields table

* Add custom field remove button

* Hide the custom fields table base on the toggle value

* Remove non list features

* Add changelog files

* Fix linter errors

* Fix empty state styles

* Fix php linter error

* Remove context from the woocommerce/product-custom-fields-toggle-field block definition since it is not used

* Change url for the Read more about custom fields
2024-03-11 11:48:55 -03:00
Matt Sherman 99dec31578
Product Editor: Remove editable outline (#45366)
* Remove outline for the block when it is editable

* Refactor block-editor-block-list__block CSS

* Changelog
2024-03-11 10:41:33 -04:00
Maikel Perez 0a90499e7b
Custom Fields for New Product Editor (#45291)
* Register metaboxhidden_product user meta as a user rest field

* Create useMetaboxHiddenProduct to manage the user metaboxhidden_product meta field

* Create woocommerce/product-custom-fields-toggle-field block

* Register woocommerce/product-custom-fields-toggle-field block

* Create product-custom-fields feature flag

* Hide custom fields behind the product-custom-fields feature flag

* Add changelog files

* Get default postcustom user meta value when the metaboxhidden_product does not exist yet in the user object
2024-03-11 10:55:31 -03:00
Fernando Marichal fce3aeb90f
Close prepublish panel before creating new product (#45397)
* Close prepublish panel before create new

* Add changelog

* Remove close fn from blockeditor

* Close panel after clicking outside

* Refactor useEffect

* Remove empty lines

* Replace mousedown with click event

* Replace click with mouseup
2024-03-11 10:10:36 -03:00
Fernando Marichal 9865701cbb
Add message after publishing a product to pre-publish panel (#44864)
* Add message after publishing product

* add styles

* Fix animation styles

* Fix panel footer

* Remove console.logs

* Add changelog

* Fix product url

* Remove preview

* Add post-publish-section and fix animation

* Add hook useProductURL

* Add postpublish

* Refactor usePreview

* Use PostPublishSection and PostPublishTitle

* move style

* modify styles

* Fix footer

* Fix copy

* Add ts-ignore

* Add CopyButtonProps

* Fix productStatus

* Rename isPublished
2024-03-07 09:08:51 -03:00