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

Request attributes conditionally #47361

Merged
merged 10 commits into from May 13, 2024
Merged

Conversation

octaedro
Copy link
Contributor

@octaedro octaedro commented May 10, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR adds the changes to request the available attributes conditionally when they will be used under the Variations tab.

Before

attr-Screenshot 2024-05-10 at 10 14 35 AM

After

attr-2Screenshot 2024-05-10 at 11 30 02 AM

Closes #47357.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Make sure the New product is enabled under /wp-admin/admin.php?page=wc-settings&tab=advanced&section=features.
  2. Checkout this branch and build the project.
  3. Open the browser's devTools and go to the Network tab.
  4. Edit a variable product
  5. Refresh the page and verify that we don't request the available attributes (terms?attribute_id=) when the component is not visible.
  6. Go to the Variations tab and verify the request was made.
  7. Go to the Organization tab and Add a new attribute. Remember that the REST API request is only made under the Variations tab.
  8. The new attribute should be visible in the Attributes section.
  9. Save the product.
  10. Verify everything looks correct after reloading the product.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@octaedro octaedro self-assigned this May 10, 2024
Copy link
Contributor

github-actions bot commented May 10, 2024

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

@octaedro octaedro marked this pull request as ready for review May 10, 2024 16:16
@octaedro octaedro requested a review from a team May 10, 2024 16:17
@octaedro octaedro added focus: new product ux revamped product management experience team: Mothra labels May 10, 2024
Copy link
Contributor

github-actions bot commented May 10, 2024

Hi @mdperez86,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

Hey @octaedro nice job here. I left one comment.

@octaedro
Copy link
Contributor Author

Thank you @mdperez86, for reviewing this. I just added your suggestion.
Could you take another look at this PR?

@octaedro octaedro requested a review from mdperez86 May 10, 2024 18:58
Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

I left one comment on this @octaedro I think we need to prevent the other /terms request from the Organization tab

@octaedro octaedro requested a review from mdperez86 May 13, 2024 14:42
Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

Since the AttributeContainer no longer has any logic and is not reused elsewhere apart form the attributes block. I think is better to remove it.

@octaedro octaedro requested a review from mdperez86 May 13, 2024 16:13
Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

LGTM @octaedro nice job!!

@octaedro octaedro merged commit b3e76c4 into trunk May 13, 2024
27 checks passed
@octaedro octaedro deleted the dev/47357_request_terms_conditionally branch May 13, 2024 17:00
@github-actions github-actions bot added this to the 9.0.0 milestone May 13, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label May 13, 2024
@rodelgc rodelgc added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: new product ux revamped product management experience needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris team: Mothra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REST API request]: Attributes are being requested when loading product editor
3 participants