diff options
author | enahum <nahumhbl@gmail.com> | 2016-12-19 12:47:43 -0300 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-12-19 10:47:43 -0500 |
commit | 98d96f5457fe3a238f88d6d94f3ed9c22b357637 (patch) | |
tree | f7f014937b3e2d8778c95dcfa2c248e4c4112bb1 /webapp/components/admin_console | |
parent | f96173528f08684092b89f903f0389fe2b607192 (diff) | |
download | chat-98d96f5457fe3a238f88d6d94f3ed9c22b357637.tar.gz chat-98d96f5457fe3a238f88d6d94f3ed9c22b357637.tar.bz2 chat-98d96f5457fe3a238f88d6d94f3ed9c22b357637.zip |
PLT-5021 Order System Console Teams section by Display Name (#4831)
Diffstat (limited to 'webapp/components/admin_console')
3 files changed, 26 insertions, 9 deletions
diff --git a/webapp/components/admin_console/admin_sidebar.jsx b/webapp/components/admin_console/admin_sidebar.jsx index 2b304f11d..e8303ea0c 100644 --- a/webapp/components/admin_console/admin_sidebar.jsx +++ b/webapp/components/admin_console/admin_sidebar.jsx @@ -114,6 +114,19 @@ export default class AdminSidebar extends React.Component { document.title = Utils.localizeMessage('sidebar_right_menu.console', 'System Console') + ' - ' + currentSiteName; } + sortTeams(a, b) { + const teamA = a.display_name.toLowerCase(); + const teamB = b.display_name.toLowerCase(); + + if (teamA < teamB) { + return -1; + } + if (teamA > teamB) { + return 1; + } + return 0; + } + renderAddTeamButton() { const addTeamTooltip = ( <Tooltip id='add-team-tooltip'> @@ -146,18 +159,18 @@ export default class AdminSidebar extends React.Component { renderTeams() { const teams = []; + const teamsArray = []; - for (const key in this.state.selectedTeams) { - if (!this.state.selectedTeams.hasOwnProperty(key)) { - continue; + Reflect.ownKeys(this.state.selectedTeams).forEach((key) => { + if (this.state.teams[key]) { + teamsArray.push(this.state.teams[key]); } + }); - const team = this.state.teams[key]; - - if (!team) { - continue; - } + teamsArray.sort(this.sortTeams); + for (let i = 0; i < teamsArray.length; i++) { + const team = teamsArray[i]; teams.push( <AdminSidebarTeam key={team.id} diff --git a/webapp/components/admin_console/admin_team_members_dropdown.jsx b/webapp/components/admin_console/admin_team_members_dropdown.jsx index 028effe66..253259493 100644 --- a/webapp/components/admin_console/admin_team_members_dropdown.jsx +++ b/webapp/components/admin_console/admin_team_members_dropdown.jsx @@ -464,7 +464,10 @@ export default class AdminTeamMembersDropdown extends React.Component { <br/> <FormattedMessage id='admin.user_item.confirmDemotionCmd' - defaultMessage='platform -assign_role -team_name="yourteam" -email="name@yourcompany.com" -role="system_admin"' + defaultMessage='platform roles system_admin {username}' + values={{ + username: me.username + }} /> {serverError} </div> diff --git a/webapp/components/admin_console/select_team_modal.jsx b/webapp/components/admin_console/select_team_modal.jsx index a661dd2f0..e407e61b4 100644 --- a/webapp/components/admin_console/select_team_modal.jsx +++ b/webapp/components/admin_console/select_team_modal.jsx @@ -24,6 +24,7 @@ export default class SelectTeamModal extends React.Component { doCancel() { this.props.onModalDismissed(); } + compare(a, b) { const teamA = a.display_name.toLowerCase(); const teamB = b.display_name.toLowerCase(); |