mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 17:55:45 +08:00
DEV: Don't use the Ember global (#13535)
This commit is contained in:
parent
717908f426
commit
aa56e2a758
app/assets/javascripts
plugins/discourse-local-dates/assets/javascripts/lib
@ -2,8 +2,7 @@ import Controller from "@ember/controller";
|
|||||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import discourseDebounce from "discourse-common/lib/debounce";
|
import discourseDebounce from "discourse-common/lib/debounce";
|
||||||
|
import { get } from "@ember/object";
|
||||||
const { get } = Ember;
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
filter: null,
|
filter: null,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import RestModel from "discourse/models/rest";
|
import RestModel from "discourse/models/rest";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
const { getProperties } = Ember;
|
import { getProperties } from "@ember/object";
|
||||||
|
|
||||||
export default RestModel.extend({
|
export default RestModel.extend({
|
||||||
revert() {
|
revert() {
|
||||||
|
@ -34,6 +34,8 @@ var define, requirejs;
|
|||||||
inject: Ember.inject.controller,
|
inject: Ember.inject.controller,
|
||||||
},
|
},
|
||||||
"@ember/debug": {
|
"@ember/debug": {
|
||||||
|
assert: Ember.assert,
|
||||||
|
runInDebug: Ember.runInDebug,
|
||||||
warn: Ember.warn,
|
warn: Ember.warn,
|
||||||
},
|
},
|
||||||
"@ember/object": {
|
"@ember/object": {
|
||||||
|
@ -5,7 +5,7 @@ import discourseComputed, {
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import { findRawTemplate } from "discourse-common/lib/raw-templates";
|
import { findRawTemplate } from "discourse-common/lib/raw-templates";
|
||||||
const { makeArray } = Ember;
|
import { makeArray } from "discourse-common/lib/helpers";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
@discourseComputed("placeholderKey")
|
@discourseComputed("placeholderKey")
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
const {
|
import { A } from "@ember/array";
|
||||||
A: emberArray,
|
import Helper from "@ember/component/helper";
|
||||||
Helper,
|
import { computed, get } from "@ember/object";
|
||||||
assert,
|
import { getOwner } from "@ember/application";
|
||||||
computed,
|
import { run } from "@ember/runloop";
|
||||||
get,
|
import { assert, runInDebug } from "@ember/debug";
|
||||||
getOwner,
|
|
||||||
run,
|
|
||||||
runInDebug,
|
|
||||||
} = Ember;
|
|
||||||
|
|
||||||
function getCurrentRouteInfos(router) {
|
function getCurrentRouteInfos(router) {
|
||||||
let routerLib = router._routerMicrolib || router.router;
|
let routerLib = router._routerMicrolib || router.router;
|
||||||
@ -15,12 +11,12 @@ function getCurrentRouteInfos(router) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getRoutes(router) {
|
function getRoutes(router) {
|
||||||
return emberArray(getCurrentRouteInfos(router)).mapBy("_route").reverse();
|
return A(getCurrentRouteInfos(router)).mapBy("_route").reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRouteWithAction(router, actionName) {
|
function getRouteWithAction(router, actionName) {
|
||||||
let action;
|
let action;
|
||||||
let handler = emberArray(getRoutes(router)).find((route) => {
|
let handler = A(getRoutes(router)).find((route) => {
|
||||||
let actions = route.actions || route._actions;
|
let actions = route.actions || route._actions;
|
||||||
action = actions[actionName];
|
action = actions[actionName];
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
const {
|
import { computed } from "@ember/object";
|
||||||
computed,
|
import { getOwner } from "@ember/application";
|
||||||
getOwner,
|
import { dasherize } from "@ember/string";
|
||||||
String: { dasherize },
|
|
||||||
} = Ember;
|
|
||||||
|
|
||||||
export default function (name) {
|
export default function (name) {
|
||||||
return computed(function (defaultName) {
|
return computed(function (defaultName) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import SelectKitFilterComponent from "select-kit/components/select-kit/select-kit-filter";
|
import SelectKitFilterComponent from "select-kit/components/select-kit/select-kit-filter";
|
||||||
const { isEmpty } = Ember;
|
import { isEmpty } from "@ember/utils";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import layout from "select-kit/templates/components/select-kit/select-kit-filter";
|
import layout from "select-kit/templates/components/select-kit/select-kit-filter";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const { getProperties } = Ember;
|
import { getProperties } from "@ember/object";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
DateWithZoneHelper provides a limited list of helpers
|
DateWithZoneHelper provides a limited list of helpers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user