DEV: Clean up Ember imports (#8979)

Includes:
* Import `computed` helpers
* Import `@ember/application`
* Import `isBlank` from `@ember/utils`
* Import `A` from `@ember/array`
* Import `EmberArray` from `@ember/array`
* Import `ArrayProxy` from `@ember/array/proxy`
* Import `warn` from `@ember/debug`
* Import `EmberObject` from `@ember/object`
* Import `Application` from `@ember/application`
* Import `EmberRouter` from `@ember/routing/router`
* Import `isPresent` from `@ember/utils`
* Import `computed` from `@ember/object`
* Import `guidFor` from `@ember/object`
* Import `isArray` from `@ember/array`
* Import `TextField` from `@ember/component`
* Import `TextArea` from `@ember/component`
* Import `Promise` from `rsvp`
* Import `Evented` from `@ember/object/evented`
* Replace deprecated `ember-addons/ember-computed-decorators` imports
This commit is contained in:
Jarek Radosz
2020-03-06 23:49:28 +01:00
committed by GitHub
parent 26da99a2d2
commit 48ba65f406
35 changed files with 108 additions and 71 deletions

View File

@@ -1,3 +1,4 @@
import EmberObject from "@ember/object";
import { withPluginApi } from "discourse/lib/plugin-api";
import { observes } from "discourse-common/utils/decorators";
import { getRegister } from "discourse-common/lib/get-owner";
@@ -44,7 +45,7 @@ function initializePolls(api) {
if (existing) {
this._polls[p.name].setProperties(p);
} else {
this._polls[p.name] = Ember.Object.create(p);
this._polls[p.name] = EmberObject.create(p);
}
});
this.set("pollsObject", this._polls);
@@ -78,8 +79,8 @@ function initializePolls(api) {
if (quotedId) {
const quotedPost = post.quoted[quotedId];
if (quotedPost) {
post = Ember.Object.create(quotedPost);
poll = Ember.Object.create(
post = EmberObject.create(quotedPost);
poll = EmberObject.create(
quotedPost.polls.find(p => p.name === pollName)
);
vote = quotedPost.polls_votes || {};

View File

@@ -1,4 +1,6 @@
import EmberObject from "@ember/object";
import { moduleForWidget, widgetTest } from "helpers/widget-test";
moduleForWidget("discourse-poll-standard-results");
const template = `{{mount-widget
@@ -11,7 +13,7 @@ widgetTest("options in descending order", {
beforeEach() {
this.set(
"poll",
Ember.Object.create({
EmberObject.create({
options: [{ votes: 5 }, { votes: 4 }],
voters: 9
})
@@ -30,7 +32,7 @@ widgetTest("options in ascending order", {
beforeEach() {
this.set(
"poll",
Ember.Object.create({
EmberObject.create({
options: [{ votes: 4 }, { votes: 5 }],
voters: 9
})
@@ -50,7 +52,7 @@ widgetTest("multiple options in descending order", {
this.set("isMultiple", true);
this.set(
"poll",
Ember.Object.create({
EmberObject.create({
type: "multiple",
options: [
{ votes: 5, html: "a" },