From c51afba71a8d4614f74709d5e9c432c2cff3fcf7 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Thu, 1 Dec 2016 23:23:28 +0100 Subject: Add Team Description to the Team Settings (#4652) * draft * Add Team Description to the Team Settings * add tooltips for team description * made changes per PM review * add message when there is no description set in the team * squash --- .../create_team/components/display_name.jsx | 2 +- .../select_team/components/select_team_item.jsx | 24 ++++ webapp/components/sidebar.jsx | 1 + webapp/components/sidebar_header.jsx | 31 +++-- webapp/components/team_general_tab.jsx | 126 +++++++++++++++++++++ 5 files changed, 174 insertions(+), 10 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/create_team/components/display_name.jsx b/webapp/components/create_team/components/display_name.jsx index a557a48c5..67805a040 100644 --- a/webapp/components/create_team/components/display_name.jsx +++ b/webapp/components/create_team/components/display_name.jsx @@ -38,7 +38,7 @@ export default class TeamSignupDisplayNamePage extends React.Component { this.setState({nameError: ( + {this.props.team.description} + + ); + + showDescriptionTooltip = ( + + + + ); + } + return (
+ {showDescriptionTooltip} {this.props.teamDisplayName}
+ ); + } else { + teamNameWithToolTip = ( + {this.props.teamDescription}} + ref='descriptionOverlay' + > +
{this.props.teamDisplayName}
+
+ ); + } + return (
{tutorialTip} @@ -79,15 +98,7 @@ export default class SidebarHeader extends React.Component { {profilePicture}
{'@' + me.username}
- {this.props.teamDisplayName}} - ref='descriptionOverlay' - > -
{this.props.teamDisplayName}
-
+ {teamNameWithToolTip}
{ + this.updateSection(''); + }, + (err) => { + state.serverError = err.message; + this.setState(state); + } + ); + } + componentDidMount() { $('#team_settings').on('hidden.bs.modal', this.handleClose); } @@ -232,6 +275,15 @@ class GeneralTab extends React.Component { } } + onUpdateDescriptionSection(e) { + e.preventDefault(); + if (this.props.activeSection === 'description') { + this.updateSection(''); + } else { + this.updateSection('description'); + } + } + onUpdateInviteIdSection(e) { e.preventDefault(); if (this.props.activeSection === 'invite_id') { @@ -254,6 +306,10 @@ class GeneralTab extends React.Component { this.setState({name: e.target.value}); } + updateDescription(e) { + this.setState({description: e.target.value}); + } + updateInviteId(e) { this.setState({invite_id: e.target.value}); } @@ -457,6 +513,74 @@ class GeneralTab extends React.Component { ); } + let descriptionSection; + + if (this.props.activeSection === 'description') { + const inputs = []; + + let teamDescriptionLabel = ( + + ); + if (Utils.isMobile()) { + teamDescriptionLabel = ''; + } + + inputs.push( +
+ +
+ +
+
+ ); + + const descriptionExtraInfo = {formatMessage(holders.teamDescriptionInfo)}; + + descriptionSection = ( + + ); + } else { + let describemsg = ''; + if (this.state.description) { + describemsg = this.state.description; + } else { + describemsg = ( + + ); + } + + descriptionSection = ( + + ); + } + return (
@@ -496,6 +620,8 @@ class GeneralTab extends React.Component {
{nameSection}
+ {descriptionSection} +
{openInviteSection}
{inviteSection} -- cgit v1.2.3-1-g7c22