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

refactor(protocol-designer): remove basename from router #16258

Merged
merged 2 commits into from
Sep 16, 2024
Merged

Conversation

shlokamin
Copy link
Member

@shlokamin shlokamin commented Sep 16, 2024

Overview

I guess hash router does not need a basename 🤷🏽 This PR fixes an issue where no route gets picked up by the router due to the route not matching a basename. This only affects sandbox links.

Test Plan and Hands on Testing

Visit https://sandbox.designer.opentrons.com/pd_fix-router and play around with the different routes and try refreshing/copying urls and pasting them into the browser. you should not get a 404.

Risk assessment

Low

@shlokamin shlokamin changed the title temporarily disable gating tests and remove basename refactor(protocol-designer): fix routing issue Sep 16, 2024
@shlokamin shlokamin changed the title refactor(protocol-designer): fix routing issue refactor(protocol-designer): remove basename from router Sep 16, 2024
@shlokamin shlokamin marked this pull request as ready for review September 16, 2024 18:38
@shlokamin shlokamin requested a review from a team as a code owner September 16, 2024 18:38
@shlokamin shlokamin requested a review from jerader September 16, 2024 18:38
Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

seems to work well. Quick question, if i refresh the url, it still stays on the specific path? don't we want it to remove the overview and go to the landing page?

Screen.Recording.2024-09-16.at.15.00.53.mov

@shlokamin
Copy link
Member Author

Quick question, if i refresh the url, it still stays on the specific path? don't we want it to remove the overview and go to the landing page?

hm yeah probably but i guess it depends on what route you try to access. are you thinking of something similar to what we do in the landing page?

  React.useEffect(() => {
    if (metadata?.created != null) {
      console.warn('protocol already exists, navigating to overview')
      navigate('/overview')
    }
  }, [metadata, navigate])

i guess we just have to define the right rules for each route. ex. if theres no data should we always route to root? and what property do we read to determine if there is "no data" and we should redirect?

Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

approving this to fix sandbox on edge but want to make a followup ticket to address the comment

@shlokamin
Copy link
Member Author

sounds good ill merge for now

@shlokamin shlokamin merged commit cf93273 into edge Sep 16, 2024
12 of 13 checks passed
@shlokamin shlokamin deleted the pd_fix-router branch September 16, 2024 19:47
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