summaryrefslogtreecommitdiffstats
path: root/web/react/components/admin_console/admin_controller.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2015-10-19 10:10:09 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2015-10-19 10:10:09 -0400
commit2d0b9529417ef2cf4d2d9cccbd88b065b0db77db (patch)
tree833171c6febaa732156a35c00d553ed074af5618 /web/react/components/admin_console/admin_controller.jsx
parent814aa57fc1cebd1e430e36102d8b3c3830351cb8 (diff)
parent9fa3c996d522589139f56964087022bd0942e5e4 (diff)
downloadchat-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.jsx12
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]} />;
+ }
}
}