Commit Graph

834 Commits

Author SHA1 Message Date
Joshua T Flowers 8fbdbaf354
Add product page inventory quantity management (#34984)
* Add manage stock section to product inventory section

* Fix up h4 styles in form sections

* Check if stock management is enabled in store settings

* Fix up more styles in form

* Extract inventory validation and add new validation rules

* Add changelog entry

* Add changelog entry

* Remove sku related validation
2022-10-12 14:30:02 -07:00
Joshua T Flowers 618cc54a3f
Add RichTextEditor component using native block editor toolbar (#34865)
* Add initial rich text editor component

* Use fixed toolbar and add base formatters

* Add link as formatter option

* Fix up references to core/link block

* Add quote transform

* Add changelog entry

* Add text alignment toolbar

* Remove references to checkbox list

* Update toolbar button organization

* Remove unused rtj format types

* Create unique instance for editor writing flow

* Add registry provider for storybook examples

* Update styling for editor

* Rebase and fix lock file

* Add packages and type dependencies

* Move component to experimental

* Fix up formatting

* Update editor to use default GB toolbar

* Prefix names with woocoommerce

* Create block on initialization so toolbar is visible

* Rely on insertBlock to handle selection

* Update text editor to use setting instead of BlockList prop

* Fix up lock file after rebase

* Handle PR feedback

* Move logic for force rerender

* Fix up pnpm lock file

* Use trunk lock file

* Update lock file

* Add missing semicolon

* Use Pauls lock file and package file
2022-10-12 14:15:55 -07:00
Fernando Marichal 98162b9d42
Images Product management MVP 1.0 (#34769)
* Add image section

# Conflicts:
#	plugins/woocommerce-admin/client/products/add-product-page.tsx

* Add `keepSpaceWhenDragging` to sortable

# Conflicts:
#	packages/js/components/src/sortable/sortable-item.tsx
#	packages/js/components/src/sortable/sortable.tsx

# Conflicts:
#	packages/js/components/src/sortable/sortable.tsx

* Export ImageGalleryItem

* Add props to `image-gallery`

# Conflicts:
#	packages/js/components/src/image-gallery/image-gallery-item.tsx
#	packages/js/components/src/image-gallery/image-gallery.tsx

* Changed `media-uploader` label

* Add changelogs

* Fix image-gallery and sortable components

# Conflicts:
#	packages/js/components/src/sortable/sortable-item.tsx
#	packages/js/components/src/sortable/sortable.tsx

# Conflicts:
#	packages/js/components/src/image-gallery/image-gallery.tsx
#	packages/js/components/src/sortable/sortable.tsx

* Set gallery min-height

* Add onOrderChange

* Show images section edit-product

# Conflicts:
#	plugins/woocommerce-admin/client/products/edit-product-page.tsx

# Conflicts:
#	plugins/woocommerce-admin/client/products/edit-product-page.tsx

# Conflicts:
#	plugins/woocommerce-admin/client/products/edit-product-page.tsx

* Fix styles

* Fix styles

* Fix image alt

* Fix TS any

* Add prop `onDragOver`

# Conflicts:
#	packages/js/components/src/image-gallery/image-gallery.tsx

* Fix styles

* Fix padding

* Fix image area min-height

* Fix subtitle copy

* Fix image margin

* Change `draggedImageId`

* Fix `setDraggedImageId` reset

* Rename `isRemoveZoneVisible`

* Add `CardBody` and remove redundant `setValue`

* Fix card styles

* Remove `getUniqueImages`

* Use url as a key when there is no image id

* Fix `orderedImages`

* Add hover to gallery images

* Fix gallery arrows and set cover problems

* Altering blur handler to prevent toolbar closure on media modal

* Fix toolbar drag and drop

* Add replace fn

* Restoring modal class for blur function

* Fix storybook

* Ensuring onBlur doesn't happen while dragging, resolving issue in Firefox

* Adding expected event object to drag callbacks

* Fix image size

* Fix lint

* Another fix lint

* Update plugins/woocommerce-admin/client/products/sections/images-section.tsx

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Fix `draggedImageId` default value

* Fix toolbar icon style

* Rename consts

* Update pnpm-lock.yaml

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joel <dygerati@gmail.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2022-10-12 15:16:22 -03:00
Sam Seay 55b49cb50a
Fix and consolidate linting across the monorepo (#35012) 2022-10-12 15:05:01 +13:00
Matt Sherman 2605d14b9d
Make DateTimePickerControl debounce handling more robust (#34963) 2022-10-11 17:22:52 -04:00
Matt Sherman 0b70974d43
Fix DateTimePickerControl initial setting of input field (#34980)
* Fix expect checks to actually do something
* Fix default 24 hour format
* Add test for when currentDate is changed
* Fix up tests that were broken (and masked by no assertions)
* Fix initial setting of input
* Export default 12 hour and 24 hour formats
2022-10-11 14:55:08 -04:00
Maikel David Pérez Gómez e95bb3768e
Add new shipping class modal to a shipping class section in product page (#34937)
Add new shippping class modal to a shipping class section in product page
2022-10-11 12:00:35 -03:00
Sam Seay aec442139f
Update pnpm once again to fix issues with auto-install-peers (#35007) 2022-10-10 16:59:51 +13:00
RJ c67a0fbe27
Add Tiktok to OBW grow list (#34953) 2022-10-07 13:50:35 +08:00
louwie17 d756494bcc
Update/experimental select control (#34620)
* Combine last 23 commits into one.

Update css, so dropdown shows correctly

Add extra callbacks and expose some downshift combobox functions

Add changelog

Update stories to reflect new props

Update stories label

Removed `clearOnSelect` prop and reverted some other changes

Fix missed props during rebase

Remove old storybook story and slight fix from rebase

Remove unneeded code

Update default get filtered functionality and add regex escaping

Some updates by testing a new onStateChange callback

Expose the onStateChange callback for more fine control ove the useSelect

Some minor adjustments

Expose stateReducer and minor adjustments from PR review

Simplify logic around isOpen handling with outside component

Remove unused import

Remove onStateChange prop

Address PR feedback

Some minor adjustments to the input handling

Update the way the stateReducer is called

Remove some of the unneeded logic

Remove onStateChange and replace it with onSelectedItemChange and onInputValueChange for simplicity

Fix lint error

* Remove duplicate and unused import

* Fix call to ControlledPropUpdatedSelectedItem in story
2022-10-06 11:40:41 -03:00
Joshua T Flowers 048e04d192
Allow external tags in SelectControl component (#34823)
* Allow external tags in SelectControl component

* Add changelog entry

* Fix up changes after rebase

* Fix up custom item type example
2022-10-05 13:29:30 -07:00
Joshua T Flowers e4f9ccf184
Update text input placement in SelectControl (#34788)
* Move input next to selected items

* Keep input focused on clicking inside combobox

* Add changelog entry

* Handle PR feedback

* Vertically center search icon
2022-10-05 12:08:10 -07:00
Joel Thiessen 77700eb3cc
Adding toolbar to the Image Gallery component (#34871) 2022-10-05 12:07:03 -07:00
louwie17 6af1695f34
Add/34333 attribute list (#34841)
* Add initial attribute list with dragging and removing functionality

* Fix sortable styling and remove the default selected logic

* Fix css formatting

* Add changelogs

* Add missing question mark

* Add tests

* Some minor CSS updates and move some logic to a util function

* Fix lint issues and add extra test
2022-10-05 13:04:20 -03:00
Joshua T Flowers 4ca95b4fd1
Fix initially selected items in SelectControl component (#34794)
* Allow initial selection of items in SelectControl

* Update stories to include initially selected items

* Add changelog entry

* Update combobox single selected item name
2022-10-04 17:03:37 -07:00
RJ c19228da95
Dev: migrate @woocommerce/data reviews to Typescript (#34844) 2022-10-04 19:42:40 +08:00
Matt Sherman 3ea8c22af5
Remove unfinished and unused SplitDropdown component (#34806) 2022-10-03 14:23:57 -04:00
Sam Seay 59e0c80f3c
Update the pnpm constraint to 7.12.2+ now auto-install is fixed. (#34872) 2022-10-03 10:52:42 +13:00
Joshua T Flowers 3fd736c72f
Update plugins installer component to TS, Fix TS bugs and Syncpack TypeScript (#34787) 2022-09-30 10:59:07 +13:00
Maikel David Pérez Gómez 7fe05d65f3
Load size units to show them as a suffix of shipping dimensions fields (#34856)
* Add dimensions to shipping section
Change the FormComponent to support input name with dot notation like dimensions.width
Add the dimension controls to the product form

* Remove custom styles from FormSection component and use Card and CardBody instead

* Add dimension fields formating using the woo number global settings

* Add dimension fields validations

* Solve conflics from rebase

* Add changelogs

* Fix resetForm function to consider the passed params and the initialValues

* Load size units to show it as a suffix of shipping dimensions fields

* Fix card styles according the disign and pass props manually to BaseControl
2022-09-29 14:54:04 -03:00
Matt Sherman 35ede22a3d
DateTimePickerControl updates (#34656)
* Switch DateTimePickerControl to use InputControl instead of DateInput
* Add label, placeholder, help props to DateTimePickerControl
* Clean up DateTimePickerControl storybook stories
* Add additional tests for DateTimePickerControl
* Debounce changes in input for DateTimePickerControl
2022-09-29 11:13:31 -04:00
Matt Sherman b8066f9b31
Add FormContext().setValues() support (#34617)
* Add setValues to FormContext
* Add onChanges callback to handle when multiple values are changed at once
2022-09-27 19:06:53 -04:00
Sam Seay c0fe3ec18f
Fix pnpm version to 7.11.0 in engines and in CI (#34773) 2022-09-27 11:30:52 +13:00
louwie17 c01c48c8c3
Add initial attributes section for empty state (#34751)
* Add new attributes section and attributes field with just an empty state

* ADd changelogs

* Add check to not render the blank section when attributes exist

* Fix misspelling
2022-09-26 14:44:06 -03:00
Maikel David Pérez Gómez 2eda531d46
Add shipping class section and dropdown (#34684)
* Add shipping class section and dropdown

* Add comment suggestions

* Add a Spinner during shipping classes resolution
2022-09-23 09:54:52 -03:00
Joshua T Flowers b65d473796
Add Sortable component accessibility (#34539)
* Add key event handlers

* Track selected item and focus

* Fix selected indexes on up down selection and drop

* Consolidate update item order logic

* Hide horizontal items on drag

* Update naming of ordering persistence

* Announce keyboard events to screen readers

* Consolidate reset method

* Simplify drop index numbers and conditions

* Fix up announcements

* Add tests around new utils

* Fall back for item name in announcement from aria label or alt text

* Update lock file

* Add changelog entry

* Handle PR feedback

* Fix up lock file after rebase

* Update lock file

* Update lock file again

* Update lock file after pnpm7

* Use trunk lock file

* Update lock file with a11y package

* Try new lock file

* Try lock file with pnpm add

* pnpm add from root

* Fix itemToString in SelectControl

* Downgrade a11y to v3.5.0
2022-09-22 12:08:26 -07:00
Matt Sherman ea6a0d31f9
Fix EnrichedLabel Storybook styles (#34736)
Fix EnrichedLabel story to not bleed styles to other stories
2022-09-21 22:03:01 -04:00
Joshua T Flowers f39d8b6b39
Improve experimental select control accessibility (#34510)
* Use downshift built in methods to handle selection of items

* Fix menu styling

* Fix removal a11y announcement

* Don't show menu without results

* Fix async example a11y

* Add changelog entry

* Deselect item in state on remove

* Fix formatting issues

* Update lock file

* Update lock file after pnpm7

* Skip lib check breaking oclif build in package-release

* Rebase again and fix up lock file

* Skip lib check in monorepo-merge

* Fix the lock

* Ignore lint

Co-authored-by: Sam Seay <samueljseay@gmail.com>
Co-authored-by: Jonathan Sadowski <sadowski@automattic.com>
2022-09-20 14:29:27 -07:00
Joel Thiessen 09bfa0b737
Allowing generic item type in new experimental SelectControl (#34547)
Co-authored-by: Joel <joel.thiessen@a8c.com>
2022-09-16 13:35:14 -07:00
Sam Seay 04b74c1053
Upgrade to pnpm 7 (#34661)
* Remove -- -- from scripts that fixed issue in pnpm 6, fix a couple TS issues in sep packages
* Minor fixes to analyzer scripts and doco based on pnpm 7
* Add dompurify types to data package to avoid TS errors
* Remove pnpx in favor of pnpm exec
* Modify the code analyzer to respect pnpm version if present.
* Update instructions for running recursive lint, add comments to explain
2022-09-16 09:21:42 +12:00
RJ 29e70faf0f
fix: handle mobile app wrong user connection for mobile app modal (#34653) 2022-09-15 12:10:05 +08:00
RJ 6e2ada3706
Add: mobile app welcome modal and magic link (#34637) 2022-09-15 11:58:47 +08:00
louwie17 fa2df55f04
Add/crud get total count selector (#34613)
* Add getItemsTotalCount to crud data store

* Add changelog

* Make getTotalItemsCount more generic

* Rename total count resource name function, and add resolver for getTotalCount

* Remove deprecated data-controls function

* Add defaultArgs option for applyNamespace
2022-09-09 11:32:21 -03:00
louwie17 a7127a8456
Revert a condition change on third param in onChange prop (#34626)
* Revert back isValid condition on third param

* Add changelog
2022-09-09 09:57:56 -03:00
louwie17 1b2e9c120d
Fix form onchange callback (#34614)
* Fix onChange method, so it contains the newValues object

* Add changelog

* Update storybook to add onChange values

* Update tests and fix onChange isValidForm callback

* Fix radio control example
2022-09-08 16:24:39 -03:00
Joshua T Flowers 43a24bc6c3
Add image gallery component (#34435)
* Add initial ImageGallery component

* Add changelog entry

* Extract list item component and styles

* Rename SortableList to Sortable

* Add placeholders for dropping items

* Fix drag throttling delays

* Use placeholder component

* Move handles back to sortable

* Add horizontal option to sortable

* Use CSS for placeholder styles

* Remove placeholder component

* Add image gallery styles

* Add last droppable class

* Extract class utils and add tests

* Add list item stories

* Add readmes

* Handle PR feedback
2022-09-06 12:46:32 -07:00
Tomek Wytrębowicz a86e387667
Update/unify jest@27 across all packages (#34322)
* Update `jest-puppeteer@5.0.4` (from `4.4.0`)

to be albe to run with jest 28.

* Update `jest` and `ts-jest@^27` (from `25`),

to match `e2e-environment` needs.

* Update api-core-tests' `jest@^27` (from `25`),

to unify the used version across the stack.

* Update e2e-env's `jest@^27` & co.  (from `25`),

to unify the used version across the stack.

* Update e2e-env's `@jest/test-sequencer@^27`  (from `25`),

to unify the used version across the stack.

* Update admin-e2e-tests' `@jest/globals@^27`  (from `26`),

to unify the used version across the stack.

* Update woocommerce's `jest@^27.5.1`  (from `25`),

to unify the used version across the stack.

* Replace `mocked` from `ts-jest` to the one from `jest`,

Update `@types/jest@27.4.1` from `27.0.2`.
Try to fix broken tsc build.

* Update `e2e-core-tests`' `@jest/globals@^27.5.1`

from `^26.4.2`.

* Remove changelog entry for bumpin jest in `api-core-tests`

It was already covered in `trunk`.

Addresses https://github.com/woocommerce/woocommerce/pull/34322#discussion_r956019567

* Updated package-lock.yaml

* Updated timeout

* Added changelogs

Co-authored-by: jamelreid <jnoelreid@gmail.com>
2022-09-06 09:29:45 -05:00
Matt Sherman b7606083e1
Update DateTimePickerControl's onChange signature (TypeScript) (#34561)
* Omit HTML onChange evnt from DateTimePickerControl

* Changelog entry for DateTimePickerControl's onChange change.
2022-09-02 15:46:27 -04:00
Fernando Marichal 30151a6cf7
Add `recordEvent` validation to Tracks package (#34005)
* Add `recordEvent` validation

# Conflicts:
#	packages/js/tracks/package.json

* Convert tests to ts

* fix error message

* Add console.error message

* Fix `validateEventNameAndProperties`

* Add changelog

* Add validation method

* Fix tests

* Fix package

* Move changelog

* Add changelog

* Fix type

* Move env definition

* Fix tests

* Fix condition

* Fix regex and tests

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2022-09-01 13:34:42 -03:00
Chi-Hsuan Huang e687a48abf
Update dependencies and jest config to pass admin tests for pnpm 7 (#34428)
* Update @wordpress/data version to ^6.15.0

* Update jest.config.js to transform is-plain-obj js

* Update pnpm-lock.yaml

* Add changelog

* Add babel configs and update jest config

* Update tsconfig.json to exclude babel.config.js

* Add missing @types packages

* Add changelog

* Update pnpm-lock.yaml

* Update pnpm-lock.yaml

* Fix DateTimePickerControl type errors
2022-08-31 12:06:51 +08:00
Joshua T Flowers dc4a2ba741
Update tag component styling (#34457)
* Update tag to new style

* Add changelog entry
2022-08-30 07:45:50 -07:00
Fernando 33405283cd
Add Pricing section (#34382)
* Add pricing inputs

# Conflicts:
#	plugins/woocommerce-admin/client/products/add-product-page.tsx
#	plugins/woocommerce-admin/client/products/layout/product-section-layout.scss
#	plugins/woocommerce-admin/client/products/sections/product-details-section.tsx

* Add pricing inputs

* Add validation

* Fix scss

* Moved validations

* Add tests

* Add regex validations

* Add tax settings

* Fix comment

* Add product name validation

* Fix validation copy

* Rename `woocommerce-add` classes

* Fix texts i18n

* Remove image section

* Fix decimal separator error

* Add `FormSection` component

* Fix `Enriched-label` component

* Add packages changelog

* Removed not used styles

* Add error handling

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2022-08-30 10:26:24 -03:00
Chi-Hsuan Huang f813153ac5
Fix country field is empty when navigating back to the store details tab (#34484)
* Add is_store_country_set to onboarding profile items

* Fix country field is empty when navigating back to store details tab

* Add changelog
2022-08-30 09:43:59 +08:00
Chi-Hsuan Huang 72d8c791e6
Migrate @woocommerce/data notes store to TS (#34220)
* Migrate wc.data.notes to TS

* Add missing field "is_read" to notes item schema

* Add changelog

* Fix test_get_notes_schema test
2022-08-30 09:42:32 +08:00
Tomek Wytrębowicz eeb090ddf8
Update `jest-puppeteer@5.0.4` (from `4.4.0`) (#33827)
to be albe to run with jest 28.
2022-08-29 12:22:30 -06:00
Tomek Wytrębowicz ea8b44115b
chore: Unify imports syntax in admin-e2e, add missing dependencies (#33901)
* Unify test spec helpers `export` syntax to ESM,

to make it possible to impor them locally.

* Unify import syntax to ESM

* Install missing dependencies of admin-e2e-tests

* Do not import `expect` from `@jest/globals` in admin-e2e-tests

Let typescript pick the puppeteer extension from global.
Address https://github.com/woocommerce/woocommerce/pull/33901#issuecomment-1221650234

* Map unknown types in `admin-e2e-tests` to make tsc happy.

* Add changelog entry

* Use the angle-bracket syntax instead of type assertions

Address https://github.com/woocommerce/woocommerce/pull/33901#discussion_r955591953

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

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2022-08-29 10:36:36 +08:00
jonathansadowski 74f8d5f17a
Use syncpack to verify consistent versions for react and react-dom (#34397)
* Add GitHub action and pre-push hook for syncpack for react and react-dom

* Fix typo in pre-push script

* Don't execute suggested command to fix mismatches automatically.

* Update react and react-dom to 17.0.2

* Move changelog check to last, so that pre-push still fails if check isn't successful

* Add changelog files

* Correct issue with syncpack.yml referencing an internal action

* Add command to top-level package.json for fixing mismatches

* Update syncpack action to only run when package.json files are affected

* Update workflow to just run syncpack list-mismatches

* Add version pinning to syncpackrc
2022-08-24 10:15:22 -05:00
Joel Thiessen 668244b2d7
Adding DateTimePicker component (#34293)
* Rudimentary functional version of datetimepicker

* Adding changelog

* Adding package changelog

* Making component more than barely functional

* Removing unnecessary export

* Rename directory to date-time-picker

* Add initial story

* Pass datetime to onChange callback

* Localize error string

* Remove initial error prop

* Rename currentDate to initialDate

* Simplify state for selected date

* Add extra stories around component

* Trigger onChange whenever date is changed

* Add readme

* Allow currentDate to be changed via props

* Update readme

* Update name to DateTimePickerControl

Co-authored-by: Joshua Flowers <joshuatf@gmail.com>
2022-08-23 15:19:46 -07:00
louwie17 78c28ae9f3
Add product link field (#34313)
* Add initial product field and modal for editing product link

* Create a product link modal for editing product link

* Only show permalink when product is published

* Add changelogs

* Add changelog for data package

* Change save button to primary

* Fix merge conflcts

* Add getPermalinkParts selector to products store

* Made use of getPermalinkParts to support draft products
2022-08-19 12:05:13 -03:00
Joshua T Flowers e73ffbe088
Add FormSection component (#34348)
* Add FormSection component

* Add changelog entry

* Move card styling outside component

* Add readme

* Allow JSX elements for title and description

* Fix lint errors
2022-08-18 10:36:43 -07:00