DEV: allows to import isPresent (#8993)
This commit is contained in:
parent
8f82d790d4
commit
25ebfd5998
|
@ -80,6 +80,7 @@ var define, requirejs;
|
|||
inject: Ember.inject.service
|
||||
},
|
||||
"@ember/utils": {
|
||||
isPresent: Ember.isPresent,
|
||||
isEmpty: Ember.isEmpty,
|
||||
isNone: Ember.isNone
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { isEmpty } from "@ember/utils";
|
||||
import { isPresent, isEmpty } from "@ember/utils";
|
||||
import { or, and, not, alias } from "@ember/object/computed";
|
||||
import EmberObject from "@ember/object";
|
||||
import { next } from "@ember/runloop";
|
||||
|
@ -1299,7 +1299,7 @@ export default Controller.extend(bufferedProperty("model"), {
|
|||
data => {
|
||||
const topic = this.model;
|
||||
|
||||
if (Ember.isPresent(data.notification_level_change)) {
|
||||
if (isPresent(data.notification_level_change)) {
|
||||
topic.set(
|
||||
"details.notification_level",
|
||||
data.notification_level_change
|
||||
|
|
|
@ -2,6 +2,7 @@ import deprecated from "discourse-common/lib/deprecated";
|
|||
import SelectKitComponent from "select-kit/components/select-kit";
|
||||
import { computed } from "@ember/object";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { isPresent } from "@ember/utils";
|
||||
|
||||
export default SelectKitComponent.extend({
|
||||
pluginApiIdentifiers: ["multi-select"],
|
||||
|
@ -41,7 +42,7 @@ export default SelectKitComponent.extend({
|
|||
},
|
||||
|
||||
select(value, item) {
|
||||
if (!Ember.isPresent(value)) {
|
||||
if (!isPresent(value)) {
|
||||
if (!this.validateSelect(this.selectKit.highlighted)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import { get } from "@ember/object";
|
|||
import UtilsMixin from "select-kit/mixins/utils";
|
||||
import PluginApiMixin from "select-kit/mixins/plugin-api";
|
||||
import Mixin from "@ember/object/mixin";
|
||||
import { isEmpty, isNone } from "@ember/utils";
|
||||
import { isPresent, isEmpty, isNone } from "@ember/utils";
|
||||
import {
|
||||
next,
|
||||
debounce,
|
||||
|
@ -422,8 +422,8 @@ export default Component.extend(
|
|||
}
|
||||
|
||||
if (this.singleSelect) {
|
||||
value = Ember.isPresent(value.firstObject) ? value.firstObject : null;
|
||||
items = Ember.isPresent(items.firstObject) ? items.firstObject : null;
|
||||
value = isPresent(value.firstObject) ? value.firstObject : null;
|
||||
items = isPresent(items.firstObject) ? items.firstObject : null;
|
||||
}
|
||||
|
||||
this._boundaryActionHandler("onChange", value, items);
|
||||
|
@ -704,7 +704,7 @@ export default Component.extend(
|
|||
},
|
||||
|
||||
select(value, item) {
|
||||
if (!Ember.isPresent(value)) {
|
||||
if (!isPresent(value)) {
|
||||
if (!this.validateSelect(this.selectKit.highlighted)) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue