Commit Graph

3006 Commits

Author SHA1 Message Date
Joel Thiessen 4dff6db40f
Adding test name block with support for entity data store (#37132)
* Adding test name block with support for entity data store

* Adding changelog

* Changing block.ts to block.json and amending TS config to support

* Experiment in loading blocks from settings template

* Enable the use of templates with the block editor

* Fix dependency

* Add changelog

* Fix lint error and remove unused utils

* Fix tests by fixing mocks

---------

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2023-03-13 11:45:25 -03:00
Gan Eng Chin 0cf56774f5
Merge branch 'trunk' into feature/34909-marketing-create-campaign-modal 2023-03-13 12:51:24 +08:00
louwie17 329b0cbd07
Hydrate product editor settings (#37123) 2023-03-10 12:21:22 -08:00
Gan Eng Chin c6e6f8774d
Specify empty array dependency in useCampaignTypes.
This is to make it work with WP 5.9. See https://github.com/woocommerce/woocommerce/pull/37044#discussion_r1132062493.
2023-03-11 00:42:09 +08:00
Gan Eng Chin 1fea0185fe
Don't throw error in getCampaignTypes.
In WP 5.9, if we throw error, there would be an uncaught promise, and it causes UI to break.
2023-03-11 00:31:23 +08:00
Matt Sherman af24637439
Create @woocommerce/admin-layout package (#37094)
* Initial admin-layout package skeleton

* Changelog files

* Use createOrderedChildren and sortFillsByOrder from @woocommerce/components for WooFooterItem

* Move WooFooterItem to @woocommerce/admin-layout

* Use WooFooterItem from @woocommerce/admin-layout

* Suppress errant TS lint errors

* Exports for @woocommerce/admin-layout

* Fill updates and eslint suppression

* Changelogs

* Remove suppression of tslint errors

* Fix react and @types/react versions

* Load @woocommerce/admin-layout script and styles

* Move WooHeaderItem, WooHeaderNavigationItem, and WooHeaderPageTitle to @woocommerce/admin-layout

* Regenerate lock file post-rebase

* Remove duplicate import post-rebase

* Add wc-admin-layout to app style dependency

* Fix jest mock of @woocommerce/admin-layout

* Fix spacing.

* Export slot names

* Fix typo in .npmrc

* Update lock file

* Try updating lock file

* Update lock file

* Update lock file

* Update to latest lock file from trunk

* Update lock file

* Sync dependencies of @woocommerce/admin-layout

* Manually sync @wordpress dependencies
2023-03-10 09:58:02 -05:00
Joel Thiessen 970c1ef352
Hydrating product entity when creating or editing product with block editor (#37064) 2023-03-09 13:11:25 -08:00
Maikel David Pérez Gómez 2896a8cd13
Add the new feature to enable the new product editor blocks experience (#37137)
* Add the new feature to enable the new product editor blocks experience

* Add the type definition of the feature flag

* Add the feature to the beta_featues in Features.php file

* Keep the page routes when the feature is anabled

* Add the feature php class to manage page assets

* Add changelog file
2023-03-09 15:33:39 -03:00
Gan Eng Chin 0a58ec19f8
Remove unneeded div in CreateNewCampaignModal. 2023-03-10 02:14:35 +08:00
Gan Eng Chin e4da8cba09
Display info message when there are no campaign types. 2023-03-10 02:13:05 +08:00
Gan Eng Chin 6446053784
Load campaign types in overview and refetch after installeing a channel. 2023-03-09 23:46:54 +08:00
Gan Eng Chin 8b6aad4138
Refetch campaign types after installing a channel in CreateNewCampaignModal. 2023-03-09 22:51:12 +08:00
Gan Eng Chin 29d67a3a21
Refactor test data in CreateNewCampaignModal tests. 2023-03-09 22:31:51 +08:00
Gan Eng Chin 9f0326b398
Remove unneeded return in CreateNewCampaignModal.
This helps us save indentation and make the code few lines shorter.
2023-03-09 22:26:06 +08:00
Gan Eng Chin e15305b7c3
Remove unneeded CardDivider in CreateNewCampaignModal.
The code is copied from the Channels component, but in CreateNewCampaignModal, we don't need to display the divider, so we can just remove the divider code.
2023-03-09 22:23:27 +08:00
Gan Eng Chin c6dcee426b
Make it clear that title and classname cannot be overwritten by props. 2023-03-09 22:17:03 +08:00
Gan Eng Chin f5bb8490ea
Rename open and setOpen to isModalOpen and setModalOpen in Campaigns. 2023-03-09 22:11:53 +08:00
Gan Eng Chin e831e89997
Make the mocked modal clearer.
The previous text "Create a new campaign" can be a bit confusing with the other text "Create new campaign" in the test.
2023-03-09 22:09:24 +08:00
Gan Eng Chin 551db21e9b
Remove unneeded getByText in Campaigns test. 2023-03-09 22:05:17 +08:00
Gan Eng Chin f19969dacb
Change NewCampaignTypes to CampaignTypes. 2023-03-09 21:52:11 +08:00
Gan Eng Chin 39ce470fe8
Specify dependency for useSelect in useNewCampaignTypes. 2023-03-09 21:43:54 +08:00
Gan Eng Chin 3ba492f32b
Move convert function out of useSelect in useNewCampaignTypes.
This is so that it doesn't become dependency in useSelect.
2023-03-09 21:42:59 +08:00
Sam Seay bec3ec18ac
Update Syncpack and use it to pin @wordpress packages to wp-6.0 (#37034) 2023-03-09 10:13:25 +13:00
Maikel David Pérez Gómez 3ded2b46e9
Create editor skeleton on add/edit product pages (#37023)
* Add required dependencies

* Create the block editor component

* Create the header component

* Create the sidebar component

* Create the editor component

* Remove comments

* Export the block editor from its package

* Enqueue wp-edit-site

* Create the new block mode product page

* Register the new ProductPage component in /add-product route

* Add temporal layout styles

* Fix rebasing conflicts

* Fix linter errors

* Redirect to the new product-editor page when edit

* Add changelog files

* Fixing dependencies conflicts and ignoring some non running test

* Add comment suggestions

* Fix conflicts after rebasing

* Add comment suggestions
2023-03-08 05:51:59 -04:00
Gan Eng Chin 97ed1d2a7d
Fix array length rendering literal 0 in CreateNewCampaignModal. 2023-03-08 02:57:02 +08:00
Rodrigue Tusse ed6c19b827 Fix 0 rendered on short-circuit evaluation. 2023-03-07 15:06:25 +02:00
Joel Thiessen 2332c7c813
Migrating details fields to product-editor package (#36945) 2023-03-06 14:33:10 -08:00
Maikel David Pérez Gómez 79841c58a5
Fixes react version to 17.0.2 globally (#37087)
* Fix react version to 17.0.2 globally

* Add changelog file
2023-03-06 18:38:05 -03:00
Joel Thiessen b825b51767
Moving useProductHelper and useVariationsOrder hooks to product editor package (#37006) 2023-03-06 09:11:54 -08:00
Gan Eng Chin e653a4ca15
Merge branch 'trunk' into feature/34909-marketing-create-campaign-modal 2023-03-04 01:04:59 +08:00
Gan Eng Chin 3e620c41c6
Add tests for CreateNewCampaignModal. 2023-03-04 01:02:46 +08:00
Gan Eng Chin 00a12db5bd
Add Campaigns card in Multichannel Marketing page (#36735) 2023-03-03 18:43:02 +08:00
Gan Eng Chin 15c57bf712
Fix and add tests for Campaigns card. 2023-03-03 03:25:00 +08:00
Gan Eng Chin 913f7176b2
Refetch registered channels after installing channel in Campaigns card. 2023-03-03 02:34:16 +08:00
Gan Eng Chin ec15697d44
Load campaign types in Campaigns card. 2023-03-03 01:08:21 +08:00
Gan Eng Chin e13112875b
Move useNewCampaignTypes to shared hooks directory. 2023-03-03 01:05:14 +08:00
Gan Eng Chin 51a5a18448
Simplify receiveCampaignTypes. 2023-03-03 00:54:21 +08:00
Gan Eng Chin 8132addd18
Simplify wp.data for receiveCampaignTypes. 2023-03-03 00:24:51 +08:00
Gan Eng Chin 2443bfd7a0
Merge branch 'feature/34905-marketing-campaigns-card' into feature/34909-marketing-create-campaign-modal
Conflicts:
	plugins/woocommerce-admin/client/marketing/data-multichannel/action-types.ts
	plugins/woocommerce-admin/client/marketing/data-multichannel/actions.ts
	plugins/woocommerce-admin/client/marketing/data-multichannel/resolvers.ts
2023-03-03 00:11:35 +08:00
Sam Seay 1834621d1a
Update the @woocommerce/eslint-plugin and fix bugs (#36988) 2023-03-02 11:36:38 +13:00
Moon d339a777e1
Update/use theme color for completed task strikethrough (#37001)
* Use theme color for completed task strikethrough

* Add changelog

* Fix style
2023-03-01 11:54:21 -08:00
Gan Eng Chin c0364ad0ab
Remove unused error property in CampaignsState. 2023-03-02 03:16:29 +08:00
Gan Eng Chin 4b87f0a4ed
Add JSDOC. 2023-03-02 03:15:38 +08:00
Gan Eng Chin 9feaf55a60
Simplify receive campaigns success and error. 2023-03-02 03:02:14 +08:00
Gan Eng Chin 5af90c5e77
Add JSDOC for getTotalFromResponse. 2023-03-02 01:16:51 +08:00
Gan Eng Chin b83888577a
Fix getTotalFromResponse treating total 0 as undefined.
If total is 0, then the function should return 0, not undefined.
2023-03-02 01:13:42 +08:00
Gan Eng Chin 8e9f344478
Test code refactor with createTestCampaign. 2023-03-02 00:59:22 +08:00
Maikel David Pérez Gómez 7d0669dcb1
Add selection to the tree control (#36435)
* Create tree-control component

* Remove items from treeItemProps

* Add tree-control expand/collapse on click the expander button or by a custom logic

* Add stories

* Add the type definitions

* Add use selection hook

* Upgrade WP components dependency to v19.8.5 to support indeterminate checkbox control

* Add selection logic to the tree control

* Create stories

* Add changelog file

* Fix linter error

* Add styles to fit the disign

* Highlight selected item when it's a single selection tree

* Rebasing from trunk

* Add comment suggestions

* Fix unit test errors due to a new version of @wordpress/compose related to the ResizeObserve feat
2023-02-28 15:10:12 -03:00
Joel Thiessen 6a345ac7eb
Moving currencyContext to currency package and updating references (#36959) 2023-02-28 08:55:49 -08:00
Gan Eng Chin d111370d1e
Make UI work with wp.data new campaign types. 2023-02-28 00:51:34 +08:00