-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed: Fix internal Final button link (v2) (#1063)
* fix: Fix internal Final button link, which wouldn't cause an experiment to reload as it was already on the same location, by introducing an InternalRedirect * fix: Fix relative url button link test & add test for button without link
- Loading branch information
1 parent
f6183fd
commit 2fc2bc6
Showing
5 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
frontend/src/components/InternalRedirect/InternalRedirect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import { Redirect, RouteComponentProps } from 'react-router-dom'; | ||
|
||
// this component is a route, so it will receive the route props | ||
interface InternalRedirectProps extends RouteComponentProps {} | ||
|
||
export const InternalRedirect: React.FC<InternalRedirectProps> = (props) => { | ||
const { path } = props.match.params as { path: string }; | ||
const { search } = props.location; | ||
|
||
// Redirect to the experiment path | ||
return <Redirect to={`/${path}${search}`} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters