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

Fetch & display marketplace promotions #44840

Merged
merged 9 commits into from Feb 21, 2024

Conversation

corsonr
Copy link
Member

@corsonr corsonr commented Feb 21, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

Related: https://github.com/Automattic/woocommerce.com/issues/19573
Related: #44655

We want to display the promos fetched from #44655 within the WC Admin UI. That's what this PR addresses.

  • introduces the <Promotions> component which aims to get the promos from the local cache (wc_addons_marketplace_promotions) but provides a fallback to call the endpoint
  • localizes promos within the WC_marketplace_promotions variable to make it accessible by the component
  • updates the <Content> component to load the promos

Promos are

  • pages, patch and tab restricted
  • localized
  • can have various formats (Notice being the one we use here)

How to test the changes in this Pull Request:

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

  1. Checkout this branch locally
  2. run nvm use
  3. run cd plugins/woocommerce
  4. run pnpm -- wp-env start
  5. run pnpm --filter='@woocommerce/plugin-woocommerce' build
  6. Visit http://localhost:8888/wp-admin/admin.php?page=wc-admin&path=%2Fextensions
  7. confirm you see one single notice, in English (the endpoint doesn't provide localized content yet)
image

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

@corsonr corsonr self-assigned this Feb 21, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 21, 2024
Copy link
Contributor

Hi @andfinally,

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

github-actions bot commented Feb 21, 2024

Test Results Summary

Commit SHA: 223d945

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests700027403448m 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.

@corsonr corsonr marked this pull request as ready for review February 21, 2024 13:03
Copy link
Contributor

@andfinally andfinally left a comment

Choose a reason for hiding this comment

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

Everything looks great, thanks for the changes! 💯

@andfinally andfinally enabled auto-merge (squash) February 21, 2024 16:08
@andfinally andfinally merged commit 20b3d51 into trunk Feb 21, 2024
36 checks passed
@andfinally andfinally deleted the add/marketplace-promotions-display branch February 21, 2024 16:09
@github-actions github-actions bot added this to the 8.7.0 milestone Feb 21, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 21, 2024
@nigeljamesstevenson nigeljamesstevenson 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 Feb 22, 2024
Konamiman pushed a commit that referenced this pull request Feb 22, 2024
* Fetch & display marketplace promotions

* add changelog entry

* Pass promos via inline JS, demove unused JS file, rely on transient only

* Return early if not on expected page

* Compare dates in UTC

* remove unused global userLocale

* Small tweaks.

* TypeScript linter errors.

* fix TS lint

---------

Co-authored-by: Remi Corson <1649788+corsonr@users.noreply.github.com>
Co-authored-by: And Finally <andfinally@users.noreply.github.com>
@andfinally andfinally mentioned this pull request Feb 22, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants