summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
Diffstat (limited to 'web/react')
-rw-r--r--web/react/.eslintrc139
-rw-r--r--web/react/components/access_history_modal.jsx16
-rw-r--r--web/react/components/activity_log_modal.jsx17
-rw-r--r--web/react/components/channel_header.jsx12
-rw-r--r--web/react/components/delete_post_modal.jsx2
-rw-r--r--web/react/components/file_preview.jsx2
-rw-r--r--web/react/components/login.jsx14
-rw-r--r--web/react/components/post_body.jsx4
-rw-r--r--web/react/components/post_list.jsx7
-rw-r--r--web/react/components/post_right.jsx4
-rw-r--r--web/react/components/rename_channel_modal.jsx2
-rw-r--r--web/react/components/search_bar.jsx11
-rw-r--r--web/react/components/sidebar_header.jsx10
-rw-r--r--web/react/components/signup_team.jsx20
-rw-r--r--web/react/components/signup_team_complete.jsx178
-rw-r--r--web/react/components/signup_user_complete.jsx52
-rw-r--r--web/react/components/view_image.jsx6
-rw-r--r--web/react/package.json4
-rw-r--r--web/react/pages/signup_team_complete.jsx4
-rw-r--r--web/react/pages/signup_user_complete.jsx2
-rw-r--r--web/react/stores/team_store.jsx8
-rw-r--r--web/react/stores/user_store.jsx4
-rw-r--r--web/react/utils/client.jsx4
-rw-r--r--web/react/utils/utils.jsx11
24 files changed, 369 insertions, 164 deletions
diff --git a/web/react/.eslintrc b/web/react/.eslintrc
new file mode 100644
index 000000000..d8b36f6ca
--- /dev/null
+++ b/web/react/.eslintrc
@@ -0,0 +1,139 @@
+{
+ "ecmaFeatures": {
+ "jsx": true,
+ "blockBindings": true,
+ "modules": true
+ },
+ "plugins": [
+ "react"
+ ],
+ "env": {
+ "browser": true,
+ "node": true,
+ "jquery": true,
+ "es6": true
+ },
+ "globals": {
+ "React": false
+ },
+ "rules": {
+ "comma-dangle": [2, "never"],
+ "no-cond-assign": [2, "except-parens"],
+ "no-console": 1,
+ "no-constant-condition": 1,
+ "no-debugger": 1,
+ "no-dupe-args": 2,
+ "no-dupe-keys": 2,
+ "no-duplicate-case": 2,
+ "no-empty": 1,
+ "no-ex-assign": 1,
+ "no-extra-semi": 2,
+ "no-func-assign": 1,
+ "no-inner-declarations": 0,
+ "no-invalid-regexp": 2,
+ "no-irregular-whitespace": 2,
+ "no-unreachable": 2,
+ "valid-typeof": 2,
+ "no-unexpected-multiline": 2,
+
+ "block-scoped-var": 1,
+ "complexity": [1, 8],
+ "consistent-return": 2,
+ "curly": [2, "all"],
+ "dot-notation": 2,
+ "dot-location": [2, "object"],
+ "eqeqeq": [2, "smart"],
+ "guard-for-in": 1,
+ "no-alert": 1,
+ "no-caller": 2,
+ "no-div-regex": 1,
+ "no-else-return": 1,
+ "no-eval": 2,
+ "no-extend-native": 2,
+ "no-floating-decimal": 2,
+ "no-labels": 2,
+ "no-lone-blocks": 1,
+ "no-multi-spaces": [2, { "exceptions": { "Property": false } }],
+ "no-multi-str": 0,
+ "no-param-reassign": 2,
+ "no-process-env": 2,
+ "no-redeclare": 2,
+ "no-return-assign": [2, "always"],
+ "no-script-url": 2,
+ "no-self-compare": 2,
+ "no-sequences": 2,
+ "no-throw-literal": 2,
+ "no-unused-expressions": 2,
+ "no-void": 2,
+ "no-warning-comments": 0,
+ "no-with": 2,
+ "radix": 2,
+ "vars-on-top": 0,
+ "wrap-iife": [2, "outside"],
+ "yoda": [2, "never", {"exceptRange": false, "onlyEquality": false}],
+
+ "no-undefined": 2,
+ "no-shadow": [2, {"hoist": "functions"}],
+ "no-unused-vars": [2, {"vars": "all", "args": "all"}],
+ "no-use-before-define": [2, "nofunc"],
+
+ // Style
+ "array-bracket-spacing": [2, "never"],
+ "brace-style": [2, "1tbs", { "allowSingleLine": false }],
+ "camelcase": [2, {"properties": "always"}],
+ "comma-spacing": [2, {"before": false, "after": true}],
+ "comma-style": [2, "last"],
+ "computed-property-spacing": [2, "never"],
+ "consistent-this": [2, "self"],
+ "func-names": 2,
+ "func-style": [2, "declaration"],
+ "indent": [2, 4, {"indentSwitchCase": false}],
+ "key-spacing": [2, {"beforeColon": false, "afterColon": true}],
+ "lines-around-comment": [2, { "beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true, "allowBlockEnd": true }],
+ "linebreak-style": 2,
+ "new-cap": 2,
+ "new-parens": 2,
+ "no-lonely-if": 2,
+ "no-mixed-spaces-and-tabs": 2,
+ "no-multiple-empty-lines": [2, {"max": 1}],
+ "no-spaced-func": 2,
+ "no-ternary": 2,
+ "no-trailing-spaces": [2, { "skipBlankLines": false }],
+ "no-underscore-dangle": 2,
+ "no-unneeded-ternary": 2,
+ "object-curly-spacing": [2, "never"],
+ "one-var": [2, "never"],
+ "operator-linebreak": [2, "after"],
+ "padded-blocks": [2, "never"],
+ "quote-props": [2, "as-needed"],
+ "quotes": [2, "single", "avoid-escape"],
+ "semi-spacing": [2, {"before": false, "after": true}],
+ "semi": [2, "always"],
+ "space-after-keywords": [2, "always"],
+ "space-before-blocks": [2, "always"],
+ "space-before-function-paren": [2, "never"],
+ "space-in-parens": [2, "never"],
+ "space-infix-ops": 2,
+ "space-return-throw-case": 2,
+ "space-unary-ops": [2, { "words": true, "nonwords": false }],
+ "wrap-regex": 2,
+
+ // React Specific
+ "react/display-name": [2, { "acceptTranspilerName": true }],
+ "react/jsx-boolean-value": [2, "always"],
+ "react/jsx-curly-spacing": [2, "never"],
+ "react/jsx-no-duplicate-props": [2, { "ignoreCase": false }],
+ "react/jsx-no-undef": 2,
+ "react/jsx-quotes": [2, "single", "avoid-escape"],
+ "react/jsx-uses-react": 2,
+ "react/jsx-uses-vars": 2,
+ "react/no-danger": 0,
+ "react/no-did-mount-set-state": 2,
+ "react/no-did-update-set-state": 2,
+ "react/no-multi-comp": 2,
+ "react/no-unknown-property": 2,
+ "react/prop-types": 2,
+ "react/sort-comp": 0,
+ "react/wrap-multilines": 2
+ }
+}
diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx
index 462f046f6..6cc8ec8a9 100644
--- a/web/react/components/access_history_modal.jsx
+++ b/web/react/components/access_history_modal.jsx
@@ -3,7 +3,8 @@
var UserStore = require('../stores/user_store.jsx');
var AsyncClient = require('../utils/async_client.jsx');
-var Utils = require('../utils/utils.jsx');
+var LoadingScreen = require('./loading_screen.jsx');
+var utils = require('../utils/utils.jsx');
function getStateFromStoresForAudits() {
return {
@@ -14,7 +15,9 @@ function getStateFromStoresForAudits() {
module.exports = React.createClass({
componentDidMount: function() {
UserStore.addAuditsChangeListener(this._onChange);
- AsyncClient.getAudits();
+ $(this.refs.modal.getDOMNode()).on('shown.bs.modal', function (e) {
+ AsyncClient.getAudits();
+ });
var self = this;
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) {
@@ -25,7 +28,10 @@ module.exports = React.createClass({
UserStore.removeAuditsChangeListener(this._onChange);
},
_onChange: function() {
- this.setState(getStateFromStoresForAudits());
+ var newState = getStateFromStoresForAudits();
+ if (!utils.areStatesEqual(newState.audits, this.state.audits)) {
+ this.setState(newState);
+ }
},
handleMoreInfo: function(index) {
var newMoreInfo = this.state.moreInfo;
@@ -87,9 +93,13 @@ module.exports = React.createClass({
<h4 className="modal-title" id="myModalLabel">Access History</h4>
</div>
<div ref="modalBody" className="modal-body">
+ { !this.state.audits.loading ?
<form role="form">
{ accessList }
</form>
+ :
+ <LoadingScreen />
+ }
</div>
</div>
</div>
diff --git a/web/react/components/activity_log_modal.jsx b/web/react/components/activity_log_modal.jsx
index 90f139e8b..f28f0d5f1 100644
--- a/web/react/components/activity_log_modal.jsx
+++ b/web/react/components/activity_log_modal.jsx
@@ -4,6 +4,8 @@
var UserStore = require('../stores/user_store.jsx');
var Client = require('../utils/client.jsx');
var AsyncClient = require('../utils/async_client.jsx');
+var LoadingScreen = require('./loading_screen.jsx');
+var utils = require('../utils/utils.jsx');
function getStateFromStoresForSessions() {
return {
@@ -29,7 +31,9 @@ module.exports = React.createClass({
},
componentDidMount: function() {
UserStore.addSessionsChangeListener(this._onChange);
- AsyncClient.getSessions();
+ $(this.refs.modal.getDOMNode()).on('shown.bs.modal', function (e) {
+ AsyncClient.getSessions();
+ });
var self = this;
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) {
@@ -40,7 +44,10 @@ module.exports = React.createClass({
UserStore.removeSessionsChangeListener(this._onChange);
},
_onChange: function() {
- this.setState(getStateFromStoresForSessions());
+ var newState = getStateFromStoresForSessions();
+ if (!utils.areStatesEqual(newState.sessions, this.state.sessions)) {
+ this.setState(newState);
+ }
},
handleMoreInfo: function(index) {
var newMoreInfo = this.state.moreInfo;
@@ -106,10 +113,16 @@ module.exports = React.createClass({
</div>
<p className="session-help-text">Sessions are created when you log in with your email and password to a new browser on a device. Sessions let you use Mattermost for up to 30 days without having to log in again. If you want to log out sooner, use the "Logout" button below to end a session.</p>
<div ref="modalBody" className="modal-body">
+ { !this.state.sessions.loading ?
+ <div>
<form role="form">
{ activityList }
</form>
{ server_error }
+ </div>
+ :
+ <LoadingScreen />
+ }
</div>
</div>
</div>
diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx
index 7a129f200..76dbe370b 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -153,7 +153,7 @@ module.exports = React.createClass({
if (isDirect) {
if (this.state.users.length > 1) {
var contact = this.state.users[((this.state.users[0].id === currentId) ? 1 : 0)];
- channelTitle = <UserProfile userId={contact.id} overwriteName={contact.nickname || contact.username} />;
+ channelTitle = contact.nickname || contact.username;
}
}
@@ -161,13 +161,13 @@ module.exports = React.createClass({
<table className="channel-header alt">
<tr>
<th>
- { !isDirect ?
<div className="channel-header__info">
<div className="dropdown">
<a href="#" className="dropdown-toggle theme" type="button" id="channel_header_dropdown" data-toggle="dropdown" aria-expanded="true">
<strong className="heading">{channelTitle} </strong>
<span className="glyphicon glyphicon-chevron-down header-dropdown__icon"></span>
</a>
+ { !isDirect ?
<ul className="dropdown-menu" role="menu" aria-labelledby="channel_header_dropdown">
<li role="presentation"><a role="menuitem" data-toggle="modal" data-target="#channel_info" data-channelid={channel.id} href="#">View Info</a></li>
{ !ChannelStore.isDefault(channel) ?
@@ -193,12 +193,14 @@ module.exports = React.createClass({
: null
}
</ul>
+ :
+ <ul className="dropdown-menu" role="menu" aria-labelledby="channel_header_dropdown">
+ <li role="presentation"><a role="menuitem" href="#" data-toggle="modal" data-target="#edit_channel" data-desc={channel.description} data-title={channel.display_name} data-channelid={channel.id}>Set Channel Description...</a></li>
+ </ul>
+ }
</div>
<div data-toggle="popover" data-content={popoverContent} className="description">{description}</div>
</div>
- :
- <a href="#"><strong className="heading">{channelTitle}</strong></a>
- }
</th>
<th><PopoverListMembers members={this.state.users} channelId={channel.id} /></th>
<th className="search-bar__container"><NavbarSearchBox /></th>
diff --git a/web/react/components/delete_post_modal.jsx b/web/react/components/delete_post_modal.jsx
index 11970bc2b..f0cb809af 100644
--- a/web/react/components/delete_post_modal.jsx
+++ b/web/react/components/delete_post_modal.jsx
@@ -98,7 +98,7 @@ module.exports = React.createClass({
: "" }
</div>
<div className="modal-footer">
- <button type="button" className="btn btn-default" data-dismiss="modal">Close</button>
+ <button type="button" className="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" className="btn btn-danger" data-dismiss="modal" onClick={this.handleDelete}>Delete</button>
</div>
</div>
diff --git a/web/react/components/file_preview.jsx b/web/react/components/file_preview.jsx
index fdd12feec..7c1db3e10 100644
--- a/web/react/components/file_preview.jsx
+++ b/web/react/components/file_preview.jsx
@@ -24,7 +24,7 @@ module.exports = React.createClass({
if (filename.indexOf("/api/v1/files/get") != -1) {
filename = filename.split("/api/v1/files/get")[1];
}
- filename = window.location.origin + "/api/v1/files/get" + filename;
+ filename = utils.getWindowLocationOrigin() + "/api/v1/files/get" + filename;
if (type === "image") {
previews.push(
diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx
index 05918650b..fe0a47777 100644
--- a/web/react/components/login.jsx
+++ b/web/react/components/login.jsx
@@ -103,13 +103,9 @@ module.exports = React.createClass({
return (
<div className="signup-team__container">
- <div>
- <span className="signup-team__name">{ teamDisplayName }</span>
- <br/>
- <span className="signup-team__subdomain">/{ teamName }/</span>
- <br/>
- <br/>
- </div>
+ <h5 className="margin--less">Sign in to:</h5>
+ <h2 className="signup-team__name">{ teamDisplayName }</h2>
+ <h2 className="signup-team__subdomain">on { config.SiteName }</h2>
<form onSubmit={this.handleSubmit}>
<div className={server_error ? 'form-group has-error' : 'form-group'}>
{ server_error }
@@ -124,13 +120,13 @@ module.exports = React.createClass({
<button type="submit" className="btn btn-primary">Sign in</button>
</div>
{ login_message }
- <div className="form-group form-group--small">
+ <div className="form-group margin--extra form-group--small">
<span><a href="/find_team">{"Find other " + strings.TeamPlural}</a></span>
</div>
<div className="form-group">
<a href={"/" + teamName + "/reset_password"}>I forgot my password</a>
</div>
- <div className="external-link">
+ <div className="margin--extra">
<span>{"Want to create your own " + strings.Team + "?"} <a href="/" className="signup-team-login">Sign up now</a></span>
</div>
</form>
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index 9f598ecb3..641ffeef2 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -32,7 +32,7 @@ module.exports = React.createClass({
if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
}
- fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
+ fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
if (type === "image") {
$('<img/>').attr('src', fileInfo.path+'_thumb.jpg').load(function(path, name){ return function() {
@@ -112,7 +112,7 @@ module.exports = React.createClass({
if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
}
- fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
+ fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
if (type === "image") {
if (i < Constants.MAX_DISPLAY_FILES) {
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 8dc5013ca..46f77660d 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -309,12 +309,15 @@ module.exports = React.createClass({
var more_messages = <p className="beginning-messages-text">Beginning of Channel</p>;
+ var userStyle = { color: UserStore.getCurrentUser().props.theme }
+
if (channel != null) {
if (order.length > 0 && order.length % Constants.POST_CHUNK_SIZE === 0) {
more_messages = <a ref="loadmore" className="more-messages-text theme" href="#" onClick={this.getMorePosts}>Load more messages</a>;
} else if (channel.type === 'D') {
var teammate = utils.getDirectTeammate(channel.id)
+
if (teammate) {
var teammate_name = teammate.nickname.length > 0 ? teammate.nickname : teammate.username;
more_messages = (
@@ -329,6 +332,7 @@ module.exports = React.createClass({
{"This is the start of your private message history with " + teammate_name + "." }<br/>
{"Private messages and files shared here are not shown to people outside this area."}
</p>
+ <a className="intro-links" href="#" style={userStyle} data-toggle="modal" data-target="#edit_channel" data-desc={channel.description} data-title={channel.display_name} data-channelid={channel.id}><i className="fa fa-pencil"></i>Set a description</a>
</div>
);
} else {
@@ -342,7 +346,6 @@ module.exports = React.createClass({
var ui_name = channel.display_name
var members = ChannelStore.getCurrentExtraInfo().members;
var creator_name = "";
- var userStyle = { color: UserStore.getCurrentUser().props.theme }
for (var i = 0; i < members.length; i++) {
if (members[i].roles.indexOf('admin') > -1) {
@@ -374,7 +377,7 @@ module.exports = React.createClass({
<div className="channel-intro">
<h4 className="channel-intro__title">Beginning of {ui_name}</h4>
<p className="channel-intro__content">
- {"This is the start of " + ui_name + ", a channel for conversations you’d prefer out of more focused channels."}
+ {"This is the start of " + ui_name + ", a channel for non-work-related conversations."}
<br/>
</p>
<a className="intro-links" href="#" style={userStyle} data-toggle="modal" data-target="#edit_channel" data-desc={channel.description} data-title={ui_name} data-channelid={channel.id}><i className="fa fa-pencil"></i>Set a description</a>
diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx
index 567be1962..8097a181e 100644
--- a/web/react/components/post_right.jsx
+++ b/web/react/components/post_right.jsx
@@ -98,7 +98,7 @@ RootPost = React.createClass({
if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
}
- fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
+ fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
if (ftype === "image") {
var url = fileInfo.path.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29');
@@ -208,7 +208,7 @@ CommentPost = React.createClass({
if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
}
- fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
+ fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
if (type === "image") {
var url = fileInfo.path.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29');
diff --git a/web/react/components/rename_channel_modal.jsx b/web/react/components/rename_channel_modal.jsx
index 9e4a25f85..d67ab3afe 100644
--- a/web/react/components/rename_channel_modal.jsx
+++ b/web/react/components/rename_channel_modal.jsx
@@ -96,7 +96,7 @@ module.exports = React.createClass({
var self = this;
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function(e) {
var button = $(e.relatedTarget);
- self.setState({ display_name: button.attr('data-display'), title: button.attr('data-name'), channel_id: button.attr('data-channelid') });
+ self.setState({ display_name: button.attr('data-display'), channel_name: button.attr('data-name'), channel_id: button.attr('data-channelid') });
});
$(this.refs.modal.getDOMNode()).on('hidden.bs.modal', this.handleClose);
},
diff --git a/web/react/components/search_bar.jsx b/web/react/components/search_bar.jsx
index f21f0cd58..e39cf5d46 100644
--- a/web/react/components/search_bar.jsx
+++ b/web/react/components/search_bar.jsx
@@ -36,6 +36,9 @@ module.exports = React.createClass({
}
}
},
+ clearFocus: function(e) {
+ $('.search-bar__container').removeClass('focused');
+ },
handleClose: function(e) {
e.preventDefault();
@@ -57,6 +60,7 @@ module.exports = React.createClass({
},
handleUserFocus: function(e) {
e.target.select();
+ $('.search-bar__container').addClass('focused');
},
performSearch: function(terms, isMentionSearch) {
if (terms.length) {
@@ -92,13 +96,14 @@ module.exports = React.createClass({
render: function() {
return (
<div>
- <div className="sidebar__collapse" onClick={this.handleClose}>Cancel</div>
- <span className="glyphicon glyphicon-search sidebar__search-icon"></span>
+ <div className="sidebar__collapse" onClick={this.handleClose}><span className="fa fa-angle-left"></span></div>
+ <span onClick={this.clearFocus} className="search__clear">Cancel</span>
<form role="form" className="search__form relative-div" onSubmit={this.handleSubmit}>
+ <span className="glyphicon glyphicon-search sidebar__search-icon"></span>
<input
type="text"
ref="search"
- className="form-control search-bar-box"
+ className="form-control search-bar"
placeholder="Search"
value={this.state.search_term}
onFocus={this.handleUserFocus}
diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx
index 5b442aeac..0156dc01a 100644
--- a/web/react/components/sidebar_header.jsx
+++ b/web/react/components/sidebar_header.jsx
@@ -68,10 +68,10 @@ var NavbarDropdown = React.createClass({
for (var i = 0; i < this.state.teams.length; i++) {
var teamName = this.state.teams[i];
- teams.push(<li key={ teamName }><a href={window.location.origin + "/" + teamName }>Switch to { teamName }</a></li>);
+ teams.push(<li key={ teamName }><a href={utils.getWindowLocationOrigin() + "/" + teamName }>Switch to { teamName }</a></li>);
}
}
- teams.push(<li><a href={window.location.origin + "/signup_team" }>Create a New Team</a></li>);
+ teams.push(<li><a href={utils.getWindowLocationOrigin() + "/signup_team" }>Create a New Team</a></li>);
return (
<ul className="nav navbar-nav navbar-right">
@@ -107,6 +107,10 @@ module.exports = React.createClass({
};
},
+ toggleDropdown: function(e) {
+ $('.team__header').find('.dropdown-toggle').trigger('click');
+ },
+
render: function() {
var me = UserStore.getCurrentUser();
@@ -116,7 +120,7 @@ module.exports = React.createClass({
return (
<div className="team__header theme">
- <a className="settings_link" href="#" data-toggle="modal" data-target="#user_settings1">
+ <a href="#" onClick={this.toggleDropdown}>
{ me.last_picture_update ?
<img className="user__picture" src={"/api/v1/users/" + me.id + "/image?time=" + me.update_at} />
:
diff --git a/web/react/components/signup_team.jsx b/web/react/components/signup_team.jsx
index 362f79163..edd48e0b9 100644
--- a/web/react/components/signup_team.jsx
+++ b/web/react/components/signup_team.jsx
@@ -20,21 +20,12 @@ module.exports = React.createClass({
state.email_error = "";
}
- team.display_name = this.refs.name.getDOMNode().value.trim();
- if (!team.display_name) {
- state.name_error = "This field is required";
- state.inValid = true;
- }
- else {
- state.name_error = "";
- }
-
if (state.inValid) {
this.setState(state);
return;
}
- client.signupTeam(team.email, team.display_name,
+ client.signupTeam(team.email,
function(data) {
if (data["follow_link"]) {
window.location.href = data["follow_link"];
@@ -55,7 +46,6 @@ module.exports = React.createClass({
render: function() {
var email_error = this.state.email_error ? <label className='control-label'>{ this.state.email_error }</label> : null;
- var name_error = this.state.name_error ? <label className='control-label'>{ this.state.name_error }</label> : null;
var server_error = this.state.server_error ? <div className={ "form-group has-error" }><label className='control-label'>{ this.state.server_error }</label></div> : null;
return (
@@ -64,15 +54,11 @@ module.exports = React.createClass({
<input autoFocus={true} type="email" ref="email" className="form-control" placeholder="Email Address" maxLength="128" />
{ email_error }
</div>
- <div className={ name_error ? "form-group has-error" : "form-group" }>
- <input type="text" ref="name" className="form-control" placeholder={utils.toTitleCase(strings.Company) + " Name"} maxLength="64" />
- { name_error }
- </div>
{ server_error }
<div className="form-group">
- <button className="btn btn-md btn-primary" type="submit">Sign up for Free</button>
+ <button className="btn btn-md btn-primary" type="submit">Sign up</button>
</div>
- <div className="form-group form-group--small">
+ <div className="form-group margin--extra-2x">
<span><a href="/find_team">{"Find my " + strings.Team}</a></span>
</div>
</form>
diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx
index 3e8a57308..83daa3b1f 100644
--- a/web/react/components/signup_team_complete.jsx
+++ b/web/react/components/signup_team_complete.jsx
@@ -42,11 +42,15 @@ WelcomePage = React.createClass({
state.email_error = "";
}
- client.signupTeam(email, this.props.state.team.name,
+ client.signupTeam(email,
function(data) {
- this.props.state.wizard = "finished";
- this.props.updateParent(this.props.state);
- window.location.href = "/signup_team_confirm/?email=" + encodeURI(email);
+ if (data["follow_link"]) {
+ window.location.href = data["follow_link"];
+ } else {
+ this.props.state.wizard = "finished";
+ this.props.updateParent(this.props.state);
+ window.location.href = "/signup_team_confirm/?email=" + encodeURIComponent(team.email);
+ }
}.bind(this),
function(err) {
this.state.server_error = err.message;
@@ -80,19 +84,25 @@ WelcomePage = React.createClass({
<div>
<p>
<img className="signup-team-logo" src="/static/images/logo.png" />
- <h2>Welcome!</h2>
- <h3>{"Let's set up your " + strings.Team + " on " + config.SiteName + "."}</h3>
+ <h3 className="sub-heading">Welcome to:</h3>
+ <h1 className="margin--top-none">{config.SiteName}</h1>
</p>
+ <p className="margin--less">Let's set up your new team</p>
<p>
Please confirm your email address:<br />
- <span className="black">{ this.props.state.team.email }</span><br />
+ <div className="inner__content">
+ <div className="block--gray">{ this.props.state.team.email }</div>
+ </div>
+ </p>
+ <p className="margin--extra color--light">
+ Your account will administer the new team site. <br />
+ You can add other administrators later.
</p>
<div className="form-group">
<button className="btn-primary btn form-group" type="submit" onClick={this.submitNext}><i className="glyphicon glyphicon-ok"></i>Yes, this address is correct</button>
{ storage_error }
</div>
<hr />
- <p>If this is not correct, you can switch to a different email. We'll send you a new invite right away.</p>
<div className={ this.state.use_diff ? "" : "hidden" }>
<div className={ email_error ? "form-group has-error" : "form-group" }>
<div className="row">
@@ -105,7 +115,7 @@ WelcomePage = React.createClass({
{ server_error }
<button className="btn btn-md btn-primary" type="button" onClick={this.handleDiffSubmit} type="submit">Use this instead</button>
</div>
- <button type="button" onClick={this.handleDiffEmail} className={ this.state.use_diff ? "btn-default btn hidden" : "btn-default btn" }>Use a different address</button>
+ <a href="#" onClick={this.handleDiffEmail} className={ this.state.use_diff ? "hidden" : "" }>Use a different email</a>
</div>
);
}
@@ -128,6 +138,7 @@ TeamDisplayNamePage = React.createClass({
this.props.state.wizard = "team_url";
this.props.state.team.display_name = display_name;
+ this.props.state.team.name = utils.cleanUpUrlable(display_name);
this.props.updateParent(this.props.state);
},
getInitialState: function() {
@@ -158,9 +169,11 @@ TeamDisplayNamePage = React.createClass({
</div>
{ name_error }
</div>
- <p>{"Your " + strings.Team + " name shows in menus and headings. It may include the name of your " + strings.Company + ", but it's not required."}</p>
- <button type="button" className="btn btn-default" onClick={this.submitBack}><i className="glyphicon glyphicon-chevron-left"></i> Back</button>&nbsp;
- <button type="submit" className="btn-primary btn" onClick={this.submitNext}>Next<i className="glyphicon glyphicon-chevron-right"></i></button>
+ <div>{"Name your " + strings.Team + " in any language. Your " + strings.Team + " name shows in menus and headings."}</div>
+ <button type="submit" className="btn btn-primary margin--extra" onClick={this.submitNext}>Next<i className="glyphicon glyphicon-chevron-right"></i></button>
+ <div className="margin--extra">
+ <a href="#" onClick={this.submitBack}>Back to previous step</a>
+ </div>
</form>
</div>
);
@@ -248,17 +261,23 @@ TeamURLPage = React.createClass({
<div className="row">
<div className="col-sm-11">
<div className="input-group">
- <span className="input-group-addon">{ window.location.origin + "/" }</span>
+ <span className="input-group-addon">{ utils.getWindowLocationOrigin() + "/" }</span>
<input type="text" ref="name" className="form-control" placeholder="" maxLength="128" defaultValue={this.props.state.team.name} autoFocus={true} onFocus={this.handleFocus}/>
</div>
</div>
</div>
{ name_error }
</div>
- <p className="black">{"Pick something short and memorable for your " + strings.Team + "'s web address."}</p>
- <p>{"Your " + strings.Team + " URL can only contain lowercase letters, numbers and dashes. Also, it needs to start with a letter and cannot end in a dash."}</p>
- <button type="button" className="btn btn-default" onClick={this.submitBack}><i className="glyphicon glyphicon-chevron-left"></i> Back</button>&nbsp;
- <button type="submit" className="btn-primary btn" onClick={this.submitNext}>Next<i className="glyphicon glyphicon-chevron-right"></i></button>
+ <p>{"Choose the web address of your new " + strings.Team + ":"}</p>
+ <ul className="color--light">
+ <li>Short and memorable is best</li>
+ <li>Use lowercase letters, numbers and dashes</li>
+ <li>Must start with a letter and can't end in a dash</li>
+ </ul>
+ <button type="submit" className="btn btn-primary margin--extra" onClick={this.submitNext}>Next<i className="glyphicon glyphicon-chevron-right"></i></button>
+ <div className="margin--extra">
+ <a href="#" onClick={this.submitBack}>Back to previous step</a>
+ </div>
</form>
</div>
);
@@ -461,14 +480,16 @@ SendInivtesPage = React.createClass({
return (
<div>
<form>
- <img className="signup-team-logo" src="/static/images/logo.png" />
- <h2>Send Invitations</h2>
- { emails }
- <div className="form-group"><button type="button" className="btn-default btn" onClick={this.submitAddInvite}>Add Invitation</button></div>
- <div className="form btn-default-group"><button type="button" className="btn btn-default" onClick={this.submitBack}><i className="glyphicon glyphicon-chevron-left"></i> Back</button>&nbsp;<button type="submit" className="btn-primary btn" onClick={this.submitNext}>Next<i className="glyphicon glyphicon-chevron-right"></i></button></div>
- </form>
- <p>{"If you'd prefer, you can send invitations after you finish setting up the "+ strings.Team + "."}</p>
- <div><a href="#" onClick={this.submitSkip}>Skip this step</a></div>
+ <img className="signup-team-logo" src="/static/images/logo.png" />
+ <h2>{"Invite " + utils.toTitleCase(strings.Team) + " Members"}</h2>
+ { emails }
+ <div className="form-group text-right"><a href="#" onClick={this.submitAddInvite}>Add Invitation</a></div>
+ <div className="form-group"><button type="submit" className="btn-primary btn" onClick={this.submitNext}>Next<i className="glyphicon glyphicon-chevron-right"></i></button></div>
+ </form>
+ <p className="color--light">{"if you prefer, you can invite " + strings.Team + " members later"}<br /> and <a href="#" onClick={this.submitSkip}>skip this step</a> for now.</p>
+ <div className="margin--extra">
+ <a href="#" onClick={this.submitBack}>Back to previous step</a>
+ </div>
</div>
);
}
@@ -512,19 +533,24 @@ UsernamePage = React.createClass({
<div>
<form>
<img className="signup-team-logo" src="/static/images/logo.png" />
- <h2>Choose a username</h2>
- <div className={ name_error ? "form-group has-error" : "form-group" }>
- <div className="row">
- <div className="col-sm-9">
- <input autoFocus={true} type="text" ref="name" className="form-control" placeholder="" defaultValue={this.props.state.user.username} maxLength="128" />
+ <h2 className="margin--less">Your username</h2>
+ <h5 className="color--light">{"Select a memorable username that makes it easy for " + strings.Team + "mates to identify you:"}</h5>
+ <div className="inner__content margin--extra">
+ <div className={ name_error ? "form-group has-error" : "form-group" }>
+ <div className="row">
+ <div className="col-sm-11">
+ <h5><strong>Choose your username</strong></h5>
+ <input autoFocus={true} type="text" ref="name" className="form-control" placeholder="" defaultValue={this.props.state.user.username} maxLength="128" />
+ <div className="color--light form__hint">Usernames must begin with a letter and contain 3 to 15 characters made up of lowercase letters, numbers, and the symbols '.', '-' and '_'</div>
+ </div>
+ </div>
+ { name_error }
</div>
</div>
- { name_error }
+ <button type="submit" className="btn btn-primary margin--extra" onClick={this.submitNext}>Next<i className="glyphicon glyphicon-chevron-right"></i></button>
+ <div className="margin--extra">
+ <a href="#" onClick={this.submitBack}>Back to previous step</a>
</div>
- <p>{"Pick something " + strings.Team + "mates will recognize. Your username is how you will appear to others."}</p>
- <p>It can be made of lowercase letters and numbers.</p>
- <button type="button" className="btn btn-default" onClick={this.submitBack}><i className="glyphicon glyphicon-chevron-left"></i> Back</button>&nbsp;
- <button type="submit" className="btn-primary btn" onClick={this.submitNext}>Next<i className="glyphicon glyphicon-chevron-right"></i></button>
</form>
</div>
);
@@ -542,15 +568,15 @@ PasswordPage = React.createClass({
var password = this.refs.password.getDOMNode().value.trim();
if (!password || password.length < 5) {
- this.setState({name_error: "Please enter at least 5 characters"});
+ this.setState({password_error: "Please enter at least 5 characters"});
return;
}
- this.setState({name_error: ""});
+ this.setState({password_error: null, server_error: null});
$('#finish-button').button('loading');
var teamSignup = JSON.parse(JSON.stringify(this.props.state));
teamSignup.user.password = password;
- teamSignup.user.allow_marketing = this.refs.email_service.getDOMNode().checked;
+ teamSignup.user.allow_marketing = true;
delete teamSignup.wizard;
var ctl = this;
@@ -561,28 +587,26 @@ PasswordPage = React.createClass({
var props = this.props;
- setTimeout(function() {
- $('#sign-up-button').button('reset');
- props.state.wizard = "finished";
- props.updateParent(props.state, true);
-
- window.location.href = window.location.origin + '/' + props.state.team.name + '/login?email=' + encodeURIComponent(teamSignup.team.email);
-
- // client.loginByEmail(teamSignup.team.domain, teamSignup.team.email, teamSignup.user.password,
- // function(data) {
- // TeamStore.setLastName(teamSignup.team.domain);
- // UserStore.setLastEmail(teamSignup.team.email);
- // UserStore.setCurrentUser(data);
- // window.location.href = '/channels/town-square';
- // }.bind(ctl),
- // function(err) {
- // this.setState({name_error: err.message});
- // }.bind(ctl)
- // );
- }, 5000);
+ $('#sign-up-button').button('reset');
+ props.state.wizard = "finished";
+ props.updateParent(props.state, true);
+
+ window.location.href = utils.getWindowLocationOrigin() + '/' + props.state.team.name + '/login?email=' + encodeURIComponent(teamSignup.team.email);
+
+ // client.loginByEmail(teamSignup.team.domain, teamSignup.team.email, teamSignup.user.password,
+ // function(data) {
+ // TeamStore.setLastName(teamSignup.team.domain);
+ // UserStore.setLastEmail(teamSignup.team.email);
+ // UserStore.setCurrentUser(data);
+ // window.location.href = '/channels/town-square';
+ // }.bind(ctl),
+ // function(err) {
+ // this.setState({name_error: err.message});
+ // }.bind(ctl)
+ // );
}.bind(this),
function(err) {
- this.setState({name_error: err.message});
+ this.setState({server_error: err.message});
$('#sign-up-button').button('reset');
}.bind(this)
);
@@ -594,30 +618,37 @@ PasswordPage = React.createClass({
client.track('signup', 'signup_team_07_password');
- var name_error = this.state.name_error ? <label className="control-label">{ this.state.name_error }</label> : null;
+ var password_error = this.state.password_error ? <div className="form-group has-error"><label className="control-label">{ this.state.password_error }</label></div> : null;
+ var server_error = this.state.server_error ? <div className="form-group has-error"><label className="control-label">{ this.state.server_error }</label></div> : null;
return (
<div>
<form>
<img className="signup-team-logo" src="/static/images/logo.png" />
- <h2>Choose a password</h2>
- <p>You'll use your email address ({this.props.state.team.email}) and password to log into {config.SiteName}.</p>
- <div className={ name_error ? "form-group has-error" : "form-group" }>
- <div className="row">
- <div className="col-sm-9">
- <input autoFocus={true} type="password" ref="password" className="form-control" placeholder="" maxLength="128" />
+ <h2 className="margin--less">Your password</h2>
+ <h5 className="color--light">Select a password that you'll use to login with your email address:</h5>
+ <div className="inner__content margin--extra">
+ <h5><strong>Email</strong></h5>
+ <div className="block--gray form-group">{this.props.state.team.email}</div>
+ <div className={ password_error ? "form-group has-error" : "form-group" }>
+ <div className="row">
+ <div className="col-sm-11">
+ <h5><strong>Choose your password</strong></h5>
+ <input autoFocus={true} type="password" ref="password" className="form-control" placeholder="" maxLength="128" />
+ <div className="color--light form__hint">Passwords must contain 5 to 50 characters. Your password will be strongest if it contains a mix of symbols, numbers, and upper and lowercase characters.</div>
+ </div>
+ </div>
+ { password_error }
+ { server_error }
</div>
- </div>
- { name_error }
- </div>
- <div className="form-group checkbox">
- <label><input type="checkbox" ref="email_service" /> It's ok to send me occassional email with updates about the {config.SiteName} service.</label>
</div>
<div className="form-group">
- <button type="button" className="btn btn-default" onClick={this.submitBack}><i className="glyphicon glyphicon-chevron-left"></i> Back</button>&nbsp;
- <button type="submit" className="btn-primary btn" id="finish-button" data-loading-text={"<span class='glyphicon glyphicon-refresh glyphicon-refresh-animate'></span> Creating "+strings.Team+"..."} onClick={this.submitNext}>Finish</button>
+ <button type="submit" className="btn btn-primary margin--extra" id="finish-button" data-loading-text={"<span class='glyphicon glyphicon-refresh glyphicon-refresh-animate'></span> Creating "+strings.Team+"..."} onClick={this.submitNext}>Finish</button>
</div>
<p>By proceeding to create your account and use { config.SiteName }, you agree to our <a href={ config.TermsLink }>Terms of Service</a> and <a href={ config.PrivacyLink }>Privacy Policy</a>. If you do not agree, you cannot use {config.SiteName}.</p>
+ <div className="margin--extra">
+ <a href="#" onClick={this.submitBack}>Back to previous step</a>
+ </div>
</form>
</div>
);
@@ -640,9 +671,6 @@ module.exports = React.createClass({
props.wizard = "welcome";
props.team = {};
props.team.email = this.props.email;
- props.team.display_name = this.props.name;
- props.team.company_name = this.props.name;
- props.team.name = utils.cleanUpUrlable(this.props.name);
props.team.allowed_domains = "";
props.invites = [];
props.invites.push("");
diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx
index bbf1f670c..670aab943 100644
--- a/web/react/components/signup_user_complete.jsx
+++ b/web/react/components/signup_user_complete.jsx
@@ -40,7 +40,7 @@ module.exports = React.createClass({
this.setState({name_error: "", email_error: "", password_error: "", server_error: ""});
- this.state.user.allow_marketing = this.refs.email_service.getDOMNode().checked;
+ this.state.user.allow_marketing = true;
client.createUser(this.state.user, this.state.data, this.state.hash,
function(data) {
@@ -104,8 +104,8 @@ module.exports = React.createClass({
var yourEmailIs = this.state.user.email == "" ? "" : <span>Your email address is { this.state.user.email }. </span>
var email = (
- <div className={ this.state.original_email == "" ? "" : "hidden"} >
- <label className="control-label">Email</label>
+ <div className={ this.state.original_email == "" ? "margin--extra" : "hidden"} >
+ <h5><strong>What's your email address?</strong></h5>
<div className={ email_error ? "form-group has-error" : "form-group" }>
<input type="email" ref="email" className="form-control" defaultValue={ this.state.user.email } placeholder="" maxLength="128" />
{ email_error }
@@ -124,29 +124,33 @@ module.exports = React.createClass({
return (
<div>
<img className="signup-team-logo" src="/static/images/logo.png" />
- <h3 className="text-center extra-margin">Signup to { config.SiteName }</h3>
- <div className="form-group form-group--small">
- <span></span>
- </div>
+ <h5 className="margin--less">Welcome to:</h5>
+ <h2 className="signup-team__name">{ this.props.teamDisplayName }</h2>
+ <h2 className="signup-team__subdomain">on { config.SiteName }</h2>
+ <h4 className="color--light">Let's create your account</h4>
{ signup_message }
- <label className="control-label">Username</label>
- <div className={ name_error ? "form-group has-error" : "form-group" }>
- <input type="text" ref="name" className="form-control" placeholder="" maxLength="128" />
- { name_error }
- <p className="form__hint">Your username can be made of lowercase letters and numbers.</p>
- <p className="form__hint">{"Pick something " + strings.Team + "mates will recognize. Your username is how you will appear to others"}</p>
- </div>
- { email }
- <label className="control-label">Password</label>
- <div className={ password_error ? "form-group has-error" : "form-group" }>
- <input type="password" ref="password" className="form-control" placeholder="" maxLength="128" />
- { password_error }
- </div>
- <p className={ this.state.original_email == "" ? "hidden" : ""}>{ yourEmailIs } You’ll use this address to sign in to {config.SiteName}.</p>
- <div className="checkbox"><label><input type="checkbox" ref="email_service" /> It's ok to send me occassional email with updates about the {config.SiteName} service. </label></div>
- <p><button onClick={this.handleSubmit} className="btn-primary btn">Create Account</button></p>
+ <div className="inner__content">
+ { email }
+ <p className={ this.state.original_email == "" ? "hidden" : ""}>{ yourEmailIs } You’ll use this address to sign in to {config.SiteName}.</p>
+ <div className="margin--extra">
+ <h5><strong>Choose your username</strong></h5>
+ <div className={ name_error ? "form-group has-error" : "form-group" }>
+ <input type="text" ref="name" className="form-control" placeholder="" maxLength="128" />
+ { name_error }
+ <p className="form__hint">Username must begin with a letter, and contain between 3 to 15 lowercase characters made up of numbers, letters, and the symbols '.', '-' and '_'"</p>
+ </div>
+ </div>
+ <div className="margin--extra">
+ <h5><strong>Choose your password</strong></h5>
+ <div className={ password_error ? "form-group has-error" : "form-group" }>
+ <input type="password" ref="password" className="form-control" placeholder="" maxLength="128" />
+ { password_error }
+ </div>
+ </div>
+ </div>
+ <p className="margin--extra"><button onClick={this.handleSubmit} className="btn-primary btn">Create Account</button></p>
{ server_error }
- <p>By proceeding to create your account and use { config.SiteName }, you agree to our <a href={ config.TermsLink }>Terms of Service</a> and <a href={ config.PrivacyLink }>Privacy Policy</a>. If you do not agree, you cannot use {config.SiteName}.</p>
+ <p>By creating an account and using Mattermost you are agreeing to our <a href={ config.TermsLink }>Terms of Service</a>. If you do not agree, you cannot use this service.</p>
</div>
);
}
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx
index c107de4d7..7b096c629 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -40,7 +40,7 @@ module.exports = React.createClass({
if (fileInfo.path.indexOf("/api/v1/files/get") !== -1) {
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
}
- fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
+ fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
src = fileInfo['path'] + '_preview.jpg';
}
@@ -148,7 +148,7 @@ module.exports = React.createClass({
if (info.path.indexOf("/api/v1/files/get") !== -1) {
info.path = info.path.split("/api/v1/files/get")[1];
}
- info.path = window.location.origin + "/api/v1/files/get" + info.path;
+ info.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + info.path;
preview_filename = info['path'] + '_preview.jpg';
}
@@ -166,7 +166,7 @@ module.exports = React.createClass({
if (download_link.indexOf("/api/v1/files/get") !== -1) {
download_link = download_link.split("/api/v1/files/get")[1];
}
- download_link = window.location.origin + "/api/v1/files/get" + download_link;
+ download_link = utils.getWindowLocationOrigin() + "/api/v1/files/get" + download_link;
return (
<div className="modal fade image_modal" ref="modal" id={this.props.modalId} tabIndex="-1" role="dialog" aria-hidden="true">
diff --git a/web/react/package.json b/web/react/package.json
index 8d9d57fab..2bba29e2b 100644
--- a/web/react/package.json
+++ b/web/react/package.json
@@ -16,7 +16,9 @@
"jest-cli": "~0.1.17",
"reactify": "^0.15.2",
"uglify-js": "~2.4.15",
- "watchify": "^2.1.1"
+ "watchify": "^2.1.1",
+ "eslint": "^0.24.1",
+ "eslint-plugin-react": "^3.0.0"
},
"scripts": {
"start": "watchify --extension=jsx -o ../static/js/bundle.js -v -d ./**/*.jsx",
diff --git a/web/react/pages/signup_team_complete.jsx b/web/react/pages/signup_team_complete.jsx
index 346f2ab5a..71806c2ea 100644
--- a/web/react/pages/signup_team_complete.jsx
+++ b/web/react/pages/signup_team_complete.jsx
@@ -3,9 +3,9 @@
var SignupTeamComplete =require('../components/signup_team_complete.jsx');
-global.window.setup_signup_team_complete_page = function(email, name, data, hash) {
+global.window.setup_signup_team_complete_page = function(email, data, hash) {
React.render(
- <SignupTeamComplete name={name} email={email} hash={hash} data={data}/>,
+ <SignupTeamComplete email={email} hash={hash} data={data}/>,
document.getElementById('signup-team-complete')
);
};
diff --git a/web/react/pages/signup_user_complete.jsx b/web/react/pages/signup_user_complete.jsx
index 60c3a609a..8f9be1f94 100644
--- a/web/react/pages/signup_user_complete.jsx
+++ b/web/react/pages/signup_user_complete.jsx
@@ -1,7 +1,7 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
-var SignupUserComplete =require('../components/signup_user_complete.jsx');
+var SignupUserComplete = require('../components/signup_user_complete.jsx');
global.window.setup_signup_user_complete_page = function(email, name, ui_name, id, data, hash, auth_services) {
React.render(
diff --git a/web/react/stores/team_store.jsx b/web/react/stores/team_store.jsx
index 3f12725f8..e6380d19e 100644
--- a/web/react/stores/team_store.jsx
+++ b/web/react/stores/team_store.jsx
@@ -11,6 +11,12 @@ var BrowserStore = require('../stores/browser_store.jsx');
var CHANGE_EVENT = 'change';
+var utils;
+function getWindowLocationOrigin() {
+ if (!utils) utils = require('../utils/utils.jsx');
+ return utils.getWindowLocationOrigin();
+}
+
var TeamStore = assign({}, EventEmitter.prototype, {
emitChange: function() {
this.emit(CHANGE_EVENT);
@@ -58,7 +64,7 @@ var TeamStore = assign({}, EventEmitter.prototype, {
return null;
},
getCurrentTeamUrl: function() {
- return window.location.origin + "/" + this.getCurrent().name;
+ return getWindowLocationOrigin() + "/" + this.getCurrent().name;
},
storeTeam: function(team) {
var teams = this._getTeams();
diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx
index 001162f47..aff5a0bed 100644
--- a/web/react/stores/user_store.jsx
+++ b/web/react/stores/user_store.jsx
@@ -164,13 +164,13 @@ var UserStore = assign({}, EventEmitter.prototype, {
BrowserStore.setItem("sessions", sessions);
},
getSessions: function() {
- return BrowserStore.getItem("sessions", []);
+ return BrowserStore.getItem("sessions", {loading: true});
},
setAudits: function(audits) {
BrowserStore.setItem("audits", audits);
},
getAudits: function() {
- return BrowserStore.getItem("audits", []);
+ return BrowserStore.getItem("audits", {loading: true});
},
setTeams: function(teams) {
BrowserStore.setItem("teams", teams);
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index 1c31dc5ed..b8eda0075 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -341,13 +341,13 @@ module.exports.updateTeamDisplayName = function(data, success, error) {
module.exports.track('api', 'api_teams_update_name');
};
-module.exports.signupTeam = function(email, display_name, success, error) {
+module.exports.signupTeam = function(email, success, error) {
$.ajax({
url: "/api/v1/teams/signup",
dataType: 'json',
contentType: 'application/json',
type: 'POST',
- data: JSON.stringify({email: email, display_name: display_name}),
+ data: JSON.stringify({email: email}),
success: success,
error: function(xhr, status, err) {
e = handleError("singupTeam", xhr, status, err);
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index fbf1e0d4f..8a4d92b85 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -22,8 +22,6 @@ module.exports.cleanUpUrlable = function(input) {
return cleaned;
};
-
-
module.exports.isTestDomain = function() {
if ((/^localhost/).test(window.location.hostname))
@@ -841,3 +839,12 @@ module.exports.getDisplayName = function(user) {
}
}
};
+
+//IE10 does not set window.location.origin automatically so this must be called instead when using it
+module.exports.getWindowLocationOrigin = function() {
+ var windowLocationOrigin = window.location.origin;
+ if (!windowLocationOrigin) {
+ windowLocationOrigin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
+ }
+ return windowLocationOrigin;
+};