Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update product editor package #36830

Merged
merged 9 commits into from Feb 24, 2023
Merged

Conversation

louwie17
Copy link
Contributor

@louwie17 louwie17 commented Feb 14, 2023

All Submissions:

Changes proposed in this Pull Request:

This PR copies over the Slot fill components for the product screen from the @woocommerce/components package to the @woocommerce/product-editor package. I have added deprecated messages to them within the components package.

Closes #36355 .

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

  1. Build this branch and go to Products > Add New with the new product management feature enabled
  2. Open your console and make sure there are no deprecated warnings showing and everything still works as expected.
  3. Check the above also in the variations view (Options > edit)
  4. Create a JS file from this gist and import it. Go to the new Test tab and make sure the deprecated warning shows up, but things still render correctly.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@github-actions github-actions bot added focus: react admin package: @woocommerce/components issues related to @woocommerce/components labels Feb 14, 2023
@louwie17 louwie17 force-pushed the update/36355_product_editor_package branch from 7856f32 to e130902 Compare February 14, 2023 12:18
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 14, 2023
@louwie17 louwie17 marked this pull request as ready for review February 14, 2023 12:24
@louwie17 louwie17 requested a review from a team February 14, 2023 12:25
@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Merging #36830 (ccc3282) into trunk (f9f6e68) will increase coverage by 0.0%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             trunk   #36830   +/-   ##
========================================
  Coverage     46.7%    46.7%           
  Complexity   17178    17178           
========================================
  Files          429      429           
  Lines        64779    64779           
========================================
+ Hits         30240    30241    +1     
+ Misses       34539    34538    -1     
Impacted Files Coverage Δ
plugins/woocommerce/includes/class-wc-tax.php 78.8% <0.0%> (+0.2%) ⬆️

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2023

Test Results Summary

Commit SHA: ccc3282

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 50s
E2E Tests189006019512m 17s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.


| Prop | Type | Description |
| -------------| -------- | ------------------------------------------------------------------------------------------------------------------------ |
| `id` | String | A unique string to identify your fill. Used for configuiration management. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to fix this typo


### WooProductFieldItem.Slot (slot)

This is the slot component, and will not be used as frequently. It must also receive the required `location` prop that will be identical to the fill `location`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include context as to why it will not be used as frequently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I am not why I added that part, let me update this and the other two places as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you forgot to update this one


### WooProductSectionItem.Slot (slot)

This is the slot component, and will not be used as frequently. It must also receive the required `location` prop that will be identical to the fill `location`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments here are the above as it's copied

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to update here as well


### WooProductTabItem.Slot (slot)

This is the slot component, and will not be used as frequently. It must also receive the required `location` prop that will be identical to the fill `location`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to update here as well

{ ( fillProps: Fill.Props ) => {
return createOrderedChildren<
Fill.Props & { tabName: string }
>( children, tabOrder || 20, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it falls within the scope of this PR, if not, please disregard it, but how about moving 20 and other numbers to a constant?

{ ( fillProps: Fill.Props ) => {
return createOrderedChildren< Fill.Props >(
children,
templateData.order || 20,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot the constant here

@louwie17 louwie17 force-pushed the update/36355_product_editor_package branch from e130902 to af16af1 Compare February 17, 2023 12:19
@louwie17
Copy link
Contributor Author

@nathanss thanks for taking a detailed look at the README's 👍 there were a couple other discrepancies that I also fixed, all as part of this commit: af16af1

This should be ready for a re-review whenever you have some time.


### WooProductFieldItem.Slot (slot)

This is the slot component, and will not be used as frequently. It must also receive the required `location` prop that will be identical to the fill `location`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you forgot to update this one


| Prop | Type | Description |
| -------------| -------- | ------------------------------------------------------------------------------------------------------------------------ |
| `id` | String | A unique string to identify your fill. Used for configuiration management. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to fix this typo


### WooProductSectionItem.Slot (slot)

This is the slot component, and will not be used as frequently. It must also receive the required `location` prop that will be identical to the fill `location`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to update here as well


### WooProductTabItem.Slot (slot)

This is the slot component, and will not be used as frequently. It must also receive the required `location` prop that will be identical to the fill `location`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to update here as well

{ ( fillProps: Fill.Props ) => {
return createOrderedChildren< Fill.Props >(
children,
templateData.order || 20,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot the constant here

@louwie17 louwie17 force-pushed the update/36355_product_editor_package branch from af16af1 to 4da0d1f Compare February 23, 2023 18:40
nathanss
nathanss previously approved these changes Feb 23, 2023
@louwie17
Copy link
Contributor Author

Thanks for the second review @nathanss, looks like I made all your previously suggested changes in the components package but forgot to do it in the product-editor package 🤦

@louwie17 louwie17 force-pushed the update/36355_product_editor_package branch from 9d0f22f to 034add7 Compare February 24, 2023 08:27
@louwie17 louwie17 merged commit aec4dfd into trunk Feb 24, 2023
@louwie17 louwie17 deleted the update/36355_product_editor_package branch February 24, 2023 13:37
@github-actions github-actions bot added this to the 7.6.0 milestone Feb 24, 2023
rodelgc added a commit that referenced this pull request Feb 25, 2023
* Add an encoding selector to the product importer

* Add changelog file

* Don't assume the character encoding parameter is present

* Add woocommerce_attributes_saved trigger. Closes #35004.

* Fix create wc extension script (#36917)

* Run create-extension for create-wc-extension script

* Add changelog

---------

Co-authored-by: Sam Seay <samueljseay@gmail.com>

* Update product editor package (#36830)

* Add missing dev packages to product-editor package

* Create components folder for organization

* Move product field, section and tab slots over to product-editor package

* Move use of product slot fills to product-editor package

* Sync dependencies

* Add changelogs

* Update README's and add constant for default values

* Update README's in product-editor package

* Change SORT_STRING to SORT_NATURAL for the encodings list

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Add changelog

* Add custom rendering logic to the item label (#36476)

* Add type definitions

* Add custom rendering logic to the item label

* Add stories

* Add changelog file

* Fix rebase merge issue

* Fix up stories after rebase

---------

Co-authored-by: Matt Sherman <matt@jam123.com>

* Fix k6 incorrect step

* Fix k6 test env setup

---------

Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
Co-authored-by: helgatheviking <507025+helgatheviking@users.noreply.github.com>
Co-authored-by: louwie17 <lourensschep@gmail.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
Co-authored-by: Maikel David Pérez Gómez <mdperez86@gmail.com>
Co-authored-by: Matt Sherman <matt@jam123.com>
rodelgc added a commit that referenced this pull request Feb 27, 2023
* Add an encoding selector to the product importer

* Add changelog file

* Don't assume the character encoding parameter is present

* Add woocommerce_attributes_saved trigger. Closes #35004.

* Fix create wc extension script (#36917)

* Run create-extension for create-wc-extension script

* Add changelog

---------

Co-authored-by: Sam Seay <samueljseay@gmail.com>

* Update product editor package (#36830)

* Add missing dev packages to product-editor package

* Create components folder for organization

* Move product field, section and tab slots over to product-editor package

* Move use of product slot fills to product-editor package

* Sync dependencies

* Add changelogs

* Update README's and add constant for default values

* Update README's in product-editor package

* Change SORT_STRING to SORT_NATURAL for the encodings list

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Add changelog

* Add custom rendering logic to the item label (#36476)

* Add type definitions

* Add custom rendering logic to the item label

* Add stories

* Add changelog file

* Fix rebase merge issue

* Fix up stories after rebase

---------

Co-authored-by: Matt Sherman <matt@jam123.com>

* Enable "Smoke test release" workflow (#36598)

* First pass at updating release test workflow

* Add changelog

* Set dir env variables

* Update to workflow

* Fix indent

* Fix indent

* Clean up indent

* Re-order steps

* Change order of jobs

* Added common php versions

* Update pipeline

* Update some labels

* Simplify for testing

* Update paths

* Create tmp folder

* Fix path

* Paths

* Try outputting some debugging

* Add step ID back

* Remove working directory

* Another path tweak

* Add API release tests

* Add k6 tests

* Add PHP tests

* Launch wp-env during PHP tests

* Try default values

* Tweak some settings, add WP testing

* Tweak some settings

* Re-order e2e steps

* Update step descriptions

* Reorganize tests, add plugin tests

* Enable only e2e job

* Initial set up to run against release smoke test site

* Fix syntax

* Temporarily disable update wc spec

* Temporarily disable downloading woocommerce zip

* Download release zip using tag name

* Fix wrong job name

* Fix wrong job name

* Fix dir

* Delete fetch-asset-id.js

* REfactor update-woocommerce spec

* Add error handling

* Download release zip by tag

* Refactor update woo spec to download zip by tag

* Correct job name

* fail test on invalid tag

* Enable all e2e tests

* Run api tests before e2e tests

* Fix job dependency

* Add customer credentials to api job

* Separate job for WC Update

* Combine e2e allure-results, then report

* Enable report job

* Fix context

* Change job and artifact names

* Use test s3 path

* Minor job name change

* Upload artifacts to bucket

* Correct s3 path

* Add quiet option

* Retain video on failures

* Finalize s3 path

* Try WP latest-1

* Revert to wp latest

* Refine search for woocommerce zip asset

* Get created-at

* Specify repo in gh command

* Slugify env description

* Trim space

* Sync with bucket instead of copy

* Remove invalid --recursive flag

* Re-add missing step to combine e2e results from update wc test

* Ensure artifact upload on test failure

* Enable all e2e tests on WP latest

* Retain existing data before updating WC

* Make test compatible with 'Canceled' and 'Cancelled'

* Set env_desc as env var

* Re-add deleted file

* Fix UPDATE_WC in daily smoke test workflow

* Add tracing in global setup

* Remove tracing

* Temporarily run only basic spec

* Job for WP Latest-1 & 2

* Fix "Required input 'created_at' not provided"

* Minor rename

* Remove install filter

* Install deps in get-wp-matrix

* Delete get-wp-versions.js

* Add get-wp-versions.js to e2e-pw folder

* REname file

* REfactor

* Refactor script for getting WP prev versions

* Update job dependencies

* Temporarily remove disabled jobs

* Allow e2e-wp-latest after api test failure

* Update L-1 & L-2 job deps

* Fix report-wp-latest

* Fix failing api test

* Make get-wp-versions quicker

* Publish report immediately after test

* Test reporting in e2e-update-wc

* Fix missing parameter

* Fix env_desc, re-enable other jobs

* Enable all e2e tests

* Minor job name change

* Fix flaky test

* Add php version testing

* stringify php versions

* Re-enable all e2e tests

* Up timeout to 2min

* Remove PHP 8.0

* Add missing conditionals

* Fix php version verification script

* Fix starting dir

* Fix flakiness

* Skip e2e if api failed

* Verify woocommerce.zip early

* Add token

* Delete test summary on github for the meantime

* Use default playwright config

* More meaningful variable names

* Update step titles based on review

* Use expect.poll()

* Minor spacing corrections

* Use `stable-check` endpoint, delete unnecessary loop

* Update locators to be JN-compatible

* Fix erroneous getting of release tag

* Fix conflict of "No thanks" button locator with that of WP Mail Logging's

* Update github-script action to v6

* Revert to 'Cancelled'

* Remove unnecessary step

* Provide missing env variables

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>

* Rename workflow file

---------

Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
Co-authored-by: helgatheviking <507025+helgatheviking@users.noreply.github.com>
Co-authored-by: louwie17 <lourensschep@gmail.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
Co-authored-by: Maikel David Pérez Gómez <mdperez86@gmail.com>
Co-authored-by: Matt Sherman <matt@jam123.com>
Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
samueljseay pushed a commit that referenced this pull request Feb 28, 2023
* Add missing dev packages to product-editor package

* Create components folder for organization

* Move product field, section and tab slots over to product-editor package

* Move use of product slot fills to product-editor package

* Sync dependencies

* Add changelogs

* Update README's and add constant for default values

* Update README's in product-editor package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: @woocommerce/components issues related to @woocommerce/components plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Product Extensibility] Create package for storing components needed for extending the product editor
2 participants