Commit Graph

1404 Commits

Author SHA1 Message Date
Matt Sherman 8aa42f433f Update context type for variation-items 2023-09-27 17:00:01 -04:00
Matt Sherman bd4c7847b9 Update context type for tag 2023-09-27 16:59:59 -04:00
Matt Sherman a2e9080150 Update context type for tab 2023-09-27 16:59:27 -04:00
Matt Sherman b6dc633e81 Fix typing for initBlock call in tab 2023-09-27 16:58:13 -04:00
Matt Sherman a4a44ef56b Fix typing for initBlock call in variation-items 2023-09-27 16:56:32 -04:00
Matt Sherman ef48cccc23 Fix typing for initBlock call in variations 2023-09-27 16:56:01 -04:00
Matt Sherman 57448d4627 Fix typing for initBlock call in variation-options 2023-09-27 16:55:29 -04:00
Matt Sherman 8a78340b30 Fix typing for initBlock call in toggle 2023-09-27 16:55:03 -04:00
Matt Sherman c2e60a4aa8 Fix typing for initBlock call in summary 2023-09-27 16:53:47 -04:00
Matt Sherman ac7ab2b1a0 Fix typing for initBlock call in shipping-dimensions 2023-09-27 16:53:15 -04:00
Matt Sherman ce4b7af7e8 Fix typing for initBlock call in shipping-class 2023-09-27 16:52:49 -04:00
Matt Sherman 8ff4f6b095 Fix typing for initBlock call in schedule-sale 2023-09-27 16:52:22 -04:00
Matt Sherman 9f55c320dc Fix typing for initBlock call in regular-price 2023-09-27 16:51:41 -04:00
Matt Sherman e94de74d00 Fix typing for initBlock call in section 2023-09-27 16:51:10 -04:00
Matt Sherman edaf1154d0 Fix typing for initBlock call in sale-price 2023-09-27 16:50:47 -04:00
Matt Sherman ed57f267fb Fix typing for initBlock call in radio 2023-09-27 16:49:35 -04:00
Matt Sherman dfaa1b7dfd Fix typing for initBlock call in pricing 2023-09-27 16:49:07 -04:00
Matt Sherman c8ad1de579 Fix typing for initBlock call in password 2023-09-27 16:48:41 -04:00
Matt Sherman 54209362a0 Fix typing for initBlock call in notice 2023-09-27 16:48:02 -04:00
Matt Sherman 4fc547dfb1 Fix typing for initBlock call in inventory-sku 2023-09-27 16:47:29 -04:00
Matt Sherman 1b64e7dd0e Fix typing for initBlock call in inventory-email 2023-09-27 16:46:41 -04:00
Matt Sherman 21929ccd25 Fix typing for initBlock call in inventory-quantity 2023-09-27 16:46:07 -04:00
Matt Sherman c507f02f47 Fix typing for initBlock call in description 2023-09-27 16:45:26 -04:00
Matt Sherman 4f72172426 Fix typing for initBlock call in checkbox 2023-09-27 16:44:56 -04:00
Matt Sherman 51e769d778 Fix typing for initBlock call in catalog-visibility 2023-09-27 16:43:59 -04:00
Matt Sherman a22e92bea3 Type context prop for BlockEditor 2023-09-27 16:42:25 -04:00
Matt Sherman 2f1a5f82ec Add ProductEditorContext and ProductEditorBlockEditProps interfaces 2023-09-27 16:40:56 -04:00
Matt Sherman 1e35d45c99
Template API: Expose template block id and order to client (#40263)
* Update unit tests to handle _templateBlockId and _templateBlockOrder

* Refactor get_formatted_template

* Initial @woocommerce/block-templates package

* Add block-templates to admin webpack

* Add block-templates to dependency-extraction-webpack-plugin

* Add block-templates to admin assets

* Add block-templates dependency

* Update name block

* Update syncpack

* Update regular price block

* Update tab block

* Update section block

* Add @wordpress/deprecated to package

* Deprecated initBlock

* Update attributes block

* Update catalog visibility block

* Update checkbox block

* Update conditional block

* Update collapsible block

* Allow additional props to be passed to useWooBlockProps

* Update inventory sku block

* Update inventory quantity block

* Update inventory email block

* Update images block

* Update description block

* Update radio block

* Update pricing block

* Update password block

* Update notice block

* Update shipping dimensions block

* Update shipping class block

* Update schedule sale block

* Update sale price block

* Update toggle block

* Update taxonomy block

* Update tag block

* Update summary block

* Update variations block

* Update variations options block

* Update variation items blocks

* Changelog

* Changelog

* Changelog

* Changelog

* Changelog

* Add test for registerWooBlockType

* Add @testing-library/react-hooks to devDependencies

* Add test for useWooBlockProps

* Document API

* Fix linting issues in README.md

* Fix tabs tests by mocking useWooBlockProps

* Allow header duplication under different nesting

* Remove unused import (fixes lint error)

* Update lock file
2023-09-27 13:38:56 -07:00
Nathan Silveira 8edcb06348
Add block documentation to woocommerce/product-checkbox-field (#40277)
* Rename block description

* Add documentation for product checkbox field

* Add changelog

* Improve README

* Add description to block's attributes

* Replace example

* Add markdown table with documentation

* Move image to developer.woocommerce.com

* Iterate documentation

* Address lints
2023-09-27 15:07:52 -03:00
Maikel David Pérez Gómez e6df583c65
Add a visibility toggle to the Quick actions list (#40464)
* Create toggle-visibility-menu-item component

* Add toggle-visibility-menu-item to variation-actions-menu

* Add toggle-visibility-menu-item to variations-actions-menu

* Add changelog file
2023-09-27 11:19:49 -04:00
Maikel David Pérez Gómez 6728e73505
Fix the visibility icon (#40419)
* Remove help icon on top of the hidden icon

* Remove help icon on top of the non filterable icon

* Add changelog file
2023-09-27 10:00:10 -04:00
Paul Sealock 7b9abcc79a
TreeSelectControl: Handle ROOT selection with individuallySelectParent (#40422)
* Handle selecting ROOT and includeParent

* changelog
2023-09-27 16:14:13 +13:00
Fernando Marichal 5fa98ace1a
Fix attribute list styles (#40378)
* Fix attribute list style

* Add changelog

* Move changelog

* Fix attributes style
2023-09-26 15:08:57 -04:00
Fernando Marichal a2efd31b6f
Open variation preview in a new tab (#40414)
* Open variation preview in new tab

* Add changelog

* Move changelog

* Add noreferrer
2023-09-26 12:17:21 -04:00
louwie17 247b8990d2
Add default price support to product variations (#40343)
* Optimize crud totalCount queries to avoid two requests

* Make use of same request params for totalCount as getVariations

* Add support for default_values when generating product variations

* Add test for default_values

* Add changelogs

* Only use default values of first variation

* Address some PR feedback

* Update types
2023-09-22 11:39:35 -03:00
Paul Sealock fb557cf21f
Components: TreeSelectControl - Make sure individuallySelectParent value is preserved (#40301)
* make sure individually selected parent value is preserved

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-09-22 10:20:08 +12:00
Fernando Marichal 1c497f3066
Update copy in the add variation options modal (#40280)
* Change add variation options modal copy

* Add changelog

* Clean component
2023-09-20 09:12:48 -03:00
Fernando Marichal f058e04046
Fix styling errors in variation actions in blocks product editor (#40220)
* Fix actions style

# Conflicts:
#	packages/js/product-editor/src/components/variations-table/styles.scss

* Add changelog

* Fix checkbox

* Refactor fix
2023-09-20 09:05:51 -03:00
louwie17 f9705a531b
Redirect to product editing page when product was still in auto draft (#40225)
* Redirect to product editing page when product was still in auto draft

* Make sure the prevent page does not show up when creating variations

* Add changelog and fix tests
2023-09-19 17:33:15 -03:00
louwie17 6337abc3c5
Add notice when variation prices are not set yet (#40281)
* Add notice dismissal and re-show upon validation

* Add support for notice actions

* Add changelogs

* Add set prices

* Fix build issues

* Add comment

* Replace additionalData with newData
2023-09-19 17:01:54 -03:00
Nathan Silveira 6dc109c3d8
Search for taxonomy with special characters (#40217)
* Decode html escaped characters in SelectTree

* Escape special characters when searching for taxonomies

* Add changelogs

* Remove unneeded decodeEntities

* Increment escapeHTML function to comply with what is happening in the legacy taxonomy editor

* Extract escapeHTML to @woocommerce/components
2023-09-19 14:49:19 -03:00
Fernando Marichal d72316490d
Fix error displaying block after removing variation (#40255)
* Fix error displaying block after removing variation

* Disable Add button

* Add changelog
2023-09-19 13:31:32 -03:00
Adrian Duffell 389dd1ac46
Remove link to outdated information in Components package documentation (#40015)
* Remove link to outdated information

* Add changelog
2023-09-18 16:14:08 +08:00
Fernando Marichal c661186499
Fix issue with deleting variations in new product editor (#40219)
* Fix onDelete param

* Add changelog
2023-09-15 17:20:47 -03:00
louwie17 9ea83d6382
Fix description styling and remove use of `woocommerce-page` in admin pages (#40218)
* Move the header data to the body as the header prop does not exist anymore

* Remove explicit setting of __unstableResolvedAssets given get_block_editor_settings already does this

* Remove use of woocommerce-page class in admin to avoid theme conflicts

* Add changelogs

* Revert change for quick test

* Two additional tweaks for admin related styling
2023-09-15 17:06:42 -03:00
louwie17 26f5cd5a9c
Update variation visibility icon in variations table (#40150)
* Create re-usuable hidden icon and re-use in variations table

* Add changelog
2023-09-15 15:51:28 -03:00
Nathan Silveira 95d7a6b86d
Improve Categories (Taxonomy) field UX (#40059)
* Add 'dialogNameHelpText' attribute to show on create taxonomy dialog

* Tweak CSS margins

* Add changelogs

* Rename "Save" to "Create" and set cancel button to Tertiary

* Add gray color to (optional)

* Create attribute to personalize label for parent
2023-09-14 16:02:16 -03:00
Nathan Silveira 2b5e3f2cb8
Decode HTML escaped string for tree-item and selected-items components (#40047) 2023-09-11 09:41:17 -03:00
Fernando Marichal 48016efaa6
Fix infinite category loading state (#40073)
* Fix loading state

* Add changelog

* Replace catch with finally
2023-09-08 08:58:34 -03:00
Ismael Martín Alabarce 80173a640e
Update TaskItem and WooPayments task (#40034)
* Custom WooPayments task header content

when action incentive is available.

* Add badge prop to experimental TaskItem component

, update task list components, docs, storybook, and tests

* Add badge property to OnboardingTasks/Task abstract class

* Add `woocommerce_admin_woopayments_onboarding_task_badge` filter

* Use the filter to display the badge from server

* Add changelog entries

* Update filter to use return existing badge

instead of an empty string

* Update task header to also check for the incentive in wcpaySettings
2023-09-07 15:43:18 +02:00
Fernando Marichal ad1920ca2e
Add Tags to product editor (#39966)
* Add block

* Add component tags-field

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

* Add changelog

* Clean code

* Add style

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

* Trim styles

* Delete input when creating tag

* Clean input after creating tag

* import Query type

* Add changelogs

* Add tests

* Rename newInputValue

* Remove lodash use

* Add useInstanceId instead of using a fixed id

* Remove pagination related code

* Remove isAsync const

* Fix list filtering

* Abstract useSelect

* Fix tests

* Refactor use-tag-search

* Fix lint
2023-09-06 15:51:22 -03:00
Maikel David Pérez Gómez 5e301f5a6f
Show sale price and list price in each variation row when the variation is on sale (#40048)
* Show sale price and list price in each variation row when the variation is on sale

* Add changelog file
2023-09-06 15:20:34 -03:00
Maikel David Pérez Gómez 9e812dd5da
Show in product details feature under Edit attribute modal (#40006)
* Change the Visible to customers checkbox label and tooltip

* Set default visibility to true if the atribute is non used for variations, false otherwise

* Add changelog file
2023-09-06 15:20:24 -03:00
Nathan Silveira e9aad24125
Migrate Category field to woocommerce/taxonomy-field block (#40021)
* Migrate category field to woocommerce/taxonomy-field block

* Remove details-categories-field

* Add changelogs

* Remove more references

* Rename block and add it to blockregistry

* Add missing setIsCreating calls

* Undo changelog change

* Add changelog
2023-09-06 10:21:37 -03:00
Matt Sherman a66a48108f
Update woocommerce/create-product-editor-block to use template API (#39993) 2023-09-06 06:30:59 -04:00
Moon c45335b936
CYS - Add LookAndFeel and ToneOfVoice pages (#39979)
* Add ProgressBar component to @woocommerce/components

* Add changelog

* Remove html.wp-toolbar in fullscreen mode

* Add base style

* Add Tell us a bit more about your business page

* Fix merge conflict issues

* Send BUSINESS_INFO_DESCRIPTION_COMPLETE event when continue button is clicked

* Remove duplicated style import

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

* Lint fix

* Add 'Look and Feel' and 'Tone of voice' pages';

* Use correct classname

* Minor changes

* Textearea color should be gray-900 after the user enter text
* guide font weight should be 500

* Fix layout shift when a choice is selected

* Fix choices width for tone of voice page

* Use context value for the default

* Revert button margin top

* Fix default selection

* Add X button

* Decrease the margin by 20px to accommodate the height of the close button

* Add close action

* Include @woocommerce/ai package

* Add AI service

* Use AI service

* Parse JSON from in function

* Fix assignLookAndTone event type

* Update plugins/woocommerce-admin/client/customize-store/design-with-ai/components/choice/choice.scss

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

* Update plugins/woocommerce-admin/client/customize-store/design-with-ai/services.ts

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

* Log when AI API endpoint request fails

* Add spinner when user clicks the continue button

* streamlined unnecessary isRequesting context and forwarded close event

* pnpm-lock changes from trunk

* lint fixes

* ai package test passWithNoTests

* changelog

* reset pnpm-lock to trunk

* Dev: update pnpm-lock.yaml and jest preset config (#40045)

* Update pnpm-lock.yaml

* Update jest-preset config to fix unexpected token error

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
Co-authored-by: rjchow <me@rjchow.com>
2023-09-06 14:21:09 +08:00
Maikel David Pérez Gómez f3d1526f71
Auto select one or more attribute terms when selecting an attribute (#40004)
* Add auto select first or all terms when an attribute is selected

* Set auto select all terms in variations tab

* Set auto select the first term in Organization tab

* Add changelog file

* Change termsAutoselection to be camel case

* Remove error suppersion when retreiving attribute terms
2023-09-05 16:29:57 -03:00
Fernando Marichal ccb72125e0
Add a notice to "track inventory" toggle (#40011)
* Add notice to "track inventory" toggle

* Add changelogs

* Remove console.logs

* Fix link URL
2023-09-05 08:35:38 -03:00
Chi-Hsuan Huang c9b8236f53
Add customize store assembler hub onboarding tour (#39981)
* Update tour-kit to have a optional skip button and custom secondary button label

* Add changelog

* Add onboarding tour

* Update layout and resiable-frame for onboarding tour

* Update onboarding tour style

* Update resizable handler

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-09-05 15:12:04 +08:00
Maikel David Pérez Gómez 4f867c6736
Components: Select Control dropdown styling issues (#39989)
* Fix select control dropdown menu width, double scroll and item aligment

* Fix attributes dropdown jumping on focus and slot position

* Add changelog files

* Fix double scroll and label margin on Category Select
2023-09-04 14:25:03 -03:00
Matt Sherman fb9857f22f Changelog 2023-08-31 17:08:39 -04:00
Matt Sherman ea4e257d65 Fix id and blockName in the add_block call 2023-08-31 17:07:14 -04:00
Matt Sherman 76c66aaee9 Update to use template API to add block 2023-08-31 16:05:43 -04:00
Maikel David Pérez Gómez cdaae1caac
Add Shipping item to the global Quick Update dropdown (#39973)
* Add Shipping item to the global Quick Update dropdown

* Add changelog file

* Fix Quick update dropdown menu position to bottom left
2023-08-31 15:00:19 -04:00
Nathan Silveira 501abc47b5
Add taxonomy block using SelectTree (#39947)
* Create Hierarchical Taxonomy block

* Add changelog

* Update CSS and remove more references to 'brands'

* Improve error message UX

* Use css variables

* Name block attribute

* Add support for non-hierarchical taxonomies

* Rename attributes

* Fetch "hierarchical" from taxonomy data

* Update changelog

* Remove 'hierarchical' attribute

* Update description

* Fix issue where hierarchy was not displayed in create modal

* Refactor taxonomy details select

* Add README to taxonomy block
2023-08-31 15:19:28 -03:00
Maikel David Pérez Gómez 6673ebecd2
Add Inventory item to the global Quick Update dropdown (#39972)
* Add Inventory item to the global Quick Update dropdown

* Add changelog file
2023-08-31 13:52:06 -04:00
louwie17 785d45fbc3
Update variation pagination table (#39967)
* Add className to sortable and perPageOptions to Pagination

* Refactor pagination into seperate components

* Add PageArrowsWithPicker pagination component and usePagination hook

* Add hook to Pagination story

* Update Pagination readme

* Add changelogs

* Make sure input is updated if currentPage updates outside of PageArrowsWithPicker component

* Only show pagination if total count exceeds the minimum page size

* Add missing doc

* Fix lint errors

* Move totalCount to seperate useSelect to avoid multiple calls on page switch

* Fix merge conflict

* Fix lint error
2023-08-31 09:28:10 -03:00
Maikel David Pérez Gómez 350f758529
Add global quick actions dropdown menu to the Variations table header (#39950)
* Create variations actions menu

* Disable Quick update dropdown menu when no variations are selected

* Add onDelete all selected variations

* Add update stock menu item to the quick updates global menu

* Add changelog file

* Fix linter error

* Add Pricing item to Quick update menu

* Add Set list price to the Quick update menu

* Fix some unit tests
2023-08-30 16:16:47 -04:00
louwie17 6582445e71
Make sure we also save default attributes prior to variation generation (#39938)
* Make sure we also save default attributes prior to variation generation

* Add changelog

* Remove unused code

* Add changelog

* Fix lint errors

* Update and consolidate isDefault logic

* Remove unused function

* Fix tests and add a few more for testing default attributes

* Fix lint error
2023-08-30 17:04:54 -03:00
Maikel David Pérez Gómez a425a62fb8
Product Block Editor: add tracks to the Variations tab (#39914)
* Add product_options_add tracking event to add variation options

* Add product_options_edit tracking event to variation options

* Add product_options_update tracking event to variation options

* Fix set default attribute when editing it

* Add changelog file

* Add product_options_add_button_click tracking event

* Get attribute options from the terms prop instead of options, this ensures to get the updated values when the user edits the options

* Add Variation options section back

* Add changelog file
2023-08-30 14:36:44 -04:00
RJ 0190f4adea
fix: applied lint autofixes (#39942)
* woocommerce-admin lint fixes

* @woocommerce/* lint fixes

* Add changefile(s) from automation for the following project(s): @woocommerce/date, @woocommerce/data, @woocommerce/components, @woocommerce/admin-layout, woocommerce

* lints

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-08-30 06:40:45 +08:00
louwie17 db9cb4db4b
Add variation inventory quick actions (#39935)
* Add new inventory submenu to variations actions

* Move pricing submenu up to its own function

* Add tests

* Move inventory markup to seperate component

* Remove menu group label

* Add changelog

* Move pricing menu to own component

* Fix lint errors

* Update use of handlePrompt to make return more flexible
2023-08-29 11:46:48 -03:00
Maikel David Pérez Gómez 1356f76f7b
Add multiselection to the Variations table under Variations tab (#39937)
* Add a checkbox to each variation row to select the current variation

* Add an indeterminate checkbox to the header of the variations table

* Add Select all and Clear selection buttons to the variations table

* Disable Select all if all items are selected and disable Clear selection when there is no items selected

* Add changelog file

* Fix linter error
2023-08-29 08:52:54 -04:00
Chris Runnells 3c25538f35
Fix Core Profiler layout shifts during plugin install step (#39898) 2023-08-28 16:05:23 -10:00
Maikel David Pérez Gómez 1708b854f7
Add Shipping item to the Quick Actions menu per Variation item (#39925)
* Add Shipping submenu to the quick actions menu

* Set dimensions correctly

* Add changelog file
2023-08-28 14:49:39 -04:00
Chris Runnells 59ca5daeeb Add changelog entry for package. 2023-08-25 14:50:41 -10:00
louwie17 6688c60fe4
Fix description toolbar (#39873)
* Make sure the iframe block toolbar still contains full width with latest WP version

* Add min height

* Add changelog

* Revert one change

* Remove unused imports
2023-08-25 13:40:51 -03:00
Maikel David Pérez Gómez 23f33a6b74
Add Pricing item to the Quick Actions menu per Variation item (#39872)
* Move the Quick Actions menu to its own component

* Add Set list price item to the Pricing sub menu

* Add notice when a variation gets updated

* Add Set sale price to Pricing sub menu

* Do not fire change if the user cancel the window propmt

* Add Increase list price to Pricing sub menu

* Add Decrease list price to Pricing sub menu

* Add Increase sale price to Pricing sub menu

* Add Decrease sale price to Pricing sub menu

* Add Schedule sale to Pricing sub menu

* Add changelog file

* Fix lint error

* Fix typo

* Add Sale end date to the Schedule sale to Pricing sub menu

* Add tracking events

* Fix tracking event params from camelcase to snakecase
2023-08-25 12:13:16 -04:00
Chris Runnells bd5fc03aae Add secondary container to fix layout shifts
Also added CSS so that the container is always aligned to the top of the wrapper
2023-08-24 14:01:55 -10:00
louwie17 9198596918
Set up and migration to use BlockTemplate classes (#39814)
* Initial set up and migration for the BlockTemplate

* Migrate remaining fields to the new SimpleProductTemplate

* Remove re-usable functions and clean up

* Add interfaces

* Add changelogs

* Remove unused id from block attributes

* Update changelog

* Address refactor suggestions

* Fix lint errors

* Add tests

* Address PR feedback

* Extend from BlockContainerInterface instead of BlockInterface
2023-08-24 16:04:44 -03:00
Fernando Marichal 471bfd1f29
Fix new category name field error (#39857)
* Fix category name input

* Add changelog

* Move changelog
2023-08-24 10:25:20 -03:00
Maikel David Pérez Gómez f2511d4034
Product Block Editor: remove +1 category from the Variations options set of cardinality 3. (#39856)
* Change variation option labels cardinality to 3

* Add changelog file
2023-08-23 16:19:53 -04:00
Maikel David Pérez Gómez 0db29cd8c1
Create several global attributes with the same name (#39827)
* Save changes

* Remove restriction from the variations dropdown to let users create multiple attributes with the same name

* Add support for autogenerate slug in the create attribute endpoint

* Add a tooltip to specify the slug of the attribute when there are more than one listed in the dropdown list

* Add changelog files

* Revert filtering to the prev implementation

* Add review suggestions

* Add return description to the generate_unique_slug function description
2023-08-23 12:08:05 -04:00
Nathan Silveira 97137f15e7
Update new product editor middleware regex to not match 'product_brand' (#39822)
Update regex to not match 'product_brand'
2023-08-23 11:38:20 -03:00
Maikel David Pérez Gómez 897e0673a7
Add quick actions dropdown menu per variation item (#39816)
* Add the dropdown menu to the variations list

* Add preview link to the preview dropdown menu item

* Add delete variation support to the delete menu item

* Fix linter error

* Add changelog file

* Add wcadmin_product_variations_menu_view, wcadmin_product_variations_preview and wcadmin_product_variations_delete tracking events to the variation quick actions menu items
2023-08-22 10:42:18 -04:00
RJ cb2cf79342
dev: refactor core profiler loader (#39735)
* dev: refactor core profiler loader

* dev: added storybook example for loader

* lint

* Apply suggestions from code review

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* addressed review feedback

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-08-22 19:58:33 +10:00
Néstor Soriano 4876ab35b8
Bump WooCommerce minimum required PHP version to 7.4 (#39820)
-Change "Requires PHP":
  - In woocommerce.php
  - In readme.txt
  - In plugins/woocommerce-docs/woocommerce-docs.php
  - In packages/js/create-product-editor-block/plugin-templates/$slug.php.mustache

- Change "testVersion" in phpcs.xml:
  - In the root of the repository
  - In plugins/woocommerce
  - In plugins/woocommerce-beta-tester

- Change "require-php" and "config-platform-php" in composer.json
- Update composer.lock with more modern versions of some of the dependencies
- Remove the admin notice about the upcoming bump for PHP 7.3 users in class-wc-admin-notices.php
2023-08-22 09:21:09 +02:00
Maikel David Pérez Gómez a4ed336a0d
Variation attributes can not be enabled in Attributes section and Non Variations attributes cannot be enabled in Variation Options section (#39770)
* Disabled attributes used in different section

* Let the attribute input field to disable some items within the dropdown list

* Define disabled attribute ids and message

* Filter non variable attributes as disabled to be used under variations options

* Filter variable attributes as disabled to be used under attributes

* Add changelog file

* Fix linter error

* Add tooltip option to menu item and use it for attribute and variations

* Fix some rebase conflicts

* Add changelog file

---------

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2023-08-21 15:39:31 -04:00
Fernando Marichal 3f17b9b13b
Allow users to select multiple items from the media library while adding images (#39741)
* Allow select multiple items

* Add changelog

* Fix TS error
2023-08-21 12:10:30 -03:00
Fernando Marichal 79df3d7937
Fix display error in the Categories dropdown (#39811)
* Set flip as false

* Add changelog
2023-08-21 11:02:12 -03:00
louwie17 b3f7be5fdc
Update ImageGallery toolbar: changing icon to text and adding ellipsis menu (#39753)
* Update ImageGallery Toolbar by adding an ellipsis options dropdown menu

* Add changelog

* Remove typings

* Fix build issues

* Fix lint errors

* Add comment and remove old comment
2023-08-18 16:24:26 -03:00
Fernando Marichal 278366def9
Disable tabs in parent product page with variations (#39675)
* Add warning block

* Delete warning block

* Add notice component

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

* Add page notice

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

* Add `isOptionsNoticeVisible` to tab

* Add utils functions

* Remove warning

* Add notice visibility to tab

* Add notice visibility to pricing, inventory, shipping

* Add changelog

* Remove warning

* Change button text

* Add check to hasAttributesUsedForVariations

* Fix tests

# Conflicts:
#	packages/js/product-editor/src/components/tabs/test/tabs.spec.tsx

* Create notice block and move notice from tabs

* Fix product-notice block declaration

* Remove title from array

* Fix notices

* Fix styles

* Change error to error-type

* Revert "Add notice visibility to pricing, inventory, shipping"

This reverts commit 140703d49e.

* Remove import

* Revert "Fix tests"

This reverts commit 96036c5a6c.

* Remove duplicated function

* Add changelog

* Remove `isSelectedTabApplicableForOptionsNotice`

* Remove styles out of scope

* Fix notice props

* Rename block

* Remove selectedTab

* Update packages/js/product-editor/src/blocks/notice/edit.tsx

Co-authored-by: louwie17 <lourensschep@gmail.com>

* Fix lint

---------

Co-authored-by: louwie17 <lourensschep@gmail.com>
2023-08-18 11:14:02 -03:00
louwie17 c11b11631b
Add/39443 attribute filters (#39685)
* Add not filterable and not visible icons to attribute list

* Fix types

* Add changelogs

* Fix lint errors
2023-08-16 14:49:52 -04:00
nigeljamesstevenson d1f2218f71
Add loading indicator when submitting location in Tax task (#39613)
thanks a lot!
2023-08-15 13:49:13 +01:00
Sam Seay 45c49dc232
Add a workflow to separate out eslint and annotate PRs. (#39704) 2023-08-15 18:21:51 +12:00
RJ 3611fafe79
dev: upgrade storybook to 6.5.17 for TypeScript 5 compatibility (#39745)
There's been a Storybook breakage with Typescript 5 detailed here: https://github.com/hipstersmoothie/react-docgen-typescript-plugin/issues/78

This fix should allow us to continue using Storybook 6 until we upgrade to Storybook 7 down the road.

Even though it relies on an alpha release of 6.5.17-alpha, the only change in the alpha is https://github.com/storybookjs/storybook/pull/21745.

It should be an acceptable risk considering that Storybook is internal dev tooling for now.
2023-08-15 14:13:42 +08:00
louwie17 3edd1bd823
Auto delete unused variations when auto generating variations (#39733)
* Add auto delete functionality for variations

* Add the remove confirmation modal

* Update delete unmatched product variation logic

* Add tests

* Add changelogs

* Fix lint errors

* Fix lint errors
2023-08-14 16:35:16 -03:00
Ilyas Foo e3caf5e540 Changelog 2023-08-14 11:48:45 +08:00
Ilyas Foo b497df10d8 Add preemptive set isRequesting when optimistically updating settings 2023-08-14 11:47:34 +08:00
Ilyas Foo 8aa753d917 Fix unintended reset of isRequesting when updating settings 2023-08-14 11:47:15 +08:00
louwie17 71e8b699db
Convert simple to variable product and auto add variations (#39673)
* Auto create variations and move product to variable when adding variation options

* Delete unused components

* Add tour to variation options

* Remove unneeded options

* Add changelog

* Fix types

* Fix lint errors

* Fix broken tests

* FIlter out option tags when not included in attributes

* Don't invalidate variations data when no new variations are created
2023-08-11 11:15:05 -03:00
Fernando Marichal 91fadfd8fe
[Product Block Editor] Remove additional create term modal (#39610)
* Remove additional create term modal

# Conflicts:
#	packages/js/product-editor/src/components/attribute-term-input-field/attribute-term-input-field.tsx

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

* Add changelog

* Fix list refresh and add loading state

* Remove duplicated "invalidateResolutionForStoreSelector"

* Add modal and `autoCreateOnSelect`

* Update packages/js/product-editor/src/components/attribute-term-input-field/attribute-term-input-field.tsx

Co-authored-by: louwie17 <lourensschep@gmail.com>

* Add Attributes `invalidateResolution`

* Improve error handling

* Add term_exists error

* Fix lint errors

* Fix isOpen variable

* Fix lint

---------

Co-authored-by: louwie17 <lourensschep@gmail.com>
2023-08-10 14:21:28 -03:00
Maikel David Pérez Gómez 3ffe7b8376
Create variation items block (#39657)
* Create and register product-variation-items-field block

* Create variations-table component

* Use variations-table component in variation-items block

* Remove last border bottom from the variation options list

* Add changelog file

* Add changelog file
2023-08-09 16:06:59 -03:00
louwie17 592b4feb5e
Fix attribute terms disappearing in list (#39620)
* Fix enhance attribute logic

* Add changelog

* Fix test

* Add auto create global attribute term and fix bug with terms for global attribute

* Fix test and update changelogs

* Add invalidate resolution call and error notice

* Revert auto create on select changes
2023-08-09 10:41:47 -03:00
louwie17 75d64ee063
Create global attributes by default (#39548)
* Add support to attribute control for creating global attributes

* Add create global attribute to variation block

* Add changelog

* Invalidate the attributeTerm search after creating a new attribute term
2023-08-08 12:54:11 -03:00
Maikel David Pérez Gómez 8d8d315d66
Focus the first attribute field when opening the modal (#39549)
* Focus the first attribute field on modal shown

* Add changelog file

* Remove setTimeout to focus the attribute dropdown field
2023-08-08 10:50:11 -04:00
Maikel David Pérez Gómez b546e4fb17
Manage default variation option (#39570)
* Add default attributes property to the Product type

* Add change log file

* Set default attributes when click add from the attribute options modal

* Add Set default value checkbox to the edit attribute modal

* Manage default attributes when update or delete an attribute option

* Show Set default value only when the editing attribute is used for variations

* Add change log file
2023-08-08 10:41:26 -04:00
Maikel David Pérez Gómez d3702c53ba
Add product visibility blocks (#39477)
* Add catalog visibility block

* Add product search visibility block

* Add changelog files

* Fix linter errors

* Remove non necesary block

* Add catalog_visibility property to the Product type
2023-08-08 09:58:00 -03:00
Sam Seay e8c3808527
Upgrade TypeScript to v5.1 (#39531) 2023-08-08 16:35:31 +12:00
Alefe Souza 428feb58a7
Update WCPay banners for WooPay (#39596)
* Update WCPay banners for WooPay

* Fix unit tests

* Always checks for WooPay eligibility

* Use existing method to determine WooPay eligibility

* Create is_woopay_eligible method
2023-08-07 19:17:59 -07:00
Joel Thiessen 144bf08293
Generating the short description on the product editor (#39237)
* [Woo AI] Generate short description after long description is generated.
2023-08-07 14:03:52 +02:00
Joshua T Flowers 63ca33ae35
Fix toolbar button text not showing in WP 6.3 (#39572)
* Fix toolbar button text not showing in WP 6.3

* Add changelog entry
2023-08-04 16:23:09 -05:00
Fernando Marichal a436b3b3a4
Fix selection of term after clicking the value name (#39574)
* Fix select attribute values

* Add changelog

* Move changelog

* Remove 'list-item' class name
2023-08-04 15:40:32 -05:00
Maikel David Pérez Gómez b5db405265
Feedback bar is mis-aligned; transient notices overlap (#39233)
* Fix the feedback bar alignment to be centered

* Move the transient notices to the top of the feedback bar

* Add changelog file

* Remove feedback bar animation
2023-08-03 10:06:45 -04:00
louwie17 1212fcb689
Add new variation modal (#39522)
* Hook up add new variations options modal

* Fix duplicate logic and test

* Add changelog

* Match local attributes by name case incentive

* Remove console log

* Make use of some function instead of findIndex
2023-08-02 14:29:09 -03:00
louwie17 86788fcaed
Pass down height of inserter panel to allow for scrolling (#39491)
* Pass down height of inserter panel to allow for scrolling

* Add changelog
2023-07-31 12:36:07 -03:00
Nathan Silveira 403c8ba8b8
[ Product Block Editor ] Create Variation options block (#39256)
* Add support for variable products

* Add 'hello world' block to variations tab

* Add product-section block to template

* Add AttributeControl component to screen

* Add changelog

* Change labels

* Make a copy of AttributeControl to VariationOptionsControl to allow the fields to evolve separately in future

* Fix tests

* Add changelog to woocommerce

* Fix alert error

* Remove copied control and start adapting attribute control to handle both scenarios

* Add -field to block name

* Revert "Add -field to block name"

This reverts commit 50e1ee66e27ffb2df22ea7f6a4f78d1577a273f5.

* Revert "Revert "Add -field to block name""

This reverts commit eee0441c6532f9fa8cf8383d9699fd503dd054ae.

* Extract more labels

* Hide drag handle in variation options
2023-07-28 14:40:18 -03:00
Nathan Silveira bf97630ad0
[Product Block Editor] Add require password block field (#39464)
* Add post password to API

* Add changelog

* Fix phpcs issue

* Remove post_password from tests

* Add additional property to test

* Increment number of properties in product schema

* Update the post when post_password changes

* Start adding password block

* Add css and import it

* Refactor attributes and erase password when checkbox is unchecked

* Add changelogs

* Remove unused imports

* Rename 'fields' to 'field'

* Refactor CSS

* Remove example object
2023-07-28 14:05:03 -03:00
Panos (Panagiotis) Synetos 155420f79c
Merge branch 'trunk' into fix/admin-colors-use-theme 2023-07-21 12:12:06 +03:00
Nathan Silveira 8020f3407b
[Block Product Editor]: Only run name validation if the field has been edited (#39320)
Only run name validation if the field has edit
2023-07-20 10:42:01 -04:00
Maikel David Pérez Gómez 776d567f30
Create the Organization tab (#39232)
* Add Organization to the right of General tab

* Add Product catalog and Attributes sections to the Organization tab

* Add Categories and Disable product reviews blocks to Product catalog section

* Add attributes block to the attributes section

* Add changelog files

* Fix php linter error

* Remove Categories and Attributes blocks from the General tab

* Change Disable product reviews by Enable product reviews
2023-07-19 10:11:03 -04:00
Panos (Panagiotis) Synetos ea1d08c72a
Merge branch 'trunk' into fix/admin-colors-use-theme 2023-07-19 15:21:30 +03:00
Sam Seay 4a2fd63b99
Use syncpack customTypes to keep pnpm and node in sync. Update pnpm to 8.6.7 (#39245) 2023-07-18 14:27:18 +12:00
Joel Thiessen 7cb5cfed69
Making completion utilities available in AI package (#39190)
Co-authored-by: github-actions <github-actions@github.com>
2023-07-17 10:25:14 -07:00
Maikel David Pérez Gómez 24a655aec4
Allow the user to delete the description (#39229) 2023-07-14 11:00:03 -04:00
Fernando Marichal bbd727c257
Add header buttons to the description editor modal (#39156)
* Add header buttons to the description editor modal

# Conflicts:
#	packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.scss
#	packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.tsx

# Conflicts:
#	packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.tsx

* Remove isModalActionsBarVisible

# Conflicts:
#	packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.tsx

* Fix styles and removed comment

# Conflicts:
#	packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.tsx

* Add changelog

* Fix styles

* Fix gap between buttons
2023-07-14 11:18:16 -03:00
Panos (Panagiotis) Synetos 6260251f52
Changelog 2023-07-14 14:06:54 +03:00
Panos (Panagiotis) Synetos cfff3c6d69
Components empty content icon color 2023-07-14 13:50:02 +03:00
louwie17 9a5f7643c4
Prepare woocommerce/components for release (#39235)
* Ran package release prepare for woocommerce components for release

* Update changelog and change version update
to minor
2023-07-13 17:00:25 -03:00
Matt Sherman a706bd666b
Product Editor: Fix description modal editor scrolling (#39212)
* Scroll modal editor

* Set editor to always 100% height

* Only scroll editor canvas

* Scroll sidebar

* Clip inserter

* Comment for inserter clipper

* Move iframe editor css

* Remove unused const

* Changelog
2023-07-13 10:40:02 -04:00
Matt Sherman 408cf8d53c
Product Editor: Add "Copy all content" menu item to description editor modal (#39199)
* Copy all content menu item skeleton

* Add blocks to editor context

* Show notice on copy success

* Use store to get blocks to copy

* Remove blocks from editor context (decided to use store instead)

* Changelog

* Disable menu item if no content
2023-07-13 10:39:34 -04:00
Matt Sherman a51f384021
Product Editor: Disable autocomplete on product name field (#39211) 2023-07-13 10:09:59 -04:00
Oleksandr Aratovskyi aeaaac9505
Change WooCommerce Payments to WooPayments across the WC Core (#39188)
* Change WooCommerce Payments to WooPayments across the WC Core

* Change WooCommerce Payments to WooPayments across the WC Core

* Add more changelogs

* Add changelog for data package

* Change banner image and task description

* Fix lint error

* Change one more banner image

* Fix to the banner image

* Roll back changelog.txt and fix one condition for backwards compatibility

* Fix in changelog.txt

* Small fix in changelog.txt
2023-07-13 12:58:17 +03:00
Matt Sherman 17f83af095
Product Editor: Add help menu item to description modal editor (#39178)
* More menu skeleton

* Help menu item

* Tracks event for help menu item

* Remove invalid/unused ref from MoreMenu

* Changelog
2023-07-11 13:19:53 -04:00
Nathan Silveira e85491bdea
Focus on name field when mounting and update summary field UI (#39050)
* Move placeholder of summary to help text at bottom of the component

* Focus the name field when mounting

* Add changelog

* Create 'autoFocus' block attribute instead of using useEffect

* Add changelog
2023-07-11 09:48:26 -03:00
Maikel David Pérez Gómez 96c0c5bd74
On-/offboarding copy updates (#39055)
* Change the modal's description test in the first step of the product block editor tour

* Change the modal's description text in the first step of the product block editor guide

* Change the modal's description text in the second step of the product block editor guide

* Change the modal's title and description text in the third step of the product block editor guide

* Change the modal's description text in the four step of the product block editor guide

* Enhance the Options menu of the product block editor

* Add slide up animation and translucent background to the feedback bottom bar

* Change de CES's modal heading text in the product block editor

* Change the notice message after the feedback is being sent from the CES Modals

* Enhance leave feedback modal checkbox labels

* Change leave feedback modal submit button text

* Show success notice after submit the leave feedback modal

* Add changelog files

* Change the illustration in the first step of the feature tour

* Change the modal's title and description text in the first step of the product block editor tour for old users

* Change the modal's title and description text in the first step of the product block editor guide for old users

* Change the modal's title and description text in the third step of the product block editor guide for old users

* Fix unit tests

* Change the customer effort score changelog description

* Change footer forward button to primary and backward button to tertiary in the tour guide modal
2023-07-10 14:51:55 -04:00
Maikel David Pérez Gómez 714e50bf4c
Create variations block with empty state (#39038)
* Create and register woocommerce/product-variations-fields block

* Hide or show the empty state or inner blocks if the product has attributes

* Add changelog files

* Fix php linter errors
2023-07-07 17:15:54 -03:00
Moon 7c5b98ea02
Remove accents from country labels to match geo detected country data (#39110)
* Remove accent for comparison

* Add changelog

* Use localCompare instead
2023-07-07 10:50:42 -07:00
Nathan Silveira ee900c9b33
Add button on toolbar to toggle show/hide block inspector (#39090)
* Add button on toolbar to toggle show/hide block inspector

* Move changelog

* Copy drawerright icon from @wordpress/icons
2023-07-07 12:14:41 -03:00
Chi-Hsuan Huang 16d50edc8b
Tourkit: focus the step after opening (#38963)
* Tourkit: Focus the first step after opening

* Add changelog

* Update focusElementSelector

* Fix Card isElevated deprecated warninig
2023-07-06 19:06:24 +08:00
Fernando Marichal 4086e8e7f5
Fix backward compatibility for AdvancedFilters (#39049)
* Create function getInterpolatedString

* Fix interpolated strings

* Add tests

* Add changelog

* Fix deprecation text

* Improve getInterpolatedString

* Add tests

* Add method backwardsCompatibleCreateInterpolateElement

* Use another "createInterpolateElement"

* Fix deprecation text
2023-07-05 14:43:07 -03:00
Maikel David Pérez Gómez 8b1d576918
registerCoreBlocks still being called on legacy product page (#38982)
* Remove registerBlocks from rich text editor to avoid  warning messages

* Expose registerBlocks as registerRichTextEditorBlocks from the rich text editor package

* Add changelog file
2023-07-04 12:46:11 -04:00
louwie17 f8c6c43721
Update/create product block package (#39023)
* Add publish config

* Add changelog
2023-06-30 15:23:13 -03:00
louwie17 8978f2a929
Prepare create product editor block package (#39022)
* Prepare create product editor block package

* Remove legacy message
2023-06-29 10:32:04 -03:00
Sam Seay 957fb2b07e
Update pnpm to 8.6.5 (#38990) 2023-06-29 16:51:29 +12:00
louwie17 cb0fb46e7b
Add gitignore to package and update package.json (#39007)
* Add .gitignore

* Update package.json

* Add changelog
2023-06-28 18:18:02 -03:00
louwie17 b11b17c17c
Added initial changelog and ran prepare package release (#39001)
* Added initial changelog and ran prepare package release

* Add gitkeep to changelog folder

* Remove legacy link that is not required
2023-06-28 14:55:25 -03:00
Maikel David Pérez Gómez ecd1795b44
Add the list view component and button to the modal editor (#38809)
* Add document overview opened state to the EditorContext

* Create document overview toolbar button

* Add document overview button to the header toolbar

* Create document overview sidebar

* Register document overview sidebar styles

* Set document overview sidebar visible when document overview button is pressed

* Add changelog file
2023-06-27 10:08:08 -04:00
Chi-Hsuan Huang 5db0fd4fce
Add instructions on how to run the tests when using @woocommerce/components (#38821)
* Add instructions on how to run the tests when using @woocommerce/components

* Add changelog
2023-06-26 17:05:49 +08:00
Joshua T Flowers 6bbc4dad1a
Add missing tracks events to product editor (#38728)
* Only record product update on already published products

* Add source into published product tracks event

* Add missing tracks options to product update event

* Track tab clicks in the editor

* Add source to tab clicks

* Record tracks on preview click

* Add events for media gallery, description, and attributes

* Add tracks events to more menu

* Replace new_product_page with source

* Add changelog entry

* Fix lint errors

* Add tracks for About the Editor menu item

* Add onClick event to AboutTheEditor menu item

* Use dropdown option event for classic editor menu click
2023-06-21 09:38:04 -07:00