From 76c6505e7fc457a26e9efd37677252751a0ba8f7 Mon Sep 17 00:00:00 2001 From: David Lu Date: Mon, 4 Jul 2016 09:31:44 -0400 Subject: PLT-3154 Updated help text on Select Team page (#3451) * Added Onboarding Changes to Select Team * changed text by PM --- webapp/components/select_team/select_team.jsx | 101 +++++++++++++++++--------- webapp/i18n/en.json | 5 +- 2 files changed, 72 insertions(+), 34 deletions(-) diff --git a/webapp/components/select_team/select_team.jsx b/webapp/components/select_team/select_team.jsx index cc53b6b8f..39a2e4442 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 136bafcd3..ec6357ce8 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", -- cgit v1.2.3-1-g7c22