diff --git a/webapp/components/select_team/select_team.jsx b/webapp/components/select_team/select_team.jsx
index cc53b6b8f5..39a2e4442e 100644
--- a/webapp/components/select_team/select_team.jsx
+++ b/webapp/components/select_team/select_team.jsx
@@ -49,10 +49,10 @@ export default class SelectTeam extends React.Component {
}
render() {
- var content;
-
- var teamContents = [];
- var isAlreadyMember = new Map();
+ let content = null;
+ let teamContents = [];
+ const isAlreadyMember = new Map();
+ const isSystemAdmin = Utils.isSystemAdmin(UserStore.getCurrentUser().roles);
for (var index in this.state.teamMembers) {
if (this.state.teamMembers.hasOwnProperty(index)) {
@@ -78,33 +78,6 @@ export default class SelectTeam extends React.Component {
}
}
- if (!teamContents || teamContents.length === 0) {
- teamContents = (
-
- );
- }
-
- content = (
-
-
-
-
-
- {teamContents}
-
-
- );
-
var openTeamContents = [];
for (var id in this.state.teamListings) {
@@ -129,6 +102,70 @@ export default class SelectTeam extends React.Component {
}
}
+ if (!this.state.teamListings.length && (global.window.mm_config.EnableTeamCreation === 'true' || isSystemAdmin)) {
+ teamContents = (
+
+ );
+ } else if (!this.state.teamListings.length) {
+ teamContents = (
+
+ );
+ } else if (teamContents.length === 0 && openTeamContents.length === 0 && (global.window.mm_config.EnableTeamCreation === 'true' || isSystemAdmin)) {
+ teamContents = (
+
+ );
+ } else if (teamContents.length === 0 && openTeamContents.length === 0) {
+ teamContents = (
+
+ );
+ } else if (teamContents.length === 0 && openTeamContents.length > 0) {
+ teamContents = null;
+ }
+
+ if (teamContents) {
+ content = (
+
+
+
+
+
+ {teamContents}
+
+
+ );
+ }
+
var openContent;
if (openTeamContents.length > 0) {
openContent = (
@@ -150,8 +187,6 @@ export default class SelectTeam extends React.Component {
openContent = ;
}
- var isSystemAdmin = Utils.isSystemAdmin(UserStore.getCurrentUser().roles);
-
let teamHelp = null;
if (isSystemAdmin && (global.window.mm_config.EnableTeamCreation === 'false')) {
teamHelp = (
diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json
index 136bafcd32..ec6357ce81 100644
--- a/webapp/i18n/en.json
+++ b/webapp/i18n/en.json
@@ -1233,7 +1233,10 @@
"signup_team.disabled": "Team creation has been disabled. Please contact an administrator for access.",
"signup_team.join_open": "Open teams you can join: ",
"signup_team.noTeams": "There are no teams included in the Team Directory and team creation has been disabled.",
- "signup_team.no_teams": "You do not appear to be a member of any team. Please ask your administrator for an invite, join an open team if one exists or possibly create a new team.",
+ "signup_team.no_teams": "No teams have been created. Please contact your administrator.",
+ "signup_team.no_teams_canCreate": "No teams have been created. You may create one by clicking \"Create a new team\".",
+ "signup_team.no_open_teams": "No open teams have been created. Please ask your administrator for an invite.",
+ "signup_team.no_open_teams_canCreate": "No open teams have been created. Please ask your administrator for an invite or create a new team.",
"signup_team.none": "No team creation method has been enabled. Please contact an administrator for access.",
"signup_team_complete.completed": "You've already completed the signup process for this invitation or this invitation has expired.",
"signup_team_confirm.checkEmail": "Please check your email: {email}
Your email contains a link to set up your team",