From 1c8b3c9447317d59b239591456bcf5499b4f0563 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 21 Nov 2015 01:10:31 +1100 Subject: [PATCH] sort out import ordering in admin js --- app/assets/javascripts/admin/components/ip-lookup.js.es6 | 2 +- .../javascripts/admin/components/permalink-form.js.es6 | 4 ++-- ...nt.js.es6 => screened-ip-address-form-component.js.es6} | 2 +- .../admin/controllers/admin-email-skipped.js.es6 | 7 ++----- app/assets/javascripts/main_include_admin.js | 6 ++++++ 5 files changed, 12 insertions(+), 9 deletions(-) rename app/assets/javascripts/admin/components/{screened_ip_address_form_component.js.es6 => screened-ip-address-form-component.js.es6} (97%) diff --git a/app/assets/javascripts/admin/components/ip-lookup.js.es6 b/app/assets/javascripts/admin/components/ip-lookup.js.es6 index b437ad7a178..63f61dcc98c 100644 --- a/app/assets/javascripts/admin/components/ip-lookup.js.es6 +++ b/app/assets/javascripts/admin/components/ip-lookup.js.es6 @@ -1,4 +1,3 @@ -import AdminUser from 'admin/models/admin-user'; export default Ember.Component.extend({ classNames: ["ip-lookup"], @@ -44,6 +43,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) { self.setProperties({ other_accounts: users, diff --git a/app/assets/javascripts/admin/components/permalink-form.js.es6 b/app/assets/javascripts/admin/components/permalink-form.js.es6 index 90dcf2a7b20..2bde845c0c6 100644 --- a/app/assets/javascripts/admin/components/permalink-form.js.es6 +++ b/app/assets/javascripts/admin/components/permalink-form.js.es6 @@ -1,5 +1,3 @@ -import Permalink from 'admin/models/permalink'; - export default Ember.Component.extend({ classNames: ['permalink-form'], formSubmitted: false, @@ -20,6 +18,8 @@ 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); diff --git a/app/assets/javascripts/admin/components/screened_ip_address_form_component.js.es6 b/app/assets/javascripts/admin/components/screened-ip-address-form-component.js.es6 similarity index 97% rename from app/assets/javascripts/admin/components/screened_ip_address_form_component.js.es6 rename to app/assets/javascripts/admin/components/screened-ip-address-form-component.js.es6 index 8eee416553f..8702dbb2f9e 100644 --- a/app/assets/javascripts/admin/components/screened_ip_address_form_component.js.es6 +++ b/app/assets/javascripts/admin/components/screened-ip-address-form-component.js.es6 @@ -1,4 +1,4 @@ -import ScreenedIpAddress from 'admin/models/screened_ip_address'; +import ScreenedIpAddress from 'admin/models/screened-ip-address'; /** A form to create an IP address that will be blocked or whitelisted. Example usage: diff --git a/app/assets/javascripts/admin/controllers/admin-email-skipped.js.es6 b/app/assets/javascripts/admin/controllers/admin-email-skipped.js.es6 index 4c537214b72..b392ea8e987 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-skipped.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-email-skipped.js.es6 @@ -1,11 +1,8 @@ import debounce from 'discourse/lib/debounce'; -import EmailLog from 'admin/models/email-log'; export default Ember.Controller.extend({ filterEmailLogs: debounce(function() { - var self = this; - EmailLog.findAll(this.get("filter")).then(function(logs) { - self.set("model", logs); - }); + const EmailLog = require('admin/models/email-log').default; + EmailLog.findAll(this.get("filter")).then(logs => this.set("model", logs)); }, 250).observes("filter.user", "filter.address", "filter.type", "filter.skipped_reason") }); diff --git a/app/assets/javascripts/main_include_admin.js b/app/assets/javascripts/main_include_admin.js index 72d94e54d46..7816da8382a 100644 --- a/app/assets/javascripts/main_include_admin.js +++ b/app/assets/javascripts/main_include_admin.js @@ -1,6 +1,12 @@ //= require_tree ./ember-addons //= require admin/models/user-field //= require admin/models/site-setting +//= require admin/models/screened-ip-address +//= require admin/models/api-key +//= require admin/models/tl3-requirements +//= require admin/models/admin-user +//= require_tree ./admin/models +//= require admin/routes/admin-email-logs //= require admin/controllers/admin-email-skipped //= require discourse/lib/export-result //= require_tree ./admin