From 9b92d88e9b08dfcfecc3f4f6a6d3564a4a3b409b Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 1 Apr 2016 09:11:27 -0400 Subject: Update tutorial channel names to reflect actual display names --- webapp/components/sidebar.jsx | 24 ++++++++++++++--- .../components/tutorial/tutorial_intro_screens.jsx | 16 ++++++++++- webapp/components/tutorial/tutorial_view.jsx | 31 +++++++++++++++++++--- 3 files changed, 63 insertions(+), 8 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index b22d3ec34..500e73cf2 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -138,7 +138,9 @@ export default class Sidebar extends React.Component { unreadCounts: JSON.parse(JSON.stringify(ChannelStore.getUnreadCounts())), showTutorialTip: tutorialStep === TutorialSteps.CHANNEL_POPOVER, currentTeam: TeamStore.getCurrent(), - currentUser: UserStore.getCurrentUser() + currentUser: UserStore.getCurrentUser(), + townSquare: ChannelStore.getByName(Constants.DEFAULT_CHANNEL), + offTopic: ChannelStore.getByName(Constants.OFFTOPIC_CHANNEL) }; } @@ -290,6 +292,16 @@ export default class Sidebar extends React.Component { createTutorialTip() { const screens = []; + let townSquareDisplayName = Constants.DEFAULT_CHANNEL_UI_NAME; + if (this.state.townSquare) { + townSquareDisplayName = this.state.townSquare.display_name; + } + + let offTopicDisplayName = Constants.OFFTOPIC_CHANNEL_UI_NAME; + if (this.state.offTopic) { + offTopicDisplayName = this.state.offTopic.display_name; + } + screens.push(
"{townsquare}" and "{offtopic}" channels

Here are two public channels to start:

-

Town Square is a place for team-wide communication. Everyone in your team is a member of this channel.

-

Off-Topic is a place for fun and humor outside of work-related channels. You and your team can decide what other channels to create.

' +

{townsquare} is a place for team-wide communication. Everyone in your team is a member of this channel.

+

{offtopic} is a place for fun and humor outside of work-related channels. You and your team can decide what other channels to create.

' + values={{ + townsquare: townSquareDisplayName, + offtopic: offTopicDisplayName + }} />
); diff --git a/webapp/components/tutorial/tutorial_intro_screens.jsx b/webapp/components/tutorial/tutorial_intro_screens.jsx index bad426cfc..0358a6a65 100644 --- a/webapp/components/tutorial/tutorial_intro_screens.jsx +++ b/webapp/components/tutorial/tutorial_intro_screens.jsx @@ -19,6 +19,12 @@ const NUM_SCREENS = 3; import React from 'react'; export default class TutorialIntroScreens extends React.Component { + static get propTypes() { + return { + townSquare: React.PropTypes.object, + offTopic: React.PropTypes.object + }; + } constructor(props) { super(props); @@ -153,6 +159,11 @@ export default class TutorialIntroScreens extends React.Component { ); } + let townSquareDisplayName = Constants.DEFAULT_CHANNEL_UI_NAME; + if (this.props.townSquare) { + townSquareDisplayName = this.props.townSquare.display_name; + } + return (

@@ -171,7 +182,10 @@ export default class TutorialIntroScreens extends React.Component { {supportInfo} {circles}

diff --git a/webapp/components/tutorial/tutorial_view.jsx b/webapp/components/tutorial/tutorial_view.jsx index d9e0ef40d..5f2c1a257 100644 --- a/webapp/components/tutorial/tutorial_view.jsx +++ b/webapp/components/tutorial/tutorial_view.jsx @@ -1,18 +1,43 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import React from 'react'; - import TutorialIntroScreens from './tutorial_intro_screens.jsx'; +import ChannelStore from 'stores/channel_store.jsx'; +import Constants from 'utils/constants.jsx'; + +import React from 'react'; + export default class TutorialView extends React.Component { + constructor(props) { + super(props); + + this.handleChannelChange = this.handleChannelChange.bind(this); + + this.state = { + townSquare: ChannelStore.getByName(Constants.DEFAULT_CHANNEL) + }; + } + componentDidMount() { + ChannelStore.addChangeListener(this.handleChannelChange); + } + componentWillUnmount() { + ChannelStore.removeChangeListener(this.handleChannelChange); + } + handleChannelChange() { + this.setState({ + townSquare: ChannelStore.getByName(Constants.DEFAULT_CHANNEL) + }); + } render() { return (
- +
); } -- cgit v1.2.3-1-g7c22