diff --git a/app/assets/javascripts/admin/controllers/admin-api-keys-new.js.es6 b/app/assets/javascripts/admin/controllers/admin-api-keys-new.js.es6 index 42391beaf83..9384e79557f 100644 --- a/app/assets/javascripts/admin/controllers/admin-api-keys-new.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-api-keys-new.js.es6 @@ -1,5 +1,6 @@ -import discourseComputed from "discourse-common/utils/decorators"; +import { isBlank } from "@ember/utils"; import Controller from "@ember/controller"; +import discourseComputed from "discourse-common/utils/decorators"; import { popupAjaxError } from "discourse/lib/ajax-error"; export default Controller.extend({ @@ -15,8 +16,8 @@ export default Controller.extend({ @discourseComputed("model.description", "model.username", "userMode") saveDisabled(description, username, userMode) { - if (Ember.isBlank(description)) return true; - if (userMode === "single" && Ember.isBlank(username)) return true; + if (isBlank(description)) return true; + if (userMode === "single" && isBlank(username)) return true; return false; }, diff --git a/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js.es6 b/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js.es6 index 1629aab70bd..7bc36038877 100644 --- a/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js.es6 +++ b/app/assets/javascripts/admin/controllers/modals/admin-edit-badge-groupings.js.es6 @@ -1,4 +1,5 @@ import Controller from "@ember/controller"; +import { A } from "@ember/array"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import { observes } from "discourse-common/utils/decorators"; @@ -7,7 +8,7 @@ export default Controller.extend(ModalFunctionality, { @observes("model") modelChanged() { const model = this.model; - const copy = Ember.A(); + const copy = A(); const store = this.store; if (model) { diff --git a/app/assets/javascripts/admin/mixins/setting-component.js.es6 b/app/assets/javascripts/admin/mixins/setting-component.js.es6 index c182abadd61..70384c1a277 100644 --- a/app/assets/javascripts/admin/mixins/setting-component.js.es6 +++ b/app/assets/javascripts/admin/mixins/setting-component.js.es6 @@ -1,3 +1,4 @@ +import { warn } from "@ember/debug"; import discourseComputed from "discourse-common/utils/decorators"; import { alias, oneWay } from "@ember/object/computed"; import { categoryLinkHTML } from "discourse/helpers/category-link"; @@ -137,7 +138,7 @@ export default Mixin.create({ }), _save() { - Ember.warn("You should define a `_save` method", { + warn("You should define a `_save` method", { id: "discourse.setting-component.missing-save" }); return Promise.resolve(); diff --git a/app/assets/javascripts/admin/models/color-scheme.js.es6 b/app/assets/javascripts/admin/models/color-scheme.js.es6 index afabb1ed6ec..ee60097b747 100644 --- a/app/assets/javascripts/admin/models/color-scheme.js.es6 +++ b/app/assets/javascripts/admin/models/color-scheme.js.es6 @@ -1,3 +1,5 @@ +import { A } from "@ember/array"; +import ArrayProxy from "@ember/array/proxy"; import discourseComputed from "discourse-common/utils/decorators"; import { not } from "@ember/object/computed"; import { ajax } from "discourse/lib/ajax"; @@ -33,7 +35,7 @@ const ColorScheme = EmberObject.extend({ const newScheme = ColorScheme.create({ name: this.name, can_edit: true, - colors: Ember.A() + colors: A() }); this.colors.forEach(c => { newScheme.colors.pushObject( @@ -111,7 +113,7 @@ const ColorScheme = EmberObject.extend({ } }); -const ColorSchemes = Ember.ArrayProxy.extend({}); +const ColorSchemes = ArrayProxy.extend({}); ColorScheme.reopenClass({ findAll() { diff --git a/app/assets/javascripts/admin/models/theme.js.es6 b/app/assets/javascripts/admin/models/theme.js.es6 index 543858c6776..e63e9e1cce8 100644 --- a/app/assets/javascripts/admin/models/theme.js.es6 +++ b/app/assets/javascripts/admin/models/theme.js.es6 @@ -1,5 +1,5 @@ import { get } from "@ember/object"; -import { isEmpty } from "@ember/utils"; +import { isBlank, isEmpty } from "@ember/utils"; import { or, gt } from "@ember/object/computed"; import RestModel from "discourse/models/rest"; import discourseComputed from "discourse-common/utils/decorators"; @@ -153,7 +153,7 @@ const Theme = RestModel.extend({ @discourseComputed("theme_fields.[]") editedFields(fields) { return fields.filter( - field => !Ember.isBlank(field.value) && field.type_id !== SETTINGS_TYPE_ID + field => !isBlank(field.value) && field.type_id !== SETTINGS_TYPE_ID ); }, diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js index 9d14e3208ca..cde52ac72ce 100644 --- a/app/assets/javascripts/discourse-loader.js +++ b/app/assets/javascripts/discourse-loader.js @@ -12,7 +12,8 @@ var define, requirejs; jquery: { default: $ }, "@ember/array": { default: Ember.Array, - A: Ember.A + A: Ember.A, + isArray: Ember.isArray }, "@ember/array/proxy": { default: Ember.ArrayProxy @@ -99,10 +100,10 @@ var define, requirejs; inject: Ember.inject.service }, "@ember/utils": { - isPresent: Ember.isPresent, isBlank: Ember.isBlank, isEmpty: Ember.isEmpty, - isNone: Ember.isNone + isNone: Ember.isNone, + isPresent: Ember.isPresent }, rsvp: { default: Ember.RSVP, diff --git a/app/assets/javascripts/discourse.js.es6 b/app/assets/javascripts/discourse.js.es6 index 8143ba27fca..10fb7dd407d 100644 --- a/app/assets/javascripts/discourse.js.es6 +++ b/app/assets/javascripts/discourse.js.es6 @@ -1,14 +1,14 @@ /*global Mousetrap:true*/ +import Application from "@ember/application"; +import EmberObject, { computed } from "@ember/object"; import { buildResolver } from "discourse-common/resolver"; 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"; import deprecated from "discourse-common/lib/deprecated"; const _pluginCallbacks = []; -const Discourse = Ember.Application.extend(FocusEvent, { +const Discourse = Application.extend(FocusEvent, { rootElement: "#main", _docTitle: document.title, RAW_TEMPLATES: {}, diff --git a/app/assets/javascripts/discourse/components/expanding-text-area.js.es6 b/app/assets/javascripts/discourse/components/expanding-text-area.js.es6 index 4c3432f2772..ca215cc3f73 100644 --- a/app/assets/javascripts/discourse/components/expanding-text-area.js.es6 +++ b/app/assets/javascripts/discourse/components/expanding-text-area.js.es6 @@ -1,8 +1,9 @@ +import { TextArea } from "@ember/component"; import { scheduleOnce } from "@ember/runloop"; import { on, observes } from "discourse-common/utils/decorators"; import autosize from "discourse/lib/autosize"; -export default Ember.TextArea.extend({ +export default TextArea.extend({ @on("didInsertElement") _startWatching() { scheduleOnce("afterRender", () => { diff --git a/app/assets/javascripts/discourse/components/honeypot-input.js.es6 b/app/assets/javascripts/discourse/components/honeypot-input.js.es6 index 8231303da54..9eb256bc12d 100644 --- a/app/assets/javascripts/discourse/components/honeypot-input.js.es6 +++ b/app/assets/javascripts/discourse/components/honeypot-input.js.es6 @@ -1,6 +1,7 @@ +import { TextField } from "@ember/component"; import { on } from "discourse-common/utils/decorators"; -export default Ember.TextField.extend({ +export default TextField.extend({ @on("init") _init() { // Chrome autocomplete is buggy per: diff --git a/app/assets/javascripts/discourse/components/number-field.js.es6 b/app/assets/javascripts/discourse/components/number-field.js.es6 index ca2db4d124f..6f78cc37076 100644 --- a/app/assets/javascripts/discourse/components/number-field.js.es6 +++ b/app/assets/javascripts/discourse/components/number-field.js.es6 @@ -1,6 +1,7 @@ +import { TextField } from "@ember/component"; import discourseComputed from "discourse-common/utils/decorators"; -export default Ember.TextField.extend({ +export default TextField.extend({ classNameBindings: ["invalid"], @discourseComputed("number") diff --git a/app/assets/javascripts/discourse/components/text-field.js.es6 b/app/assets/javascripts/discourse/components/text-field.js.es6 index 1978cd0ab22..23440b291dd 100644 --- a/app/assets/javascripts/discourse/components/text-field.js.es6 +++ b/app/assets/javascripts/discourse/components/text-field.js.es6 @@ -1,7 +1,8 @@ +import { TextField } from "@ember/component"; import discourseComputed from "discourse-common/utils/decorators"; import { siteDir, isRTL, isLTR } from "discourse/lib/text-direction"; -export default Ember.TextField.extend({ +export default TextField.extend({ attributeBindings: [ "autocorrect", "autocapitalize", diff --git a/app/assets/javascripts/discourse/controllers/create-account.js.es6 b/app/assets/javascripts/discourse/controllers/create-account.js.es6 index 62085e548ed..3d93a61393e 100644 --- a/app/assets/javascripts/discourse/controllers/create-account.js.es6 +++ b/app/assets/javascripts/discourse/controllers/create-account.js.es6 @@ -1,3 +1,4 @@ +import { A } from "@ember/array"; import { isEmpty } from "@ember/utils"; import { notEmpty, or, not } from "@ember/object/computed"; import Controller, { inject as controller } from "@ember/controller"; @@ -31,7 +32,7 @@ export default Controller.extend( accountChallenge: 0, accountHoneypot: 0, formSubmitted: false, - rejectedEmails: Ember.A([]), + rejectedEmails: A(), prefilledUsername: null, userFields: null, isDeveloper: false, diff --git a/app/assets/javascripts/discourse/helpers/topic-status-icons.js.es6 b/app/assets/javascripts/discourse/helpers/topic-status-icons.js.es6 index 80076d725d2..2f2da65a250 100644 --- a/app/assets/javascripts/discourse/helpers/topic-status-icons.js.es6 +++ b/app/assets/javascripts/discourse/helpers/topic-status-icons.js.es6 @@ -1,4 +1,6 @@ -export default Ember.ArrayProxy.extend({ +import ArrayProxy from "@ember/array/proxy"; + +export default ArrayProxy.extend({ render(topic, renderIcon) { const renderIconIf = (conditionProp, name, key) => { if (!topic.get(conditionProp)) { diff --git a/app/assets/javascripts/discourse/lib/computed.js.es6 b/app/assets/javascripts/discourse/lib/computed.js.es6 index 992029d293a..acd6cde60ba 100644 --- a/app/assets/javascripts/discourse/lib/computed.js.es6 +++ b/app/assets/javascripts/discourse/lib/computed.js.es6 @@ -1,3 +1,4 @@ +import { computed } from "@ember/object"; import addonFmt from "ember-addons/fmt"; /** @@ -10,7 +11,7 @@ import addonFmt from "ember-addons/fmt"; **/ export function propertyEqual(p1, p2) { - return Ember.computed(p1, p2, function() { + return computed(p1, p2, function() { return this.get(p1) === this.get(p2); }); } @@ -24,19 +25,19 @@ export function propertyEqual(p1, p2) { @return {Function} discourseComputedProperty function **/ export function propertyNotEqual(p1, p2) { - return Ember.computed(p1, p2, function() { + return computed(p1, p2, function() { return this.get(p1) !== this.get(p2); }); } export function propertyGreaterThan(p1, p2) { - return Ember.computed(p1, p2, function() { + return computed(p1, p2, function() { return this.get(p1) > this.get(p2); }); } export function propertyLessThan(p1, p2) { - return Ember.computed(p1, p2, function() { + return computed(p1, p2, function() { return this.get(p1) < this.get(p2); }); } @@ -51,7 +52,7 @@ export function propertyLessThan(p1, p2) { **/ export function i18n(...args) { const format = args.pop(); - return Ember.computed(...args, function() { + return computed(...args, function() { return I18n.t(addonFmt(format, ...args.map(a => this.get(a)))); }); } @@ -67,7 +68,7 @@ export function i18n(...args) { **/ export function fmt(...args) { const format = args.pop(); - return Ember.computed(...args, function() { + return computed(...args, function() { return addonFmt(format, ...args.map(a => this.get(a))); }); } @@ -83,7 +84,7 @@ export function fmt(...args) { **/ export function url(...args) { const format = args.pop(); - return Ember.computed(...args, function() { + return computed(...args, function() { return Discourse.getURL(addonFmt(format, ...args.map(a => this.get(a)))); }); } @@ -99,7 +100,7 @@ export function url(...args) { export function endWith() { const args = Array.prototype.slice.call(arguments, 0); const substring = args.pop(); - return Ember.computed(...args, function() { + return computed(...args, function() { return args .map(a => this.get(a)) .every(s => { @@ -118,7 +119,7 @@ export function endWith() { @param {String} name of site setting **/ export function setting(name) { - return Ember.computed(function() { + return computed(function() { return Discourse.SiteSettings[name]; }); } diff --git a/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 b/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 index 449c70ab799..dca23e1a855 100644 --- a/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 +++ b/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 @@ -1,3 +1,4 @@ +import EmberArray from "@ember/array"; import EmberObject from "@ember/object"; import discourseComputed from "discourse-common/utils/decorators"; @@ -5,7 +6,7 @@ export function Placeholder(viewName) { this.viewName = viewName; } -export default EmberObject.extend(Ember.Array, { +export default EmberObject.extend(EmberArray, { posts: null, _appendingIds: null, diff --git a/app/assets/javascripts/discourse/mapping-router.js.es6 b/app/assets/javascripts/discourse/mapping-router.js.es6 index c50eb9112c5..38b8eec72ef 100644 --- a/app/assets/javascripts/discourse/mapping-router.js.es6 +++ b/app/assets/javascripts/discourse/mapping-router.js.es6 @@ -1,3 +1,4 @@ +import EmberRouter from "@ember/routing/router"; import { defaultHomepage } from "discourse/lib/utilities"; import { rewritePath } from "discourse/lib/url"; import ENV from "discourse-common/config/environment"; @@ -5,7 +6,7 @@ import Site from "discourse/models/site"; const rootURL = Discourse.BaseUri; -const BareRouter = Ember.Router.extend({ +const BareRouter = EmberRouter.extend({ rootURL, location: ENV.environment === "test" ? "none" : "discourse-location", diff --git a/app/assets/javascripts/discourse/mixins/upload.js.es6 b/app/assets/javascripts/discourse/mixins/upload.js.es6 index 820e2e912a6..f7d568cb964 100644 --- a/app/assets/javascripts/discourse/mixins/upload.js.es6 +++ b/app/assets/javascripts/discourse/mixins/upload.js.es6 @@ -1,3 +1,4 @@ +import { warn } from "@ember/debug"; import { displayErrorForUpload, validateUploadedFiles @@ -11,7 +12,7 @@ export default Mixin.create({ uploadProgress: 0, uploadDone() { - Ember.warn("You should implement `uploadDone`", { + warn("You should implement `uploadDone`", { id: "discourse.upload.missing-upload-done" }); }, diff --git a/app/assets/javascripts/discourse/models/category-list.js.es6 b/app/assets/javascripts/discourse/models/category-list.js.es6 index b8437f706dd..ce655978b35 100644 --- a/app/assets/javascripts/discourse/models/category-list.js.es6 +++ b/app/assets/javascripts/discourse/models/category-list.js.es6 @@ -1,10 +1,11 @@ +import ArrayProxy from "@ember/array/proxy"; import PreloadStore from "preload-store"; import { ajax } from "discourse/lib/ajax"; import Topic from "discourse/models/topic"; import Category from "discourse/models/category"; import Site from "discourse/models/site"; -const CategoryList = Ember.ArrayProxy.extend({ +const CategoryList = ArrayProxy.extend({ init() { this.set("content", []); this._super(...arguments); diff --git a/app/assets/javascripts/discourse/models/rest.js.es6 b/app/assets/javascripts/discourse/models/rest.js.es6 index a140dad5047..40b38e5107b 100644 --- a/app/assets/javascripts/discourse/models/rest.js.es6 +++ b/app/assets/javascripts/discourse/models/rest.js.es6 @@ -1,3 +1,4 @@ +import { warn } from "@ember/debug"; import { equal } from "@ember/object/computed"; import EmberObject from "@ember/object"; import { Promise } from "rsvp"; @@ -24,7 +25,7 @@ const RestModel = EmberObject.extend({ const payload = this.__munge(res.payload || res.responseJson); if (payload.success === "OK") { - Ember.warn("An update call should return the updated attributes", { + warn("An update call should return the updated attributes", { id: "discourse.rest-model.update-attributes" }); res = props; diff --git a/app/assets/javascripts/discourse/models/result-set.js.es6 b/app/assets/javascripts/discourse/models/result-set.js.es6 index 56e2c164b50..5ed3dd90cd5 100644 --- a/app/assets/javascripts/discourse/models/result-set.js.es6 +++ b/app/assets/javascripts/discourse/models/result-set.js.es6 @@ -1,7 +1,8 @@ +import ArrayProxy from "@ember/array/proxy"; import discourseComputed from "discourse-common/utils/decorators"; import { Promise } from "rsvp"; -export default Ember.ArrayProxy.extend({ +export default ArrayProxy.extend({ loading: false, loadingMore: false, totalRows: 0, diff --git a/app/assets/javascripts/discourse/models/user-drafts-stream.js.es6 b/app/assets/javascripts/discourse/models/user-drafts-stream.js.es6 index 7472cc8e67c..07529f6ee72 100644 --- a/app/assets/javascripts/discourse/models/user-drafts-stream.js.es6 +++ b/app/assets/javascripts/discourse/models/user-drafts-stream.js.es6 @@ -1,3 +1,4 @@ +import { A } from "@ember/array"; import discourseComputed from "discourse-common/utils/decorators"; import { ajax } from "discourse/lib/ajax"; import { url } from "discourse/lib/computed"; @@ -70,7 +71,7 @@ export default RestModel.extend({ this.set("noContentHelp", result.no_results_help); } if (result && result.drafts) { - const copy = Ember.A(); + const copy = A(); result.drafts.forEach(draft => { let draftData = JSON.parse(draft.data); draft.post_number = draftData.postId || null; diff --git a/app/assets/javascripts/discourse/models/user-stream.js.es6 b/app/assets/javascripts/discourse/models/user-stream.js.es6 index 81af6b30f8c..7bca68c8b39 100644 --- a/app/assets/javascripts/discourse/models/user-stream.js.es6 +++ b/app/assets/javascripts/discourse/models/user-stream.js.es6 @@ -1,3 +1,4 @@ +import { A } from "@ember/array"; import { ajax } from "discourse/lib/ajax"; import { url } from "discourse/lib/computed"; import RestModel from "discourse/models/rest"; @@ -104,7 +105,7 @@ export default RestModel.extend({ this.set("noContentHelp", result.no_results_help); } if (result && result.user_actions) { - const copy = Ember.A(); + const copy = A(); result.user_actions.forEach(action => { action.title = emojiUnescape( Handlebars.Utils.escapeExpression(action.title) diff --git a/app/assets/javascripts/discourse/models/user.js.es6 b/app/assets/javascripts/discourse/models/user.js.es6 index 84c2765f6f5..b15c868d804 100644 --- a/app/assets/javascripts/discourse/models/user.js.es6 +++ b/app/assets/javascripts/discourse/models/user.js.es6 @@ -1,3 +1,4 @@ +import { A } from "@ember/array"; import { isEmpty } from "@ember/utils"; import { gt, equal, or } from "@ember/object/computed"; import EmberObject, { computed } from "@ember/object"; @@ -884,7 +885,7 @@ User.reopenClass(Singleton, { responses.set("count", responses.get("count") + stat.get("count")); }); - const result = Ember.A(); + const result = A(); result.pushObjects(stats.rejectBy("isResponse")); let insertAt = 0; diff --git a/app/assets/javascripts/discourse/pre-initializers/map-routes.js.es6 b/app/assets/javascripts/discourse/pre-initializers/map-routes.js.es6 index 312e56eee31..c48b6970878 100644 --- a/app/assets/javascripts/discourse/pre-initializers/map-routes.js.es6 +++ b/app/assets/javascripts/discourse/pre-initializers/map-routes.js.es6 @@ -1,3 +1,4 @@ +import Application from "@ember/application"; import { mapRoutes } from "discourse/mapping-router"; export default { @@ -10,8 +11,9 @@ export default { // HACK to fix: https://github.com/emberjs/ember.js/issues/10310 const originalBuildInstance = - originalBuildInstance || Ember.Application.prototype.buildInstance; - Ember.Application.prototype.buildInstance = function() { + originalBuildInstance || Application.prototype.buildInstance; + + Application.prototype.buildInstance = function() { this.buildRegistry(); return originalBuildInstance.apply(this); }; diff --git a/app/assets/javascripts/discourse/services/app-events.js.es6 b/app/assets/javascripts/discourse/services/app-events.js.es6 index fa73e9d463f..8a3e770c752 100644 --- a/app/assets/javascripts/discourse/services/app-events.js.es6 +++ b/app/assets/javascripts/discourse/services/app-events.js.es6 @@ -1,7 +1,8 @@ import deprecated from "discourse-common/lib/deprecated"; +import Evented from "@ember/object/evented"; import Service from "@ember/service"; -export default Service.extend(Ember.Evented, { +export default Service.extend(Evented, { _events: {}, on() { diff --git a/app/assets/javascripts/select-kit/components/multi-select.js.es6 b/app/assets/javascripts/select-kit/components/multi-select.js.es6 index a37eff583f2..51ce57dc94c 100644 --- a/app/assets/javascripts/select-kit/components/multi-select.js.es6 +++ b/app/assets/javascripts/select-kit/components/multi-select.js.es6 @@ -1,8 +1,8 @@ import deprecated from "discourse-common/lib/deprecated"; import SelectKitComponent from "select-kit/components/select-kit"; import { computed } from "@ember/object"; -import { makeArray } from "discourse-common/lib/helpers"; import { isPresent } from "@ember/utils"; +import { makeArray } from "discourse-common/lib/helpers"; export default SelectKitComponent.extend({ pluginApiIdentifiers: ["multi-select"], diff --git a/app/assets/javascripts/select-kit/components/select-kit.js.es6 b/app/assets/javascripts/select-kit/components/select-kit.js.es6 index 30a37cf4501..9c9d5424319 100644 --- a/app/assets/javascripts/select-kit/components/select-kit.js.es6 +++ b/app/assets/javascripts/select-kit/components/select-kit.js.es6 @@ -1,4 +1,4 @@ -import { computed, default as EmberObject } from "@ember/object"; +import { computed, guidFor, default as EmberObject } from "@ember/object"; import Component from "@ember/component"; import deprecated from "discourse-common/lib/deprecated"; import { makeArray } from "discourse-common/lib/helpers"; @@ -76,7 +76,7 @@ export default Component.extend( this.set( "selectKit", EmberObject.create({ - uniqueID: Ember.guidFor(this), + uniqueID: guidFor(this), valueProperty: this.valueProperty, nameProperty: this.nameProperty, options: EmberObject.create(), diff --git a/app/assets/javascripts/wizard/router.js.es6 b/app/assets/javascripts/wizard/router.js.es6 index 05921b0a5dc..822d3d7aba7 100644 --- a/app/assets/javascripts/wizard/router.js.es6 +++ b/app/assets/javascripts/wizard/router.js.es6 @@ -1,7 +1,8 @@ +import EmberRouter from "@ember/routing/router"; import getUrl from "discourse-common/lib/get-url"; import ENV from "discourse-common/config/environment"; -const Router = Ember.Router.extend({ +const Router = EmberRouter.extend({ rootURL: getUrl("/wizard/"), location: ENV.environment === "test" ? "none" : "history" }); diff --git a/app/assets/javascripts/wizard/wizard.js.es6 b/app/assets/javascripts/wizard/wizard.js.es6 index 6934febba2f..db337565865 100644 --- a/app/assets/javascripts/wizard/wizard.js.es6 +++ b/app/assets/javascripts/wizard/wizard.js.es6 @@ -1,6 +1,7 @@ +import Application from "@ember/application"; import { buildResolver } from "discourse-common/resolver"; -export default Ember.Application.extend({ +export default Application.extend({ rootElement: "#wizard-main", Resolver: buildResolver("wizard"), diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 index 4b562eaecc6..374aacad939 100644 --- a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 +++ b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 @@ -1,13 +1,15 @@ +import EmberObject from "@ember/object"; import { isEmpty } from "@ember/utils"; import { schedule } from "@ember/runloop"; import Component from "@ember/component"; +import { notEmpty } from "@ember/object/computed"; +import { Promise } from "rsvp"; /* global Pikaday:true */ import { propertyNotEqual } from "discourse/lib/computed"; import loadScript from "discourse/lib/load-script"; -import computed from "discourse-common/utils/decorators"; +import computed, { observes } from "discourse-common/utils/decorators"; import { cookAsync } from "discourse/lib/text"; import discourseDebounce from "discourse/lib/debounce"; -import { observes } from "discourse-common/utils/decorators"; export default Component.extend({ timeFormat: "HH:mm:ss", @@ -24,9 +26,9 @@ export default Component.extend({ isValid: true, timezone: null, fromSelected: null, - fromFilled: Ember.computed.notEmpty("date"), + fromFilled: notEmpty("date"), toSelected: null, - toFilled: Ember.computed.notEmpty("toDate"), + toFilled: notEmpty("toDate"), init() { this._super(...arguments); @@ -113,7 +115,7 @@ export default Component.extend({ format = "LL"; } - return Ember.Object.create({ + return EmberObject.create({ date: dateTime.format(this.dateFormat), time, dateTime, @@ -146,7 +148,7 @@ export default Component.extend({ format = "LL"; } - return Ember.Object.create({ + return EmberObject.create({ date: dateTime.format(this.dateFormat), time, dateTime, @@ -157,7 +159,7 @@ export default Component.extend({ @computed("recurring", "timezones", "timezone", "format") options(recurring, timezones, timezone, format) { - return Ember.Object.create({ + return EmberObject.create({ recurring, timezones, timezone, @@ -171,7 +173,7 @@ export default Component.extend({ "options.{recurring,timezones,timezone,format}" ) computedConfig(fromConfig, toConfig, options) { - return Ember.Object.create({ + return EmberObject.create({ from: fromConfig, to: toConfig, options @@ -372,7 +374,7 @@ export default Component.extend({ }, _setupPicker() { - return new Ember.RSVP.Promise(resolve => { + return new Promise(resolve => { loadScript("/javascripts/pikaday.js").then(() => { const options = { field: this.$(`.fake-input`)[0], diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 index 220c8dc07ae..175f3a99852 100644 --- a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 +++ b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 @@ -2,6 +2,8 @@ import { once } from "@ember/runloop"; import { debounce } from "@ember/runloop"; import { cancel } from "@ember/runloop"; import Component from "@ember/component"; +import { equal, gt } from "@ember/object/computed"; +import { Promise } from "rsvp"; import { ajax } from "discourse/lib/ajax"; import computed, { observes, on } from "discourse-common/utils/decorators"; @@ -22,6 +24,9 @@ export default Component.extend({ presenceUsers: null, channel: null, + isReply: equal("action", "reply"), + shouldDisplay: gt("users.length", 0), + @on("didInsertElement") composerOpened() { this._lastPublish = new Date(); @@ -113,7 +118,7 @@ export default Component.extend({ // Don't publish presence if disabled if (this.currentUser.hide_profile_and_presence) { - return Ember.RSVP.Promise.resolve(); + return Promise.resolve(); } return ajax("/presence/publish", { type: "POST", data }); @@ -122,8 +127,5 @@ export default Component.extend({ @computed("presenceUsers", "currentUser.id") users(users, currentUserId) { return (users || []).filter(user => user.id !== currentUserId); - }, - - isReply: Ember.computed.equal("action", "reply"), - shouldDisplay: Ember.computed.gt("users.length", 0) + } }); diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.js.es6 b/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.js.es6 index c022cd50edb..c12573803d5 100644 --- a/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.js.es6 +++ b/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.js.es6 @@ -1,6 +1,7 @@ import { debounce } from "@ember/runloop"; import { cancel } from "@ember/runloop"; import Component from "@ember/component"; +import { gt } from "@ember/object/computed"; import computed, { on } from "discourse-common/utils/decorators"; import { keepAliveDuration, @@ -13,6 +14,8 @@ export default Component.extend({ topicId: null, presenceUsers: null, + shouldDisplay: gt("users.length", 0), + clear() { if (!this.isDestroyed) this.set("presenceUsers", []); }, @@ -53,7 +56,5 @@ export default Component.extend({ user => user.id !== currentUser.id && !ignoredUsers.includes(user.username) ); - }, - - shouldDisplay: Ember.computed.gt("users.length", 0) + } }); diff --git a/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 b/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 index 77d8513cee6..13b209dd50e 100644 --- a/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 +++ b/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 @@ -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 || {}; diff --git a/plugins/poll/test/javascripts/widgets/discourse-poll-standard-results-test.js.es6 b/plugins/poll/test/javascripts/widgets/discourse-poll-standard-results-test.js.es6 index 33ee000b0a1..47705e2cb57 100644 --- a/plugins/poll/test/javascripts/widgets/discourse-poll-standard-results-test.js.es6 +++ b/plugins/poll/test/javascripts/widgets/discourse-poll-standard-results-test.js.es6 @@ -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" }, diff --git a/test/javascripts/models/post-stream-test.js.es6 b/test/javascripts/models/post-stream-test.js.es6 index f7a587333f2..dbcc4b5ca8b 100644 --- a/test/javascripts/models/post-stream-test.js.es6 +++ b/test/javascripts/models/post-stream-test.js.es6 @@ -1,3 +1,4 @@ +import ArrayProxy from "@ember/array/proxy"; import Post from "discourse/models/post"; import createStore from "helpers/create-store"; import User from "discourse/models/user"; @@ -863,7 +864,7 @@ QUnit.test("postsWithPlaceholders", async assert => { const postsWithPlaceholders = postStream.get("postsWithPlaceholders"); const store = postStream.store; - const testProxy = Ember.ArrayProxy.create({ content: postsWithPlaceholders }); + const testProxy = ArrayProxy.create({ content: postsWithPlaceholders }); const p1 = store.createRecord("post", { id: 1, post_number: 1 }); const p2 = store.createRecord("post", { id: 2, post_number: 2 });