mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 23:15:34 +08:00
Merge pull request #810 from ZmagoD/zd_SCI_1641
trigger redirect to root page on team switch [fixes SCI-1641]
This commit is contained in:
commit
395d0cb863
1 changed files with 9 additions and 5 deletions
|
@ -6,6 +6,7 @@ import { NavDropdown, MenuItem, Glyphicon } from "react-bootstrap";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
|
||||||
|
import { ROOT_PATH } from "../../../config/routes";
|
||||||
import { BORDER_GRAY_COLOR } from "../../../config/constants/colors";
|
import { BORDER_GRAY_COLOR } from "../../../config/constants/colors";
|
||||||
import { changeTeam } from "../../actions/TeamsActions";
|
import { changeTeam } from "../../actions/TeamsActions";
|
||||||
import { getTeamsList } from "../../actions/TeamsActions";
|
import { getTeamsList } from "../../actions/TeamsActions";
|
||||||
|
@ -27,15 +28,18 @@ class TeamSwitch extends Component {
|
||||||
|
|
||||||
changeTeam(teamId) {
|
changeTeam(teamId) {
|
||||||
this.props.changeTeam(teamId);
|
this.props.changeTeam(teamId);
|
||||||
|
window.location = ROOT_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
displayTeams() {
|
displayTeams() {
|
||||||
if (!_.isEmpty(this.props.all_teams)) {
|
if (!_.isEmpty(this.props.all_teams)) {
|
||||||
return this.props.all_teams.filter(team => !team.current_team).map(team =>
|
return this.props.all_teams
|
||||||
<MenuItem onSelect={() => this.changeTeam(team.id)} key={team.id}>
|
.filter(team => !team.current_team)
|
||||||
{team.name}
|
.map(team => (
|
||||||
</MenuItem>
|
<MenuItem onSelect={() => this.changeTeam(team.id)} key={team.id}>
|
||||||
);
|
{team.name}
|
||||||
|
</MenuItem>
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue