Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

use wc-admin urls in devdocs #2827

Merged
merged 2 commits into from Aug 22, 2019
Merged

use wc-admin urls in devdocs #2827

merged 2 commits into from Aug 22, 2019

Conversation

rrennick
Copy link
Collaborator

Fixes #2813

This PR changes the URLs used in the DevDocs page to use wc-admin URLs instead of fully qualified dashboard URLs.

Detailed test instructions:

  • Ensure navigation among regular dashboard pages, WC Admin, DevDocs main & component pages works without issue.

Changelog Note:

Fix: Bug navigating from DevDoc component pages to WP dashboard pages.

@rrennick rrennick added [Status] Needs Review type: documentation This issue is a request for better documentation. labels Aug 21, 2019
@rrennick rrennick requested a review from a team August 21, 2019 21:22
@rrennick rrennick added this to In Progress PRs (for automation purposes) in Isotope via automation Aug 21, 2019
@@ -63,15 +62,13 @@ export default class extends Component {
component ? (
componentName
) : (
<Link href={ getAdminLink( `?page=wc-admin&path=/devdocs/${ filePath }` ) }>
<Link href={ `admin.php?page=wc-admin&path=/devdocs/${ filePath }` }>
Copy link
Contributor

Choose a reason for hiding this comment

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

What changed in getAdminLink() to make it unsuitable for this usage?

Copy link
Collaborator Author

@rrennick rrennick Aug 22, 2019

Choose a reason for hiding this comment

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

In the <Link /> component an onClick handler is added if the link type is wc-admin. When the link is clicked it appends the link href to the end of the base wc-admin URL. By using the getAdminLink() function the onClick is using full URI.

The alternative change that would work is changing the link type in the getAdminLink() call.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, it looks like the <Link> component internally calls getAdminLink(). 👍

Copy link
Contributor

@jeffstieler jeffstieler left a comment

Choose a reason for hiding this comment

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

Looks good. Optionally explicitly pass the type="wc-admin" to the <Link> component, but this can be 🚢ed as is.

@rrennick
Copy link
Collaborator Author

Optionally explicitly pass the type="wc-admin" to the component

@jeffstieler thanks for the suggestion. I added these in 0065615 .

@rrennick rrennick merged commit ed07b2b into master Aug 22, 2019
Isotope automation moved this from In Progress PRs (for automation purposes) to Done Sprint 23 (August 13 - August 26) Aug 22, 2019
@rrennick rrennick deleted the fix/2813 branch August 22, 2019 17:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: documentation This issue is a request for better documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single DevDoc page breaks address bar URL
3 participants