Revert "REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS"
This reverts commit c0b277d273.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ["ip-lookup"],
|
||||
|
||||
@@ -43,8 +42,7 @@ export default Ember.Component.extend({
|
||||
self.set("totalOthersWithSameIP", result.total);
|
||||
});
|
||||
|
||||
const AdminUser = require('admin/models/admin-user').default;
|
||||
AdminUser.findAll("active", data).then(function (users) {
|
||||
Discourse.AdminUser.findAll("active", data).then(function (users) {
|
||||
self.setProperties({
|
||||
other_accounts: users,
|
||||
otherAccountsLoading: false,
|
||||
|
||||
@@ -18,17 +18,15 @@ export default Ember.Component.extend({
|
||||
|
||||
actions: {
|
||||
submit: function() {
|
||||
const Permalink = require('admin/models/permalink').default;
|
||||
|
||||
if (!this.get('formSubmitted')) {
|
||||
const self = this;
|
||||
self.set('formSubmitted', true);
|
||||
const permalink = Permalink.create({url: self.get('url'), permalink_type: self.get('permalinkType'), permalink_type_value: self.get('permalink_type_value')});
|
||||
const permalink = Discourse.Permalink.create({url: self.get('url'), permalink_type: self.get('permalinkType'), permalink_type_value: self.get('permalink_type_value')});
|
||||
permalink.save().then(function(result) {
|
||||
self.set('url', '');
|
||||
self.set('permalink_type_value', '');
|
||||
self.set('formSubmitted', false);
|
||||
self.sendAction('action', Permalink.create(result.permalink));
|
||||
self.sendAction('action', Discourse.Permalink.create(result.permalink));
|
||||
Em.run.schedule('afterRender', function() { self.$('.permalink-url').focus(); });
|
||||
}, function(e) {
|
||||
self.set('formSubmitted', false);
|
||||
|
||||
+1
-3
@@ -10,7 +10,7 @@
|
||||
uploadText="UPLOAD"
|
||||
}}
|
||||
**/
|
||||
const ResumableUploadComponent = Ember.Component.extend(Discourse.StringBuffer, {
|
||||
Discourse.ResumableUploadComponent = Ember.Component.extend(Discourse.StringBuffer, {
|
||||
tagName: "button",
|
||||
classNames: ["btn", "ru"],
|
||||
classNameBindings: ["isUploading"],
|
||||
@@ -118,5 +118,3 @@ const ResumableUploadComponent = Ember.Component.extend(Discourse.StringBuffer,
|
||||
}.on("willDestroyElement")
|
||||
|
||||
});
|
||||
|
||||
export default ResumableUploadComponent;
|
||||
+3
-6
@@ -1,4 +1,3 @@
|
||||
import ScreenedIpAddress from 'admin/models/screened-ip-address';
|
||||
/**
|
||||
A form to create an IP address that will be blocked or whitelisted.
|
||||
Example usage:
|
||||
@@ -14,7 +13,7 @@ import ScreenedIpAddress from 'admin/models/screened-ip-address';
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
const ScreenedIpAddressFormComponent = Ember.Component.extend({
|
||||
Discourse.ScreenedIpAddressFormComponent = Ember.Component.extend({
|
||||
classNames: ['screened-ip-address-form'],
|
||||
formSubmitted: false,
|
||||
actionName: 'block',
|
||||
@@ -43,11 +42,11 @@ const ScreenedIpAddressFormComponent = Ember.Component.extend({
|
||||
if (!this.get('formSubmitted')) {
|
||||
var self = this;
|
||||
this.set('formSubmitted', true);
|
||||
var screenedIpAddress = ScreenedIpAddress.create({ip_address: this.get('ip_address'), action_name: this.get('actionName')});
|
||||
var screenedIpAddress = Discourse.ScreenedIpAddress.create({ip_address: this.get('ip_address'), action_name: this.get('actionName')});
|
||||
screenedIpAddress.save().then(function(result) {
|
||||
self.set('ip_address', '');
|
||||
self.set('formSubmitted', false);
|
||||
self.sendAction('action', ScreenedIpAddress.create(result.screened_ip_address));
|
||||
self.sendAction('action', Discourse.ScreenedIpAddress.create(result.screened_ip_address));
|
||||
Em.run.schedule('afterRender', function() { self.$('.ip-address-input').focus(); });
|
||||
}, function(e) {
|
||||
self.set('formSubmitted', false);
|
||||
@@ -75,5 +74,3 @@ const ScreenedIpAddressFormComponent = Ember.Component.extend({
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
export default ScreenedIpAddressFormComponent;
|
||||
Reference in New Issue
Block a user