REFACTOR: Remove Ember.get
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { get } from "@ember/object";
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import MultiSelectComponent from "select-kit/components/multi-select";
|
||||
import Category from "discourse/models/category";
|
||||
@@ -39,7 +40,7 @@ export default MultiSelectComponent.extend({
|
||||
filterComputedContent(computedContent, computedValues, filter) {
|
||||
const regex = new RegExp(filter, "i");
|
||||
return computedContent.filter(category =>
|
||||
this._normalize(Ember.get(category, "name")).match(regex)
|
||||
this._normalize(get(category, "name")).match(regex)
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { get } from "@ember/object";
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import Category from "discourse/models/category";
|
||||
import ComboBox from "select-kit/components/combo-box";
|
||||
@@ -6,7 +8,6 @@ import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
import renderTag from "discourse/lib/render-tag";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||
const { get, isEmpty, run } = Ember;
|
||||
|
||||
export default ComboBox.extend(TagsMixin, {
|
||||
allowContentReplacement: true,
|
||||
@@ -168,9 +169,7 @@ export default ComboBox.extend(TagsMixin, {
|
||||
computeHeaderContent() {
|
||||
let content = this._super(...arguments);
|
||||
|
||||
const joinedTags = this.selection
|
||||
.map(s => Ember.get(s, "value"))
|
||||
.join(", ");
|
||||
const joinedTags = this.selection.map(s => get(s, "value")).join(", ");
|
||||
|
||||
if (isEmpty(this.selection)) {
|
||||
content.label = I18n.t("tagging.choose_for_topic");
|
||||
@@ -198,7 +197,7 @@ export default ComboBox.extend(TagsMixin, {
|
||||
|
||||
if (this.selection) {
|
||||
data.selected_tags = this.selection
|
||||
.map(s => Ember.get(s, "value"))
|
||||
.map(s => get(s, "value"))
|
||||
.slice(0, 100);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { get } from "@ember/object";
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { throttle } from "@ember/runloop";
|
||||
@@ -298,7 +299,7 @@ export default Mixin.create({
|
||||
.slice()
|
||||
.reverse()
|
||||
.some(selection => {
|
||||
if (!Ember.get(selection, "locked")) {
|
||||
if (!get(selection, "locked")) {
|
||||
this.highlightSelection(selection);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user