DEV: Import ember ENV instead of Ember.testing (#8305)

This commit is contained in:
Mark VanLandingham
2019-11-07 11:20:35 -06:00
committed by GitHub
parent 60a235d128
commit 9ffdbf912f
32 changed files with 75 additions and 37 deletions
@@ -9,6 +9,7 @@ import { outputExportResult } from "discourse/lib/export-result";
import { isNumeric } from "discourse/lib/utilities";
import { SCHEMA_VERSION, default as Report } from "admin/models/report";
import computed from "ember-addons/ember-computed-decorators";
import ENV from "discourse-common/config/environment";
const TABLE_OPTIONS = {
perPage: 8,
@@ -162,8 +163,8 @@ export default Component.extend({
let reportKey = "reports:";
reportKey += [
dataSourceName,
Ember.testing ? "start" : startDate.replace(/-/g, ""),
Ember.testing ? "end" : endDate.replace(/-/g, ""),
ENV.environment === "test" ? "start" : startDate.replace(/-/g, ""),
ENV.environment === "test" ? "end" : endDate.replace(/-/g, ""),
"[:prev_period]",
this.get("reportOptions.table.limit"),
customFilters
@@ -7,6 +7,7 @@ import {
} from "ember-addons/ember-computed-decorators";
import { iconHTML } from "discourse-common/lib/icon-library";
import { escape } from "pretty-text/sanitizer";
import ENV from "discourse-common/config/environment";
const MAX_COMPONENTS = 4;
@@ -43,7 +44,7 @@ export default Component.extend({
animate(isInitial) {
const $container = $(this.element);
const $list = $(this.element.querySelector(".components-list"));
if ($list.length === 0 || Ember.testing) {
if ($list.length === 0 || ENV.environment === 'test') {
return;
}
const duration = 300;
@@ -2,6 +2,7 @@ import { gt, equal } from "@ember/object/computed";
import Component from "@ember/component";
import { THEMES, COMPONENTS } from "admin/models/theme";
import { default as computed } from "ember-addons/ember-computed-decorators";
import { getOwner } from "@ember/application";
export default Component.extend({
THEMES: THEMES,
@@ -70,7 +71,7 @@ export default Component.extend({
}
},
navigateToTheme(theme) {
Ember.getOwner(this)
getOwner(this)
.lookup("router:main")
.transitionTo("adminCustomizeThemes.show", theme);
}