diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js index 2f7b0b9b282..5016efe3956 100644 --- a/app/assets/javascripts/discourse-loader.js +++ b/app/assets/javascripts/discourse-loader.js @@ -104,6 +104,9 @@ var define, requirejs; }, "@ember/error": { default: Ember.error + }, + "@ember/utils": { + isNone: Ember.isNone } }; } diff --git a/app/assets/javascripts/discourse/models/invite.js.es6 b/app/assets/javascripts/discourse/models/invite.js.es6 index dc2d4c8538e..dc41ac77767 100644 --- a/app/assets/javascripts/discourse/models/invite.js.es6 +++ b/app/assets/javascripts/discourse/models/invite.js.es6 @@ -3,6 +3,7 @@ import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { userPath } from "discourse/lib/url"; import { Promise } from "rsvp"; +import { isNone } from "@ember/utils"; const Invite = EmberObject.extend({ rescind() { @@ -36,8 +37,8 @@ Invite.reopenClass({ if (!user) Promise.resolve(); const data = {}; - if (!Ember.isNone(filter)) data.filter = filter; - if (!Ember.isNone(search)) data.search = search; + if (!isNone(filter)) data.filter = filter; + if (!isNone(search)) data.search = search; data.offset = offset || 0; return ajax(userPath(`${user.username_lower}/invited.json`), { diff --git a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 index 064f02a494c..b7dceff0894 100644 --- a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 +++ b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 @@ -9,6 +9,7 @@ import PermissionType from "discourse/models/permission-type"; import CategoryList from "discourse/models/category-list"; import Category from "discourse/models/category"; import { Promise, all } from "rsvp"; +import { isNone } from "@ember/utils"; // A helper function to create a category route with parameters export default (filterArg, params) => { @@ -79,7 +80,7 @@ export default (filterArg, params) => { _createSubcategoryList(category) { this._categoryList = null; if ( - Ember.isNone(category.get("parentCategory")) && + isNone(category.get("parentCategory")) && category.get("show_subcategory_list") ) { return CategoryList.listForParent(this.store, category).then( diff --git a/app/assets/javascripts/select-kit/components/category-row.js.es6 b/app/assets/javascripts/select-kit/components/category-row.js.es6 index e8963e96b6d..dee781b2942 100644 --- a/app/assets/javascripts/select-kit/components/category-row.js.es6 +++ b/app/assets/javascripts/select-kit/components/category-row.js.es6 @@ -4,6 +4,7 @@ import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-r import discourseComputed from "discourse-common/utils/decorators"; import Category from "discourse/models/category"; import { categoryBadgeHTML } from "discourse/helpers/category-link"; +import { isNone } from "@ember/utils"; export default SelectKitRowComponent.extend({ layoutName: "select-kit/templates/components/category-row", @@ -15,7 +16,7 @@ export default SelectKitRowComponent.extend({ @discourseComputed("options.displayCategoryDescription") displayCategoryDescription(displayCategoryDescription) { - if (Ember.isNone(displayCategoryDescription)) { + if (isNone(displayCategoryDescription)) { return true; } @@ -63,7 +64,7 @@ export default SelectKitRowComponent.extend({ @discourseComputed("parentCategoryid") hasParentCategory(parentCategoryid) { - return !Ember.isNone(parentCategoryid); + return !isNone(parentCategoryid); }, @discourseComputed("category") diff --git a/app/assets/javascripts/select-kit/components/future-date-input-selector/mixin.js.es6 b/app/assets/javascripts/select-kit/components/future-date-input-selector/mixin.js.es6 index dd111348de5..9aa6cf56fe2 100644 --- a/app/assets/javascripts/select-kit/components/future-date-input-selector/mixin.js.es6 +++ b/app/assets/javascripts/select-kit/components/future-date-input-selector/mixin.js.es6 @@ -1,6 +1,7 @@ import { CLOSE_STATUS_TYPE } from "discourse/controllers/edit-topic-timer"; import { timeframeDetails } from "select-kit/components/future-date-input-selector"; import Mixin from "@ember/object/mixin"; +import { isNone } from "@ember/utils"; export default Mixin.create({ _computeIconsForValue(value) { @@ -14,7 +15,7 @@ export default Mixin.create({ }, _computeDatetimeForValue(value) { - if (Ember.isNone(value)) { + if (isNone(value)) { return null; } diff --git a/app/assets/javascripts/select-kit/mixins/plugin-api.js.es6 b/app/assets/javascripts/select-kit/mixins/plugin-api.js.es6 index 68dd1c8839c..9386c595cfa 100644 --- a/app/assets/javascripts/select-kit/mixins/plugin-api.js.es6 +++ b/app/assets/javascripts/select-kit/mixins/plugin-api.js.es6 @@ -1,8 +1,9 @@ import Mixin from "@ember/object/mixin"; +import { isNone } from "@ember/utils"; let _appendContentCallbacks = {}; function appendContent(pluginApiIdentifiers, contentFunction) { - if (Ember.isNone(_appendContentCallbacks[pluginApiIdentifiers])) { + if (isNone(_appendContentCallbacks[pluginApiIdentifiers])) { _appendContentCallbacks[pluginApiIdentifiers] = []; } @@ -11,7 +12,7 @@ function appendContent(pluginApiIdentifiers, contentFunction) { let _prependContentCallbacks = {}; function prependContent(pluginApiIdentifiers, contentFunction) { - if (Ember.isNone(_prependContentCallbacks[pluginApiIdentifiers])) { + if (isNone(_prependContentCallbacks[pluginApiIdentifiers])) { _prependContentCallbacks[pluginApiIdentifiers] = []; } @@ -20,7 +21,7 @@ function prependContent(pluginApiIdentifiers, contentFunction) { let _modifyContentCallbacks = {}; function modifyContent(pluginApiIdentifiers, contentFunction) { - if (Ember.isNone(_modifyContentCallbacks[pluginApiIdentifiers])) { + if (isNone(_modifyContentCallbacks[pluginApiIdentifiers])) { _modifyContentCallbacks[pluginApiIdentifiers] = []; } @@ -29,9 +30,7 @@ function modifyContent(pluginApiIdentifiers, contentFunction) { let _modifyHeaderComputedContentCallbacks = {}; function modifyHeaderComputedContent(pluginApiIdentifiers, contentFunction) { - if ( - Ember.isNone(_modifyHeaderComputedContentCallbacks[pluginApiIdentifiers]) - ) { + if (isNone(_modifyHeaderComputedContentCallbacks[pluginApiIdentifiers])) { _modifyHeaderComputedContentCallbacks[pluginApiIdentifiers] = []; } @@ -42,7 +41,7 @@ function modifyHeaderComputedContent(pluginApiIdentifiers, contentFunction) { let _modifyCollectionHeaderCallbacks = {}; function modifyCollectionHeader(pluginApiIdentifiers, contentFunction) { - if (Ember.isNone(_modifyCollectionHeaderCallbacks[pluginApiIdentifiers])) { + if (isNone(_modifyCollectionHeaderCallbacks[pluginApiIdentifiers])) { _modifyCollectionHeaderCallbacks[pluginApiIdentifiers] = []; } @@ -51,7 +50,7 @@ function modifyCollectionHeader(pluginApiIdentifiers, contentFunction) { let _onSelectNoneCallbacks = {}; function onSelectNone(pluginApiIdentifiers, mutationFunction) { - if (Ember.isNone(_onSelectNoneCallbacks[pluginApiIdentifiers])) { + if (isNone(_onSelectNoneCallbacks[pluginApiIdentifiers])) { _onSelectNoneCallbacks[pluginApiIdentifiers] = []; } @@ -60,7 +59,7 @@ function onSelectNone(pluginApiIdentifiers, mutationFunction) { let _onSelectCallbacks = {}; function onSelect(pluginApiIdentifiers, mutationFunction) { - if (Ember.isNone(_onSelectCallbacks[pluginApiIdentifiers])) { + if (isNone(_onSelectCallbacks[pluginApiIdentifiers])) { _onSelectCallbacks[pluginApiIdentifiers] = []; }