diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2017-02-08 00:20:01 +0900 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2017-02-07 07:20:01 -0800 |
commit | 68a05653ea6f2588a27c8ce523b0d213e48f6480 (patch) | |
tree | 4b99b1f3424ae83a4908386d53caa7dd09f8bf54 /webapp/components/create_team | |
parent | 9bdea0de80a21b214eb9041057ab8e3fea681a8b (diff) | |
download | chat-68a05653ea6f2588a27c8ce523b0d213e48f6480.tar.gz chat-68a05653ea6f2588a27c8ce523b0d213e48f6480.tar.bz2 chat-68a05653ea6f2588a27c8ce523b0d213e48f6480.zip |
Add webapp/utils/url.jsx (#5285)
webapp/utils/utils.jsx got big and that caused a potential circular
dependency with webapp/stores/team_store.jsx. This change solves the
issue by introducing webapp/utils/url.jsx and moving URL-related
functions, which is not likely to depend on actions and stores, from
webapp/utils/utils.jsx.
Diffstat (limited to 'webapp/components/create_team')
-rw-r--r-- | webapp/components/create_team/components/display_name.jsx | 4 | ||||
-rw-r--r-- | webapp/components/create_team/components/team_url.jsx | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/webapp/components/create_team/components/display_name.jsx b/webapp/components/create_team/components/display_name.jsx index 67805a040..29077bd24 100644 --- a/webapp/components/create_team/components/display_name.jsx +++ b/webapp/components/create_team/components/display_name.jsx @@ -3,8 +3,8 @@ import {track} from 'actions/analytics_actions.jsx'; -import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; +import {cleanUpUrlable} from 'utils/url.jsx'; import logoImage from 'images/logo.png'; @@ -50,7 +50,7 @@ export default class TeamSignupDisplayNamePage extends React.Component { this.props.state.wizard = 'team_url'; this.props.state.team.display_name = displayName; - this.props.state.team.name = Utils.cleanUpUrlable(displayName); + this.props.state.team.name = cleanUpUrlable(displayName); this.props.updateParent(this.props.state); } diff --git a/webapp/components/create_team/components/team_url.jsx b/webapp/components/create_team/components/team_url.jsx index ccf5d63dc..4a063d145 100644 --- a/webapp/components/create_team/components/team_url.jsx +++ b/webapp/components/create_team/components/team_url.jsx @@ -1,11 +1,10 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import * as Utils from 'utils/utils.jsx'; - import {checkIfTeamExists, createTeam} from 'actions/team_actions.jsx'; import {track} from 'actions/analytics_actions.jsx'; import Constants from 'utils/constants.jsx'; +import * as URL from 'utils/url.jsx'; import logoImage from 'images/logo.png'; @@ -38,7 +37,7 @@ export default class TeamUrl extends React.Component { e.preventDefault(); const name = ReactDOM.findDOMNode(this.refs.name).value.trim(); - const cleanedName = Utils.cleanUpUrlable(name); + const cleanedName = URL.cleanUpUrlable(name); const urlRegex = /^[a-z]+([a-z\-0-9]+|(__)?)[a-z0-9]+$/g; if (!name) { @@ -136,7 +135,7 @@ export default class TeamUrl extends React.Component { nameDivClass += ' has-error'; } - const title = `${Utils.getSiteURL()}/`; + const title = `${URL.getSiteURL()}/`; const urlTooltip = ( <Tooltip id='urlTooltip'>{title}</Tooltip> ); |