-
-
-
Choose your password
-
-
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.
+
+
Your password
+
Select a password that you'll use to login with your email address:
+
+
Email
+
{this.props.state.team.email}
+
+
+
+
Choose your password
+
+
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.
+
+
+ {passwordError}
+ {serverError}
- { password_error }
- { server_error }
+
+ Creating ' + strings.Team + '...'} onClick={this.submitNext}>Finish
-
-
- Creating "+strings.Team+"..."} onClick={this.submitNext}>Finish
-
-
By proceeding to create your account and use { config.SiteName }, you agree to our Terms of Service and Privacy Policy . If you do not agree, you cannot use {config.SiteName}.
-
-
+
By proceeding to create your account and use {config.SiteName}, you agree to our Terms of Service and Privacy Policy . If you do not agree, you cannot use {config.SiteName}.
+
+
);
}
@@ -668,14 +739,14 @@ module.exports = React.createClass({
if (!props) {
props = {};
- props.wizard = "welcome";
+ props.wizard = 'welcome';
props.team = {};
props.team.email = this.props.email;
- props.team.allowed_domains = "";
+ props.team.allowed_domains = '';
props.invites = [];
- props.invites.push("");
- props.invites.push("");
- props.invites.push("");
+ props.invites.push('');
+ props.invites.push('');
+ props.invites.push('');
props.user = {};
props.hash = this.props.hash;
props.data = this.props.data;
@@ -684,36 +755,34 @@ module.exports = React.createClass({
return props;
},
render: function() {
- if (this.state.wizard == "welcome") {
- return
+ if (this.state.wizard === 'welcome') {
+ return
;
}
- if (this.state.wizard == "team_display_name") {
- return
+ if (this.state.wizard === 'team_display_name') {
+ return
;
}
- if (this.state.wizard == "team_url") {
- return
+ if (this.state.wizard === 'team_url') {
+ return
;
}
- if (this.state.wizard == "allowed_domains") {
- return
+ if (this.state.wizard === 'allowed_domains') {
+ return
;
}
- if (this.state.wizard == "send_invites") {
- return
+ if (this.state.wizard === 'send_invites') {
+ return
;
}
- if (this.state.wizard == "username") {
- return
+ if (this.state.wizard === 'username') {
+ return
;
}
- if (this.state.wizard == "password") {
- return
+ if (this.state.wizard === 'password') {
+ return
;
}
return (
You've already completed the signup process for this invitation or this invitation has expired.
);
}
});
-
-
diff --git a/web/react/pages/channel.jsx b/web/react/pages/channel.jsx
index 90d90b29f6..9294997151 100644
--- a/web/react/pages/channel.jsx
+++ b/web/react/pages/channel.jsx
@@ -1,7 +1,6 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
-
var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
var Navbar = require('../components/navbar.jsx');
var Sidebar = require('../components/sidebar.jsx');
@@ -36,21 +35,23 @@ var AccessHistoryModal = require('../components/access_history_modal.jsx');
var ActivityLogModal = require('../components/activity_log_modal.jsx');
var RemovedFromChannelModal = require('../components/removed_from_channel_modal.jsx')
+var AsyncClient = require('../utils/async_client.jsx');
var Constants = require('../utils/constants.jsx');
var ActionTypes = Constants.ActionTypes;
global.window.setup_channel_page = function(team_name, team_type, team_id, channel_name, channel_id) {
+ AsyncClient.getConfig();
AppDispatcher.handleViewAction({
- type: ActionTypes.CLICK_CHANNEL,
- name: channel_name,
- id: channel_id
+ type: ActionTypes.CLICK_CHANNEL,
+ name: channel_name,
+ id: channel_id
});
AppDispatcher.handleViewAction({
- type: ActionTypes.CLICK_TEAM,
- id: team_id
+ type: ActionTypes.CLICK_TEAM,
+ id: team_id
});
React.render(
@@ -99,7 +100,7 @@ global.window.setup_channel_page = function(team_name, team_type, team_id, chann
);
React.render(
-
,
+
,
document.getElementById('invite_member_modal')
);
@@ -194,17 +195,17 @@ global.window.setup_channel_page = function(team_name, team_type, team_id, chann
);
React.render(
-
,
+
,
document.getElementById('post_mention_tab')
);
React.render(
-
,
+
,
document.getElementById('reply_mention_tab')
);
React.render(
-
,
+
,
document.getElementById('edit_mention_tab')
);
diff --git a/web/react/pages/signup_team.jsx b/web/react/pages/signup_team.jsx
index e982f5a795..37c441d4fc 100644
--- a/web/react/pages/signup_team.jsx
+++ b/web/react/pages/signup_team.jsx
@@ -1,11 +1,15 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
-var SignupTeam =require('../components/signup_team.jsx');
+var SignupTeam = require('../components/signup_team.jsx');
+
+var AsyncClient = require('../utils/async_client.jsx');
global.window.setup_signup_team_page = function() {
+ AsyncClient.getConfig();
+
React.render(
,
document.getElementById('signup-team')
);
-};
\ No newline at end of file
+};
diff --git a/web/react/stores/config_store.jsx b/web/react/stores/config_store.jsx
new file mode 100644
index 0000000000..7ff177b35f
--- /dev/null
+++ b/web/react/stores/config_store.jsx
@@ -0,0 +1,56 @@
+// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
+var EventEmitter = require('events').EventEmitter;
+var assign = require('object-assign');
+
+var BrowserStore = require('../stores/browser_store.jsx');
+
+var Constants = require('../utils/constants.jsx');
+var ActionTypes = Constants.ActionTypes;
+
+var CHANGE_EVENT = 'change';
+
+var ConfigStore = assign({}, EventEmitter.prototype, {
+ emitChange: function emitChange() {
+ this.emit(CHANGE_EVENT);
+ },
+ addChangeListener: function addChangeListener(callback) {
+ this.on(CHANGE_EVENT, callback);
+ },
+ removeChangeListener: function removeChangeListener(callback) {
+ this.removeListener(CHANGE_EVENT, callback);
+ },
+ getSetting: function getSetting(key, defaultValue) {
+ return BrowserStore.getItem('config_' + key, defaultValue);
+ },
+ getSettingAsBoolean: function getSettingAsNumber(key, defaultValue) {
+ var value = ConfigStore.getSetting(key, defaultValue);
+
+ if (typeof value !== 'string') {
+ return !!value;
+ } else {
+ return value === 'true';
+ }
+ },
+ updateStoredSettings: function updateStoredSettings(settings) {
+ for (var key in settings) {
+ BrowserStore.setItem('config_' + key, settings[key]);
+ }
+ }
+});
+
+ConfigStore.dispatchToken = AppDispatcher.register(function registry(payload) {
+ var action = payload.action;
+
+ switch (action.type) {
+ case ActionTypes.RECIEVED_CONFIG:
+ ConfigStore.updateStoredSettings(action.settings);
+ ConfigStore.emitChange();
+ break;
+ default:
+ }
+});
+
+module.exports = ConfigStore;
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 7e8a6116c8..0b87bbd7b1 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -4,6 +4,7 @@
var client = require('./client.jsx');
var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
var ChannelStore = require('../stores/channel_store.jsx');
+var ConfigStore = require('../stores/config_store.jsx');
var PostStore = require('../stores/post_store.jsx');
var UserStore = require('../stores/user_store.jsx');
var utils = require('./utils.jsx');
@@ -457,3 +458,28 @@ module.exports.getMyTeam = function() {
}
);
}
+
+function getConfig() {
+ if (isCallInProgress('getConfig')) {
+ return;
+ }
+
+ callTracker['getConfig'] = utils.getTimestamp();
+ client.getConfig(
+ function(data, textStatus, xhr) {
+ callTracker['getConfig'] = 0;
+
+ if (data && xhr.status !== 304) {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECIEVED_CONFIG,
+ settings: data
+ });
+ }
+ },
+ function(err) {
+ callTracker['getConfig'] = 0;
+ dispatchError(err, 'getConfig');
+ }
+ );
+}
+module.exports.getConfig = getConfig;
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index f2b6619a51..5aab80d014 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -880,3 +880,18 @@ module.exports.updateValetFeature = function(data, success, error) {
module.exports.track('api', 'api_teams_update_valet_feature');
};
+
+function getConfig(success, error) {
+ $.ajax({
+ url: '/api/v1/config/get_all',
+ dataType: 'json',
+ type: 'GET',
+ ifModified: true,
+ success: success,
+ error: function(xhr, status, err) {
+ var e = handleError('getConfig', xhr, status, err);
+ error(e);
+ }
+ });
+};
+module.exports.getConfig = getConfig;
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index 0c714567a8..508de9185c 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -31,6 +31,8 @@ module.exports = {
CLICK_TEAM: null,
RECIEVED_TEAM: null,
+
+ RECIEVED_CONFIG: null
}),
PayloadSources: keyMirror({