use wc-admin urls in devdocs #2827
Conversation
client/devdocs/index.js
Outdated
@@ -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 }` }> |
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.
What changed in getAdminLink()
to make it unsuitable for this usage?
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.
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.
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.
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.
Oh, it looks like the <Link>
component internally calls getAdminLink()
. 👍
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.
Looks good. Optionally explicitly pass the type="wc-admin"
to the <Link>
component, but this can be 🚢ed as is.
@jeffstieler thanks for the suggestion. I added these in 0065615 . |
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:
Changelog Note:
Fix: Bug navigating from DevDoc component pages to WP dashboard pages.