Removed isEmailEnabledSynchronous and switched the email disabled warnings to use ConfigStore
Этот коммит содержится в:
@@ -18,7 +18,6 @@ func InitConfig(r *mux.Router) {
|
|||||||
|
|
||||||
sr := r.PathPrefix("/config").Subrouter()
|
sr := r.PathPrefix("/config").Subrouter()
|
||||||
sr.Handle("/get_all", ApiAppHandler(getConfig)).Methods("GET")
|
sr.Handle("/get_all", ApiAppHandler(getConfig)).Methods("GET")
|
||||||
sr.Handle("/get/bypass_email", ApiAppHandler(getBypassEmail)).Methods("GET")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
func getConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -33,7 +32,3 @@ func getConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Write(bytes)
|
w.Write(bytes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getBypassEmail(c *Context, w http.ResponseWriter, r *http.Request) {
|
|
||||||
w.Write([]byte(strconv.FormatBool(utils.Cfg.EmailSettings.ByPassEmail)))
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
var utils = require('../utils/utils.jsx');
|
var utils = require('../utils/utils.jsx');
|
||||||
|
var ConfigStore = require('../stores/config_store.jsx');
|
||||||
var Client = require('../utils/client.jsx');
|
var Client = require('../utils/client.jsx');
|
||||||
var UserStore = require('../stores/user_store.jsx');
|
var UserStore = require('../stores/user_store.jsx');
|
||||||
var ConfirmModal = require('./confirm_modal.jsx');
|
var ConfirmModal = require('./confirm_modal.jsx');
|
||||||
@@ -152,7 +153,7 @@ module.exports = React.createClass({
|
|||||||
emailErrors: {},
|
emailErrors: {},
|
||||||
firstNameErrors: {},
|
firstNameErrors: {},
|
||||||
lastNameErrors: {},
|
lastNameErrors: {},
|
||||||
emailEnabled: Client.isEmailEnabledSynchronous()
|
emailEnabled: !ConfigStore.getSettingAsBoolean('ByPassEmail', false)
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
var utils = require('../utils/utils.jsx');
|
var utils = require('../utils/utils.jsx');
|
||||||
|
var ConfigStore = require('../stores/config_store.jsx');
|
||||||
var client = require('../utils/client.jsx');
|
var client = require('../utils/client.jsx');
|
||||||
var UserStore = require('../stores/user_store.jsx');
|
var UserStore = require('../stores/user_store.jsx');
|
||||||
var BrowserStore = require('../stores/browser_store.jsx');
|
var BrowserStore = require('../stores/browser_store.jsx');
|
||||||
@@ -500,7 +501,7 @@ SendInivtesPage = React.createClass({
|
|||||||
},
|
},
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
return {
|
return {
|
||||||
emailEnabled: client.isEmailEnabledSynchronous()
|
emailEnabled: !ConfigStore.getSettingAsBoolean('ByPassEmail', false)
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|||||||
@@ -864,24 +864,3 @@ function getConfig(success, error) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
module.exports.getConfig = getConfig;
|
module.exports.getConfig = getConfig;
|
||||||
|
|
||||||
module.exports.isEmailEnabledSynchronous = function() {
|
|
||||||
var enabled = false;
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
async: false,
|
|
||||||
url: '/api/v1/config/get/bypass_email',
|
|
||||||
dataType: 'json',
|
|
||||||
type: 'GET',
|
|
||||||
success: function(value) {
|
|
||||||
enabled = !value;
|
|
||||||
},
|
|
||||||
error: function(xhr, status, err) {
|
|
||||||
if (status !== '200') {
|
|
||||||
handleError('isEmailEnabled', xhr, status, err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return enabled;
|
|
||||||
};
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user