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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
161 changed files with 227 additions and 356 deletions

View File

@ -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 = {

View File

@ -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({

View File

@ -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";

View File

@ -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(() => {

View File

@ -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"],

View File

@ -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";

View File

@ -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";

View File

@ -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({

View File

@ -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"],

View File

@ -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 */

View File

@ -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";

View File

@ -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";

View File

@ -1,4 +1,4 @@
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
export default Ember.Controller.extend({

View File

@ -2,7 +2,7 @@ import { alias, equal } from "@ember/object/computed";
import { inject } from "@ember/controller";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { setting, i18n } from "discourse/lib/computed";
export default Controller.extend({

View File

@ -1,4 +1,4 @@
import discourseComputed from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { alias } from "@ember/object/computed";
import { inject } from "@ember/controller";
import Controller from "@ember/controller";
@ -27,10 +27,11 @@ export default Controller.extend(bufferedProperty("model"), {
return modelQuery && modelQuery.trim().length > 0;
},
@observes("model.id")
_resetSaving: function() {
this.set("saving", false);
this.set("savingStatus", "");
}.observes("model.id"),
},
actions: {
save() {

View File

@ -1,7 +1,7 @@
import EmberObject from "@ember/object";
import Controller from "@ember/controller";
import showModal from "discourse/lib/show-modal";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Controller.extend({
@discourseComputed("model.@each.id")

View File

@ -1,6 +1,6 @@
import Controller from "@ember/controller";
import { url } from "discourse/lib/computed";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Controller.extend({
section: null,

View File

@ -7,7 +7,7 @@ import {
notEmpty
} from "@ember/object/computed";
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { url } from "discourse/lib/computed";
import { popupAjaxError } from "discourse/lib/ajax-error";
import showModal from "discourse/lib/show-modal";

View File

@ -1,5 +1,5 @@
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { THEMES } from "admin/models/theme";
export default Controller.extend({

View File

@ -1,8 +1,10 @@
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
import discourseDebounce from "discourse/lib/debounce";
import { observes } from "discourse-common/utils/decorators";
export default AdminEmailLogsController.extend({
@observes("filter.{status,user,address,type}")
filterEmailLogs: discourseDebounce(function() {
this.loadLogs();
}, 250).observes("filter.{status,user,address,type}")
}, 250)
});

View File

@ -1,6 +1,8 @@
import { empty } from "@ember/object/computed";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
/**
Is the "send test email" button disabled?
@ -14,9 +16,10 @@ export default Controller.extend({
@method testEmailAddressChanged
**/
@observes("testEmailAddress")
testEmailAddressChanged: function() {
this.set("sentTestEmail", false);
}.observes("testEmailAddress"),
},
actions: {
/**

View File

@ -1,11 +1,13 @@
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
import discourseDebounce from "discourse/lib/debounce";
import IncomingEmail from "admin/models/incoming-email";
import { observes } from "discourse-common/utils/decorators";
export default AdminEmailLogsController.extend({
@observes("filter.{status,from,to,subject}")
filterIncomingEmails: discourseDebounce(function() {
this.loadLogs(IncomingEmail);
}, 250).observes("filter.{status,from,to,subject}"),
}, 250),
actions: {
loadMore() {

View File

@ -1,11 +1,13 @@
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
import discourseDebounce from "discourse/lib/debounce";
import IncomingEmail from "admin/models/incoming-email";
import { observes } from "discourse-common/utils/decorators";
export default AdminEmailLogsController.extend({
@observes("filter.{status,from,to,subject,error}")
filterIncomingEmails: discourseDebounce(function() {
this.loadLogs(IncomingEmail);
}, 250).observes("filter.{status,from,to,subject,error}"),
}, 250),
actions: {
loadMore() {

View File

@ -1,8 +1,10 @@
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
import discourseDebounce from "discourse/lib/debounce";
import { observes } from "discourse-common/utils/decorators";
export default AdminEmailLogsController.extend({
@observes("filter.{status,user,address,type,reply_key}")
filterEmailLogs: discourseDebounce(function() {
this.loadLogs();
}, 250).observes("filter.{status,user,address,type,reply_key}")
}, 250)
});

View File

@ -1,8 +1,10 @@
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
import discourseDebounce from "discourse/lib/debounce";
import { observes } from "discourse-common/utils/decorators";
export default AdminEmailLogsController.extend({
@observes("filter.{status,user,address,type}")
filterEmailLogs: discourseDebounce(function() {
this.loadLogs();
}, 250).observes("filter.{status,user,address,type}")
}, 250)
});

View File

@ -3,18 +3,20 @@ import discourseDebounce from "discourse/lib/debounce";
import { outputExportResult } from "discourse/lib/export-result";
import { exportEntity } from "discourse/lib/export-csv";
import ScreenedIpAddress from "admin/models/screened-ip-address";
import { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
loading: false,
filter: null,
savedIpAddress: null,
@observes("filter")
show: discourseDebounce(function() {
this.set("loading", true);
ScreenedIpAddress.findAll(this.filter).then(result => {
this.setProperties({ model: result, loading: false });
});
}, 250).observes("filter"),
}, 250),
actions: {
allow(record) {

View File

@ -4,10 +4,7 @@ import { scheduleOnce } from "@ember/runloop";
import Controller from "@ember/controller";
import { exportEntity } from "discourse/lib/export-csv";
import { outputExportResult } from "discourse/lib/export-result";
import {
default as discourseComputed,
on
} from "discourse-common/utils/decorators";
import discourseComputed, { on } from "discourse-common/utils/decorators";
export default Controller.extend({
model: null,

View File

@ -1,17 +1,19 @@
import Controller from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";
import Permalink from "admin/models/permalink";
import { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
loading: false,
filter: null,
@observes("filter")
show: discourseDebounce(function() {
Permalink.findAll(this.filter).then(result => {
this.set("model", result);
this.set("loading", false);
});
}, 250).observes("filter"),
}, 250),
actions: {
recordAdded(arg) {

View File

@ -2,6 +2,7 @@ import { isEmpty } from "@ember/utils";
import { alias } from "@ember/object/computed";
import Controller from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";
import { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
filter: null,
@ -76,13 +77,14 @@ export default Controller.extend({
);
},
@observes("filter", "onlyOverridden", "model")
filterContent: discourseDebounce(function() {
if (this._skipBounce) {
this.set("_skipBounce", false);
} else {
this.filterContentNow();
}
}, 250).observes("filter", "onlyOverridden", "model"),
}, 250),
actions: {
clearFilter() {

View File

@ -6,7 +6,7 @@ import CanCheckEmails from "discourse/mixins/can-check-emails";
import { propertyNotEqual, setting } from "discourse/lib/computed";
import { userPath } from "discourse/lib/url";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { fmt } from "discourse/lib/computed";
import { htmlSafe } from "@ember/template";

View File

@ -1,4 +1,4 @@
import discourseComputed from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import Controller from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";
import { i18n } from "discourse/lib/computed";
@ -29,9 +29,10 @@ export default Controller.extend(CanCheckEmails, {
return I18n.t("admin.users.titles." + query);
},
@observes("listFilter")
_filterUsers: discourseDebounce(function() {
this.resetFilters();
}, 250).observes("listFilter"),
}, 250),
resetFilters() {
this._page = 1;

View File

@ -3,6 +3,7 @@ import { alias } from "@ember/object/computed";
import EmberObject from "@ember/object";
import Controller from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";
import { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
filter: null,
@ -43,10 +44,11 @@ export default Controller.extend({
this.set("model", matchesByAction);
},
@observes("filter")
filterContent: discourseDebounce(function() {
this.filterContentNow();
this.set("filtered", !isEmpty(this.filter));
}, 250).observes("filter"),
}, 250),
actions: {
clearFilter() {

View File

@ -4,10 +4,7 @@ import { inject } from "@ember/controller";
import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { ajax } from "discourse/lib/ajax";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
const THEME_FIELD_VARIABLE_TYPE_IDS = [2, 3, 4];

View File

@ -1,6 +1,6 @@
import { alias, map } from "@ember/object/computed";
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { escapeExpression } from "discourse/lib/utilities";
export default Controller.extend({

View File

@ -4,10 +4,7 @@ import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { THEMES, COMPONENTS } from "admin/models/theme";
import { POPULAR_THEMES } from "discourse-common/helpers/popular-themes";
import { set } from "@ember/object";

View File

@ -1,5 +1,5 @@
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import ModalFunctionality from "discourse/mixins/modal-functionality";
export default Controller.extend(ModalFunctionality, {

View File

@ -1,5 +1,4 @@
import {
default as discourseComputed,
import discourseComputed, {
observes,
on
} from "discourse-common/utils/decorators";

View File

@ -2,7 +2,7 @@ import { get } from "@ember/object";
import { isEmpty } from "@ember/utils";
import { or, gt } from "@ember/object/computed";
import RestModel from "discourse/models/rest";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { ajax } from "discourse/lib/ajax";
import { escapeExpression } from "discourse/lib/utilities";

View File

@ -2,10 +2,7 @@ import { isEmpty } from "@ember/utils";
import RestModel from "discourse/models/rest";
import Category from "discourse/models/category";
import Group from "discourse/models/group";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import Site from "discourse/models/site";
export default RestModel.extend({

View File

@ -1,8 +1,5 @@
import DiscourseRoute from "discourse/routes/discourse";
import {
default as EmailPreview,
oneWeekAgo
} from "admin/models/email-preview";
import EmailPreview, { oneWeekAgo } from "admin/models/email-preview";
export default DiscourseRoute.extend({
model() {

View File

@ -1,9 +1,6 @@
/*global Mousetrap:true*/
import { buildResolver } from "discourse-common/resolver";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { computed } from "@ember/object";
import FocusEvent from "discourse-common/mixins/focus-event";
import EmberObject from "@ember/object";

View File

@ -1,8 +1,7 @@
import Component from "@ember/component";
import {
import discourseComputed, {
on,
observes,
default as discourseComputed
observes
} from "discourse-common/utils/decorators";
import { findRawTemplate } from "discourse/lib/raw-templates";
const { makeArray } = Ember;

View File

@ -1,4 +1,4 @@
import discourseComputed from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { alias, not } from "@ember/object/computed";
import Component from "@ember/component";
@ -16,9 +16,10 @@ export default Component.extend({
}
},
@observes("topicList.[]")
_topicListChanged: function() {
this._initFromTopicList(this.topicList);
}.observes("topicList.[]"),
},
_initFromTopicList(topicList) {
if (topicList !== null) {

View File

@ -1,6 +1,6 @@
import { filter } from "@ember/object/computed";
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import deprecated from "discourse-common/lib/deprecated";
// A breadcrumb including category drop downs

View File

@ -1,6 +1,6 @@
import { alias, equal } from "@ember/object/computed";
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import {
PRIVATE_MESSAGE,
CREATE_TOPIC,

View File

@ -4,10 +4,7 @@ import { cancel } from "@ember/runloop";
import { scheduleOnce } from "@ember/runloop";
import { later } 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 Composer from "discourse/models/composer";
import afterTransition from "discourse/lib/after-transition";
import positioningWorkaround from "discourse/lib/safari-hacks";

View File

@ -5,8 +5,7 @@ import { scheduleOnce } from "@ember/runloop";
import { later } from "@ember/runloop";
import Component from "@ember/component";
import userSearch from "discourse/lib/user-search";
import {
default as discourseComputed,
import discourseComputed, {
observes,
on
} from "discourse-common/utils/decorators";

View File

@ -3,10 +3,7 @@ import { next } from "@ember/runloop";
import { debounce } from "@ember/runloop";
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 { load } from "pretty-text/oneboxer";
import { lookupCache } from "pretty-text/oneboxer-cache";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,9 +1,6 @@
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";
export default Component.extend({
showSelector: true,

View File

@ -1,6 +1,6 @@
import { notEmpty, empty, equal } from "@ember/object/computed";
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import DiscourseURL from "discourse/lib/url";
export default Component.extend({

View File

@ -6,8 +6,7 @@ import { later } from "@ember/runloop";
import { inject as service } from "@ember/service";
import Component from "@ember/component";
/*global Mousetrap:true */
import {
default as discourseComputed,
import discourseComputed, {
on,
observes
} from "discourse-common/utils/decorators";

View File

@ -2,10 +2,7 @@ import { next } from "@ember/runloop";
import Component from "@ember/component";
/* global Pikaday:true */
import loadScript from "discourse/lib/load-script";
import {
default as discourseComputed,
on
} from "discourse-common/utils/decorators";
import discourseComputed, { on } from "discourse-common/utils/decorators";
export default Component.extend({
classNames: ["d-date-input"],

View File

@ -2,10 +2,7 @@ import { next } from "@ember/runloop";
import Component from "@ember/component";
/* global Pikaday:true */
import loadScript from "discourse/lib/load-script";
import {
default as discourseComputed,
on
} from "discourse-common/utils/decorators";
import discourseComputed, { on } from "discourse-common/utils/decorators";
const DATE_FORMAT = "YYYY-MM-DD";

View File

@ -1,5 +1,5 @@
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
tagName: "span",

View File

@ -1,6 +1,6 @@
import EmberObject from "@ember/object";
import { buildCategoryPanel } from "discourse/components/edit-category-panel";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default buildCategoryPanel("images").extend({
@discourseComputed("category.uploaded_background.url")

View File

@ -1,12 +1,14 @@
import { scheduleOnce } from "@ember/runloop";
import { buildCategoryPanel } from "discourse/components/edit-category-panel";
import { observes } from "discourse-common/utils/decorators";
export default buildCategoryPanel("topic-template", {
@observes("activeTab")
_activeTabChanged: function() {
if (this.activeTab) {
scheduleOnce("afterRender", () =>
this.element.querySelector(".d-editor-input").focus()
);
}
}.observes("activeTab")
}
});

View File

@ -2,8 +2,7 @@ import { isEmpty } from "@ember/utils";
import { alias, equal, or } from "@ember/object/computed";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import {
default as discourseComputed,
import discourseComputed, {
observes,
on
} from "discourse-common/utils/decorators";

View File

@ -1,6 +1,6 @@
import { notEmpty, not } from "@ember/object/computed";
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import UploadMixin from "discourse/mixins/upload";
export default Component.extend(UploadMixin, {

View File

@ -1,5 +1,5 @@
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
tagName: "button",

View File

@ -1,10 +1,7 @@
import { isEmpty } from "@ember/utils";
import { equal, and, empty } from "@ember/object/computed";
import Component from "@ember/component";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { FORMAT } from "select-kit/components/future-date-input-selector";
import { PUBLISH_TO_CATEGORY_STATUS_TYPE } from "discourse/controllers/edit-topic-timer";

View File

@ -1,7 +1,7 @@
import { alias, match, gt, or } from "@ember/object/computed";
import Component from "@ember/component";
import { setting } from "discourse/lib/computed";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import CardContentsBase from "discourse/mixins/card-contents-base";
import CleansUp from "discourse/mixins/cleans-up";
import { groupPath } from "discourse/lib/url";

View File

@ -1,5 +1,5 @@
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
import showModal from "discourse/lib/show-modal";

View File

@ -1,9 +1,8 @@
import { isEmpty } from "@ember/utils";
import Component from "@ember/component";
import {
import discourseComputed, {
on,
observes,
default as discourseComputed
observes
} from "discourse-common/utils/decorators";
import { findRawTemplate } from "discourse/lib/raw-templates";

View File

@ -1,5 +1,5 @@
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
init() {

View File

@ -1,10 +1,7 @@
import { isEmpty } from "@ember/utils";
import { not } from "@ember/object/computed";
import Component from "@ember/component";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import Group from "discourse/models/group";
import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseDebounce from "discourse/lib/debounce";

View File

@ -1,9 +1,6 @@
import { next } 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 DiscourseURL from "discourse/lib/url";
import { renderedConnectorsFor } from "discourse/lib/plugin-connectors";
import FilterModeMixin from "discourse/mixins/filter-mode";

View File

@ -1,6 +1,6 @@
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { keyValueStore as pushNotificationKeyValueStore } from "discourse/lib/push-notifications";
import { default as DesktopNotificationConfig } from "discourse/components/desktop-notification-config";
import DesktopNotificationConfig from "discourse/components/desktop-notification-config";
const userDismissedPromptKey = "dismissed-prompt";

View File

@ -1,10 +1,7 @@
import { alias, not } from "@ember/object/computed";
import Component from "@ember/component";
import { iconHTML } from "discourse-common/lib/icon-library";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
export default Component.extend({
classNameBindings: [":popup-tip", "good", "bad", "lastShownAt::hide"],

View File

@ -1,9 +1,6 @@
import { bind } from "@ember/runloop";
import Component from "@ember/component";
import {
default as discourseComputed,
on
} from "discourse-common/utils/decorators";
import discourseComputed, { on } from "discourse-common/utils/decorators";
const USER_DISMISSED_PROMPT_KEY = "dismissed-pwa-install-banner";

View File

@ -1,5 +1,5 @@
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
@discourseComputed("reviewable.user_fields")

View File

@ -3,7 +3,7 @@ import { alias } from "@ember/object/computed";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import { escapeExpression } from "discourse/lib/utilities";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import Sharing from "discourse/lib/sharing";
export default Component.extend({

View File

@ -4,10 +4,7 @@ import { scheduleOnce } from "@ember/runloop";
import Component from "@ember/component";
import { wantsNewWindow } from "discourse/lib/intercept-click";
import { longDateNoYear } from "discourse/lib/formatter";
import {
default as discourseComputed,
on
} from "discourse-common/utils/decorators";
import discourseComputed, { on } from "discourse-common/utils/decorators";
import Sharing from "discourse/lib/sharing";
import { nativeShare } from "discourse/lib/pwa-utils";

View File

@ -1,7 +1,7 @@
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import showModal from "discourse/lib/show-modal";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import { reads, and } from "@ember/object/computed";
import { isEmpty } from "@ember/utils";

View File

@ -1,5 +1,5 @@
import Component from "@ember/component";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
classNames: ["topic-notice"],

View File

@ -1,10 +1,7 @@
import { alias, reads } 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 LoadMore from "discourse/mixins/load-more";
import { on } from "@ember/object/evented";

View File

@ -1,10 +1,7 @@
import { alias } from "@ember/object/computed";
import { scheduleOnce } 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";
export default Component.extend({
elementId: "topic-progress-wrapper",

View File

@ -1,6 +1,10 @@
import Component from "@ember/component";
import { observes } from "discourse-common/utils/decorators";
export default Component.extend({
tagName: "span",
@observes("selected")
selectionChanged: function() {
const selected = this.selected;
const list = this.selectedList;
@ -11,5 +15,5 @@ export default Component.extend({
} else {
list.removeObject(id);
}
}.observes("selected")
}
});

View File

@ -2,10 +2,7 @@ import { isEmpty } from "@ember/utils";
import { alias, gte, and, gt, not, or } from "@ember/object/computed";
import EmberObject from "@ember/object";
import Component from "@ember/component";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import User from "discourse/models/user";
import { propertyNotEqual, setting } from "discourse/lib/computed";
import { durationTiny } from "discourse/lib/formatter";

View File

@ -7,6 +7,7 @@ import DiscourseURL from "discourse/lib/url";
import Draft from "discourse/models/draft";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { getOwner } from "discourse-common/lib/get-owner";
import { observes } from "discourse-common/utils/decorators";
import { on } from "@ember/object/evented";
export default Component.extend(LoadMore, {
@ -24,9 +25,10 @@ export default Component.extend(LoadMore, {
eyelineSelector: ".user-stream .item",
classNames: ["user-stream"],
@observes("stream.user.id")
_scrollTopOnModelChange: function() {
schedule("afterRender", () => $(document).scrollTop(0));
}.observes("stream.user.id"),
},
_inserted: on("didInsertElement", function() {
this.bindScrolling({ name: "user-stream-view" });

View File

@ -3,10 +3,7 @@ import EmberObject from "@ember/object";
import Controller from "@ember/controller";
import Badge from "discourse/models/badge";
import UserBadge from "discourse/models/user-badge";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
queryParams: ["username"],

View File

@ -8,8 +8,7 @@ import DiscourseURL from "discourse/lib/url";
import Quote from "discourse/lib/quote";
import Draft from "discourse/models/draft";
import Composer from "discourse/models/composer";
import {
default as discourseComputed,
import discourseComputed, {
observes,
on
} from "discourse-common/utils/decorators";

View File

@ -5,8 +5,8 @@ import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { setting } from "discourse/lib/computed";
import {
default as discourseComputed,
import discourseComputed, {
observes,
on
} from "discourse-common/utils/decorators";
import { emailValid } from "discourse/lib/utilities";
@ -171,6 +171,7 @@ export default Controller.extend(
: providerName;
},
@observes("emailValidation", "accountEmail")
prefillUsername: function() {
if (this.prefilledUsername) {
// If username field has been filled automatically, and email field just changed,
@ -189,7 +190,7 @@ export default Controller.extend(
// then look for a registered username that matches the email.
this.fetchExistingUsername();
}
}.observes("emailValidation", "accountEmail"),
},
// Determines whether at least one login button is enabled
@discourseComputed

View File

@ -3,6 +3,7 @@ import { inject } from "@ember/controller";
import Controller from "@ember/controller";
import DiscourseURL from "discourse/lib/url";
import Category from "discourse/models/category";
import { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
discoveryTopics: inject("discovery/topics"),
@ -16,9 +17,10 @@ export default Controller.extend({
loadedAllItems: not("discoveryTopics.model.canLoadMore"),
@observes("loadedAllItems")
_showFooter: function() {
this.set("application.showFooter", this.loadedAllItems);
}.observes("loadedAllItems"),
},
showMoreUrl(period) {
let url = "",

View File

@ -3,8 +3,7 @@ import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import DiscourseURL from "discourse/lib/url";
import { extractError } from "discourse/lib/ajax-error";
import {
default as discourseComputed,
import discourseComputed, {
on,
observes
} from "discourse-common/utils/decorators";

View File

@ -1,6 +1,6 @@
import EmberObject from "@ember/object";
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import TopicTimer from "discourse/models/topic-timer";
import { popupAjaxError } from "discourse/lib/ajax-error";

View File

@ -1,10 +1,7 @@
import { equal, gte, none, alias } from "@ember/object/computed";
import { schedule } from "@ember/runloop";
import Controller from "@ember/controller";
import {
on,
default as discourseComputed
} from "discourse-common/utils/decorators";
import discourseComputed, { on } from "discourse-common/utils/decorators";
const ButtonBackBright = {
classes: "btn-primary",

View File

@ -9,10 +9,7 @@ import {
getSearchKey,
isValidSearchTerm
} from "discourse/lib/search";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import Category from "discourse/models/category";
import { escapeExpression } from "discourse/lib/utilities";
import { setTransient } from "discourse/lib/page-tracker";

View File

@ -1,9 +1,6 @@
import Controller, { inject } from "@ember/controller";
import { alias } from "@ember/object/computed";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseDebounce from "discourse/lib/debounce";

View File

@ -1,10 +1,7 @@
import { inject } from "@ember/controller";
import EmberObject from "@ember/object";
import Controller from "@ember/controller";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
group: inject(),

View File

@ -1,6 +1,6 @@
import { inject as service } from "@ember/service";
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
export default Controller.extend({
router: service(),

View File

@ -1,8 +1,5 @@
import Controller, { inject } from "@ember/controller";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseDebounce from "discourse/lib/debounce";

View File

@ -1,7 +1,7 @@
import EmberObject from "@ember/object";
import { inject } from "@ember/controller";
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { inject as service } from "@ember/service";
import { readOnly } from "@ember/object/computed";

View File

@ -1,10 +1,7 @@
import { inject } from "@ember/controller";
import Controller from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
application: inject(),

View File

@ -1,7 +1,7 @@
import { isEmpty } from "@ember/utils";
import { alias, notEmpty } from "@ember/object/computed";
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import getUrl from "discourse-common/lib/get-url";
import DiscourseURL from "discourse/lib/url";
import { ajax } from "discourse/lib/ajax";

View File

@ -6,7 +6,7 @@ import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { movePosts, mergeTopic } from "discourse/models/topic";
import DiscourseURL from "discourse/lib/url";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { extractError } from "discourse/lib/ajax-error";
export default Controller.extend(ModalFunctionality, {

View File

@ -1,6 +1,6 @@
import { alias, or, readOnly } from "@ember/object/computed";
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import DiscourseURL from "discourse/lib/url";
import { ajax } from "discourse/lib/ajax";
import PasswordValidation from "discourse/mixins/password-validation";

View File

@ -2,7 +2,7 @@ import { not, or, gt } from "@ember/object/computed";
import Controller from "@ember/controller";
import { iconHTML } from "discourse-common/lib/icon-library";
import CanCheckEmails from "discourse/mixins/can-check-emails";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import PreferencesTabController from "discourse/mixins/preferences-tab-controller";
import { propertyNotEqual, setting } from "discourse/lib/computed";
import { popupAjaxError } from "discourse/lib/ajax-error";

View File

@ -1,7 +1,7 @@
import { equal } from "@ember/object/computed";
import Controller from "@ember/controller";
import PreferencesTabController from "discourse/mixins/preferences-tab-controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
const EMAIL_LEVELS = {

View File

@ -2,10 +2,7 @@ import { inject } from "@ember/controller";
import Controller from "@ember/controller";
import PreferencesTabController from "discourse/mixins/preferences-tab-controller";
import { setDefaultHomepage } from "discourse/lib/utilities";
import {
default as discourseComputed,
observes
} from "discourse-common/utils/decorators";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import {
listThemes,
previewTheme,

View File

@ -1,7 +1,7 @@
import { isEmpty } from "@ember/utils";
import EmberObject from "@ember/object";
import Controller from "@ember/controller";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import discourseComputed from "discourse-common/utils/decorators";
import PreferencesTabController from "discourse/mixins/preferences-tab-controller";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { cookAsync } from "discourse/lib/text";

Some files were not shown because too many files have changed in this diff Show More