mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 08:02:44 +08:00
DEV: Import makeArray
from discourse-common
instead using Ember
global (#8977)
This commit is contained in:
parent
25ebfd5998
commit
9f8a27a132
|
@ -81,7 +81,7 @@ export default SelectKitComponent.extend({
|
|||
},
|
||||
|
||||
selectedContent: computed("value.[]", "content.[]", function() {
|
||||
const value = Ember.makeArray(this.value).map(v =>
|
||||
const value = makeArray(this.value).map(v =>
|
||||
this.selectKit.options.castInteger && this._isNumeric(v) ? Number(v) : v
|
||||
);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
|
||||
import { computed } from "@ember/object";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
|
||||
export default SelectKitHeaderComponent.extend({
|
||||
classNames: ["multi-select-header"],
|
||||
|
@ -7,11 +8,11 @@ export default SelectKitHeaderComponent.extend({
|
|||
"select-kit/templates/components/multi-select/multi-select-header",
|
||||
|
||||
selectedNames: computed("selectedContent", function() {
|
||||
return Ember.makeArray(this.selectedContent).map(c => this.getName(c));
|
||||
return makeArray(this.selectedContent).map(c => this.getName(c));
|
||||
}),
|
||||
|
||||
selectedValue: computed("selectedContent", function() {
|
||||
return Ember.makeArray(this.selectedContent)
|
||||
return makeArray(this.selectedContent)
|
||||
.map(c => {
|
||||
if (this.getName(c) !== this.getName(this.selectKit.noneItem)) {
|
||||
return this.getValue(c);
|
||||
|
|
|
@ -318,7 +318,7 @@ export default Component.extend(
|
|||
validateSelect() {
|
||||
this.clearErrors();
|
||||
|
||||
const selection = Ember.makeArray(this.value);
|
||||
const selection = makeArray(this.value);
|
||||
|
||||
const maximum = this.selectKit.options.maximum;
|
||||
if (maximum && selection.length >= maximum) {
|
||||
|
|
|
@ -28,7 +28,7 @@ export default MultiSelectComponent.extend({
|
|||
},
|
||||
|
||||
content: computed("value.[]", function() {
|
||||
return Ember.makeArray(this.value).map(x => this.defaultItem(x, x));
|
||||
return makeArray(this.value).map(x => this.defaultItem(x, x));
|
||||
}),
|
||||
|
||||
excludedUsers: computed(
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import Mixin from "@ember/object/mixin";
|
||||
import { isNone } from "@ember/utils";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
|
||||
let _appendContentCallbacks = {};
|
||||
function appendContent(pluginApiIdentifiers, contentFunction) {
|
||||
|
@ -109,10 +110,10 @@ export function applyContentPluginApiCallbacks(
|
|||
) {
|
||||
identifiers.forEach(key => {
|
||||
(_prependContentCallbacks[key] || []).forEach(c => {
|
||||
content = Ember.makeArray(c(selectKit, content)).concat(content);
|
||||
content = makeArray(c(selectKit, content)).concat(content);
|
||||
});
|
||||
(_appendContentCallbacks[key] || []).forEach(c => {
|
||||
content = content.concat(Ember.makeArray(c(selectKit, content)));
|
||||
content = content.concat(makeArray(c(selectKit, content)));
|
||||
});
|
||||
const filterCallbacks = _filterContentCallbacks[key] || [];
|
||||
if (filterCallbacks.length) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user