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

fix: Flow URLs should re-compute on re-render of Sidebar #3692

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Sep 17, 2024

What's the problem?

  • Bug introduced in refactor: Split up Sidebar child components #3668
  • URLs are not being re-generated when the route changes
  • This is because by defining urls outside of the lifecycle scope of a component, this is never re-generated
  • To recreate -
    • Navigate to a flow in the Editor, checkout icon hrefs in Sidebar
    • Navigate to another flow
    • Icon hrefs have not updated ❌

What's the solution?

  • Calculate within the Sidebar component
  • Pass URL as prop, instead of importing it

Copy link

github-actions bot commented Sep 17, 2024

Removed vultr server and associated DNS entries

Copy link
Contributor

@RODO94 RODO94 left a comment

Choose a reason for hiding this comment

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

Works as expected for me! Added one wee nit / question

@@ -147,7 +148,7 @@ export const PublishFlowButton = () => {
<Box pb={2}>
<Typography variant="body2">
{`Preview these content changes in-service before publishing `}
<Link href={urls.preview} target="_blank">
<Link href={previewURL} target="_blank">
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we be using rel="noopener" in combo with the target="_blank" - I've always done it for security reasons, but I don't know enough to determine whether it's actually useful in all scenarios

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot! When linking internally this isn't required, but is best practice when using any third-party resources.

@DafyddLlyr DafyddLlyr merged commit f28786f into main Sep 17, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/fix-sidebar-url-updates branch September 17, 2024 14:16
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