mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 03:35:32 -05:00
DEV: Ember linting - disallow Ember.* variable usage (#8782)
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
import Draft from "discourse/models/draft";
|
||||
import { computed } from "@ember/object";
|
||||
import { camelize } from "@ember/string";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
|
||||
// Component can get destroyed and lose state
|
||||
let _topicSnapshot = null;
|
||||
@@ -49,7 +50,7 @@ export default DropdownSelectBoxComponent.extend({
|
||||
_postSnapshot = this.get("composerModel.post");
|
||||
}
|
||||
|
||||
if (Ember.isEmpty(this.content)) {
|
||||
if (isEmpty(this.content)) {
|
||||
this.set("selectKit.isHidden", true);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { computed, default as EmberObject } from "@ember/object";
|
||||
import Component from "@ember/component";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
const { get, isNone, makeArray } = Ember;
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
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 {
|
||||
next,
|
||||
debounce,
|
||||
@@ -26,7 +29,7 @@ export const MAIN_COLLECTION = "MAIN_COLLECTION";
|
||||
export const ERRORS_COLLECTION = "ERRORS_COLLECTION";
|
||||
|
||||
const EMPTY_OBJECT = Object.freeze({});
|
||||
const SELECT_KIT_OPTIONS = Ember.Mixin.create({
|
||||
const SELECT_KIT_OPTIONS = Mixin.create({
|
||||
mergedProperties: ["selectKitOptions"],
|
||||
selectKitOptions: EMPTY_OBJECT
|
||||
});
|
||||
@@ -220,7 +223,7 @@ export default Component.extend(
|
||||
);
|
||||
|
||||
this.selectKit.setProperties({
|
||||
hasSelection: !Ember.isEmpty(this.value),
|
||||
hasSelection: !isEmpty(this.value),
|
||||
noneItem: this._modifyNoSelectionWrapper()
|
||||
});
|
||||
|
||||
@@ -572,7 +575,7 @@ export default Component.extend(
|
||||
}
|
||||
}
|
||||
|
||||
const hasNoContent = Ember.isEmpty(content);
|
||||
const hasNoContent = isEmpty(content);
|
||||
|
||||
if (
|
||||
this.selectKit.hasSelection &&
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Component from "@ember/component";
|
||||
import { computed } from "@ember/object";
|
||||
import { bind } from "@ember/runloop";
|
||||
|
||||
export default Component.extend({
|
||||
layoutName: "select-kit/templates/components/select-kit/select-kit-body",
|
||||
@@ -13,10 +14,7 @@ export default Component.extend({
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.handleRootMouseDownHandler = Ember.run.bind(
|
||||
this,
|
||||
this.handleRootMouseDown
|
||||
);
|
||||
this.handleRootMouseDownHandler = bind(this, this.handleRootMouseDown);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
||||
@@ -2,6 +2,7 @@ import Component from "@ember/component";
|
||||
import { propertyEqual } from "discourse/lib/computed";
|
||||
import { computed } from "@ember/object";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { guidFor } from "@ember/object/internals";
|
||||
import UtilsMixin from "select-kit/mixins/utils";
|
||||
|
||||
export default Component.extend(UtilsMixin, {
|
||||
@@ -30,7 +31,7 @@ export default Component.extend(UtilsMixin, {
|
||||
}),
|
||||
|
||||
guid: computed("item", function() {
|
||||
return Ember.guidFor(this.item);
|
||||
return guidFor(this.item);
|
||||
}),
|
||||
|
||||
ariaLabel: computed("item.ariaLabel", "title", function() {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ajax } from "discourse/lib/ajax";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import Mixin from "@ember/object/mixin";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
|
||||
export default Mixin.create({
|
||||
searchTags(url, data, callback) {
|
||||
@@ -55,7 +56,7 @@ export default Mixin.create({
|
||||
}
|
||||
|
||||
const toLowerCaseOrUndefined = string => {
|
||||
return Ember.isEmpty(string) ? undefined : string.toLowerCase();
|
||||
return isEmpty(string) ? undefined : string.toLowerCase();
|
||||
};
|
||||
|
||||
const inCollection = content
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Mixin from "@ember/object/mixin";
|
||||
const { get } = Ember;
|
||||
import { get } from "@ember/object";
|
||||
|
||||
export default Mixin.create({
|
||||
defaultItem(value, name) {
|
||||
@@ -57,7 +57,7 @@ export default Mixin.create({
|
||||
},
|
||||
|
||||
findValue(content, item) {
|
||||
const property = Ember.get(this.selectKit, "valueProperty");
|
||||
const property = get(this.selectKit, "valueProperty");
|
||||
|
||||
if (!property) {
|
||||
if (content.indexOf(item) > -1) {
|
||||
|
||||
Reference in New Issue
Block a user