diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2015-10-19 10:10:09 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2015-10-19 10:10:09 -0400 |
commit | 2d0b9529417ef2cf4d2d9cccbd88b065b0db77db (patch) | |
tree | 833171c6febaa732156a35c00d553ed074af5618 /web/react/components/admin_console/admin_controller.jsx | |
parent | 814aa57fc1cebd1e430e36102d8b3c3830351cb8 (diff) | |
parent | 9fa3c996d522589139f56964087022bd0942e5e4 (diff) | |
download | chat-2d0b9529417ef2cf4d2d9cccbd88b065b0db77db.tar.gz chat-2d0b9529417ef2cf4d2d9cccbd88b065b0db77db.tar.bz2 chat-2d0b9529417ef2cf4d2d9cccbd88b065b0db77db.zip |
Merge pull request #1101 from stasvovk/admin_console_urls
#962: change url when a user navigates between tabs in admin console
Diffstat (limited to 'web/react/components/admin_console/admin_controller.jsx')
-rw-r--r-- | web/react/components/admin_console/admin_controller.jsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/web/react/components/admin_console/admin_controller.jsx b/web/react/components/admin_console/admin_controller.jsx index f2fb8ac78..f770d166c 100644 --- a/web/react/components/admin_console/admin_controller.jsx +++ b/web/react/components/admin_console/admin_controller.jsx @@ -40,9 +40,13 @@ export default class AdminController extends React.Component { config: AdminStore.getConfig(), teams: AdminStore.getAllTeams(), selectedTeams, - selected: 'service_settings', - selectedTeam: null + selected: props.tab || 'service_settings', + selectedTeam: props.teamId || null }; + + if (!props.tab) { + history.replaceState(null, null, `/admin_console/${this.state.selected}`); + } } componentDidMount() { @@ -142,7 +146,9 @@ export default class AdminController extends React.Component { } else if (this.state.selected === 'service_settings') { tab = <ServiceSettingsTab config={this.state.config} />; } else if (this.state.selected === 'team_users') { - tab = <TeamUsersTab team={this.state.teams[this.state.selectedTeam]} />; + if (this.state.teams) { + tab = <TeamUsersTab team={this.state.teams[this.state.selectedTeam]} />; + } } } |