DEV: Import isNone for @ember/utils

This commit is contained in:
Mark VanLandingham 2019-11-08 13:00:19 -06:00 committed by Robin Ward
parent c04369ed8f
commit 1bbb9b30fc
6 changed files with 21 additions and 15 deletions

View File

@ -104,6 +104,9 @@ var define, requirejs;
},
"@ember/error": {
default: Ember.error
},
"@ember/utils": {
isNone: Ember.isNone
}
};
}

View File

@ -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`), {

View File

@ -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(

View File

@ -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")

View File

@ -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;
}

View File

@ -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] = [];
}