Commit Graph

14 Commits

Author SHA1 Message Date
Maikel David Pérez Gómez 3ded2b46e9
Create editor skeleton on add/edit product pages (#37023)
* Add required dependencies

* Create the block editor component

* Create the header component

* Create the sidebar component

* Create the editor component

* Remove comments

* Export the block editor from its package

* Enqueue wp-edit-site

* Create the new block mode product page

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

* Add temporal layout styles

* Fix rebasing conflicts

* Fix linter errors

* Redirect to the new product-editor page when edit

* Add changelog files

* Fixing dependencies conflicts and ignoring some non running test

* Add comment suggestions

* Fix conflicts after rebasing

* Add comment suggestions
2023-03-08 05:51:59 -04:00
Maikel David Pérez Gómez 1ab678c13f
Include tax options in pricing section (#36299)
* Add Charge sales tax on sub section to pricing section when enable taxes is set to yes

* Add tax classes datastore

* Load tax classes in pricing section

* Set empty value when tax class is standard rate

* Add changelog files

* Add custom resolver to use slug as id for tax classes

* Add helper text and learn more link to tax class radio group
2023-01-06 09:41:45 -03:00
Maikel David Pérez Gómez 3857b51f30
Fix price field currency symbol position (#35718)
* Currency symbol is fixed on the left side of the price input field

* Currency symbol has a different color from the input field value (Gutenberg-700)

* Input value is aligned right

* On focus, we highlight the field's content so the user can quickly clear or overwrite the placeholder text

* On focus, the user can press the up and down arrow keys to increase or decrease the value by 1

* Add changelog

* Remove unnecesary stepUp function
2022-11-25 11:48:18 -03:00
Fernando Marichal 28f5616973
Fix the gap in the featured product checkbox (#35710)
* Fix style

* Add changelog

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2022-11-24 12:15:15 -03:00
Nathan Silveira 6d4c1b3b8a
Adapt the width of the pricing fields (#35545)
* Add css class to change the input width based on the screen's width

* Changelog

* Move class from pricing-section.scss to product-page.scss and use breakpoint 960px mixin

* Move className from currencyInputProps to InputControl

* Improve changelog

* Move 'half-width-field' class to currencyInputProps instead of adding it manually for the two currency fields

* Add 'half-width-field' class to SKU and Shipping Class

Sent as a parameter to getInputProps and getSelectControlProps to avoid overwriting any additional className

* Update changelog
2022-11-18 13:03:10 -03:00
Matt Sherman 5b06618a6f
Add scheduled sale fields (#34538)
* Add scheduled sale fields to product form
* Close DateTimePickerControl's dropdown when blurring from input.
* Log when onChange is called for Controlled stories
* Handle when input changes occur but the end date is the same
* Fix DateTimePickerControl usage when uncontrolled
* Fix handling when blur happens before debounced onChange
2022-11-14 21:03:13 +00:00
Joshua T Flowers 2aa4ce0d9f
Disable product inventory toggle when inventory management is disabled (#35059)
* Disable product inventory toggle when inventory management is disabled

* Export conditional wrapper as experimental component

* Conditionally show the tooltip

* Add comment explaining the tooltip overlay

* Add components changelog entry

* Display tooltip on hover any portion of toggle or label

* Add changelog entry

* Fix scss lint error

* Center tooltip over label and toggle

* Fix up input props after rebase

* Add wrapper around field to maintain block item formatting
2022-10-24 09:08:27 -07:00
Joshua T Flowers 28f8e7f996
Enhance getInputProps to allow passing of non-overridden props (#35034)
* Allow additional props to be passed to the Form getInputProps method

* Remove getTextControlProps

* Pass additional shared props through getInputProps in shipping

* Simplify checkbox props

* Unwrap currency props

* Use onBlur event to sanitize prices

* Add changelog entry

* Add option to get checkbox props to form context helpers

* Update checkbox tracks handler naming and typing

* Fix up usage of getInputProps

* Add helper sanitize method

* Use sanitize helper method for product input fields

* Fix inventory input props after rebase

* Fix shipping typo

* Fix up form types after rebase

* Align all checkboxes on product page

* Rename new checkbox helper to getCheckboxControlProps

* Add helper method to get select control props

* Add data changelog entry

* Check for product name length on blur

* Add initial value for name to prevent uncontrolled value

* Add initial value for sku
2022-10-21 07:03:49 -07:00
Joshua T Flowers c72e00d85c
Add Tooltip component and remove EnrichedLabel (#35024)
* Add experimental tooltip component

* Add tooltip stories

* Update EnrichedLabel component

* Remove EnrichedLabel

* Add changelog entries

* Fix up linting issues

* Handle PR feedback
2022-10-18 16:08:49 -07:00
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
Fernando Marichal dadb1d6a87
Price section - Small refactor and style fix (#34558)
* Fix modal

* Add method sanitizePrice to `useProductHelper`

# Conflicts:
#	plugins/woocommerce-admin/client/products/sections/pricing-section.tsx

# Conflicts:
#	plugins/woocommerce-admin/client/products/sections/pricing-section.tsx

* Add changelog

* Add sales validation

* Add sale price validation

* Fix regularPriceProps

* Set list price when it's empty

* Fix Sale price validation

* Check empty regular_price

* Small refactor to use-product-helper

* Remove method `maybeSetRegularPrice`

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2022-09-15 10:56:33 -03: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
Fernando 4693e251f7
Add product name and checkboxes for Product details (#34214)
* Add product details

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

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

* Rename folder

* Fix help icon

* Fix form

* Removed useless `useState`

* Add `getCheckboxProps`

* Add params to getCheckboxProps

* Add recordEvent

* Rename event

* Add changelog

* Fix texts

* Remove Fragment

* Fix useState initial state

* Convert EnrichedLabel to TS

* Fix unknown value prop

* Rename event

* Move EnrichedLabel

* Fix js warning

* Add storybook

* Add readme

* Add components changelog

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2022-08-12 10:47:54 -03:00
louwie17 a498cc8280
Add product form buttons and specific product edit page (#34211)
* Add initial product form action buttons to form

* Add new edit page and allow for updating and creating products

* Move crud functions to helper hook to keep things seperated better

* Add changelog

* ADd package changelogs

* Add isPending selector to products store

* Fix trash screen showing up when deleting product and add loading indicators

* Add extra types to Product type

* Update track names and add product data to tracks

* Update track logic when product is published

* Remove the Image section for now, to prevent confusion as it is not ready yet

* Add tests for the product form actions

* Update copy for publish & duplicate

* Remove unused code

* Set window.location correctly with href

* Reset changes in pnpm lock

* Moved pending action variables to product helper and updated buttons to reflect new suggestions

* Fix backwards compabitibility issue with Form changes

* Add switch to draft button
2022-08-11 11:04:14 -03:00