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

Unify Coming Soon admin site status badge with WooCommerce's #41

Merged
merged 16 commits into from
Nov 11, 2024

Conversation

wpalani
Copy link
Member

@wpalani wpalani commented Nov 8, 2024

Proposed changes

Recently WooCommerce added their own coming soon functionality and part of it is an admin bar site status badge. So now when Woo is active the site will have 2 site status badges in the admin bar that can be out of sync and confusing.

CleanShot 2024-10-21 at 15 52 41@2x

This PR aims to solve that by addressing: P8-50

  • Move our badge to the left side and match Woo's style.
  • New WooCommerceOptionsSync class to unify the options values in the DB.
  • When Woo is active, we'll completely remove our badge and display Woo's instead.
  • Update the JS toggle function to reflect the new location/style of the badge and make it work with Woo's as well.
  • For our badge: When the user publishes their site (disable coming soon), the badge will show "Live" for only 10 mins then we'll hide it.
  • Woo is also adding a site preview notice when the site is not live, so when Woo is active we'll disable our site preview warning In favor of theirs.
  • Update tests to reflect new location/functionality.
  • Extract the admin bar and site preview to their own class to clean up the module a little bit.
  • Obviously, tying our site status badge to Woo's can be tricky if they update theirs at some point, so we have a new test coming-soon-woo.cy.js that checks theirs for simple things like structure, location and content.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Video

The video showcases the new admin badge with Woo inactive and then active, as well as the site preview warning.
https://github.com/user-attachments/assets/85f2808b-af93-454f-be69-10f48293f6a1

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

https://jira.newfold.com/browse/PRESS8-50

@wpalani
Copy link
Member Author

wpalani commented Nov 9, 2024

Module tests are passing: https://github.com/newfold-labs/wp-module-coming-soon/actions/runs/11753678396/job/32746822585?pr=41#step:31:117

The failing tests are in the Onboarding, pretty sure they're not related to this PR.

@wpalani wpalani merged commit 1d3bf3a into main Nov 11, 2024
2 of 6 checks passed
@wpalani wpalani deleted the add/sync-woo-options branch November 11, 2024 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants