DEV: Import isNone for @ember/utils
This commit is contained in:
parent
c04369ed8f
commit
1bbb9b30fc
|
@ -104,6 +104,9 @@ var define, requirejs;
|
||||||
},
|
},
|
||||||
"@ember/error": {
|
"@ember/error": {
|
||||||
default: Ember.error
|
default: Ember.error
|
||||||
|
},
|
||||||
|
"@ember/utils": {
|
||||||
|
isNone: Ember.isNone
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { ajax } from "discourse/lib/ajax";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { userPath } from "discourse/lib/url";
|
import { userPath } from "discourse/lib/url";
|
||||||
import { Promise } from "rsvp";
|
import { Promise } from "rsvp";
|
||||||
|
import { isNone } from "@ember/utils";
|
||||||
|
|
||||||
const Invite = EmberObject.extend({
|
const Invite = EmberObject.extend({
|
||||||
rescind() {
|
rescind() {
|
||||||
|
@ -36,8 +37,8 @@ Invite.reopenClass({
|
||||||
if (!user) Promise.resolve();
|
if (!user) Promise.resolve();
|
||||||
|
|
||||||
const data = {};
|
const data = {};
|
||||||
if (!Ember.isNone(filter)) data.filter = filter;
|
if (!isNone(filter)) data.filter = filter;
|
||||||
if (!Ember.isNone(search)) data.search = search;
|
if (!isNone(search)) data.search = search;
|
||||||
data.offset = offset || 0;
|
data.offset = offset || 0;
|
||||||
|
|
||||||
return ajax(userPath(`${user.username_lower}/invited.json`), {
|
return ajax(userPath(`${user.username_lower}/invited.json`), {
|
||||||
|
|
|
@ -9,6 +9,7 @@ import PermissionType from "discourse/models/permission-type";
|
||||||
import CategoryList from "discourse/models/category-list";
|
import CategoryList from "discourse/models/category-list";
|
||||||
import Category from "discourse/models/category";
|
import Category from "discourse/models/category";
|
||||||
import { Promise, all } from "rsvp";
|
import { Promise, all } from "rsvp";
|
||||||
|
import { isNone } from "@ember/utils";
|
||||||
|
|
||||||
// A helper function to create a category route with parameters
|
// A helper function to create a category route with parameters
|
||||||
export default (filterArg, params) => {
|
export default (filterArg, params) => {
|
||||||
|
@ -79,7 +80,7 @@ export default (filterArg, params) => {
|
||||||
_createSubcategoryList(category) {
|
_createSubcategoryList(category) {
|
||||||
this._categoryList = null;
|
this._categoryList = null;
|
||||||
if (
|
if (
|
||||||
Ember.isNone(category.get("parentCategory")) &&
|
isNone(category.get("parentCategory")) &&
|
||||||
category.get("show_subcategory_list")
|
category.get("show_subcategory_list")
|
||||||
) {
|
) {
|
||||||
return CategoryList.listForParent(this.store, category).then(
|
return CategoryList.listForParent(this.store, category).then(
|
||||||
|
|
|
@ -4,6 +4,7 @@ import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-r
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import Category from "discourse/models/category";
|
import Category from "discourse/models/category";
|
||||||
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
||||||
|
import { isNone } from "@ember/utils";
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layoutName: "select-kit/templates/components/category-row",
|
layoutName: "select-kit/templates/components/category-row",
|
||||||
|
@ -15,7 +16,7 @@ export default SelectKitRowComponent.extend({
|
||||||
|
|
||||||
@discourseComputed("options.displayCategoryDescription")
|
@discourseComputed("options.displayCategoryDescription")
|
||||||
displayCategoryDescription(displayCategoryDescription) {
|
displayCategoryDescription(displayCategoryDescription) {
|
||||||
if (Ember.isNone(displayCategoryDescription)) {
|
if (isNone(displayCategoryDescription)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ export default SelectKitRowComponent.extend({
|
||||||
|
|
||||||
@discourseComputed("parentCategoryid")
|
@discourseComputed("parentCategoryid")
|
||||||
hasParentCategory(parentCategoryid) {
|
hasParentCategory(parentCategoryid) {
|
||||||
return !Ember.isNone(parentCategoryid);
|
return !isNone(parentCategoryid);
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("category")
|
@discourseComputed("category")
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { CLOSE_STATUS_TYPE } from "discourse/controllers/edit-topic-timer";
|
import { CLOSE_STATUS_TYPE } from "discourse/controllers/edit-topic-timer";
|
||||||
import { timeframeDetails } from "select-kit/components/future-date-input-selector";
|
import { timeframeDetails } from "select-kit/components/future-date-input-selector";
|
||||||
import Mixin from "@ember/object/mixin";
|
import Mixin from "@ember/object/mixin";
|
||||||
|
import { isNone } from "@ember/utils";
|
||||||
|
|
||||||
export default Mixin.create({
|
export default Mixin.create({
|
||||||
_computeIconsForValue(value) {
|
_computeIconsForValue(value) {
|
||||||
|
@ -14,7 +15,7 @@ export default Mixin.create({
|
||||||
},
|
},
|
||||||
|
|
||||||
_computeDatetimeForValue(value) {
|
_computeDatetimeForValue(value) {
|
||||||
if (Ember.isNone(value)) {
|
if (isNone(value)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import Mixin from "@ember/object/mixin";
|
import Mixin from "@ember/object/mixin";
|
||||||
|
import { isNone } from "@ember/utils";
|
||||||
|
|
||||||
let _appendContentCallbacks = {};
|
let _appendContentCallbacks = {};
|
||||||
function appendContent(pluginApiIdentifiers, contentFunction) {
|
function appendContent(pluginApiIdentifiers, contentFunction) {
|
||||||
if (Ember.isNone(_appendContentCallbacks[pluginApiIdentifiers])) {
|
if (isNone(_appendContentCallbacks[pluginApiIdentifiers])) {
|
||||||
_appendContentCallbacks[pluginApiIdentifiers] = [];
|
_appendContentCallbacks[pluginApiIdentifiers] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +12,7 @@ function appendContent(pluginApiIdentifiers, contentFunction) {
|
||||||
|
|
||||||
let _prependContentCallbacks = {};
|
let _prependContentCallbacks = {};
|
||||||
function prependContent(pluginApiIdentifiers, contentFunction) {
|
function prependContent(pluginApiIdentifiers, contentFunction) {
|
||||||
if (Ember.isNone(_prependContentCallbacks[pluginApiIdentifiers])) {
|
if (isNone(_prependContentCallbacks[pluginApiIdentifiers])) {
|
||||||
_prependContentCallbacks[pluginApiIdentifiers] = [];
|
_prependContentCallbacks[pluginApiIdentifiers] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@ function prependContent(pluginApiIdentifiers, contentFunction) {
|
||||||
|
|
||||||
let _modifyContentCallbacks = {};
|
let _modifyContentCallbacks = {};
|
||||||
function modifyContent(pluginApiIdentifiers, contentFunction) {
|
function modifyContent(pluginApiIdentifiers, contentFunction) {
|
||||||
if (Ember.isNone(_modifyContentCallbacks[pluginApiIdentifiers])) {
|
if (isNone(_modifyContentCallbacks[pluginApiIdentifiers])) {
|
||||||
_modifyContentCallbacks[pluginApiIdentifiers] = [];
|
_modifyContentCallbacks[pluginApiIdentifiers] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,9 +30,7 @@ function modifyContent(pluginApiIdentifiers, contentFunction) {
|
||||||
|
|
||||||
let _modifyHeaderComputedContentCallbacks = {};
|
let _modifyHeaderComputedContentCallbacks = {};
|
||||||
function modifyHeaderComputedContent(pluginApiIdentifiers, contentFunction) {
|
function modifyHeaderComputedContent(pluginApiIdentifiers, contentFunction) {
|
||||||
if (
|
if (isNone(_modifyHeaderComputedContentCallbacks[pluginApiIdentifiers])) {
|
||||||
Ember.isNone(_modifyHeaderComputedContentCallbacks[pluginApiIdentifiers])
|
|
||||||
) {
|
|
||||||
_modifyHeaderComputedContentCallbacks[pluginApiIdentifiers] = [];
|
_modifyHeaderComputedContentCallbacks[pluginApiIdentifiers] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@ function modifyHeaderComputedContent(pluginApiIdentifiers, contentFunction) {
|
||||||
|
|
||||||
let _modifyCollectionHeaderCallbacks = {};
|
let _modifyCollectionHeaderCallbacks = {};
|
||||||
function modifyCollectionHeader(pluginApiIdentifiers, contentFunction) {
|
function modifyCollectionHeader(pluginApiIdentifiers, contentFunction) {
|
||||||
if (Ember.isNone(_modifyCollectionHeaderCallbacks[pluginApiIdentifiers])) {
|
if (isNone(_modifyCollectionHeaderCallbacks[pluginApiIdentifiers])) {
|
||||||
_modifyCollectionHeaderCallbacks[pluginApiIdentifiers] = [];
|
_modifyCollectionHeaderCallbacks[pluginApiIdentifiers] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +50,7 @@ function modifyCollectionHeader(pluginApiIdentifiers, contentFunction) {
|
||||||
|
|
||||||
let _onSelectNoneCallbacks = {};
|
let _onSelectNoneCallbacks = {};
|
||||||
function onSelectNone(pluginApiIdentifiers, mutationFunction) {
|
function onSelectNone(pluginApiIdentifiers, mutationFunction) {
|
||||||
if (Ember.isNone(_onSelectNoneCallbacks[pluginApiIdentifiers])) {
|
if (isNone(_onSelectNoneCallbacks[pluginApiIdentifiers])) {
|
||||||
_onSelectNoneCallbacks[pluginApiIdentifiers] = [];
|
_onSelectNoneCallbacks[pluginApiIdentifiers] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +59,7 @@ function onSelectNone(pluginApiIdentifiers, mutationFunction) {
|
||||||
|
|
||||||
let _onSelectCallbacks = {};
|
let _onSelectCallbacks = {};
|
||||||
function onSelect(pluginApiIdentifiers, mutationFunction) {
|
function onSelect(pluginApiIdentifiers, mutationFunction) {
|
||||||
if (Ember.isNone(_onSelectCallbacks[pluginApiIdentifiers])) {
|
if (isNone(_onSelectCallbacks[pluginApiIdentifiers])) {
|
||||||
_onSelectCallbacks[pluginApiIdentifiers] = [];
|
_onSelectCallbacks[pluginApiIdentifiers] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue