-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add Preview store button to Home screen #32739
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
Conversation
louwie17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@octaedro the styling for this PR looks great, just the store link wasn't working for me. I left a comment on the line that calls window.open with some more context.
| icon: <Icon icon={ external } />, | ||
| visible: isHomescreen(), | ||
| onClick: () => { | ||
| window.open( getSetting( 'siteUrl' ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mine redirects to /wp-admin/false, because getSetting returns false.
I believe you want to make use of getAdminSetting or do getSetting('admin').siteUrl.
But instead of siteUrl I think you want to use shopUrl? given siteUrl just goes to the home page of the site, not the store.
shopUrl is the same url that is used when hovering over WooCommerce <site name> in the top left and clicking Visit store.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! I fixed the link in commit 93b9c48
| render( <ActivityPanel query={ { page: 'wc-admin' } } /> ); | ||
|
|
||
| expect( screen.getByText( 'Preview store' ) ).toBeDefined(); | ||
| } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding a test for this :)
|
Thank you @louwie17 for your review. |
louwie17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 Thanks for the fix, this tested well!
|
Hi @octaedro, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
All Submissions:
Changes proposed in this Pull Request:
This PR adds a
Preview storebutton to the Home screen.Closes #32156.
Acceptance Criteria:
Preview storebutton is visible on the Home screenHow to test the changes in this Pull Request:
Preview storebutton is visible in the Activity panel.Other information:
pnpm nx affected --target=changelog?FOR PR REVIEWER ONLY: