DEV: Fix function prototype deprecations (#8681)

* DEV: Fix the function prototype observers deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.observes('foo') to observer('foo', function() {}). [deprecation id: function-prototype-extensions.observes] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-observes for more details.

* DEV: Fix the function prototype event listeners deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.on('foo') to on('foo', function() {}). [deprecation id: function-prototype-extensions.on] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-on for more details.

* DEV: Simplify `default as` imports

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is contained in:
Jarek Radosz
2020-01-16 18:56:53 +01:00
committed by GitHub
parent ff5a82b614
commit fe588cc7f8
161 changed files with 227 additions and 356 deletions
@@ -8,7 +8,7 @@ import ReportLoader from "discourse/lib/reports-loader";
import { exportEntity } from "discourse/lib/export-csv";
import { outputExportResult } from "discourse/lib/export-result";
import { isNumeric } from "discourse/lib/utilities";
import { SCHEMA_VERSION, default as Report } from "admin/models/report";
import Report, { SCHEMA_VERSION } from "admin/models/report";
import ENV from "discourse-common/config/environment";
const TABLE_OPTIONS = {
@@ -1,6 +1,6 @@
import { next } from "@ember/runloop";
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { fmt } from "discourse/lib/computed";
export default Component.extend({
@@ -7,8 +7,7 @@ import { bufferedProperty } from "discourse/mixins/buffered-content";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { propertyEqual } from "discourse/lib/computed";
import { i18n } from "discourse/lib/computed";
import {
default as discourseComputed,
import discourseComputed, {
observes,
on
} from "discourse-common/utils/decorators";
@@ -1,6 +1,7 @@
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import { default as loadScript, loadCSS } from "discourse/lib/load-script";
import loadScript, { loadCSS } from "discourse/lib/load-script";
import { observes } from "discourse-common/utils/decorators";
/**
An input field for a color.
@@ -11,6 +12,8 @@ import { default as loadScript, loadCSS } from "discourse/lib/load-script";
**/
export default Component.extend({
classNames: ["color-picker"],
@observes("hexValue", "brightnessValue", "valid")
hexValueChanged: function() {
var hex = this.hexValue;
let text = this.element.querySelector("input.hex-input");
@@ -33,7 +36,7 @@ export default Component.extend({
} else {
text.setAttribute("style", "");
}
}.observes("hexValue", "brightnessValue", "valid"),
},
didInsertElement() {
loadScript("/javascripts/spectrum.js").then(() => {
@@ -1,8 +1,5 @@
import Component from "@ember/component";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
export default Component.extend({
classNames: ["inline-edit"],
@@ -1,7 +1,7 @@
import EmberObject from "@ember/object";
import { later } from "@ember/runloop";
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { ajax } from "discourse/lib/ajax";
import AdminUser from "admin/models/admin-user";
import copyText from "discourse/lib/copy-text";
@@ -1,6 +1,6 @@
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { fmt } from "discourse/lib/computed";
import Permalink from "admin/models/permalink";
@@ -1,5 +1,5 @@
import Category from "discourse/models/category";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import FilterComponent from "admin/components/report-filters/filter";
export default FilterComponent.extend({
@@ -1,5 +1,5 @@
import FilterComponent from "admin/components/report-filters/filter";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default FilterComponent.extend({
classNames: ["group-filter"],
@@ -2,10 +2,7 @@ import { schedule } from "@ember/runloop";
import { later } from "@ember/runloop";
import Component from "@ember/component";
import { iconHTML } from "discourse-common/lib/icon-library";
import {
default as discourseComputed,
on
} from "discourse-common/utils/decorators";
import discourseComputed, { on } from "discourse-common/utils/decorators";
/*global Resumable:true */
@@ -1,10 +1,7 @@
import { gt, and } from "@ember/object/computed";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { iconHTML } from "discourse-common/lib/icon-library";
import { escape } from "pretty-text/sanitizer";
import ENV from "discourse-common/config/environment";
@@ -2,8 +2,7 @@ import { isEmpty } from "@ember/utils";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import WatchedWord from "admin/models/watched-word";
import {
default as discourseComputed,
import discourseComputed, {
on,
observes
} from "discourse-common/utils/decorators";