Commit Graph

1915 Commits

Author SHA1 Message Date
Damián Suárez e494d53aee introduce showBackButton prop 2023-12-06 17:38:47 -03:00
Damián Suárez 035280b426 do not sub registry for the Product Editor 2023-12-06 17:38:10 -03:00
Damián Suárez f58405f1a3 dispatching action to close from modal cmp 2023-12-06 17:38:10 -03:00
Damián Suárez 39778dadf4 fix prettier issue 2023-12-06 17:38:10 -03:00
Damián Suárez 3f39802848 minor doc comment 2023-12-06 17:38:10 -03:00
Damián Suárez 42a9ed7087 remove useSubRegistry prop 2023-12-06 17:38:10 -03:00
Damián Suárez 26f44671a2 do not memoize parsed blocks 2023-12-06 17:38:10 -03:00
Damián Suárez adefe04c84 set the Modal editor content when clicking 2023-12-06 17:38:10 -03:00
Damián Suárez c9a4a1aab7 add a line break (minor) 2023-12-06 17:38:10 -03:00
Damián Suárez 7bd4c1b8cb rename store actions, consts, etc 2023-12-06 17:38:10 -03:00
Damián Suárez be31dd7ae1 handler parsing blocks and redering the preview 2023-12-06 17:38:09 -03:00
Damián Suárez 05e2eeb958 set should update blocks when onSave() 2023-12-06 17:38:09 -03:00
Damián Suárez 137d23b6fd register when modal editor blocks change 2023-12-06 17:38:09 -03:00
Damián Suárez d0d744627d decouple Modal and Product editor 2023-12-06 17:38:09 -03:00
Damián Suárez c3b6b61f82 set modal editor blocks with empty array when not defined 2023-12-06 17:38:09 -03:00
Damián Suárez 6962e6c0aa changelog 2023-12-06 17:38:09 -03:00
Damián Suárez b60d723982 move the Modal editor out of the block instance 2023-12-06 17:38:09 -03:00
Damián Suárez 388c980cf5 onChange and onClose are optional 2023-12-06 17:38:09 -03:00
Damián Suárez 5003dff2db store iFrame blocks in the store instead on the local state 2023-12-06 17:38:09 -03:00
Damián Suárez 2c1ff8a66e store modal editor blocks in the woo state 2023-12-06 17:38:09 -03:00
Christopher Allford 8c6b414fe0
Revert "Refactoring Task Infrastructure" (#41928)
Revert "Refactored Task Infrastructure (#41202)"

This reverts commit 96a973b9fa.
2023-12-06 11:36:12 -08:00
Christopher Allford 96a973b9fa
Refactored Task Infrastructure (#41202)
* Fixed NPM packages with invalid names.
* Renamed plugin packages.
* Standardized package NPM scripts.
* Replaced Turborepo with Wireit.
2023-12-06 09:32:32 -08:00
Christopher Allford 88969742f2
Regenerate PNPM Lock File & Fix Errors (#41830) 2023-12-05 00:36:30 -08:00
Damián Suárez fda0cd13d5 Merge branch 'trunk' into fix/wrdpressscripts 2023-12-04 20:16:14 -03:00
Damián Suárez 6c5cb1ed2b rename store folder 2023-12-04 16:51:54 -03:00
Nathan Schneider 1e3b7425dc Remove unused @wordpress/scripts dependency 2023-12-04 16:17:28 -03:00
Damián Suárez dfa1adaf44 changelog 2023-12-04 14:43:29 -03:00
Damián Suárez 7a1cb7619e handle Modal editor via store 2023-12-04 14:43:29 -03:00
Damián Suárez a22331f3db import, export and register the store 2023-12-04 13:25:52 -03:00
Damián Suárez 3b6e70ace0 introduce Product Editor store 2023-12-04 13:25:52 -03:00
Fernando Marichal 0a6ca9e7db
Add max width to tooltip (#41797)
* Add max-width to tooltip

* Add changelog
2023-12-04 10:22:10 -03:00
Damián Suárez 1da600718b handle attrs at component edit level 2023-12-01 11:44:30 -03:00
Damián Suárez 0c2e79dfe4 set label at block def level 2023-12-01 09:51:22 -03:00
Damián Suárez a376da9316 changelog 2023-12-01 09:38:30 -03:00
Damián Suárez 8cf5424c5e summary block: tweak name, and attrs handling 2023-12-01 09:14:11 -03:00
Christopher Allford c6b74ddafa
Revert "Resolve PNPM Lock File Errors" (#41828)
Revert "Resolve PNPM Lock File Errors (#41800)"

This reverts commit 2550558a13.
2023-11-30 14:55:35 -08:00
Christopher Allford 2550558a13
Resolve PNPM Lock File Errors (#41800)
This makes the lock file constraints more specific to prevent the
backward incompatible types from WordPress types using the caret
constraint.
2023-11-30 09:33:34 -08:00
Damián Suárez ac18ae7db4 Merge branch 'trunk' into update/rename-edit-fn-names 2023-11-30 08:15:26 -03:00
Damián Suárez 5ecedbd1ca fix importing Tab block in tests 2023-11-30 08:15:06 -03:00
Damián Suárez f36ce5b3f1
[Product Block Editor]: fix Input control issue in Manage download limit form (#41796)
* do not destructure number input props

* changelog
2023-11-29 17:18:48 -04:00
Maikel David Pérez Gómez f24af0e197
[Grouped products] Add ordering support to the product list (#41709)
* When the user clicks the search field, we immediately display the list of all existing products. It is sorted alphabetically. Clicking an item closes the search and adds the product to the list.

* Fix linter errors

* Create useDraggable hook

* Add dragging to sort products in the modal

* Fix product row padding

* Improve product petching

* Add changelog file
2023-11-29 16:05:16 -05:00
Lourens Schep 423d5a86fa Fix spelling mistake and lint issue 2023-11-29 15:13:43 -04:00
Lourens Schep 476374049c Add changelog 2023-11-29 14:45:49 -04:00
Lourens Schep bffd013afe Update parseNumber to handle empty string seperators 2023-11-29 14:45:03 -04:00
louwie17 03cac8bf89
Add rimraf to admin-layout package (#41784)
* Add rimraf to admin-layout package

* Add changelog
2023-11-29 14:00:23 -04:00
Fernando Marichal e684ae348b
Add empty state when no attributes (#41679)
* Add empty state for attributes

* Add styles

* Remove comment

* Add changelog

* Remove downshift

# Conflicts:
#	pnpm-lock.yaml

* move changelog

* Remove another comment

* Create MenuAttributeList component

* Refactor renderMenuItems

* Replace div with Fragment
2023-11-29 11:10:37 -03:00
Maikel David Pérez Gómez 92eac565e5
[Grouped products] Product list (#41653)
* When the user selects a grouped product type, we show an additional Products in this group section in the General tab.

* When the user selects a grouped product type, we hide the Pricing and Shipping tabs.

* When empty, the grouped products card has an empty state with an illustration

* When the user clicks Add products, we show a modal

* When the user clicks the search field, we immediately display the list of all existing products. It is sorted alphabetically. Clicking an item closes the search and adds the product to the list.

* Add remove button to the product list

* When the user clicks Add, we close the modal and display the list of added products in the product form

* Clicking the product name will open it in the editing view in a new tab

* Clicking the arrow button will open the product's page in a new tab

* Prevent adding already added products

* If the name or SKU extends beyond this width, we truncate the text

* Add changelog files

* Fix linter errors
2023-11-28 22:21:17 -03:00
louwie17 882527fe05
Prep both admin-layout and product editor (#41764) 2023-11-28 16:23:08 -04:00
Fernando Marichal 0482be94cc
Remove downloads list fixed height (#41744)
* Remove fixed height in downloads list

* Add changelog
2023-11-28 10:05:22 -05:00
Damián Suárez 2cdf4971f3 Merge branch 'trunk' into update/rename-edit-fn-names 2023-11-28 11:35:12 -03:00
Damián Suárez cf9f629c1f
[Product Block Editor]: remove unused block attributes (#41674) 2023-11-28 11:32:47 -03:00
Damián Suárez 12b9c4d8bc TabBlockEdit 2023-11-28 09:42:54 -03:00
Damián Suárez 30a3869cfe changelog 2023-11-28 09:42:54 -03:00
Damián Suárez e9fa11d062 rename edit fn of the Descrption block 2023-11-28 09:42:54 -03:00
Damián Suárez 1ad4cac81c rename edit fn of Tab block 2023-11-28 09:42:54 -03:00
Damián Suárez db3496d268 change function name of section block edit 2023-11-28 09:42:54 -03:00
github-actions[bot] 7ccbd6fd0e
Prepare Packages for Release (#41657)
Automated change: Prep @woocommerce/csv-export for release.

Co-authored-by: anu-rock <anu-rock@users.noreply.github.com>
Co-authored-by: Anurag Bhandari <anurag@automattic.com>
2023-11-28 20:47:14 +13:00
louwie17 2088e3d99a
Package release prep - product editor (#41720)
Package release prep
2023-11-27 17:34:19 -04:00
louwie17 68e0a6404a
Remove invaild react-hooks dev dependency (#41712)
* Remove invaild react-hooks dev dependency

* Add changelog
2023-11-27 16:14:47 -04:00
louwie17 2b60fd5e83
Prepare block templates package for release (#41707) 2023-11-27 14:09:54 -04:00
Damián Suárez 7254836adf changelog 2023-11-27 14:18:46 -03:00
Damián Suárez d453188ae4 remove... 2023-11-27 14:17:59 -03:00
Damián Suárez 5e35d42fed remove unused templateLock block attrs 2023-11-27 14:17:59 -03:00
louwie17 8397478c61
Package release preperation for product-editor package (#41706) 2023-11-27 11:45:43 -04:00
louwie17 d7a67783a4
Release/package expression evaluation (#41708)
* Automated change: Prep @woocommerce/expression-evaluation --initial-release for release.

* Update pnpm-lock.yaml

Revert pnpm-lock changes

* Add gitkeep to changelog directory

---------

Co-authored-by: louwie17 <louwie17@users.noreply.github.com>
2023-11-27 11:45:13 -04:00
Maikel David Pérez Gómez 3d6c2b637e
Improved variations table header (#41550)
* Add header row to the variations table and fix a11y table issues

* Fix TableRowSkeleton styles

* Add changelog files

* Fix compilation errors

* Fix linter errors

* Fix unit tests

* Fix downloads table
2023-11-24 12:54:45 -05:00
Fernando Marichal 4a0db06321
Modify notice for legacy local attributes (#41646)
* Modify notice for legacy local attributes

* Rename variable

* Add changelogs

* Rename local_attributes_notice_dismissed_ids
2023-11-23 12:00:17 -03:00
Maikel David Pérez Gómez 5a513cc9a6
We won’t append a unique string to the filename if the settings are configured to do so (#41621)
* Create media library component

* Use media library component instead of the MediaUpload from the @wordpress/media-utils

* Remove UploadFilesMenuItemm from the DownloadsMenu until we solve the insecure file upload using the wp/v2/media endpoint

* Remove the @woocommerce/components/MediaUploader from downloads block until we solve the insecure file upload using the wp/v2/media endpoint

* Remove the FormFileUpload from EditDownloadsModal until we solve the insecure file upload using the wp/v2/media endpoint

* Add changelog file
2023-11-22 09:53:34 -05:00
Damián Suárez 8f5f3bbf87
[Product blocks editor]: Add help text to Shipping toggle (#41590) 2023-11-21 18:41:39 -03:00
Matt Sherman 6944345371
expression-evaluation: Support key/value pair object arrays (like product meta data) (#41594)
* Test key/value pair arrays in expressions

* Support key/value pair arrays in expressions

* Changelog
2023-11-21 16:39:57 -04:00
Damián Suárez 8337f67683 Merge branch 'trunk' into update/product-editor-add-variation-pickup-help 2023-11-21 16:05:20 -03:00
Damián Suárez cb539c787f
[Product Blocks editor]: set max width for the description general field (#41555) 2023-11-21 16:03:30 -03:00
Damián Suárez 96e79fca39 remove commented line 2023-11-21 15:17:07 -03:00
Fernando Marichal bed99d0705
Add error state to variation list (#41525)
* Refactor table-empty-state component

* Add error image

* Add error handling in product-variation-helper

* Add error handling to use-variations

* Add rename

* Fix link

* Fix error cleaning

* Add changelog

* Add generateProductVariationsError selector

* Clean error on success

* Use generateProductVariationsError instead of catch

* Add changelog
2023-11-21 13:37:43 -03:00
Damián Suárez f53715e91a address width of fieldset overflow issue 2023-11-21 13:22:08 -03:00
Damián Suárez fa71ae7f92 Merge branch 'trunk' into update/product-editor-tweak-summary-field 2023-11-21 12:02:43 -03:00
Damián Suárez a3336d62f8 introduce checkedHelp and uncheckedHelp attributes 2023-11-21 09:04:20 -03:00
Damián Suárez 56f59ff969 hide help when it's disabled 2023-11-21 09:04:20 -03:00
Damián Suárez 4ffc4eda55 changelog 2023-11-21 09:04:20 -03:00
Damián Suárez 69e2900e26 render help component when defined 2023-11-21 09:04:20 -03:00
Damián Suárez b3da1853d4 add help attr to toggle component 2023-11-21 09:04:20 -03:00
Leif Singer 39a1164d98
Update / tweak a few more links in docs and comments (#41598) 2023-11-21 12:38:09 +01:00
RJ 7d465c406a
dev: edited package.json lint scripts to output to console (#41498)
* edited package.jsons to output to console

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

* empty commit to trigger CI

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-11-21 11:16:08 +08:00
Paul Sealock b7ba45d419
Tree Select Control: Allow parents to be searchable (#41559) 2023-11-21 14:25:46 +13:00
Nathan Silveira 5bba23ddb1
Fix currency breaking lines when 2 or more characters (#41548)
* Fix currency breaking lines when 2 or more characters

* Add missing changelog
2023-11-20 11:50:20 -03:00
Damián Suárez f6725545c2 changelog 2023-11-20 10:07:22 -03:00
Damián Suárez c1eefcf145 set max width to the summary block 2023-11-20 09:33:37 -03:00
Damián Suárez f89828c797 Merge branch 'trunk' into update/hanle-update-button 2023-11-20 08:30:05 -03:00
Paul Sealock fda2c15c76
Tree Select Control: Handle accents (#41495) 2023-11-18 11:05:21 +13:00
louwie17 65692011a9
Update/41463 update botton description (#41552)
* Update insert from url info text

* Add changelog
2023-11-17 16:05:12 -05:00
Damián Suárez a75fa7a6af populate aria-disable instead of disabled prop 2023-11-17 16:29:22 -03:00
Damián Suárez 77598a0e3f Merge branch 'trunk' into update/hanle-update-button 2023-11-17 16:20:05 -03:00
Maikel David Pérez Gómez d269401959
[Individual Variant] Manage limits for downloads in a single variant are not working (#41508)
* Fix manage limits for downloads in a single variant are not working

* Fix invalid download id when saving after editing one download file

* Add changelog file
2023-11-17 13:30:18 -05:00
Nathan Silveira 6f6b5f5b4a
Fix typo in ts-ignore comment (#41517) 2023-11-17 14:57:31 -03:00
Matt Sherman fd65b3036e
Doc: Update generic blocks readme (#41545)
* Update generic blocks README

* Changelog

* Remove links to section and tab readmes, since they don't exist yet.
2023-11-17 13:49:03 -04:00
nigeljamesstevenson 00e1a29194
dev/fix no use before define lint violations (#41452) 2023-11-17 12:05:18 +00:00
Paul Sealock 3c703d3718
Tree Select Control: Use enter button for selection (#41480)
* enable enter to select

* Add changefile(s) from automation for the following project(s): @woocommerce/components

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-11-17 10:07:01 +13:00
Maikel David Pérez Gómez ed0d38c44b
[External products] Product details (#41442)
* Add buy button section

* Enable external product support into the product block editor

* Hide buy button section when product type is not external

* Remove BaseControl from TextControl since it's not required anymore, InputControl takes care of that now

* Add type and suffix support to the product-text-field block

* Add the placeholder to the external url input and remove required constraint to the buy button text

* Set the url icon link type to external

* Fix input border to be red when invalida now that base control is not present twice

* Set the min height to 36px to match others non InputControls components height

* Extends required constrain to also support a custom error message

* Extends the product-text-field validation system

* Add product-text-field documentation

* Add changelog files

* Fix php linter error

* Fix compilation error

* Fix linter errors
2023-11-16 14:11:44 -05:00
Nathan Silveira 9b1e5de687
Remove unnecessary focus on block divs in product editor (#41436)
* Add tabIndex -1 to useWooBlockProps

* Add changelog

* Fix property name in test

* Fix test

* Update changelog

* Add ts explanation

* Fix typo
2023-11-16 15:31:14 -03:00
Fernando Marichal b64416597b
[Individual variation] Fix empty state illustration visibility (#41337)
* Fix empty state illustration visibility

* Add changelog
2023-11-16 11:10:29 -05:00
Maikel David Pérez Gómez 1065762104
Display an alert icon for variations that contains "any" values (#41433)
* Move variations table row to its own component

* Add alert icon to the left of the variation row

* Render a tag when the variation option is not present in the product variable attributes

* Only shows the tooltip when the variation option is not present in the product variable attributes

* Add changelog file

* Fix linter errors
2023-11-16 10:45:50 -05:00
Fernando Marichal 4e383b647b
Show one help text when user clicks help button (#41435)
* Fix styles

* Add className to Tooltip component

* Add prop in edit-attribute-modal

* Add changelogs

* Add tooltip class to section
2023-11-16 11:59:25 -03:00
rjchow e062db64c9 deleted duplicate changelog 2023-11-16 21:01:09 +08:00
github-actions 3d606e2eb8 Add changefile(s) from automation for the following project(s): @woocommerce/api, woocommerce 2023-11-16 11:28:16 +00:00
rjchow 69f1b43160 Fix no-use-before-define lint rule violation 2023-11-16 19:26:24 +08:00
github-actions 420d219c2c Add changefile(s) from automation for the following project(s): @woocommerce/eslint-plugin, @woocommerce/components, @woocommerce/api, woocommerce 2023-11-16 19:21:30 +08:00
rjchow 5d99b267bf fix: fixed all instances of no-use-before-define lint rule violations 2023-11-16 19:21:30 +08:00
RJ b61b86545a
fix: fixed all instances of translator lint rule violations (#41450)
* fix: fixed all instances of translator lint rule violations

* Add changefile(s) from automation for the following project(s): @woocommerce/eslint-plugin, @woocommerce/components, woocommerce

* fix i18n lint violations in @woo/components

* fix all i18n lint rule violations in @woo/product-editor

* Add changefile(s) from automation for the following project(s): @woocommerce/product-editor, @woocommerce/eslint-plugin, @woocommerce/components, woocommerce

* empty commit to trigger CI

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-11-16 19:15:11 +08:00
Maikel David Pérez Gómez c416b57a94
The variations table should match the height of number of rows selected (#41140)
* Remove fixed height to the variations table and add per row skeletong when loading

* Add changelog file

* Add last variations instead of the current per page var given that there it is not accessible anymore
2023-11-15 14:42:48 -04:00
Damián Suárez d96b3327bf changelog 2023-11-15 12:31:59 -03:00
Damián Suárez 39b4ea86ab check and pass `disabled` option 2023-11-15 12:31:59 -03:00
Damián Suárez f5f88bc9cf move changelog file 2023-11-15 12:31:26 -03:00
Damián Suárez 3846e58642 move chnagelog file to the proper folder 2023-11-15 12:31:25 -03:00
Damián Suárez ea6ed050de move changelog file to components/ folder 2023-11-15 12:31:25 -03:00
Damián Suárez abebfffe53 changelog 2023-11-15 12:31:25 -03:00
Damián Suárez 682da9fca3 don't allow to select paginator text 2023-11-15 12:31:25 -03:00
Damián Suárez 803e583342 create a paginationLabel const 2023-11-15 12:31:25 -03:00
Ahmed 23df9a59e9
Use ' instead of backspace for escaping in csv export (#41163)
* Use ' instead of backspace for escaping

* Update tests

* Update dead link

* Update test case title

* Add changelog

* Fix typo in changelog

* Escape tab and carriage return chars too

---------

Co-authored-by: Anurag Bhandari <anurag@automattic.com>
2023-11-15 10:29:55 +01:00
Matt Sherman 7b2767aa57
Template API: Only generate templates on WCA routes (#41410) 2023-11-14 15:47:20 -05:00
Matt Sherman 489322d084 Always set templateLock to all 2023-11-14 15:14:57 -05:00
Nathan Silveira 55766ac140
Template API: Conditional disabling support (#41307)
* Add disable conditions functionality to back-end

* Evaluate _templateBlockDisableConditions in registerWooBlockType

* Add 'disabled' support for number, pricing, and text

* Add disabled support for checkbox

* Add disabled for taxonomy block

* Add changelogs

* Update documentation

* Add unit tests

* Augment attribute with disabled in back-end

* Fix disabled styling

* Remove disabled from toggle since it's being added for all blocks

* Improve CSS for disabled fields

* Only add disabled attribute when it's not added on the block json and refactor

* Allow adding disable conditions in the constructor

* Fix lint issue

* Fix test

* Add disableConditions to dependencies
2023-11-14 13:17:34 -03:00
Matt Sherman 11f593fe3c Changelog 2023-11-13 15:05:52 -05:00
Matt Sherman e766673829 Remove template from settings type (unused) 2023-11-13 14:50:57 -05:00
Nathan Silveira 703936e307
Remove FullScreenMode component from new product editor (#41375)
Remove FullScreenMode component since it seems we're not using it for anything
2023-11-13 16:11:32 -03:00
Nathan Silveira 8d731f8a43
Show global attribute slug without 'pa_' prefix (#41333)
* Show global attribute slug without 'pa_' prefix

* Make implementation more robust
2023-11-13 15:39:58 -03:00
Fernando Marichal b24591432d
Add `popoverProps` to DatePicker (#41404)
* Add `popoverProps` to DatePicker

* Add changelog

* Move changelog

* Add popoverProps to README.md

* Fix lint

* Fix lint again
2023-11-13 14:45:31 -03:00
Leif Singer be76c3c341
update references to woocommerce.com to now reference woo.com (#41241) 2023-11-10 20:47:58 +01:00
Fernando Marichal 811e0c079b
Fix date range and UI in Analytics (#41372)
* Fix date range and ui in Analytics

* Add changelogs

* Modify default behavior

* Remove changelog
2023-11-10 16:01:52 -03:00
Fernando Marichal 05c96d8cf0
Fix block header style in description modal (#41338)
* Fix block header style in description modal

* Add changelog
2023-11-10 11:57:51 -04:00
Leif Singer 030d67531f Woocommerce → WooCommerce (when used in prose only) 2023-11-10 16:13:06 +01:00
Leif Singer 641208c449 fix linter findings in js/components 2023-11-10 15:49:08 +01:00
Leif Singer eb5a8a65f8 add changelog files 2023-11-10 15:49:08 +01:00
Leif Singer 9edad5270d appease the linter 2023-11-10 15:49:08 +01:00
Leif Singer 808a0fc54f update references to woocommerce.com to now reference woo.com 2023-11-10 15:49:08 +01:00
Fernando Marichal 21b24d9ef2
Add custom image in downloads editor (#41342)
* Add custom image in downloads editor

* Add changelog
2023-11-10 09:44:49 -04:00
Fernando Marichal f5156e2860
Fix toggle chart views within Analytics Overview (#41329)
* Fix component blur

* Add changelog
2023-11-10 09:35:58 -04:00
Maikel David Pérez Gómez e5b1ee338e
Update the select all behavior in the variations table (#41008)
* We display the number of selected items, e.g., '5 selected'

* We display a number of all existing items next to the button, e.g., "Select all (25)".

* When only some items are selected on the page, we show an additional button that says "Select page (X)" where X stands for the number of rows on the page. Clicking it selects all rows on the page.

* Clicking "Select all" selects all existing items

* Add changelog file

* Add tracking events

* Saving progress on variations table

* Manage tracking events and error handling

* Hide edition features when at least one variation is selected

* Fix linter errors

* Resolve rebase conflicts

* Remove use selection hook since is not needed anymore

* Fix filter items vertical alignment

* Add changelog files

* Fix inconsistent loading and variations state

* Do not show EmptyTableState when the product has variations but the filter get empty list

* Invalidate cache state before generating variations

* Fix select all after filtering variations

* Remove delete variations from the selection list

* Retreive the product after generating variations

* Fix linter

* Invalidate variations cache after generating variations
2023-11-09 08:25:27 -05:00
Fernando Marichal fd8a5604ba
Add empty state to images block (#41165)
* Add svgs

* Add image place holder

* Refactor components

* Fix styles

* Add changelog

* Remove comment

* Add text translation

* Remove line
2023-11-08 12:36:08 -03:00
Moon 54a00b282a
CYS - make the progress bar move forward in small segments (#41279)
* Add 2 additional steps between the loader steps

* Support onChange callback

* Add loader progress transition

* Add smooth transition story

* Set the initial percentage to 5 to make the transition smoother

* Add changefile(s) from automation for the following project(s): @woocommerce/onboarding, woocommerce

* Add smooth-transition class to the progressbar

* Fix lint

* Update AssembleHubLoader

* Fix e2e

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-11-08 16:50:15 +08:00
Nathan Silveira 68a538cb17
Add animation for variable product tour and tweak logic (#41250)
* Add fade-in animation

* Show variable product tour only when product editor tour was already dismissed

* Add changelog
2023-11-07 15:18:49 -03:00
Fernando Marichal 5c4c926474
Update selected item styling dropdown (#41217)
* Update dropdown item style

* Add changelog
2023-11-07 12:59:08 -03:00
Fernando Marichal 02e163aadc
Update section description design (#41251)
* Modify tooltip helper text

* Update section header design

* Add changelog

* Add components changelog
2023-11-07 12:58:52 -03:00
Nathan Silveira 2a30735b28
[Product Block Editor] Show onboarding tour within description block editor (#41161)
* Copy WelcomeGuide from gutenberg

* Remove CSS copied from guide component since it's not influencing the product Welcome Guide and it's interfering with the block editor welcome guide

* Fix issue with box-sizing

* Fix lint issues

* Show guide only when modal is open

* Add changelog

* Remove template and fix issue with component not re-rendering

* Add comment

* Add additional changelog

* Rename component
2023-11-06 16:38:33 -03:00
Matt Sherman 20fac52381
Product Editor: Select product name block initially if set to autofocus (#41189) 2023-11-06 14:08:12 -05:00
Nathan Silveira 87db3d20a6
Add attribute empty state image when no attribute has been added (#40956)
* Add attribute empty state image when no attribute has been added

* Render attribute skeleton as HTML
2023-11-06 14:05:22 -03:00
Matt Sherman 2f65ad23a5 Changelog 2023-11-06 10:58:10 -05:00
Matt Sherman 6544a9cf69 Select product name block initially 2023-11-06 10:58:10 -05:00
Fernando Marichal b1b9e11323
Add preview and replace button to downloads edit (#40835)
* Add image replace

# Conflicts:
#	packages/js/product-editor/src/blocks/product-fields/downloads/edit-downloads-modal/edit-downloads-modal.tsx

* Add image and replace button

* Change styles

* Add changelog

* Verify the file is an image

* Fix image size

* Fix styles

* Changed left padding

* Fix image gap

* Fix style
2023-11-03 17:07:07 -03:00
Matt Sherman 18faf14db7 Update changelog 2023-11-03 09:16:14 -04:00
Matt Sherman afbe61a4f7 Move PluginArea into BlockEditor so plugins can get block info 2023-11-03 09:16:14 -04:00
Matt Sherman fc2fa8598b Changelog 2023-11-03 09:16:14 -04:00
Matt Sherman 15d46e478c Add PostTypeContext 2023-11-03 09:16:14 -04:00
Matt Sherman eae4dc1b9c Changelog 2023-11-01 15:54:55 -04:00
Matt Sherman 94c7112c00 Only select on focus in currency and number fields if still has focus 2023-11-01 15:54:03 -04:00
Maikel David Pérez Gómez 6b44a969d0
Add filters to Variation table (#40978)
* Create product variations filter component

* Add slug to the product and variation attributes
This is needed to be able to filter variations by specific attribute slugs

* Add support to filter variations by many attribute options

* Integrate attribute options filter in variations table

* Fix rebase conflicts

* Set initial filter values

* Improve intial filter values and cache invalidation

* Add changelog files

* Fix linter errors

* Fix unit tests

* Change the min amount of options to show the search input

* Fix invalid cache key generation for the datastore

* Fix unit tests

* Fix linter errors

* Fix js tests

* Add terms pagination for varition filters

* Load terms on demand plus pagination

* Show selected option names as the dropdown button toggle text

* Fix invalida state when reset and on close the popover

* Revert adding selected options as part of the dropdown toggle text

---------

Co-authored-by: Fernando Marichal <ultimoround@gmail.com>
2023-10-31 13:29:48 -04:00
Fernando Marichal bae33f34de
Fix attributes modal incorrect notice (#40976)
* Remove modal copy

* Fix styles

* Add changelog

* Fix build error
2023-10-31 13:18:32 -03:00
Matt Sherman 17ed81c24f
Order menu items in product editor's more menu (kebab menu) (#41104) 2023-10-31 10:45:20 -04:00
Nathan Silveira 1037d9a8b0
Add __experimentalRole: 'content' to block properties (#41045)
* Add __experimentalRole: 'content' to block properties

* Revert change in versions
2023-10-31 11:29:10 -03:00
Nathan Silveira 164ae0984c
Fix double scroll in General tab and image upload overlapping (#40977)
Fix double scroll in General tab and image upload overlapping with other blocks
2023-10-31 11:10:40 -03:00
github-actions[bot] 3a265c3afd
Prepare Packages for Release (#41065)
Co-authored-by: opr <opr@users.noreply.github.com>
2023-10-31 02:02:59 -07:00
Matt Sherman 16d8215119 Changelog 2023-10-30 15:00:18 -04:00
Matt Sherman c83f581932 Add support for ordering product more menu items 2023-10-30 14:59:37 -04:00
Matt Sherman affbb01136 Changelog 2023-10-30 14:44:08 -04:00
Matt Sherman a921863e40 Remove SlotFillProvider from editor 2023-10-30 14:39:01 -04:00
Maikel David Pérez Gómez 65408410fb
Unable to select the values from the dropdown menu on the "Products > Add New > Product Catalog" page (#41093)
* Fix unable to select the values from the select tree control

* Add changelog file
2023-10-30 12:06:59 -04:00
Thomas Roberts 0baec4e003
Add `@woocommerce/blocks-components` to `dependency-extraction-webpack-plugin` packages list (#41042)
Co-authored-by: github-actions <github-actions@github.com>
2023-10-27 02:21:46 -07:00
Leif Singer 1ed69451a5
integrate-plugin: remove superfluous test scripts (#41053)
* remove superfluous test scripts

* Add changefile(s) from automation for the following project(s): @woocommerce/integrate-plugin

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-10-27 00:16:31 +02:00
Nathan Silveira 81cb9e9458
Add tooltip next to label for text and number blocks (#40908)
* Create initial version of TextControl

* Extract 'label' component for reusability

* Reduce gap

* Add label component to number control and add tooltip and required attributes

* Add changelog

* Remove unused CSS

* Add tooltip to type definitions

* Update doc for number block

* Add text block documentation

* Update parameters definition

* Set label to 'mandatory' in TypeScript

* Set label to mandatory

* Organize to alphabetical order

* Refactor required validation to be more consistent with name field

* Generify documentation

* Use createInterpolateElement for label with required indicator
2023-10-26 15:35:39 -03:00
Fernando Marichal 898eb30f7e
[Single Variation] Add missing tracks events (#40996)
* Add note prop

* Add note for single variation

* Add event recording for generic toggle

* Add changelog

* Add parent_id to toggle event

* move logic inside recordProductEvent

* Modify postType
2023-10-26 00:45:53 -03:00
Nathan Silveira a8e4b27df2
Fix 'Hide in product catalog' being unchecked for variations (#41007)
* Don't touch status attribute in variations

* Add missing validate for variations
2023-10-25 16:52:23 -03:00
Wacław Jacek 3d5b58b7d6
Remove dependency on Jetpack from Shipping and Tax task list items (#39992)
* Remove dependency on Jetpack from WCS&T's task list item

- Remove installing Jetpack-the-plugin from WooCommerce Shipping &
Tax WC Home task list and recommended extensions area.

- Update Jetpack auth link generation to use getJetpackAuthUrl().

- Remove references of Jetpack-the-plugin from WCS&T onboarding
as the extension will now use the Jetpack Connection package
for establishing a connection between WPCOM infrastructure
and a Woo site.

* Update WooCommerce Tax flow in WC Home task list

* Inline the agreementText variable

* Add missing pluginSlugs prop to <Plugins> instance for WC Tax

* Fix WC Tax extension name in API response

* Remove Jetpack from copy in Tax task header

* Fix MD034/no-bare-urls MD linting violation

* Fix experimental shipping recommendation tests

* Add changelogs requested by linter

* Add changefile(s) from automation for the following project(s): @woocommerce/components, woocommerce

* Remove mention of Jetpack from ExperimentalShippingRecommendation

* Fix text wrapping bug in WC Tax onboarding task

* Add changefile(s) from automation for the following project(s): @woocommerce/components, woocommerce

* Use isResolving() to detect pending auth URL fetch

* Replace unused hasErrors with ref to error

* Fix lint

* Jetpack auth URL prefetching

* Revert "Jetpack auth URL prefetching"

This reverts commit 2b79000e20.

* Add PrefetchJetpackAuthUrl component to remove Connect button load time

* Replace URL prefetching in component with useEffect

* Fix: Accept redirect URL as param instead of prop

* Fix lint

* Remove prefetching. Make Connect button always available

* Fix ExperimentalShippingRecommendation incompatibility with new Connect behavior

* Handle empty object errors in Connect

* Display TOS above WooCommerce Shipping & Tax installation buttons (#40863)

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-10-25 22:39:43 +08:00
louwie17 3f7eb0ce31
Invalidate variations upon generation and fix formatted name (#40905)
* Invalidate variations upon generation and fix formatted name

* Add aditional invalidates to keep cache up to date

* Update formatted name to always return attribute term name list
2023-10-25 08:45:58 -04:00
Nathan Silveira bc04234732
Fix checkbox not working when checkedValue is provided (#40979) 2023-10-25 00:29:53 -03:00
RJ e01e6f8b2a
add: core profiler email marketing opt in (#40869)
* add: core profiler email marketing opt in

* tests

* changed mailchimp feature flag

* fix: made experiment name static

* lint
2023-10-24 17:07:26 +02:00
Maikel David Pérez Gómez 791af33e95
Empty state for uncreated/empty variations (#40940)
* Move empty-variations-image to the images folder so it can be used in other components

* Create TableEmptyState component

* Add TableEmptyState to the Variations table component

* Add changelog file

* Fix linter error
2023-10-23 15:21:42 -04:00
Fernando Marichal 469a76a82f
Show error message when single variation price is empty (#40885)
* Show notice when price is empty

* Add changelog

* Add variation check

* Allow multiple errors

* Show unique errors

* Change error text

* Rename wpError to wpErrors

* Show single error

* Add error type

* Refactor catch
2023-10-23 16:19:00 -03:00
Maikel David Pérez Gómez eff2b8cca3
Update default visibility settings for variation options (#40949)
* Replace hidden icon by seen icon

* The 'visible' icon is only shown when the Show in product details box in the variation option is checked

* The tooltip displayed when the user hovers over the 'hidden' icon is updated to: Visible in product details

* On hover, the cursor changes to help

* Add changelog file
2023-10-23 14:19:33 -03:00
Maikel David Pérez Gómez 16ce05109f
Add a loading state for the new product form (#40939)
* Create product page skeleton

* Load skeleton in product and variation pages

* Let each page to define own loading/skeleton when the router is resolving the page.

* Add changelog files

* Fix linter error

* Fix unit test
2023-10-23 12:47:26 -04:00
Maikel David Pérez Gómez 50ff379f25
Delete variations from the single page does not reflect correctly in the parent product (#40900)
* Invalidate resolution for paginated variations after removing any from the single variation page

* Add changelog file

* Invalidate resolution also for getProductVariationsTotalCount
2023-10-20 13:06:02 -03:00
louwie17 fbac42aafc
Update variation switcher logic to not loop (#40901) 2023-10-20 11:17:30 -04:00
Matt Sherman 3fa5573706
Template API: Deprecate woocommerce/conditional block (#40883) 2023-10-20 09:53:06 -04:00
Nathan Silveira 3d182f342f
Create React component wrappers for the checkbox and number blocks (#40828)
* Add @woocommerce/number to @woocommerce/components

* Create a component for checkbox and use it on the block

* Create a component for number and use it on the block

* Add changelogs

* Remove scss import

* Rename Numbercontrol prop

* Expose useProductEntityProp

* Move components to product-editor package and fix UI bug created in checkbox component

* Revert unnecessary changes in components and update changelogs

* Revert changes in use-number-input-props

* Fix issue in checkbox

* Revert css change
2023-10-20 10:52:56 -03:00
Fernando Marichal 3426692606
Hide `Switch to draft` button on single variation page (#40856)
* Hide Switch to draft when variable product

* Add changelog

* Change changelog
2023-10-20 09:32:06 -04:00
Matt Sherman 61ef8a9fa2 Changelog 2023-10-19 15:34:32 -04:00
Matt Sherman 60fde2be96 Deprecate woocommerce/conditional block 2023-10-19 15:32:40 -04:00
Maikel David Pérez Gómez 8827e42bd7
Set prices button from the variations notice is not updating the right amount of variations (#40876)
* Improve has_price filter so it can matches when the price record does not exist or it's empty/null

* Get the exact variation ids of those ones that do not have price

* Add changelog files

* Fix linter errors
2023-10-19 13:14:08 -04:00
Matt Sherman 613a63b0ef
Template API: Conditional visibility support (#40722) 2023-10-19 12:02:05 -04:00
Matt Sherman df2a0eb337 Remove productType from ProductEditorContext interface 2023-10-19 11:20:20 -04:00
Fernando Marichal b0113ee555
Add edit downloads modal (#40599)
* Create edit downloads modal

* Add modal to downloads

# Conflicts:
#	packages/js/product-editor/src/blocks/product-fields/downloads/edit.tsx

* Refactor removeHandler

* Fix EditDownloadsModal

* Refactor onSave

* Add changelog

* Fix onRemove

* Fix styles

* Fix lint

* Fix lint

* Fix modal closing when copyToClipboard
2023-10-19 11:09:04 -04:00
Daniel Mallory e4b1657f98
Remove references to Sofort (#40745)
* Removing all references to Sofort in the various locations we show payment method information.

* Adding changelogs.
2023-10-19 13:45:48 +01:00
Matt Sherman 7fd28367d8 Remove order attribute from tab block 2023-10-19 08:28:14 -04:00
Matt Sherman 4605f7ee57 Set tab order based on block's order 2023-10-19 08:23:44 -04:00
Matt Sherman 97dc41e2aa Remove productType from context (it was really just postType, which is already in context) 2023-10-19 07:43:09 -04:00
Matt Sherman abd71af40a Switch conditional block to use postType from context instead of productType 2023-10-19 07:33:29 -04:00
Matt Sherman b40f9d2035 Switch productType to postType in context augmentation 2023-10-19 07:30:53 -04:00
Matt Sherman f399196b39 Changelog 2023-10-18 18:57:27 -04:00
Matt Sherman 4a49683a69 Changelog 2023-10-18 18:57:22 -04:00
Matt Sherman 6b6ffd184e Remove unused imports 2023-10-18 18:44:32 -04:00
Matt Sherman 8a1709a275 Make useEvaluationContext param optional 2023-10-18 18:41:40 -04:00
Matt Sherman d14124c513 Fix up registerWooBlockType unit test 2023-10-18 18:41:22 -04:00
Matt Sherman 076939f2e4 Ignore ts error about lack of types for @wordpress/data 2023-10-18 15:43:26 -04:00
Matt Sherman 48d5cca0b8 Fix block registration for downloads 2023-10-18 15:16:17 -04:00
Matt Sherman 6b55e7c096 Refactor client-side usesContext augmentation 2023-10-18 15:16:17 -04:00
Matt Sherman a4002105a4 Refactor client-side attribute augmentation 2023-10-18 15:16:17 -04:00
Matt Sherman 23b2953934 Fix block registration on notice-edit-single-variation 2023-10-18 15:16:17 -04:00
Matt Sherman 2981f14a5b Fix block registration for downloads 2023-10-18 15:16:17 -04:00
Matt Sherman b256841135 Use getEditedEntityRecord to get product 2023-10-18 15:16:17 -04:00
Matt Sherman f466d84bf5 Remove editedProduct from usesContext 2023-10-18 15:16:17 -04:00
Matt Sherman 67e3d72095 Add productType to ProductEditorContext interface 2023-10-18 15:16:17 -04:00
Matt Sherman 6f53697df2 Remove console.log 2023-10-18 15:16:17 -04:00
Matt Sherman aa942771e5 Fix up TS errors 2023-10-18 15:16:17 -04:00
Matt Sherman ea6dc94897 Move useEvaluationContext implementation to product-editor 2023-10-18 15:16:17 -04:00
Matt Sherman 334a10a9a4 useEvaluationContext hook 2023-10-18 15:16:17 -04:00
Matt Sherman e244c8e025 Improve useSelect implementation 2023-10-18 15:16:17 -04:00
Matt Sherman 09b0cdcef7 Memoize block context 2023-10-18 15:16:17 -04:00
Matt Sherman 86a0a15588 Include productType in context; don't include editedProduct 2023-10-18 15:16:17 -04:00
Matt Sherman 7161534f96 Conditional visibility implementation with useSelect 2023-10-18 15:16:17 -04:00
Matt Sherman 5845bcb768 Conditional visibility implementation with context 2023-10-18 15:16:17 -04:00
Matt Sherman 6f2e89adcb Use registerProductEditorBlockType for variations 2023-10-18 15:16:17 -04:00
Matt Sherman cb15fbcd34 Use registerProductEditorBlockType for variation-options 2023-10-18 15:16:17 -04:00
Matt Sherman dbc3c7a77b Use registerProductEditorBlockType for variation-items 2023-10-18 15:16:17 -04:00
Matt Sherman 9d492800f3 Use registerProductEditorBlockType for tag 2023-10-18 15:16:17 -04:00
Matt Sherman 271258a0c4 Use registerProductEditorBlockType for summary 2023-10-18 15:16:16 -04:00
Matt Sherman ca9b5c3dd9 Use registerProductEditorBlockType for shipping-dimensions 2023-10-18 15:16:16 -04:00
Matt Sherman 686ad5c026 Use registerProductEditorBlockType for shipping-class 2023-10-18 15:16:16 -04:00
Matt Sherman e366809711 Use registerProductEditorBlockType for schedule-sale 2023-10-18 15:16:16 -04:00
Matt Sherman d92d34f9fe Use registerProductEditorBlockType for sale-price 2023-10-18 15:16:16 -04:00
Matt Sherman c937b3eea9 Use registerProductEditorBlockType for regular-price 2023-10-18 15:16:16 -04:00
Matt Sherman c4bd765eb6 Use registerProductEditorBlockType for password 2023-10-18 15:16:16 -04:00
Matt Sherman 6596e9c05c Use registerProductEditorBlockType for notice 2023-10-18 15:16:16 -04:00
Matt Sherman b3e0b2af93 Use registerProductEditorBlockType for name 2023-10-18 15:16:16 -04:00
Matt Sherman 8574fdec36 Use registerProductEditorBlockType for inventory-sku 2023-10-18 15:16:16 -04:00
Matt Sherman 9b161c6667 Use registerProductEditorBlockType for inventory-quantity 2023-10-18 15:16:16 -04:00
Matt Sherman 0d03ad93b3 Use registerProductEditorBlockType for inventory-email 2023-10-18 15:16:16 -04:00
Matt Sherman ccdccc2de3 Use registerProductEditorBlockType for images 2023-10-18 15:16:16 -04:00
Matt Sherman 3324fe2787 Use registerProductEditorBlockType for description 2023-10-18 15:16:16 -04:00
Matt Sherman f9aa73c7d3 Use registerProductEditorBlockType for catalog-visibility 2023-10-18 15:16:16 -04:00
Matt Sherman 8fee2c1669 Use registerProductEditorBlockType for attributes 2023-10-18 15:16:16 -04:00
Matt Sherman 2296f910c9 Use registerProductEditorBlockType for toggle 2023-10-18 15:16:16 -04:00
Matt Sherman f2feaa7d55 Use registerProductEditorBlockType for text 2023-10-18 15:16:16 -04:00
Matt Sherman d082491e1d Use registerProductEditorBlockType for taxonomy 2023-10-18 15:16:16 -04:00
Matt Sherman 7a04b3909e Use registerProductEditorBlockType for tab 2023-10-18 15:16:16 -04:00
Matt Sherman 3afe5d8233 Use registerProductEditorBlockType for section 2023-10-18 15:16:16 -04:00
Matt Sherman aa9ed2d88a Use registerProductEditorBlockType for radio 2023-10-18 15:16:16 -04:00
Matt Sherman 9bb83c1745 Use registerProductEditorBlockType for pricing 2023-10-18 15:16:16 -04:00
Matt Sherman 63d18234f8 Use registerProductEditorBlockType for number 2023-10-18 15:16:16 -04:00
Matt Sherman 57d1c4a0a7 Use registerProductEditorBlockType for conditional 2023-10-18 15:16:16 -04:00
Matt Sherman f3eea29421 Use registerProductEditorBlockType for collapsible 2023-10-18 15:16:16 -04:00
Matt Sherman bf8ea9a016 Use registerProductEditorBlockType for checkbox 2023-10-18 15:16:16 -04:00
Matt Sherman 7448e78aa7 Implement registerProductEditorBlockType 2023-10-18 15:16:16 -04:00
Matt Sherman c616e0c7c9
Add @woocommerce/block-templates dependencies (#40849) 2023-10-18 14:41:23 -04:00
Matt Sherman 51dec2db53 Add @wordpress/data to dependencies 2023-10-18 13:31:46 -04:00
Maikel David Pérez Gómez 40a410ae1f
Product Shipping: New class should automatically create a slug (#40847)
* Remove empty values from the shipping class request so slug can be generated server side

* Add changelog file
2023-10-18 13:04:14 -04:00
Matt Sherman 8ca38b6df2 Add react dependencies 2023-10-18 12:07:23 -04:00
Matt Sherman a1e38b0b25 Add @woocommerce/element to dependencies 2023-10-18 11:58:31 -04:00
Matt Sherman 375717c655 Changelog 2023-10-18 11:38:21 -04:00
Matt Sherman ef268fe545 Add @woocommerce/expression-evaluation dependency 2023-10-18 11:37:10 -04:00
Maikel David Pérez Gómez 51c9b9051e
[Downloads] Manage limits (#40797)
* Create ManageDownloadLimitsModal component

* Integrate ManageDownloadLimitsModal with product downloads block

* Add changelog file

* When there's at least 1 file uploaded, we add a Manage limits button to the Downloads section heading

* Both fields only accept numbers

* Add suffix to each input

* Add integer validation message

* Fix validation to support -1 and 0 values
2023-10-18 10:15:43 -04:00
Maikel David Pérez Gómez 39019d2750
Manage single variation as virtual (#40809)
* Add virtual section to the product variation template

* Add changelog file

* Let the toogle block to use inverted value to be checked

* Fix virtual toggle to be inverted

* Add changelog file
2023-10-18 10:47:33 -03:00
louwie17 cee08e44d9
Hide header on variation edit page and remove use of `:has()` CSS selector (#40843)
* Make sure we hide the header on the variation edit page and remove use of has()

* Add changelogs
2023-10-18 09:22:55 -03:00
RJ 1e86558083
fix: cys design-with-api loader should not loop (#40829) 2023-10-18 15:14:51 +08:00
Joel Thiessen b2197bb423
[Woo AI] Add background removal feature for the legacy product editor images (#40833)
Co-authored-by: Joel <dygerati@gmail.com>
Co-authored-by: Thomas Shellberg <6723003+tommyshellberg@users.noreply.github.com>
Co-authored-by: Nima Karimi <73110514+nima-karimi@users.noreply.github.com>
2023-10-17 14:27:24 -07:00
Maikel David Pérez Gómez 5dedfd7ebe
Add Downloads section to the single variation page (#40807)
* Add support to downloads block to use the context postType

* Register the downloads block into the ProductVariationTemplate

* Add changelog files

* Fix compilation error

* Fix download block init function
2023-10-17 16:58:53 -03:00
Moon fdc2401fcc
Fix badge size issue when a number larger than 3 digits is used (#40624)
* Fix badge design issue for big numbers

* Add changefile(s) from automation for the following project(s): @woocommerce/components

* Update packages/js/components/src/badge/style.scss

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-10-17 12:30:41 -07:00
Ismael Martín Alabarce c598a88d77
Manually prepare packages for release (#40826)
Manually run package release prepare for @woocommerce/components

To avoid GH workflow issues
2023-10-17 16:32:20 +02:00
Fernando Marichal b1451b8cf8
Display notice at the top single variations (#40679)
* Rename notice component

* Add notice-edit-single-variation

# Conflicts:
#	packages/js/product-editor/src/blocks/style.scss

* Add dismiss button to notice

* Add use-notice hook

* Refactor hook

* Changes in notice

* Rename

# Conflicts:
#	packages/js/product-editor/src/blocks/product-fields/notice/index.ts

* Create helper class

* Add notice block to general tab

* Add notice to other tabs

# Conflicts:
#	plugins/woocommerce/src/Admin/Features/ProductBlockEditor/ProductTemplates/ProductVariationTemplate.php

* Change comment

* Add parent product name to copy

* Fix lint

* Removed space

* Add changelogs

* Refactor notice block

* Remove context

* Refactor useConfirmUnsavedProductChanges

* Add useConfirmUnsavedProductChanges to Notice block

* fix lint

* Add return to `registerWooBlockType`

* Remove `useConfirmUnsavedProductChanges`

* Fix links styles

* Remove ProductEditorHelper use

* Remove ProductEditorHelper

* Refactor noticeLink

* Fix isResolving issue
2023-10-16 15:07:50 -04:00
Nathan Silveira c3ffd5af95
Add 'min' and 'max' attributes to number block (#40715)
* Add 'min' and 'max' attributes to number block

* Rename string
2023-10-16 12:07:17 +00:00
Ismael Martín Alabarce 8f533167f7
Add PhoneNumberInput component – cooldown (#40335)
* Move component from WooPayments

* Expose component on the package

And include its style sheet.

* Add missing global typing

* Fallback to alpha2 codes

when wcSettings.countries is not available

* Add build data script and its output

* Move defaults to their own file

* Add readme and JSDocs

* Add storyboard examples

* Add JS unit and snapshot tests

* Move `DataType` to a `types.ts` file

To get rid of the type definition in the build data script

* Fix markdown issues

* Add changefile(s) from automation for the following project(s): @woocommerce/components

* Minor markdown update

* Fix input sanitization

* Add component output to storybook examples

* Remove consecutive spaces or hyphens from input sanitization

* Improve consecutive character sanitization

Move it to the component keyDown event to avoid the caret to be displaced

* Ensure imports from @wordpress/element

* Refactor to avoid using lodash

* Add changefile(s) from automation for the following project(s): @woocommerce/components

* Use $gray-5 for highlighted items for better contrast

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-10-16 10:19:36 +02:00
louwie17 7f25060044
Variation switching when deleting (#40780)
* Add variation switcher hook for easier use across multiple components

* Add unregister function for validation

* Add changelogs

* Remove stray console

* Add unRegisterValidator function
2023-10-13 19:25:58 -04:00
Maikel David Pérez Gómez df2bf33bcd
Add edit button to each variation to redirect to the single variation page (#40709)
* Add edit button to each variation to redirect to the single variation page

* Add changelog file

* Fix blocks and plugin registration

* Add router redirection

* Fix css conflicts with the prev experience

* Fix linter errors

* Add changelog file
2023-10-13 16:22:11 -04:00
Maikel David Pérez Gómez 177f8bbe6b
[Virtual] ‘Needs shipping’ toggle (#40735)
* Add virtual section and block to the Shipping tab

* Set shipping disabled when the product is virtual

* Add changelog files

* Fix linter errors
2023-10-13 16:19:32 -04:00
Maikel David Pérez Gómez ff062eed4d
Add new file dropdown menu (#40731)
* Create downloads menu component

* Add the menu to the downloads section

* Create upload-files-menu-item component

* Add upload-files-menu-item to the downloads menu

* Create media-library-menu-item component

* Fix media library menu item zindex conflict with the media upload modal

* Create insert-url-menu-item component

* Add insert-url-menu-item to the downloads menu

* Add support for digital product when product-virtual-downloadable feature is enabled

* Add changelog files

* Remove non needed style

* Fix linter errors

* Fix redirection logic

* Keep drop zone on to of the table

* Avoid duplicate files

* Stringify download ids before persist them

* Fix summary block property value under SimpleProductTemplate

* Fix linter error
2023-10-13 15:25:37 -04:00
Maikel David Pérez Gómez 985d9596d6
Add Delete variation item to the editor actions menu (#40672)
* Create DeleteVariationMenuItem to be added to the Header's MoreMenu

* Move registration menu item fills to each product/variation page

* Export RemoveConfirmationModal from the product editor package

* Request for variation deletion

* Show notice when deleting variation

* Redirect to parent product page after deleting the variation

* Add tracking event

* Manage isRemoving state under RemoveConfirmationModal

* Add changelog files

* Fix linter error

* Fix delete variation modal title

* Add tracking events

* Use the right prop to get the variation name

* Add name and parent_id to the ProductVariation type definition

* Add changelog file

* Feedback modal should get the correct product id when editing a variation

* Fix rebase conflicts

* Fix unit test
2023-10-12 15:59:13 -04:00
louwie17 c4c56f3fc8
Add variation switcher in footer for variation page (#40713)
* Add variation switcher in footer for variation page

* Add productId to make sure template is updated correctly

* Don't show bar when less then 2 variations.

* Add class for when page is scrolled to bottom

* Add changelogs

* Add tracks

* Fix lint error

* Fix css lint issues
2023-10-12 11:56:48 -03:00
Fernando Marichal ff51b07da3
Change the blocks editor header to support variations (#40606)
* Add variation name and parent id to REST API

* Add variation title

* Add changelog

* Change changelog

* Fix lint

* Add changelog

* Fix typo

* Modify header check
2023-10-11 15:34:26 -03:00
Maikel David Pérez Gómez 2cff75c73c
Add virtual and downloads related controls to variation management flows (#40567)
* Add Toggle shipping item to the variations quick actions menu

* Add Downloads -> Set download limit item to the variations quick actions menu

* Add Downloads -> Set download expiry item to the variations quick actions menu

* Add Downloads -> Upload files item to the variations quick actions menu

* Add changelog file

* Fix some styles conflicts and set default uploaded files

* Hide the toggle shipping and downloads menu items behind the feature flag product-virtual-downloadable

* Fix unit tests
2023-10-11 12:50:00 -04:00
Maikel David Pérez Gómez eb9a8b3cde
[Downloads] File list (#40526)
* Add downloads section

* Create and register the downloads block

* Conditionally remove the upload button from the media upload component

* Create upload image component

* Add media uploader component to the downloads block

* Add downloads table

* Add remove file feature to the downloads table

* Set downloadable to false when there are no download files

* Add support to remove uploaded file

* If the file has a custom name added by the user, we show it first. The actual file name is then shown in a second line.

* Add changelog files

* Fix linter error

* Address feedback from comments

* Fix allowed media types

* Register the new feature flag product-virtual-downloadable

* Hide the downloads section behind the feature flag product-virtual-downloadable

* Update editor settings after sync blocks with template

* Get allowedMimeTypes from the editor settings

* Fix linter errors
2023-10-11 10:37:41 -04:00
Maikel David Pérez Gómez e0a138b27b
Complete General tab for Single Variation page (#40633)
* Add description to the Variation details section

* Add Image section block to the Single Variation page

* Add support to the checkbox block for changing non boolean properties and extend it to use the entity context

* Register the product-variation-visibility block into the ProductVariationTemplate

* Null is a valid value but not updafined

* Fix type definitions

* Add changelog files

* Fix linter errors

* Add changelog file

* Change onValue and offValue for checkedValue and unchackedValue for the checkbox block to avoid event naming conflicts

* Set multiple value dynamically into the media uploader component

* Prevent uploading multiple files when multiple is set to false

* Remove cover label when multiple is set to false

* Fix DropZone min height in Image section

* Fix rebase conflict

* Fix linter error
2023-10-10 09:42:26 -04:00
louwie17 98876f54d9
Add pricing tab for variations (#40642)
* Update blocks with postType context

* Add tax class

* Pass context into get_tax_class

* Add parent option

* Add changelog

* Update changelog

* Add isRequired attribute to regular price block for use in variations

* Add additional condition to avoid error in date time picker

* Add changelog

* Fix lint errors
2023-10-10 08:55:05 -03:00
Matt Sherman 8ac66ab2b7
Template API: Expression evaluation package (#40556) 2023-10-09 09:22:17 -04:00
Nathan Silveira a1226d5e30
Add support for 'meta_data.' property format for reusable blocks (#40600)
* Add support to multiple types in useProductEntityProp

* Migrate 'checkbox' to useProductEntityProp

* Migrate 'pricing' to useProductEntityProp

* Migrate 'radio' to useProductEntityProp

* Migrate 'taxonomy' to useProductEntityProp

* Migrate 'text' to useProductEntityProp

* Migrate 'toggle' to useProductEntityProp

* Add changelog

* Update unit tests

* Add postType context to generic blocks and use-product-entity-props and add code review suggestions

* Use postType for meta_data as well

* Fix unit tests
2023-10-09 12:34:37 +00:00
Matt Sherman 2abd3eee38 Initial documentation 2023-10-08 08:13:54 -04:00
Matt Sherman 7a950f51b6 Changelog 2023-10-08 07:03:17 -04:00
Christopher Allford 1c30563ffc
Separate PHP and JS Unit Tests (#40639)
Since some projects might have both kinds of tests we are
going to have a `test:php` and a `test:js` script for each.
2023-10-06 15:41:47 -07:00
Maikel David Pérez Gómez d1656e12e5
Add Shipping tab to the single variation page (#40637)
* Fix shipping blocks ids into ProductVariationTemplate

* Add support to postType context to product-shipping-class-field block

* Add support to postType context to product-shipping-dimensions-fields block

* Add changelog files
2023-10-06 13:47:45 -04:00
Maikel David Pérez Gómez 5d97297c89
Add Inventory tab to the single variation page (#40636)
* Remove advance section from the inventory section in the ProductVariationTemplate

* Add support to postType context to product-sku-field block

* Add support to postType context to product-toggle-field block

* Add support to postType context to product-inventory-quantity-field block

* Add support to postType context to product-radio-field block

* Fix inventory blocks ids into ProductVariationTemplate

* Add changelog files
2023-10-06 13:45:27 -04:00
Nathan Silveira 129f11df9e
Create woocommerce/product-number-field block (#40619)
* Add initial structure for number block

* Add more attributes and remove currenty formatting

* Add changelog

* Refactor

* Add readme

* Remove unused import

* Add changelog

* Use 'formatNumber' and 'parseNumber' functions from useProductHelper hook

* Use 36px default size

* Fix README
2023-10-06 16:21:33 +00:00
Maikel David Pérez Gómez a918e79093
Setup the product editor to support the product variation (#40605)
* Initial changes needed to get product variation to load in its own form

* Allow the publishing of an individual variation

* Address some PR feedback and do some general cleanup

* Update template with new attribute name

* Add changelogs

* Update label of note field and allow for optional param in summary block

* Remove helpText in variation note field

* Fix PHP lint errors

* Make editor type more abstract

---------

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2023-10-05 15:27:54 -03:00
louwie17 a28a552bbf
Add initial migration script (#40564)
* Add initial integrate plugin package

* Add changelog

* Make plugin data parsing less strict, to support bad formatting

* Update package dependency

* Remove unused code
2023-10-05 09:35:50 -03:00
Matt Sherman fd2c07cac0 Clean up ConditionalExpression rule 2023-10-04 20:12:40 -04:00
Matt Sherman eb71f43bdc Implement conditional expressions 2023-10-04 19:52:39 -04:00
Matt Sherman 0646031217 Implement multiline comments and be more forgiving of extra whitespace 2023-10-04 15:47:06 -04:00
Matt Sherman 1812a76f8d Test with complex expression with arithmetic, relational, and logical operators 2023-10-04 10:02:15 -04:00
Matt Sherman 83c3ff365a Implement arithmetic expressions 2023-10-04 09:59:39 -04:00
Matt Sherman 11653fe327 Rearrange tests to match grammar order 2023-10-04 09:54:15 -04:00
Matt Sherman e7e9e30884 Test NOT with parenthesis 2023-10-04 09:52:54 -04:00
Nathan Silveira 793e4a821d
Split product editor blocks into separate directory structures (#40571)
* Create 'generic' and 'product-fields' and separate blocks between the two

* Refactor 'BlockRegistry' to include new directory structure

* Increment README

* Add param documentation

* Add changelogs

* Lint markdown

* Add block directory doc

* Fix jest test

* Update handbook reference
2023-10-04 13:51:25 +00:00
Matt Sherman 99b06b67a2 Tests for complex expressions 2023-10-04 09:38:52 -04:00
Matt Sherman 18992e7891 Implement relational expressions 2023-10-04 09:33:21 -04:00
Matt Sherman f47bb0db37 Refactor to evaluate function 2023-10-04 09:25:49 -04:00