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

ui: fix link to problem ranges #49122

Merged

Conversation

dhartunian
Copy link
Collaborator

@dhartunian dhartunian commented May 15, 2020

Release note (admin ui change): Fixed bug where link to
specific problem ranges had an incorrect path. Problem
ranges are now linked correctly again.

This closes #48559

Release note (admin ui change): Fixed bug where link to
specific problem ranges had an incorrect path. Problem
ranges are now linked correctly again.
@dhartunian dhartunian requested a review from a team May 15, 2020 16:46
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dhartunian
Copy link
Collaborator Author

@koorosh was there a change in React Router 4 that requires / in front of <Link to=" paths? I saw a few other examples in the code but they weren't broken like this one was.

@koorosh
Copy link
Collaborator

koorosh commented May 17, 2020

@koorosh was there a change in React Router 4 that requires / in front of <Link to=" paths? I saw a few other examples in the code but they weren't broken like this one was.

As far as I know, one of the major changes is that react-router v4 version doesn't support nested routing. Leading / makes this routing path absolute (while missing it - relative to the current path).
I suppose the current issue could be caused by the rearrangement of components hierarchy somehow in the way that relative path didn't match to the expected route.

Before migration to v4

<Route path="reports">
    <Route path="problemranges" component={ ProblemRanges }>...</Route>
     ...
    <Route path={`range/:${rangeIDAttr}`} component={ Range } />
</Route>

now:

<Route path="/">
  <Layout>
      <Switch>
        ...
         <Route exact path="/reports/problemranges" component={ ProblemRanges } />
         <Route exact path={`/reports/range/:${rangeIDAttr}`} component={ Range } />
      </Switch>
  </Layout>
</Route>

Before, problemranges and range routes had a common parent (nested) route reports and now both routes are descendants of root.

Copy link
Collaborator

@koorosh koorosh left a comment

Choose a reason for hiding this comment

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

LGTM

@dhartunian
Copy link
Collaborator Author

Thanks for the explanation @koorosh! I checked a few others I was able to find that didn't have / on the front and they worked fine so this explains why.

@dhartunian
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented May 18, 2020

Build succeeded

@craig craig bot merged commit c21c3ca into cockroachdb:master May 18, 2020
@dhartunian dhartunian deleted the problem-range-report-link-bug-48559 branch May 18, 2020 17:17
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.

webui: problem range report links broken on 20.1
4 participants