Commit Graph

1996 Commits

Author SHA1 Message Date
Fernando Marichal b3e76c41b4
Request attributes conditionally (#47361)
* Request terms conditionally

* Add changelog

* Add used context

* Transform fetchAttributes into a hook

* Call fetchAttributes inside Attributes component

* Fix tests

* Remove useless useEntityId and fix dependency

* Refactor attriburtes component

* Add AttributeControl to Attributes component

* Add warning comment to Attributes component
2024-05-13 14:00:31 -03:00
Sam Seay 2db29164f9
Update to pnpm 9.1 (#47385)
* Update to pnpm 9.1 and fix a mini css bug

* 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/extend-cart-checkout-block, @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/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/ai, @woocommerce/admin-e2e-tests, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai

* temporarily disable swallowing build output to diagnose issue with perf workflow

* Ignore some type issues that commonly resurface when deps slightly change

* Fix persistent type issues that have recurred many times

* Add more ignores

* Fix lint issue

* Revert change to swallow build error

* Improve access of the config that needs updated build dir.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-05-13 10:57:39 -03:00
Fernando Marichal 69fa74ef8d
Request variations conditionally (#47360)
* Get variations conditionally

* Make second call conditionally

* Add changelog

* Remove usesContext from JSON
2024-05-13 10:57:03 -03:00
Damián Suárez c31051385d
Product Block Editor: use FormTokenField component for the attribute terms (#47288)
* fisrt approach

* do not clear same selected term

* tweak token field component

* chage the attributes type

* filter attributes already taken

* set instanceNumber for each combobox instance

* implement remove attribute

* final first approach

* update onRemove type

* rename edit VariationItemsBlockEdit

* handle local attributes

* rollback unrelated issue

* changelog

* remove unused component

* remove test

* add border color when disabled
2024-05-10 15:45:58 +01:00
Nathan Silveira 7c7d9837a4
Add improvements to NumberControl (#47121)
* Use min and max values if provided when sanitizing values

* Pass min and max attributes to NumberControl

* Use 'min' and 'max' values when incrementing through + and - buttons

* Add changelog

* Handle increment when pressing buttons

* Show + and - buttons disabled when max/min has been reached

* Prevent suffix from being selected
2024-05-10 10:02:00 -03:00
Fernando Marichal d81ab3c9d3
Request categories conditionally (#47216)
* Request categories conditionally

* Add changelog
2024-05-09 08:29:55 -03:00
Chi-Hsuan Huang f2cf6b56aa
Update @automattic/tour-kit to 1.1.3 and @automattic/components to 2.1.1 (#47129)
* Use @automattic/tour-kit@1.1.3

* Update onPreviousStep and onNextStep callback

* Add changelog

* Add changelog

* Update @automattic/components

* Update package.json

* Fix pnpm-lock.yaml

* Update changelog

* Add changelog

* Enable autoScroll for shipping tour
2024-05-09 08:56:08 +08:00
Fernando Marichal 9ad1321c66
Request shipping classes conditionally (#47196)
* Request shipping classes conditionally

* Add changelog

* Fix getProdcutShippingClasses return

* Refactor useSelect
2024-05-08 08:19:32 -03:00
Sam Seay fbcdb78d18
Fix one more instance of unspecified include in tsconfig. (#47207) 2024-05-08 13:53:56 +12:00
Damián Suárez 5ab1241ac2
Product Block Editor: use `<AttributesComboboxControl />` in the Attributes modal (#47093)
* update combobox story

* first step replacing with attribute combobox

* introduce takenBy prop

* filter attributes when taken

* add and tweak combobox styles

* changelog

* tweak wrapped item

* update tests

* pass instanceNumber

* remove commented line
2024-05-07 16:56:14 +01:00
Matt Sherman b107cff519
Product Editor API: Modal block editor sidebar extensibility (description field) (#46597)
* iframe editor PluginSidebar

* iframe editor PluginArea and ComplementaryArea

* iframe editor PinnedItems

* Try ComplementaryArea slot

* Update scope name

* Only render ComplementaryArea.Slot when right sidebar is open

* Register interface store in sub registry

* Move block inspector to complementary area

* Remove hardcoded inspector toggle button from header

* Remove debug statement

* Remove unused isSidebarOpened context

* Set settings sidebar to be active by default

* Don't allow unpinning of settings sidebar

* Organize sidebar components under folder

* Add plugin more menu item

* Remove width for sidebar

* Update PluginArea scope name

* Pull out small viewport support for pinned items (incomplete)

* Move sidebar complementary area scope to a const

* Update sidebar complementary area scope name

* Update PluginSidebar export name

* Provide comments to clarify sidebar props settings

* Add comment about why this icon was copied

* Remove unnecessary wrapper div around complementary area

* Changelog
2024-05-07 11:43:34 -04:00
Maikel Perez 40486a0151
Remove duplicate code lines in css (#47122)
* Remove duplicate css code from any woo scss file

* Add changelog files
2024-05-07 08:35:25 -04:00
github-actions[bot] 9b042534d0
Prepare Packages for Release (#47208)
Automated change: Prep @woocommerce/dependency-extraction-webpack-plugin for release.

Co-authored-by: psealock <psealock@users.noreply.github.com>
2024-05-07 20:33:45 +12:00
Paul Sealock 3cab2e6909
Dependency Extraction Webpack - add @woocommerce/price-format (#47099)
* add package

* remove log

* Add changefile(s) from automation for the following project(s): @woocommerce/dependency-extraction-webpack-plugin, woocommerce

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-05-07 08:20:54 +03:00
Sam Seay fbb553be0f
Update tsconfigs to explicitly include files to avoid TS build errors (#47156) 2024-05-07 13:18:56 +12:00
Fernando Marichal e5e78a33bf
Request tags only when we need them (#47068)
* Get Tags conditionally

* Create file types.ts

* Add changelog

* Fix tests
2024-05-06 15:54:18 -03:00
Matt Sherman 10a14bd179
Product Editor: Fix undo/redo in modal block editor (description field) (#47151)
* Set BlockEditorProvider's value to temporalBlocks

* Remove unnecessary code

* Set initial blocks in editor history, so that the first edit on an existing description can be undone

* Changelog
2024-05-06 12:53:44 -04:00
Damián Suárez 6a77c3458d
Product Block Editor: request initial linked-products request only when tab is selected (#47130)
* add optional isInSelectedTab context type

* clean type def

* only filter linked products when tab selected

* changelog
2024-05-06 14:07:30 +01:00
Nathan Silveira 5fbd502a17
Enable inline actions in the variations table for images (#47065)
* Increment ProductVariationImage type

* Allow adding images to variations from the main product screen through a button

* Add changelog

* Add changelog

* Change showSuccess parameter to optional
2024-05-03 15:26:22 -03:00
Nathan Silveira 08508dfecc
Add 'placeholder' attribute to taxonomy block and add 'placeholder' a… (#46938)
* Add 'placeholder' attribute to taxonomy block and add 'placeholder' attribute to category field in Simple Product Template

* Only show placeholder when nothing is selected

* Remove suffix from function parameters

* Add changelog for component

* fix unit tests
2024-05-03 15:26:08 -03:00
Fernando Marichal 163e579ac6
Avoid requesting product with id -1 while loading (#46769)
* Avoid requesting product with id -1

* Add changelog

* Move changelog

* Add options to useEntityRecord type

* Fix editedRecord

* Add comment

* Undo early return

* Avoid making a request for product if it isn't already loaded

* Avoid making a request for product if it isn't already loaded

* Add typing for useEntityId

* Rework header to avoid requesting product unless we have a product ID

* Avoid requesting product when getting productTemplateId and blocks

* Remove unused import (fix lint error)

---------

Co-authored-by: Matt Sherman <matt@jam123.com>
2024-05-03 11:52:57 -04:00
Fernando Marichal e21a78f8f0
Request variations only when the product has variations (#46963)
* Make variations api request conditional

* Add changelog
2024-05-03 11:37:22 -04:00
Damián Suárez f0765081fe
Product Block Editor: move logic to add new attributes to modal component (#47058)
* rename TS prop name

* save unsaved change

* onChange() value is required

* continue `value` is required

* move logic to add new attribute to modal component

* polish process to add attribute

* rename function argument

* improve jsdoc

* remove unused getProductAttributeObject helper

* jsdoc

* changelog

* remove unused import

* remove obsolete tests

* fix eslint issues
2024-05-03 12:25:35 +01:00
Gan Eng Chin 48f479fd67
Rename and sort filter options in "Add a filter" in Analytics (#46955)
* Rename filter options in Orders Analytics.

* Sort filter options in labels in Orders Analytics.

* Change filter labels to singular.

* Wider label column to accommodate label change.

* Rename filter options in Variations Analytics.

* Change filter options to Attribute, Category and Product in Variations Analytics.

* Revert "Change filter options to Attribute, Category and Product in Variations Analytics."

This reverts commit b3ca5d5807.

* Change "Add a Filter" to "Add a filter".

* Add changelog.

* Add changelog.

* Refactor getAvailableFilterKeys and getAvailableFilters into one function.

* Add code comment and remove unneeded code.

* Code refactor getAvailableFilters.

This is done by starting from allFilterKeys, and filtering with allowMultiple or not yet active.

With this, we don't need to have `inactiveFilterKeys` and "Ensure filters that allow multiples are always present."

* Fix tests and lint issues.

* Simplify code with Object.entries.
2024-05-02 18:34:17 +08:00
github-actions[bot] 05e166e0f1
Prepare Packages for Release (#46977)
Automated change: Prep @woocommerce/onboarding for release.

Co-authored-by: rrennick <rrennick@users.noreply.github.com>
2024-05-01 11:22:50 -05:00
github-actions[bot] ad2b170f1d
Prepare Packages for Release (#46976)
* Automated change: Prep @woocommerce/components for release.

* fix changelog linting

---------

Co-authored-by: rrennick <rrennick@users.noreply.github.com>
Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2024-05-01 11:21:29 -05:00
Damián Suárez 987d702335
Product Block Editor: move logic to pull product attributes from Selector to Modal component (#46655)
* rename type for item of attribuite input field

* options is not part of the input item

* update type of getProductAttributeObject

* update types

* changelog

* fix eslint issue

* fix test

* move the logic to pull attribute to modal cmp

* changelog

* remove options from item props

* rename TS prop name

* save unsaved change
2024-04-30 08:21:45 -04:00
Damián Suárez ee5f12f806
Product Block Editor: tidy product attribute TS types (#46998)
* rename type for item of attribuite input field

* options is not part of the input item

* update type of getProductAttributeObject

* update types

* changelog

* fix eslint issue

* fix test
2024-04-30 07:18:03 -04:00
Nathan Silveira 567a6b5c77
Show 'up' and 'down' chevron in SelectTree and remove suffix prop (#46939) 2024-04-29 10:23:48 -03:00
Fernando Marichal f437c538e7
Avoid duplicated product request (#46934)
* Add getPermalinkParts utility

* Use getPermalinkParts utility

* Add changelog
2024-04-26 09:56:25 -03:00
Damián Suárez 8d2f88da71
[Product Block Editor]: update the attributes list optimistically when a new attribute is created (#46717)
* tweak optimisticQueryUpdate type

* sort items optimistically

* update attributes list optimistically

* do not invalidate when creating a new attribute

* changelog

* changelog

* update tests

* update options param in test

* wait for the promise when creating new attribute

* fix the rest of tests
2024-04-26 07:53:13 -04:00
Damián Suárez ae305a0ef8
Product Block Editor: introduce AttributesComboboxControl component (#46912)
* first approach

* update TS types

* rename

* add storybook story

* changelog

* update types

* onChange should return item

* rename css classes

* tweak styles. remove unused prop
2024-04-26 06:24:16 -04:00
Nathan Silveira 6d914ff573
Fix invalid date format errors in certain languages (#46932)
* Fix invalid date format errors in certain languages

* Remove rest of jsdoc
2024-04-26 06:28:47 -03:00
Nathan Silveira a317bc5fab
The toolbar to edit linked text in the new product's editor disappears too fast (#46888)
Add .block-editor-link-control css class to condition to not clear the selected block
2024-04-25 11:06:23 -03:00
Vlad Olaru 8a0ed2dd0b
Revert "Upgrade the WooPayments surfaces to the new designs" (#46915)
Revert "Upgrade the WooPayments surfaces to the new designs (#46873)"

This reverts commit 24808a0a8b.
2024-04-25 16:24:05 +03:00
Damián Suárez a0aa4724df
Tidy and update product attribute TypeScript types (#46907)
* rename ProductAttribute with ProductProductAttribute

* introduce ProductAttribute to define actions

* update importing attribute types

* fix select item type

* export ProductAttribute TS type

* update attribute-input-field component

* changelog

* update jsdoc block

* update test
2024-04-25 07:30:02 -04:00
Vlad Olaru 24808a0a8b
Upgrade the WooPayments surfaces to the new designs (#46873)
* Import colors.native scss variables

* Add changelog

* Refactor WCPay banner and cleanup

We introduce a new WCPayConnectCard onboarding component and
remove/cleanup all other WCPay surface components.

This component uses the new design, updated payment methods icons
and WCPay logo.

* Add changelog

* Upgrade the WCPay payments settings banner

* test: Fix WCPay payments settings banner tests

* Update the WCPay welcome page to use the WCPayConnectCard component

* Update the Payments task page to use the WCPayConnectCard component

* Fix copy for payments settings methods CTA buttons label

* Add changelog

* Further cleanup of no-longer-used WCPay surfaces

* Consolidate onboarding component icons for single sources

* Minor cleanup

* test: Fix WCPay payments settings banner test

* test: Fix payments tasks page tests
2024-04-24 21:41:40 +03:00
Matt Sherman 955786affc
Product Editor: Add ability to check if product editor made REST request (#46741)
* Add apiFetch middleware to add X-Wc-Product-Editor header to all requests from product editor

* Use productEditorHeaderApiFetchMiddleware

* Update name of header

* Utility function to check header

* Changelog

* Changelog
2024-04-24 06:24:09 -04:00
github-actions[bot] 4ca110172b
Prepare Packages for Release (#46847)
Automated change: Prep @woocommerce/dependency-extraction-webpack-plugin for release.

Co-authored-by: psealock <psealock@users.noreply.github.com>
2024-04-24 08:39:24 +12:00
Cvetan Cvetanov 2ea10959a6
Update the styling of the WooPayments banner for the mobile version (#46647)
* Style WCPay banner for mobile version

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-23 15:30:42 +03:00
Sam Seay 67f67b1017
Add assets to the dewp distribution as it is needed. (#46755) 2024-04-23 20:32:12 +12:00
Nathan Silveira 05e838ec82
Export useProductEdits hook (#46808) 2024-04-22 15:50:50 -03:00
Gan Eng Chin c595717d16
Fix "Add a filter" UI issue in Analytics (#46750)
* Fix UI for add filter popover in Analytics.

* Make character casing consistent for filters.

* Add changelog.

* Add changelog.

* Change filter label to sentence case.
2024-04-22 21:15:22 +08:00
Chi-Hsuan Huang b9ea5bacd8
Fix back from CYS via LYS goes to Home, not LYS (#46665)
* Add goBack action to customize-store

* Add changelog

* Add __experimentLocationStack to history

* Update customize-store goBack action

* Rename __experimentalLocationStack
2024-04-22 21:26:32 +12:00
RJ fd52f18f6b
Move LYS coming soon initialization to core profiler flow (#46708)
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2024-04-22 14:49:59 +08:00
Maikel Perez 46d87d427a
[CFT Custom fields]: Show error message after pressing Add or Add another (#46703)
* Show validation message in the field that lost the focus

* Add unique validation for custom field names and trim values

* Let edit custom fields when creating a new product

* Add changelog file
2024-04-19 12:39:52 +00:00
Fernando Marichal eb4873dcd3
Fix edit custom field modal width (#46727)
* Remove min-width

* Add changelog

* move changelog

* Fix width
2024-04-19 09:36:09 -03:00
Nathan Silveira 80133578be
Fix description block collapsing when unfocused (#46646) 2024-04-18 10:37:40 -03:00
Nathan Silveira 3a21f87bed
Allow saving a product as a draft when hitting ctrl/cmd + S (#46552)
* Allow saving a product as a draft when hitting ctrl/cmd + S

* Increment logic to keep product published/scheduled after it is published when using shortcut
2024-04-18 10:37:30 -03:00
Ron Rennick 4797d72c60
Release webpack dependency plugin (#46702)
* add changelog entry for node bump

* bump package version

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2024-04-18 11:26:01 +01:00