From 430806301da06e927b8d7d6dcba20ea4b6b6d6c1 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 1 Oct 2015 17:52:47 -0700 Subject: PLT-44 allow team switching without the need to login --- web/react/components/navbar_dropdown.jsx | 10 ++++++---- web/react/components/sidebar.jsx | 4 +++- web/react/components/sidebar_header.jsx | 3 +++ 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'web/react/components') diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx index 57a78a0d4..dc5983f1e 100644 --- a/web/react/components/navbar_dropdown.jsx +++ b/web/react/components/navbar_dropdown.jsx @@ -142,10 +142,10 @@ export default class NavbarDropdown extends React.Component { > ); - if (this.state.teams.length > 1 && this.state.currentTeam) { - var curTeamName = this.state.currentTeam.name; + + if (this.state.teams.length > 1) { this.state.teams.forEach((teamName) => { - if (teamName !== curTeamName) { + if (teamName !== this.props.teamName) { teams.push(
  • {'Switch to ' + teamName}
  • ); } }); @@ -234,5 +234,7 @@ NavbarDropdown.defaultProps = { teamType: '' }; NavbarDropdown.propTypes = { - teamType: React.PropTypes.string + teamType: React.PropTypes.string, + teamDisplayName: React.PropTypes.string, + teamName: React.PropTypes.string }; diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx index 6033f200f..dfaa4c794 100644 --- a/web/react/components/sidebar.jsx +++ b/web/react/components/sidebar.jsx @@ -508,6 +508,7 @@ export default class Sidebar extends React.Component { /> @@ -587,5 +588,6 @@ Sidebar.defaultProps = { }; Sidebar.propTypes = { teamType: React.PropTypes.string, - teamDisplayName: React.PropTypes.string + teamDisplayName: React.PropTypes.string, + teamName: React.PropTypes.string }; diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx index 072c14e0a..33de35064 100644 --- a/web/react/components/sidebar_header.jsx +++ b/web/react/components/sidebar_header.jsx @@ -52,6 +52,8 @@ export default class SidebarHeader extends React.Component { ); @@ -64,5 +66,6 @@ SidebarHeader.defaultProps = { }; SidebarHeader.propTypes = { teamDisplayName: React.PropTypes.string, + teamName: React.PropTypes.string, teamType: React.PropTypes.string }; -- cgit v1.2.3-1-g7c22 From 4452bb798878ee3a803b018f817cb3259e341a82 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 2 Oct 2015 09:13:30 -0700 Subject: Fixing issues --- web/react/components/navbar_dropdown.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/components') diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx index dc5983f1e..78057d10b 100644 --- a/web/react/components/navbar_dropdown.jsx +++ b/web/react/components/navbar_dropdown.jsx @@ -9,7 +9,7 @@ var TeamStore = require('../stores/team_store.jsx'); var Constants = require('../utils/constants.jsx'); function getStateFromStores() { - return {teams: UserStore.getTeams(), currentTeam: TeamStore.getCurrent()}; + return {teams: UserStore.getTeams()}; } export default class NavbarDropdown extends React.Component { -- cgit v1.2.3-1-g7c22