Commit Graph

2055 Commits

Author SHA1 Message Date
Maikel Perez caa7c8707b
Enable pricing inline actions in the variations table (#48164)
* Create VariationPricingForm component

* Add validations to the VariationPricingForm component

* Add changelog file
2024-06-13 14:41:15 -04:00
Fernando Marichal c696b1b5d9
Do not dismiss the error snackbar automatically (#48192)
* Modify Publish button error snackbar

* Modify Preview snackbar and error handling

* Modify Save draft snackbar error handling

* Modify publish button menu error handling

* Modify change product type error handling

* Fix getProductErrorMessageAndProps return types

* Remove getProductErrorMessage

* Rename get-product-error-message file

* Fix tests

* Add changelog

* Fix e2e test

* Add WC changelog

* Improve getProductErrorMessageAndProps

* Fix Variable product

* Remove productType from error object

* Remove productType from errorHandler

* Remove postType from block

* Remove visibleTab
2024-06-13 13:56:26 -03:00
Maikel Perez 68107ba8a3
Enable manage stock inline actions in the variations table (#48239)
* Create VariationStockStatusForm component

* Integrate VariationStockStatusForm within the VariationsTableRow component

* Add woocommerce_manage_stock option to the default_option_permissions list in the Options rest controller

* Enable track inventory when woocommerce_manage_stock is set to yes

* Add stock_status radio component to the VariationStockStatusForm component

* Fix VariationStockStatusForm padding

* Fix control spacing

* Add stock_quantity to the VariationStockStatusForm component

* Add changelog files

* Fix linter errors

* Fix invalid sortable state in the variations table
2024-06-13 12:08:52 -04:00
Damián Suárez 6328ffdfb2
Product Form Template: populate the template selector control with the PFTs (#48327)
* switch setting templates order

* pull product_form from the entity store

* fix typo

* set post excerpt with template description

* update the description for the Simple template

* rename type for product form post

* introduce isProductFormTemplateEnabled() helper

* render the PFTs into the templates selector

* changelog

* tscripting

* remopve dropdown

* re-write changelog files

* change and rename isProductFormTemplateSystemEnabled

* remove unused component

* try change the template version name
2024-06-13 13:55:07 +01:00
Chi-Hsuan Huang 54321a5a60
Add generic error boundary component (#48363)
* Fix storybook

* Add experimental error boundary component

* Add error boundary component

* Fix empty content button

* Add changelog

* Fix storybook

* Reset state after actioned

* Fix story

* Address feedback
2024-06-13 05:05:28 +00:00
Chi-Hsuan Huang ab1789afd2
Remove onboarding welcome modals (#48346) 2024-06-13 10:39:21 +08:00
Matt Sherman 8a69728312
Product Editor: Show error notice when error occurs uploading an image via drop on Images (#48396)
* Export MediaUploaderErrorCallback

* Show notice when error uploading image

* Changelog

* Changelog

* Wrap error message in __ for translation

* Fix sprintf/__ usage to avoid lint errors
2024-06-12 15:50:48 -04:00
github-actions[bot] 10bad90c6f
Prepare Packages for Release (#48411)
Automated change: Prep @woocommerce/csv-export for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:59:46 -07:00
github-actions[bot] 1d3c34eacd
Prepare Packages for Release (#48410)
Automated change: Prep @woocommerce/currency for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:55:38 -07:00
github-actions[bot] d88e877eea
Prepare Packages for Release (#48409)
Automated change: Prep @woocommerce/customer-effort-score for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:49:59 -07:00
Maikel Perez e3e303e776
Enable image inline actions in the variations table (#48083)
* Create UploadFilesMenuItem component

* Create MediaLibraryMenuItem component

* Create ImageActionsMenu component

* Integrate ImageActionsMenu with VariationsTableRow

* Add extensibility to the ImageActionsMenu component

* Add changelog file

* Fix compilation errors

* Fix linter errors

* Allow images only to be uploaded from the UploadFilesMenuItem component

* Fix image aligment in the actions menu toggle
2024-06-11 22:42:02 +00:00
github-actions[bot] 31254c4d45
Prepare Packages for Release (#48408)
Automated change: Prep @woocommerce/date for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:41:49 -07:00
github-actions[bot] d2ea42a658
Prepare Packages for Release (#48407)
Automated change: Prep @woocommerce/data for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:37:33 -07:00
github-actions[bot] 35609532b0
Prepare Packages for Release (#48406)
Automated change: Prep @woocommerce/eslint-plugin for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:31:03 -07:00
github-actions[bot] 4c42a8d914
Prepare Packages for Release (#48405)
Automated change: Prep @woocommerce/tracks for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:29:16 -07:00
github-actions[bot] 594d466ece
Prepare Packages for Release (#48404)
Automated change: Prep @woocommerce/navigation for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:26:38 -07:00
github-actions[bot] 1504add942
Prepare Packages for Release (#48403)
Automated change: Prep @woocommerce/number for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:10:48 -07:00
github-actions[bot] c3fffc28bf
Prepare Packages for Release (#48402)
Automated change: Prep @woocommerce/explat for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 22:03:35 +00:00
Chi-Hsuan Huang 50d6d0a9c5
Fix getOption() not catch error properly (#48246)
* Improve batch fetching of options error handling and code

* Add changelog

* Catch promise error

* Catch options fetch error

* Fix lint

* Use debounce fetch

* Change debounce wait time to 100ms

* Fix debounce
2024-06-11 13:44:51 +08:00
Ilyas Foo 0d461fa6e7
Add unit tests for some tracks in product editor (#48245)
* Add tests for ProductPage

* Add tests for ProductVariationPage

* Add test for product_tab_click event

* Add test for product_editor_feedback_bar_turnoff_editor_click event

* Add test for product_dropdown_option_click event

* Add test for product_add_view track

* Changelogs

* Changelog

* Lint

* Add product_edit_view test and falsey test

* Fix test name
2024-06-10 23:05:20 +08:00
Nathan Silveira b8a6966ca6
Only run layout effect after product is resolved (#48281)
* Only run layout effect after product is resolved

* Fix edit variable product test

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-06-07 20:49:47 +00:00
Maikel Perez 3d0b9993be
Product template not updating in the UI when it is changed (#48288)
* Fix Product template not updating in the UI when it is changed

* Add changelog file
2024-06-07 20:00:15 +00:00
Nathan Silveira 442adcc395
Determine _product_template_id from WP filter (#47762)
* Remove template matching from front-end

* Create 'woocommerce_rest_get_product' filter to allow extensions to change the product when it's fetched through the REST API

* Stop defaulting to 'standard-product-template' product template and handle defaults only in getLayoutTemplateId function

* Use created hook to determine and persist the product template ID when it's not defined.

Also introduce 'match_fn' in ProductTemplate to allow extensions to provide robust ways of matching the template

* Add changelog

* Fix tests

* Remove outdated tests

* Fix issue in filter because $product can be false and move API change to v3

* Add comments to continue statements

* Small refactor

* Only send layout template id to useLayoutTemplate after product is loaded

* Revert front-end changes

* Remove match_fn and create filter to allow extensions to determine the product template id

* Avoid loading layout template before product is loaded

* Create woocommerce_product_editor_determine_product_template filter and use it

* Update changelogs and remove unused code

* Remove _product_template_id for products that were created with the new product editor.

* Use only id to find productTemplate

* Turn hook into experimental

* Remove deprecated tests

* Rename filter

* Add more typings to useEntityRecord

* Use hasResolved boolean to check whether product has been resolved

* Add changelog

* Add 'variation' to ProductType

* Don't default to the standard-product-template for variations

* Update changelog

* Accept null in getLayoutTemplateId

* Fix edit variable product test

* Rename hook

* Revert changed logic to avoid regressions

* Increment useProductTemplate logic

* Default to standard-product-template instead of undefined when no matches

* Re-import Features class

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-06-07 19:48:20 +00:00
Damián Suárez a5bbf14e6f
PFT: retrieve and render the product form templates (#48206)
* introduce ProductFormTemplateProps type

* pull and set the default product form template

* render the PFT when it exists

* render a temporeary form templates selector

* changelog

* rollback TS global changes

* fix typo
2024-06-07 17:14:01 +01:00
Nathan Silveira cf2572bc32
Fix tabs overflowing when viewport is small (#48193) 2024-06-07 12:48:46 -03:00
Fernando Marichal f0feb62837
Override product name height and font-size (#47979)
* Override name field height and font

* Add changelog

* Update packages/js/product-editor/src/blocks/product-fields/name/editor.scss

Co-authored-by: Maikel Perez <maikel.perez@automattic.com>

* Fix styles

---------

Co-authored-by: Maikel Perez <maikel.perez@automattic.com>
2024-06-04 16:40:03 -03:00
Damián Suárez 63a2788527
Product Block Editor: improve a11y when creating a new Shipping class (#47995)
* focus description when generating slug

* focus the name once the modal renders

* changelog

* do not focus on description field

* isSecondary is depcreated. use "variant" prop

* move changelog file
2024-06-04 10:12:08 +01:00
Matt Sherman 1386fa2df2
Product Editor: Remove Add Sizes and Add Colors buttons from Variations tab (#48114)
* Temporarily remove Add Sizes and Add Colors buttons until they are fixed

* Changelog
2024-06-03 12:23:01 -04:00
Maikel Perez a0f9d159e5
New image empty state for variations (#47909)
* Fix the variations image block placeholder to show only one image

* Add changelog file
2024-05-31 11:14:33 -03:00
Damián Suárez ac6fe9f933
Product Block Editor: populate shipping class slug automatically (#47896)
* extend shipping_classses with '/suggest-slug' endpoint

* generate slug automatically

* changelog

* jsdoc

* polish setting and pulling the slug

* replace checkbox by button

* reword slug inout label with "Slug"

* add slug help

* use prefix input property

* isPrimary is deprecated. Use "variant" instead

* fixing typo. props to @mdperez86
2024-05-30 12:05:34 +01:00
Ilyas Foo c9752f1eaf
Fix analytics chart previous year data when date range includes 29 Feb (#45874)
* Temp commit

* Clean up unused codes and streamline logic

* More cleanups and add comment

* Better naming and fix logic

* Rename and comment

* Changelog

* Changelog

* Lint

* Moved leap year utils to date package, added tests

* Moved functions to utils, add tests

* Add more test

* Fix changelog
2024-05-30 12:54:00 +08:00
Ilyas Foo 98b32b5ecc
Fix getPreviousDate default behaviour to compare previous year (#47951)
* Add default compare previous_year and add tests

* Changelogs
2024-05-30 11:31:10 +08:00
Damián Suárez 6f8bce8bb0
Product Block Editor: load and create shipping classes optimistically (#47848)
* define ans use shippingClassRequestQuery

* do not invalidate getProductShippingClasses

* changelog
2024-05-29 19:59:24 +01:00
Maikel Perez 189476fcdf
Fix accessibility issues when using the keyboard to navigate/select tabs in the new product editor (#47860)
* Focus tab shows focus style

* Tabbing when inside the tabs takes you to the first focusable element inside the current tab's tab panel

* Users can press the left and right arrow keys to move between tabs

* When a tab is focused and the Home key is pressed the first tab in the list should be focused. When the End key is pressed the last tab should be focused

* Add changelog file

* Fix e2e tests

* Add changelog file

* Get last tab by index

* Fix linter errors
2024-05-28 17:44:21 +00:00
Fernando Marichal 890fd87e7e
Update product name validation message (#47846)
* Update product name validation message

* Add changelog
2024-05-27 15:43:44 -03:00
Matt Sherman 8894850ce1
Product Editor: Fix styling of checkboxes in Categories and Tags fields with Gutenberg plugin installed (#47816)
* Remove styling of checkbox (use GB core styling)

* Remove setting of margin on checkbox control

* Remove unused CSS

* Changelog
2024-05-27 14:34:21 -04:00
Matt Sherman 988c3634b7
Doc: Update list of product editor generic blocks to include select and text-area (#47810)
* Add select and textarea fields to list

* Changelog
2024-05-27 14:34:01 -04:00
Damián Suárez f51b93359f
CRUD: populates `items` and `itemsCount` when a new item is created (#47632)
* minor change in reducer

* use organizeItemsById to compute new items

* add reducer test with pick optimisticUrlParameters

* rename constant name

* add optimisticUrlParameters to CRUD actions types

* use organizeItemsById to generate store IDs

* add more reducer tests

* compute nextItemsData based on ids

* tessstssssss

* add a order_by: name test

* fix sorting data when url parameters

* add tests

* introduce filterDataByKeys helper fn

* fix process to sort items optimistically

* rollback wrong change in actions

* changelog

* set action `options` as optional

* set default value for options
2024-05-27 16:34:12 +01:00
Ilyas Foo 012f0d3418
Fix redundant confetti on LYS task congrats page (#47838)
* Add useRef to ensure confetti is only trigerred once

* Changelog
2024-05-27 21:01:40 +08:00
Maikel Perez 55aafb9fc6
Remove the new old experience (#47814)
* Remove ProductTitle component

* Remove ProductSettings component

* Remove ProductMoreMenu component

* Remove ProductFormHeader component

* Remove ProductVariationFormHeader component

* Remove ProductFormFooter component

* Remove ProductFormLayout component

* Remove ProductForm component

* Remove ProductTourContainer component

* Remove AddProductPage component

* Remove ProductVariationForm component

* Remove EditProductPage component

* Remove ProductFormTab component

* Remove SingleImageField component

* Remove ProductVariationDetailsSection component

* Remove ProductVariationsSection component

* Remove DetailsSectionFills component

* Remove ImagesSectionFills component

* Remove ShippingSectionFills component

* Remove AttributesSectionFills component

* Remove PricingSectionFills component

* Remove InventorySectionFills component

* Remove product-form-fills file

* Remove product-form-variation-fills file

* Remove product-form-api-fills file

* Remove ClassicEditorIcon component

* Remove HiddenIcon component

* Remove VisibleIcon component

* Remove drag-and-drop.svg file

* Remove ProductSectionLayout component

* Remove products/constants.tsx file

* Remove new-product-management-experience feature flag

* Fix linter errors

* Add changelog files
2024-05-24 18:00:22 +00:00
Matt Sherman 660c550071
Product Editor: Set description properly if description consists only of a single non-paragraph block (#47763)
* Explicitly check whether the only block is a paragraph

* Update comment

* Move handling of empty block array into clearDescriptionIfEmpty

* Add areBlocksEmpty util function

* Check for empty block inside iframe editor

* Remove check for empty block from description block

* Add unit tests for areBlocksEmpty

* Changelog

* Update comment to clarify
2024-05-24 13:32:06 -04:00
Maikel Perez 4ddfd43864
Enhancement editor loading speed (#47425)
* Lazy load the PluginArea and the ModalEditor

* Remove repeated product request when editing a specific product

* Fix linter errors

* Add changelog files

* Fix linter errors

* Refactor the block editor to remove some extra rerenders

* Defer the publish button processing

* Defer the tab content render 500ms to reduce the total blocking time

* Fix linter errors

* Fix unit test and tabs unexpected rerender

* Fix linter errors

* Reduce the defered time to 300ms

* Fix get product url when the product has been duplicated since the new copy does not have permalink

* Fix the invalid unregistration of wc-admin-more-menu in the product page

* Fix compilation errors
2024-05-24 08:39:53 -04:00
Maikel Perez 7f6e73dcd3
Cannot create variation options when viewport width is small (#47766)
* Fix cannot create variation options when viewport width is small

* Add changelog file
2024-05-23 14:16:03 -04:00
Matt Sherman 5e6bce3334
Product Editor: Fix deprecation warnings about toolbar items in modal block editor (#47527)
* Don't use NavigableToolbar for header

* Rename CSS styles for header

* Put document tools in NavigableToolbar

* Fix alignment of inserter button

* Switch non-toolbar items to regular buttons

* Remove unused const

* Use same CSS styling as core for document tools

* Clean up errant change while rebasing

* Changelog
2024-05-22 15:37:17 -04:00
Adrian Moldovan 13ab9007f6
[testing workflows] Add workflow_call trigger in CI workflow - support daily and other types of runs (#47612)
* Add workflow_call event

* Add tests-daily-run.yml

* Remove workflow version

* Update input value

* Remove secrets from caller workflow

* Rename job

* Check context

* Check context

* Check workflow_call inputs

* Override github.event_name with inputs.trigger

* Fix input name

* Add config for daily e2e tests with Gutenberg

* Update env commands for Gutenberg run

* Add disableHpos env variable in ci-utils

* Revert the trigger to push

* Revert the env variable setting in ci-jobs

* Revert the env variable setting in ci-jobs

* Rebuild utils

* Update test env start command

* Define the Gutenberg Playwright project

* Use path relative to workspace root

* Update events for test projects

* Update events for test projects

* Add changelogs

* Remove the e2e tests with Gutenberg tests from daily runs

* Set the schedule and workflow_dispatch triggers

* Add --project default flag to only run the default tests in CI

* Renamed snapshots to match the new Playwright project name
2024-05-22 11:04:44 -07:00
Matt Sherman 8c47cfd247
Product Editor: Fix modal block editor undo granularity (#47524)
* Rename appendEdit function to appendToEditorHistory

* Don't append to editor history onInput

* Changelog

* Move onChange and onInput handles to named functions

* Debounce appendEdit

* Change undo and redo to useCallback

* Update debounce time to feel closer to post editor

* Move debounce of appendEdit into useEditorHistory

* Make sure debounced appendEdit is flushed before undo/redo

* Remove console.log() statement
2024-05-22 09:07:04 -04:00
Maikel Perez bdf2ed170d
Simplify the product images empty state (#47663)
* Simplify the product images empty state

* Add changelog file
2024-05-22 08:36:22 -03:00
Maikel Perez 4c0399991a
Replace copy: List Price to Regular Price (#47658)
* Replace copy: List Price to Regular Price

* Add changelog files

* Fix md-docs linter errors and update the manifest
2024-05-21 16:28:01 -04:00
Maikel Perez 30c449e749
Fix layout template request not being executed after registering a new entity with the new version of GB installed (#47678)
* Fix layout template request not being executed after registering a new entity with the new version of GB installed

* Add changelog file
2024-05-21 20:02:02 +00:00
Damián Suárez fcc4c33726
Product Block Editor: tweak the gap between the form field blocks (#47666)
* introduce block gap unit-20

* set unit-20 as default for section and subsections

* changelog
2024-05-21 14:46:16 -03:00