mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-28 17:54:16 +08:00
trigger redirect to root page on team switch [fixes SCI-1641]
This commit is contained in:
parent
f8fc2737d5
commit
14bae8def5
3 changed files with 14 additions and 10 deletions
|
@ -6,6 +6,7 @@ import { NavDropdown, MenuItem, Glyphicon } from "react-bootstrap";
|
|||
import styled from "styled-components";
|
||||
import _ from "lodash";
|
||||
|
||||
import { ROOT_PATH } from "../../../config/routes";
|
||||
import { BORDER_GRAY_COLOR } from "../../../config/constants/colors";
|
||||
import { changeTeam } from "../../actions/TeamsActions";
|
||||
import { getTeamsList } from "../../actions/TeamsActions";
|
||||
|
@ -27,15 +28,18 @@ class TeamSwitch extends Component {
|
|||
|
||||
changeTeam(teamId) {
|
||||
this.props.changeTeam(teamId);
|
||||
window.location = ROOT_PATH;
|
||||
}
|
||||
|
||||
displayTeams() {
|
||||
if (!_.isEmpty(this.props.all_teams)) {
|
||||
return this.props.all_teams.filter(team => !team.current_team).map(team =>
|
||||
<MenuItem onSelect={() => this.changeTeam(team.id)} key={team.id}>
|
||||
{team.name}
|
||||
</MenuItem>
|
||||
);
|
||||
return this.props.all_teams
|
||||
.filter(team => !team.current_team)
|
||||
.map(team => (
|
||||
<MenuItem onSelect={() => this.changeTeam(team.id)} key={team.id}>
|
||||
{team.name}
|
||||
</MenuItem>
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,8 +68,6 @@
|
|||
"react-bootstrap-table": "^4.0.0",
|
||||
"react-bootstrap-timezone-picker": "^1.0.11",
|
||||
"react-data-grid": "^2.0.2",
|
||||
"react-tagsinput": "^3.17.0",
|
||||
"react-transition-group": "^2.2.0",
|
||||
"react-dom": "^15.6.1",
|
||||
"react-intl": "^2.3.0",
|
||||
"react-intl-redux": "^0.6.0",
|
||||
|
@ -78,7 +76,9 @@
|
|||
"react-router-bootstrap": "^0.24.2",
|
||||
"react-router-dom": "^4.1.2",
|
||||
"react-router-prop-types": "^0.0.1",
|
||||
"react-tagsinput": "^3.17.0",
|
||||
"react-timezone": "^0.2.0",
|
||||
"react-transition-group": "^2.2.1",
|
||||
"redux": "^3.7.2",
|
||||
"redux-thunk": "^2.2.0",
|
||||
"resolve-url-loader": "^2.1.0",
|
||||
|
|
|
@ -4829,9 +4829,9 @@ react-timezone@^0.2.0:
|
|||
dependencies:
|
||||
classnames "^2.2.1"
|
||||
|
||||
react-transition-group@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.2.0.tgz#793bf8cb15bfe91b3101b24bce1c1d2891659575"
|
||||
react-transition-group@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.2.1.tgz#e9fb677b79e6455fd391b03823afe84849df4a10"
|
||||
dependencies:
|
||||
chain-function "^1.0.0"
|
||||
classnames "^2.2.5"
|
||||
|
|
Loading…
Reference in a new issue