mirror of
https://github.com/discourse/discourse.git
synced 2025-03-28 11:15:39 +08:00
FIX: Move makeArray
to discourse-common
This commit is contained in:
parent
6300ac699a
commit
dceb72bc69
app/assets/javascripts
admin
components
admin-report-chart.js.es6admin-report-stacked-chart.js.es6admin-report-table.js.es6admin-report.js.es6value-list.js.es6
controllers
models
discourse-common/lib
discourse
select-kit
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { debounce } from "@ember/runloop";
|
||||
import { schedule } from "@ember/runloop";
|
||||
import Component from "@ember/component";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { debounce } from "@ember/runloop";
|
||||
import { schedule } from "@ember/runloop";
|
||||
import Component from "@ember/component";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { alias } from "@ember/object/computed";
|
||||
import Component from "@ember/component";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { alias, or, and, reads, equal, notEmpty } from "@ember/object/computed";
|
||||
import EmberObject from "@ember/object";
|
||||
import { next } from "@ember/runloop";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { empty, alias } from "@ember/object/computed";
|
||||
import Component from "@ember/component";
|
||||
import { on } from "ember-addons/ember-computed-decorators";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { empty, notEmpty, match } from "@ember/object/computed";
|
||||
import Controller from "@ember/controller";
|
||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { inject } from "@ember/controller";
|
||||
import Controller from "@ember/controller";
|
||||
import { setting } from "discourse/lib/computed";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import EmberObject from "@ember/object";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
|
@ -1,5 +1,12 @@
|
||||
import { get } from "@ember/object";
|
||||
|
||||
export function makeArray(obj) {
|
||||
if (obj === null || obj === undefined) {
|
||||
return [];
|
||||
}
|
||||
return Array.isArray(obj) ? obj : [obj];
|
||||
}
|
||||
|
||||
export function htmlHelper(fn) {
|
||||
return Ember.Helper.helper(function(...args) {
|
||||
args =
|
||||
|
@ -3,13 +3,6 @@ import toMarkdown from "discourse/lib/to-markdown";
|
||||
|
||||
const homepageSelector = "meta[name=discourse_current_homepage]";
|
||||
|
||||
export function makeArray(obj) {
|
||||
if (obj === null || obj === undefined) {
|
||||
return [];
|
||||
}
|
||||
return Array.isArray(obj) ? obj : [obj];
|
||||
}
|
||||
|
||||
export function translateSize(size) {
|
||||
switch (size) {
|
||||
case "tiny":
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { createWidget } from "discourse/widgets/widget";
|
||||
import { h } from "virtual-dom";
|
||||
import { avatarFor, avatarImg } from "discourse/widgets/post";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { get } from "@ember/object";
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import MultiSelectComponent from "select-kit/components/multi-select";
|
||||
import Category from "discourse/models/category";
|
||||
|
||||
|
@ -3,7 +3,8 @@ import ComboBox from "select-kit/components/combo-box";
|
||||
import TagsMixin from "select-kit/mixins/tags";
|
||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
import renderTag from "discourse/lib/render-tag";
|
||||
import { escapeExpression, makeArray } from "discourse/lib/utilities";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||
import { get } from "@ember/object";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { on } from "ember-addons/ember-computed-decorators";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
|
||||
|
@ -2,7 +2,7 @@ import MultiSelectComponent from "select-kit/components/multi-select";
|
||||
import TagsMixin from "select-kit/mixins/tags";
|
||||
import renderTag from "discourse/lib/render-tag";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
const { get, run } = Ember;
|
||||
|
||||
export default MultiSelectComponent.extend(TagsMixin, {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import ComboBoxComponent from "select-kit/components/combo-box";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import TagsMixin from "select-kit/mixins/tags";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { get } from "@ember/object";
|
||||
import { makeArray } from "discourse/lib/utilities";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { throttle } from "@ember/runloop";
|
||||
import { schedule } from "@ember/runloop";
|
||||
|
Loading…
x
Reference in New Issue
Block a user