Skip to content

Commit 7503a7b

Browse files
Redirect changed to Redirect push to to keep history. (#869)
* Redirect to changed to Redirect push to to keep history. * Rewiev - remove false changes in comments
1 parent 685591f commit 7503a7b

File tree

11 files changed

+12
-12
lines changed

11 files changed

+12
-12
lines changed

developer_guidelines.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Example:
8282

8383
```
8484
// Static route
85-
<Redirect to={Paths.search}/>
85+
<Redirect push to={Paths.search}/>
8686
8787
// Dynamic route
88-
<Redirect to={formatPath(Paths.editNamespace, {namespace: NSname});}/>
88+
<Redirect push to={formatPath(Paths.editNamespace, {namespace: NSname});}/>
8989
```

src/containers/edit-namespace/edit-namespace.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class EditNamespace extends React.Component<RouteComponentProps, IState> {
9292
}
9393

9494
if (redirect) {
95-
return <Redirect to={redirect} />;
95+
return <Redirect push to={redirect} />;
9696
}
9797
return (
9898
<React.Fragment>

src/containers/execution-environment-detail/base.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function withContainerRepo(WrappedComponent) {
8080
/>
8181
);
8282
} else if (this.state.redirect === 'notFound') {
83-
return <Redirect to={Paths.notFound} />;
83+
return <Redirect push to={Paths.notFound} />;
8484
}
8585

8686
if (this.state.loading) {

src/containers/group-management/group-list.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class GroupList extends React.Component<RouteComponentProps, IState> {
115115
const noData = groups.length === 0 && !filterIsSet(params, ['name']);
116116

117117
if (redirect) {
118-
return <Redirect to={redirect} />;
118+
return <Redirect push to={redirect} />;
119119
}
120120

121121
return (

src/containers/login/login.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class LoginPage extends React.Component<RouteComponentProps, IState> {
3434

3535
render() {
3636
if (this.state.redirect) {
37-
return <Redirect to={this.state.redirect}></Redirect>;
37+
return <Redirect push to={this.state.redirect}></Redirect>;
3838
}
3939

4040
const helperText = (

src/containers/namespace-detail/namespace-detail.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class NamespaceDetail extends React.Component<IProps, IState> {
113113
} = this.state;
114114

115115
if (redirect) {
116-
return <Redirect to={redirect} />;
116+
return <Redirect push to={redirect} />;
117117
}
118118

119119
if (!namespace) {

src/containers/settings/user-profile.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class UserProfile extends React.Component<RouteComponentProps, IState> {
123123
},
124124
() => this.context.setUser(result.data),
125125
);
126-
//redirect to login page when password is changed
126+
//Redirect to login page when password is changed
127127
if (user.password) {
128128
this.setState({ redirect: Paths.login });
129129
}

src/containers/user-management/user-edit.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class UserEdit extends React.Component<RouteComponentProps, IState> {
8686
const { user } = this.state;
8787
UserAPI.update(user.id.toString(), user)
8888
.then(() => {
89-
//redirect to login page when password of logged user is changed
89+
//Redirect to login page when password of logged user is changed
9090
if (this.context.user.id === user.id && user.password) {
9191
this.setState({ redirect: Paths.login });
9292
} else {

src/containers/user-management/user-list.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class UserList extends React.Component<RouteComponentProps, IState> {
113113
const { user } = this.context;
114114

115115
if (redirect) {
116-
return <Redirect to={redirect} />;
116+
return <Redirect push to={redirect} />;
117117
}
118118

119119
return (

src/loaders/insights/Routes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export const Routes = (props) => {
281281
<Route
282282
render={() =>
283283
some(Paths, (p) => p === path) ? null : (
284-
<Redirect to={Paths.notFound} />
284+
<Redirect push to={Paths.notFound} />
285285
)
286286
}
287287
/>

src/loaders/standalone/routes.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class AuthHandler extends React.Component<
128128
// only enforce this if feature flags are set. Otherwise the container
129129
// registry will always return a 404 on the first load.
130130
if (this.props.isDisabled) {
131-
return <Redirect to={Paths.notFound}></Redirect>;
131+
return <Redirect push to={Paths.notFound}></Redirect>;
132132
}
133133

134134
return <Component {...props}></Component>;

0 commit comments

Comments
 (0)