From c7475ee03b2a1371712dee9e22d24625263e2453 Mon Sep 17 00:00:00 2001 From: Mark VanLandingham Date: Tue, 29 Oct 2019 14:23:50 -0500 Subject: [PATCH] DEV: Import EmberObject rather than global variable (#8256) * DEV: Import ember/object rather than Ember.Object globally * fixed broken object proxy import * prettier on js * added @ember/object/proxy to loader * added unstaged file * Fixed objet proxy reference is loader * Linting! --- .../admin/components/admin-report.js.es6 | 5 +++-- .../javascripts/admin/components/ip-lookup.js.es6 | 3 ++- .../admin/controllers/admin-customize-colors.js.es6 | 3 ++- .../admin/controllers/admin-emojis.js.es6 | 3 ++- .../controllers/admin-logs-staff-action-logs.js.es6 | 7 ++++--- .../admin/controllers/admin-watched-words.js.es6 | 3 ++- app/assets/javascripts/admin/models/report.js.es6 | 3 ++- .../javascripts/admin/models/user-field.js.es6 | 3 ++- .../admin/routes/admin-backups-logs.js.es6 | 3 ++- .../javascripts/admin/routes/admin-backups.js.es6 | 3 ++- .../javascripts/admin/routes/admin-emojis.js.es6 | 3 ++- .../admin/routes/admin-search-logs-index.js.es6 | 3 ++- .../admin/routes/admin-search-logs-term.js.es6 | 3 ++- .../routes/admin-site-settings-category.js.es6 | 3 ++- .../admin/routes/admin-watched-words-action.js.es6 | 3 ++- .../javascripts/admin/services/admin-tools.js.es6 | 3 ++- app/assets/javascripts/discourse-loader.js | 1 + .../javascripts/discourse/adapters/rest.js.es6 | 3 ++- .../discourse/components/composer-messages.js.es6 | 3 ++- .../components/edit-category-images.js.es6 | 5 +++-- .../discourse/components/invite-panel.js.es6 | 5 +++-- .../discourse/components/topic-navigation.js.es6 | 3 ++- .../discourse/components/user-card-contents.js.es6 | 3 ++- .../discourse/controllers/badges/show.js.es6 | 3 ++- .../discourse/controllers/edit-topic-timer.js.es6 | 3 ++- .../javascripts/discourse/controllers/flag.js.es6 | 3 ++- .../discourse/controllers/group-manage-logs.js.es6 | 5 +++-- .../javascripts/discourse/controllers/group.js.es6 | 3 ++- .../javascripts/discourse/controllers/login.js.es6 | 3 ++- .../controllers/preferences/profile.js.es6 | 3 ++- .../discourse/controllers/reorder-categories.js.es6 | 3 ++- .../javascripts/discourse/controllers/topic.js.es6 | 3 ++- .../javascripts/discourse/controllers/user.js.es6 | 3 ++- .../discourse/initializers/banner.js.es6 | 5 +++-- .../subscribe-user-notifications.js.es6 | 3 ++- .../discourse/lib/discourse-location.js.es6 | 5 +++-- .../discourse/lib/posts-with-placeholders.js.es6 | 3 ++- app/assets/javascripts/discourse/lib/search.js.es6 | 5 +++-- app/assets/javascripts/discourse/lib/url.js.es6 | 3 ++- .../discourse/mixins/buffered-content.js.es6 | 4 +++- .../javascripts/discourse/mixins/singleton.js.es6 | 4 ++-- .../discourse/mixins/user-fields-validation.js.es6 | 3 ++- .../javascripts/discourse/models/badge.js.es6 | 3 ++- .../javascripts/discourse/models/composer.js.es6 | 5 +++-- .../javascripts/discourse/models/group.js.es6 | 5 +++-- .../javascripts/discourse/models/invite.js.es6 | 5 +++-- .../discourse/models/login-method.js.es6 | 3 ++- .../javascripts/discourse/models/model.js.es6 | 3 ++- app/assets/javascripts/discourse/models/post.js.es6 | 5 +++-- app/assets/javascripts/discourse/models/rest.js.es6 | 4 +++- app/assets/javascripts/discourse/models/site.js.es6 | 9 ++++----- .../javascripts/discourse/models/static-page.js.es6 | 3 ++- .../javascripts/discourse/models/store.js.es6 | 3 ++- .../discourse/models/topic-details.js.es6 | 3 ++- .../javascripts/discourse/models/topic-list.js.es6 | 3 ++- .../javascripts/discourse/models/topic.js.es6 | 3 ++- app/assets/javascripts/discourse/models/user.js.es6 | 3 ++- .../raw-views/list/post-count-or-badges.js.es6 | 3 ++- .../raw-views/list/posts-count-column.js.es6 | 3 ++- .../discourse/raw-views/list/visited-line.js.es6 | 3 ++- .../raw-views/topic-list-header-column.js.es6 | 3 ++- .../discourse/raw-views/topic-status.js.es6 | 3 ++- .../discourse/routes/discovery-categories.js.es6 | 5 +++-- .../routes/user-private-messages-tags.js.es6 | 3 ++- .../discourse/services/logs-notice.js.es6 | 3 ++- .../javascripts/discourse/services/search.js.es6 | 3 ++- .../select-kit/components/select-kit.js.es6 | 5 +++-- app/assets/javascripts/wizard/models/step.js.es6 | 3 ++- .../javascripts/wizard/models/wizard-field.js.es6 | 3 ++- app/assets/javascripts/wizard/models/wizard.js.es6 | 3 ++- .../admin/components/group-list-setting-test.js.es6 | 3 ++- .../controllers/preferences-account-test.js.es6 | 5 +++-- .../controllers/reorder-categories-test.js.es6 | 11 ++++++----- test/javascripts/controllers/topic-test.js.es6 | 11 ++++++----- test/javascripts/helpers/component-test.js.es6 | 3 ++- test/javascripts/lib/computed-test.js.es6 | 13 +++++++------ test/javascripts/mixins/singleton-test.js.es6 | 11 ++++++----- test/javascripts/models/composer-test.js.es6 | 3 ++- test/javascripts/models/model-test.js.es6 | 7 ++++--- test/javascripts/models/topic-test.js.es6 | 3 ++- test/javascripts/widgets/post-test.js.es6 | 3 ++- 81 files changed, 200 insertions(+), 120 deletions(-) diff --git a/app/assets/javascripts/admin/components/admin-report.js.es6 b/app/assets/javascripts/admin/components/admin-report.js.es6 index 28e30b8a24a..4efdf099263 100644 --- a/app/assets/javascripts/admin/components/admin-report.js.es6 +++ b/app/assets/javascripts/admin/components/admin-report.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Component from "@ember/component"; import ReportLoader from "discourse/lib/reports-loader"; import { exportEntity } from "discourse/lib/export-csv"; @@ -368,12 +369,12 @@ export default Component.extend({ _buildOptions(mode) { if (mode === "table") { const tableOptions = JSON.parse(JSON.stringify(TABLE_OPTIONS)); - return Ember.Object.create( + return EmberObject.create( Object.assign(tableOptions, this.get("reportOptions.table") || {}) ); } else { const chartOptions = JSON.parse(JSON.stringify(CHART_OPTIONS)); - return Ember.Object.create( + return EmberObject.create( Object.assign(chartOptions, this.get("reportOptions.chart") || {}) ); } diff --git a/app/assets/javascripts/admin/components/ip-lookup.js.es6 b/app/assets/javascripts/admin/components/ip-lookup.js.es6 index c1938dc2d9d..f97deff7113 100644 --- a/app/assets/javascripts/admin/components/ip-lookup.js.es6 +++ b/app/assets/javascripts/admin/components/ip-lookup.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Component from "@ember/component"; import { default as computed } from "ember-addons/ember-computed-decorators"; import { ajax } from "discourse/lib/ajax"; @@ -21,7 +22,7 @@ export default Component.extend({ if (!this.location) { ajax("/admin/users/ip-info", { data: { ip: this.ip } }).then(location => - this.set("location", Ember.Object.create(location)) + this.set("location", EmberObject.create(location)) ); } diff --git a/app/assets/javascripts/admin/controllers/admin-customize-colors.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-colors.js.es6 index 9dad0098f10..21c628be24c 100644 --- a/app/assets/javascripts/admin/controllers/admin-customize-colors.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-customize-colors.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import showModal from "discourse/lib/show-modal"; import { default as computed } from "ember-addons/ember-computed-decorators"; @@ -15,7 +16,7 @@ export default Controller.extend({ @computed("baseColorScheme") baseColors(baseColorScheme) { - const baseColorsHash = Ember.Object.create({}); + const baseColorsHash = EmberObject.create({}); baseColorScheme.get("colors").forEach(color => { baseColorsHash.set(color.get("name"), color); }); diff --git a/app/assets/javascripts/admin/controllers/admin-emojis.js.es6 b/app/assets/javascripts/admin/controllers/admin-emojis.js.es6 index 6bde3d29d8d..f9611b2813b 100644 --- a/app/assets/javascripts/admin/controllers/admin-emojis.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-emojis.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; export default Controller.extend({ @@ -12,7 +13,7 @@ export default Controller.extend({ actions: { emojiUploaded(emoji) { emoji.url += "?t=" + new Date().getTime(); - this.model.pushObject(Ember.Object.create(emoji)); + this.model.pushObject(EmberObject.create(emoji)); }, destroy(emoji) { diff --git a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 index e06ad2cbebf..da3afb72c59 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import { exportEntity } from "discourse/lib/export-csv"; import { outputExportResult } from "discourse/lib/export-result"; @@ -20,14 +21,14 @@ export default Controller.extend({ @on("init") resetFilters() { this.setProperties({ - model: Ember.Object.create({ loadingMore: true }), - filters: Ember.Object.create() + model: EmberObject.create({ loadingMore: true }), + filters: EmberObject.create() }); this.scheduleRefresh(); }, _changeFilters(props) { - this.set("model", Ember.Object.create({ loadingMore: true })); + this.set("model", EmberObject.create({ loadingMore: true })); this.filters.setProperties(props); this.scheduleRefresh(); }, diff --git a/app/assets/javascripts/admin/controllers/admin-watched-words.js.es6 b/app/assets/javascripts/admin/controllers/admin-watched-words.js.es6 index 6d064301f38..5d52d67a360 100644 --- a/app/assets/javascripts/admin/controllers/admin-watched-words.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-watched-words.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import debounce from "discourse/lib/debounce"; @@ -28,7 +29,7 @@ export default Controller.extend({ return wordRecord.word.indexOf(filter) > -1; }); matchesByAction.pushObject( - Ember.Object.create({ + EmberObject.create({ nameKey: wordsForAction.nameKey, name: wordsForAction.name, words: wordRecords, diff --git a/app/assets/javascripts/admin/models/report.js.es6 b/app/assets/javascripts/admin/models/report.js.es6 index c7967cc6d54..b85e2e8c793 100644 --- a/app/assets/javascripts/admin/models/report.js.es6 +++ b/app/assets/javascripts/admin/models/report.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { escapeExpression } from "discourse/lib/utilities"; import { ajax } from "discourse/lib/ajax"; import round from "discourse/lib/round"; @@ -323,7 +324,7 @@ const Report = Discourse.Model.extend({ const formatedValue = () => { const userId = row[properties.id]; - const user = Ember.Object.create({ + const user = EmberObject.create({ username, name: formatUsername(username), avatar_template: row[properties.avatar] diff --git a/app/assets/javascripts/admin/models/user-field.js.es6 b/app/assets/javascripts/admin/models/user-field.js.es6 index a57e452d869..78c004d4183 100644 --- a/app/assets/javascripts/admin/models/user-field.js.es6 +++ b/app/assets/javascripts/admin/models/user-field.js.es6 @@ -1,9 +1,10 @@ +import EmberObject from "@ember/object"; import RestModel from "discourse/models/rest"; import { i18n } from "discourse/lib/computed"; const UserField = RestModel.extend(); -const UserFieldType = Ember.Object.extend({ +const UserFieldType = EmberObject.extend({ name: i18n("id", "admin.user_fields.field_types.%@") }); diff --git a/app/assets/javascripts/admin/routes/admin-backups-logs.js.es6 b/app/assets/javascripts/admin/routes/admin-backups-logs.js.es6 index 58baa135871..3d24756a4ab 100644 --- a/app/assets/javascripts/admin/routes/admin-backups-logs.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-backups-logs.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Route from "@ember/routing/route"; import PreloadStore from "preload-store"; @@ -16,7 +17,7 @@ export default Route.extend({ return log.message.length === 0 || log.message[0] === "["; }) .map(function(log) { - return Ember.Object.create(log); + return EmberObject.create(log); }) .value(); logs.pushObjects(newLogs); diff --git a/app/assets/javascripts/admin/routes/admin-backups.js.es6 b/app/assets/javascripts/admin/routes/admin-backups.js.es6 index 44585e5d461..5025f415364 100644 --- a/app/assets/javascripts/admin/routes/admin-backups.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-backups.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; import { ajax } from "discourse/lib/ajax"; import showModal from "discourse/lib/show-modal"; @@ -42,7 +43,7 @@ export default DiscourseRoute.extend({ } else { this.controllerFor("adminBackupsLogs") .get("logs") - .pushObject(Ember.Object.create(log)); + .pushObject(EmberObject.create(log)); } }); }, diff --git a/app/assets/javascripts/admin/routes/admin-emojis.js.es6 b/app/assets/javascripts/admin/routes/admin-emojis.js.es6 index 4a001195fcd..dd7e94d40a3 100644 --- a/app/assets/javascripts/admin/routes/admin-emojis.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-emojis.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; import { ajax } from "discourse/lib/ajax"; @@ -5,7 +6,7 @@ export default DiscourseRoute.extend({ model: function() { return ajax("/admin/customize/emojis.json").then(function(emojis) { return emojis.map(function(emoji) { - return Ember.Object.create(emoji); + return EmberObject.create(emoji); }); }); } diff --git a/app/assets/javascripts/admin/routes/admin-search-logs-index.js.es6 b/app/assets/javascripts/admin/routes/admin-search-logs-index.js.es6 index b01674d2f22..8244c0f2af6 100644 --- a/app/assets/javascripts/admin/routes/admin-search-logs-index.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-search-logs-index.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; import { ajax } from "discourse/lib/ajax"; @@ -12,7 +13,7 @@ export default DiscourseRoute.extend({ return ajax("/admin/logs/search_logs.json", { data: { period: params.period, search_type: params.searchType } }).then(search_logs => { - return search_logs.map(sl => Ember.Object.create(sl)); + return search_logs.map(sl => EmberObject.create(sl)); }); }, diff --git a/app/assets/javascripts/admin/routes/admin-search-logs-term.js.es6 b/app/assets/javascripts/admin/routes/admin-search-logs-term.js.es6 index a0cd40d8b07..7c9c8f274c8 100644 --- a/app/assets/javascripts/admin/routes/admin-search-logs-term.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-search-logs-term.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; import { ajax } from "discourse/lib/ajax"; import { fillMissingDates } from "discourse/lib/utilities"; @@ -33,7 +34,7 @@ export default DiscourseRoute.extend({ json.term.search_result = translateResults(json.term.search_result); } - const model = Ember.Object.create({ type: "search_log_term" }); + const model = EmberObject.create({ type: "search_log_term" }); model.setProperties(json.term); return model; }); diff --git a/app/assets/javascripts/admin/routes/admin-site-settings-category.js.es6 b/app/assets/javascripts/admin/routes/admin-site-settings-category.js.es6 index 2b680c9b83e..b5a2f810b28 100644 --- a/app/assets/javascripts/admin/routes/admin-site-settings-category.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-site-settings-category.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; export default DiscourseRoute.extend({ @@ -11,7 +12,7 @@ export default DiscourseRoute.extend({ "categoryNameKey", params.category_id ); - return Ember.Object.create({ + return EmberObject.create({ nameKey: params.category_id, name: I18n.t("admin.site_settings.categories." + params.category_id), siteSettings: this.controllerFor("adminSiteSettingsCategory").get( diff --git a/app/assets/javascripts/admin/routes/admin-watched-words-action.js.es6 b/app/assets/javascripts/admin/routes/admin-watched-words-action.js.es6 index d8c76aac5cf..358cfebe675 100644 --- a/app/assets/javascripts/admin/routes/admin-watched-words-action.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-watched-words-action.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; export default DiscourseRoute.extend({ @@ -9,7 +10,7 @@ export default DiscourseRoute.extend({ let filteredContent = this.controllerFor("adminWatchedWordsAction").get( "filteredContent" ); - return Ember.Object.create({ + return EmberObject.create({ nameKey: params.action_id, name: I18n.t("admin.watched_words.actions." + params.action_id), words: filteredContent diff --git a/app/assets/javascripts/admin/services/admin-tools.js.es6 b/app/assets/javascripts/admin/services/admin-tools.js.es6 index b8d0e6e805e..38aa9e452de 100644 --- a/app/assets/javascripts/admin/services/admin-tools.js.es6 +++ b/app/assets/javascripts/admin/services/admin-tools.js.es6 @@ -2,6 +2,7 @@ // and the admin application. Use this if you need front end code to access admin // modules. Inject it optionally, and if it exists go to town! +import EmberObject from "@ember/object"; import AdminUser from "admin/models/admin-user"; import { iconHTML } from "discourse-common/lib/icon-library"; import { ajax } from "discourse/lib/ajax"; @@ -22,7 +23,7 @@ export default Service.extend({ "controller:adminLogs.staffActionLogs" ); target.transitionToRoute("adminLogs.staffActionLogs").then(() => { - controller.set("filters", Ember.Object.create()); + controller.set("filters", EmberObject.create()); controller._changeFilters(filters); }); }, diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js index f11b583d42b..1762d116aac 100644 --- a/app/assets/javascripts/discourse-loader.js +++ b/app/assets/javascripts/discourse-loader.js @@ -12,6 +12,7 @@ var define, requirejs; inject: Ember.inject.controller }, "@ember/object": { default: Ember.Object }, + "@ember/object/proxy": { default: Ember.ObjectProxy }, "@ember/routing/route": { default: Ember.Route }, "@ember/service": { default: Ember.Service, diff --git a/app/assets/javascripts/discourse/adapters/rest.js.es6 b/app/assets/javascripts/discourse/adapters/rest.js.es6 index b5ffc0f6263..3d86fe934c7 100644 --- a/app/assets/javascripts/discourse/adapters/rest.js.es6 +++ b/app/assets/javascripts/discourse/adapters/rest.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import { hashString } from "discourse/lib/hash"; @@ -24,7 +25,7 @@ function rethrow(error) { throw error; } -export default Ember.Object.extend({ +export default EmberObject.extend({ storageKey(type, findArgs, options) { if (options && options.cacheKey) { return options.cacheKey; diff --git a/app/assets/javascripts/discourse/components/composer-messages.js.es6 b/app/assets/javascripts/discourse/components/composer-messages.js.es6 index 659839bf65a..fb07997b809 100644 --- a/app/assets/javascripts/discourse/components/composer-messages.js.es6 +++ b/app/assets/javascripts/discourse/components/composer-messages.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Component from "@ember/component"; import LinkLookup from "discourse/lib/link-lookup"; @@ -122,7 +123,7 @@ export default Component.extend({ _create(info) { this.reset(); - this.send("popup", Ember.Object.create(info)); + this.send("popup", EmberObject.create(info)); }, _findSimilar() { diff --git a/app/assets/javascripts/discourse/components/edit-category-images.js.es6 b/app/assets/javascripts/discourse/components/edit-category-images.js.es6 index f7b03702ecd..2e122688856 100644 --- a/app/assets/javascripts/discourse/components/edit-category-images.js.es6 +++ b/app/assets/javascripts/discourse/components/edit-category-images.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { buildCategoryPanel } from "discourse/components/edit-category-panel"; import { default as computed } from "ember-addons/ember-computed-decorators"; @@ -33,7 +34,7 @@ export default buildCategoryPanel("images").extend({ _deleteUpload(path) { this.set( path, - Ember.Object.create({ + EmberObject.create({ id: null, url: null }) @@ -43,7 +44,7 @@ export default buildCategoryPanel("images").extend({ _setFromUpload(path, upload) { this.set( path, - Ember.Object.create({ + EmberObject.create({ url: upload.url, id: upload.id }) diff --git a/app/assets/javascripts/discourse/components/invite-panel.js.es6 b/app/assets/javascripts/discourse/components/invite-panel.js.es6 index 3f1dd39a0a9..c7f09e6bf3e 100644 --- a/app/assets/javascripts/discourse/components/invite-panel.js.es6 +++ b/app/assets/javascripts/discourse/components/invite-panel.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Component from "@ember/component"; import { emailValid } from "discourse/lib/utilities"; import computed from "ember-addons/ember-computed-decorators"; @@ -324,7 +325,7 @@ export default Component.extend({ .then(data => { model.setProperties({ saving: false, finished: true }); this.get("inviteModel.details.allowed_groups").pushObject( - Ember.Object.create(data.group) + EmberObject.create(data.group) ); this.appEvents.trigger("post-stream:refresh"); }) @@ -350,7 +351,7 @@ export default Component.extend({ }); } else if (this.isPM && result && result.user) { this.get("inviteModel.details.allowed_users").pushObject( - Ember.Object.create(result.user) + EmberObject.create(result.user) ); this.appEvents.trigger("post-stream:refresh"); } else if ( diff --git a/app/assets/javascripts/discourse/components/topic-navigation.js.es6 b/app/assets/javascripts/discourse/components/topic-navigation.js.es6 index 96db2ab095b..4a67114f1a7 100644 --- a/app/assets/javascripts/discourse/components/topic-navigation.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-navigation.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Component from "@ember/component"; import { observes } from "ember-addons/ember-computed-decorators"; import showModal from "discourse/lib/show-modal"; @@ -14,7 +15,7 @@ export default Component.extend(PanEvents, { init() { this._super(...arguments); - this.set("info", Ember.Object.create()); + this.set("info", EmberObject.create()); }, _performCheckSize() { diff --git a/app/assets/javascripts/discourse/components/user-card-contents.js.es6 b/app/assets/javascripts/discourse/components/user-card-contents.js.es6 index 882e13dc459..e9ebcde33ac 100644 --- a/app/assets/javascripts/discourse/components/user-card-contents.js.es6 +++ b/app/assets/javascripts/discourse/components/user-card-contents.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Component from "@ember/component"; import { default as computed, @@ -84,7 +85,7 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, { const value = userFields ? userFields[field.get("id")] : null; return Ember.isEmpty(value) ? null - : Ember.Object.create({ value, field }); + : EmberObject.create({ value, field }); }) .compact(); } diff --git a/app/assets/javascripts/discourse/controllers/badges/show.js.es6 b/app/assets/javascripts/discourse/controllers/badges/show.js.es6 index e34818fe0c9..d1093c13bc2 100644 --- a/app/assets/javascripts/discourse/controllers/badges/show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/badges/show.js.es6 @@ -1,4 +1,5 @@ import { inject } from "@ember/controller"; +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import Badge from "discourse/models/badge"; import UserBadge from "discourse/models/user-badge"; @@ -22,7 +23,7 @@ export default Controller.extend({ @computed("filteredList") selectableUserBadges(filteredList) { return [ - Ember.Object.create({ + EmberObject.create({ badge: Badge.create({ name: I18n.t("badges.none") }) }), ...filteredList.uniqBy("badge.name") diff --git a/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 b/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 index a0562e655ac..88a9109d020 100644 --- a/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import ModalFunctionality from "discourse/mixins/modal-functionality"; @@ -87,7 +88,7 @@ export default Controller.extend(ModalFunctionality, { } else { const topicTimer = this.isPublic === "true" ? "topic_timer" : "private_topic_timer"; - this.set(`model.${topicTimer}`, Ember.Object.create({})); + this.set(`model.${topicTimer}`, EmberObject.create({})); this.setProperties({ selection: null diff --git a/app/assets/javascripts/discourse/controllers/flag.js.es6 b/app/assets/javascripts/discourse/controllers/flag.js.es6 index 54ef36d3063..2b18533279e 100644 --- a/app/assets/javascripts/discourse/controllers/flag.js.es6 +++ b/app/assets/javascripts/discourse/controllers/flag.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import ModalFunctionality from "discourse/mixins/modal-functionality"; import ActionSummary from "discourse/models/action-summary"; @@ -58,7 +59,7 @@ export default Controller.extend(ModalFunctionality, { return flagsAvailable; } else { // flagging topic - let lookup = Ember.Object.create(); + let lookup = EmberObject.create(); let model = this.model; model.get("actions_summary").forEach(a => { a.flagTopic = model; diff --git a/app/assets/javascripts/discourse/controllers/group-manage-logs.js.es6 b/app/assets/javascripts/discourse/controllers/group-manage-logs.js.es6 index 123c27f4f14..f5c3ba48f35 100644 --- a/app/assets/javascripts/discourse/controllers/group-manage-logs.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-manage-logs.js.es6 @@ -1,4 +1,5 @@ import { inject } from "@ember/controller"; +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import { default as computed, @@ -13,7 +14,7 @@ export default Controller.extend({ init() { this._super(...arguments); - this.set("filters", Ember.Object.create()); + this.set("filters", EmberObject.create()); }, @computed( @@ -53,7 +54,7 @@ export default Controller.extend({ reset() { this.setProperties({ offset: 0, - filters: Ember.Object.create() + filters: EmberObject.create() }); }, diff --git a/app/assets/javascripts/discourse/controllers/group.js.es6 b/app/assets/javascripts/discourse/controllers/group.js.es6 index ee4011d939f..322e7ab12c6 100644 --- a/app/assets/javascripts/discourse/controllers/group.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group.js.es6 @@ -1,8 +1,9 @@ +import EmberObject from "@ember/object"; import { inject } from "@ember/controller"; import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; -const Tab = Ember.Object.extend({ +const Tab = EmberObject.extend({ init() { this._super(...arguments); let name = this.name; diff --git a/app/assets/javascripts/discourse/controllers/login.js.es6 b/app/assets/javascripts/discourse/controllers/login.js.es6 index cec011b279d..ca94d979c00 100644 --- a/app/assets/javascripts/discourse/controllers/login.js.es6 +++ b/app/assets/javascripts/discourse/controllers/login.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { inject } from "@ember/controller"; import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; @@ -378,7 +379,7 @@ export default Controller.extend(ModalFunctionality, { accountEmail: options.email, accountUsername: options.username, accountName: options.name, - authOptions: Ember.Object.create(options) + authOptions: EmberObject.create(options) }); showModal("createAccount"); diff --git a/app/assets/javascripts/discourse/controllers/preferences/profile.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/profile.js.es6 index f253c027f40..315c8c9da5b 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/profile.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/profile.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; @@ -34,7 +35,7 @@ export default Controller.extend(PreferencesTabController, { const value = userFields ? userFields[field.get("id").toString()] : null; - return Ember.Object.create({ value, field }); + return EmberObject.create({ value, field }); }); } }, diff --git a/app/assets/javascripts/discourse/controllers/reorder-categories.js.es6 b/app/assets/javascripts/discourse/controllers/reorder-categories.js.es6 index 05d69d39c6d..c7dda8c792a 100644 --- a/app/assets/javascripts/discourse/controllers/reorder-categories.js.es6 +++ b/app/assets/javascripts/discourse/controllers/reorder-categories.js.es6 @@ -1,3 +1,4 @@ +import EmberObjectProxy from "@ember/object/proxy"; import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import ModalFunctionality from "discourse/mixins/modal-functionality"; @@ -23,7 +24,7 @@ export default Controller.extend(ModalFunctionality, Ember.Evented, { @computed("site.categories") categoriesBuffered(categories) { - const bufProxy = Ember.ObjectProxy.extend(BufferedProxy); + const bufProxy = EmberObjectProxy.extend(BufferedProxy); return categories.map(c => bufProxy.create({ content: c })); }, diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index ba9afb0a96e..d31fe002922 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { inject } from "@ember/controller"; import Controller from "@ember/controller"; import { bufferedProperty } from "discourse/mixins/buffered-content"; @@ -1058,7 +1059,7 @@ export default Controller.extend(bufferedProperty("model"), { statusType, null ) - .then(() => this.set(`model.${topicTimer}`, Ember.Object.create({}))) + .then(() => this.set(`model.${topicTimer}`, EmberObject.create({}))) .catch(error => popupAjaxError(error)); } }, diff --git a/app/assets/javascripts/discourse/controllers/user.js.es6 b/app/assets/javascripts/discourse/controllers/user.js.es6 index ebe7a8bb230..81ce8051bd2 100644 --- a/app/assets/javascripts/discourse/controllers/user.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { inject as service } from "@ember/service"; import { inject } from "@ember/controller"; import Controller from "@ember/controller"; @@ -124,7 +125,7 @@ export default Controller.extend(CanCheckEmails, { : null; return Ember.isEmpty(value) ? null - : Ember.Object.create({ value, field }); + : EmberObject.create({ value, field }); }) .compact(); } diff --git a/app/assets/javascripts/discourse/initializers/banner.js.es6 b/app/assets/javascripts/discourse/initializers/banner.js.es6 index 46e3899b30f..ccec6a95b49 100644 --- a/app/assets/javascripts/discourse/initializers/banner.js.es6 +++ b/app/assets/javascripts/discourse/initializers/banner.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import PreloadStore from "preload-store"; export default { @@ -5,7 +6,7 @@ export default { after: "message-bus", initialize(container) { - const banner = Ember.Object.create(PreloadStore.get("banner") || {}), + const banner = EmberObject.create(PreloadStore.get("banner") || {}), site = container.lookup("site:main"); site.set("banner", banner); @@ -16,7 +17,7 @@ export default { } messageBus.subscribe("/site/banner", function(ban) { - site.set("banner", Ember.Object.create(ban || {})); + site.set("banner", EmberObject.create(ban || {})); }); } }; diff --git a/app/assets/javascripts/discourse/initializers/subscribe-user-notifications.js.es6 b/app/assets/javascripts/discourse/initializers/subscribe-user-notifications.js.es6 index d3c251bb882..2de97db0373 100644 --- a/app/assets/javascripts/discourse/initializers/subscribe-user-notifications.js.es6 +++ b/app/assets/javascripts/discourse/initializers/subscribe-user-notifications.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; // Subscribes to user events on the message bus import { init as initDesktopNotifications, @@ -82,7 +83,7 @@ export default { } oldNotifications.insertAt( insertPosition, - Ember.Object.create(lastNotification) + EmberObject.create(lastNotification) ); } diff --git a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 index 3843831588f..b1238d8d390 100644 --- a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 +++ b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { defaultHomepage } from "discourse/lib/utilities"; let popstateFired = false; const supportsHistoryState = window.history && "state" in window.history; @@ -9,9 +10,9 @@ const popstateCallbacks = []; @class DiscourseLocation @namespace Discourse - @extends Ember.Object + @extends @ember/object */ -const DiscourseLocation = Ember.Object.extend({ +const DiscourseLocation = EmberObject.extend({ init() { this._super(...arguments); 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 03271c6d6b7..d1b20924458 100644 --- a/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 +++ b/app/assets/javascripts/discourse/lib/posts-with-placeholders.js.es6 @@ -1,10 +1,11 @@ +import EmberObject from "@ember/object"; import { default as computed } from "ember-addons/ember-computed-decorators"; export function Placeholder(viewName) { this.viewName = viewName; } -export default Ember.Object.extend(Ember.Array, { +export default EmberObject.extend(Ember.Array, { posts: null, _appendingIds: null, diff --git a/app/assets/javascripts/discourse/lib/search.js.es6 b/app/assets/javascripts/discourse/lib/search.js.es6 index b8e7dd0546a..a558fdd495c 100644 --- a/app/assets/javascripts/discourse/lib/search.js.es6 +++ b/app/assets/javascripts/discourse/lib/search.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import { findRawTemplate } from "discourse/lib/raw-templates"; import Category from "discourse/models/category"; @@ -75,7 +76,7 @@ export function translateResults(results, opts) { results.tags = results.tags .map(function(tag) { const tagName = Handlebars.Utils.escapeExpression(tag.name); - return Ember.Object.create({ + return EmberObject.create({ id: tagName, url: Discourse.getURL("/tags/" + tagName) }); @@ -127,7 +128,7 @@ export function translateResults(results, opts) { !results.categories.length ); - return noResults ? null : Ember.Object.create(results); + return noResults ? null : EmberObject.create(results); } export function searchForTerm(term, opts) { diff --git a/app/assets/javascripts/discourse/lib/url.js.es6 b/app/assets/javascripts/discourse/lib/url.js.es6 index 34bb600e07a..085619f9e93 100644 --- a/app/assets/javascripts/discourse/lib/url.js.es6 +++ b/app/assets/javascripts/discourse/lib/url.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import offsetCalculator from "discourse/lib/offset-calculator"; import LockOn from "discourse/lib/lock-on"; import { defaultHomepage } from "discourse/lib/utilities"; @@ -77,7 +78,7 @@ export function jumpToElement(elementId) { let _transitioning = false; -const DiscourseURL = Ember.Object.extend({ +const DiscourseURL = EmberObject.extend({ isJumpScheduled() { return _transitioning || _jumpScheduled; }, diff --git a/app/assets/javascripts/discourse/mixins/buffered-content.js.es6 b/app/assets/javascripts/discourse/mixins/buffered-content.js.es6 index 36f6de60715..99364df7a9c 100644 --- a/app/assets/javascripts/discourse/mixins/buffered-content.js.es6 +++ b/app/assets/javascripts/discourse/mixins/buffered-content.js.es6 @@ -1,8 +1,10 @@ +import EmberObjectProxy from "@ember/object/proxy"; + /* global BufferedProxy: true */ export function bufferedProperty(property) { const mixin = { buffered: Ember.computed(property, function() { - return Ember.ObjectProxy.extend(BufferedProxy).create({ + return EmberObjectProxy.extend(BufferedProxy).create({ content: this.get(property) }); }), diff --git a/app/assets/javascripts/discourse/mixins/singleton.js.es6 b/app/assets/javascripts/discourse/mixins/singleton.js.es6 index 62a82656137..b67c529fdf6 100644 --- a/app/assets/javascripts/discourse/mixins/singleton.js.es6 +++ b/app/assets/javascripts/discourse/mixins/singleton.js.es6 @@ -8,7 +8,7 @@ ```javascript // Define your class and apply the Mixin - User = Ember.Object.extend({}); + User = EmberObject.extend({}); User.reopenClass(Singleton); // Retrieve the current instance: @@ -34,7 +34,7 @@ ```javascript // Define your class and apply the Mixin - Foot = Ember.Object.extend({}); + Foot = EmberObject.extend({}); Foot.reopenClass(Singleton, { createCurrent: function() { return Foot.create({toes: 5}); diff --git a/app/assets/javascripts/discourse/mixins/user-fields-validation.js.es6 b/app/assets/javascripts/discourse/mixins/user-fields-validation.js.es6 index 57a4b9cec0a..c5345d4ee9d 100644 --- a/app/assets/javascripts/discourse/mixins/user-fields-validation.js.es6 +++ b/app/assets/javascripts/discourse/mixins/user-fields-validation.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import InputValidation from "discourse/models/input-validation"; import { on, @@ -14,7 +15,7 @@ export default Ember.Mixin.create({ let userFields = this.site.get("user_fields"); if (userFields) { userFields = _.sortBy(userFields, "position").map(function(f) { - return Ember.Object.create({ value: null, field: f }); + return EmberObject.create({ value: null, field: f }); }); } this.set("userFields", userFields); diff --git a/app/assets/javascripts/discourse/models/badge.js.es6 b/app/assets/javascripts/discourse/models/badge.js.es6 index d70a5fbbe6e..ed1378ac3b4 100644 --- a/app/assets/javascripts/discourse/models/badge.js.es6 +++ b/app/assets/javascripts/discourse/models/badge.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import BadgeGrouping from "discourse/models/badge-grouping"; import RestModel from "discourse/models/rest"; @@ -66,7 +67,7 @@ Badge.reopenClass({ if ("badge_types" in json) { json.badge_types.forEach( badgeTypeJson => - (badgeTypes[badgeTypeJson.id] = Ember.Object.create(badgeTypeJson)) + (badgeTypes[badgeTypeJson.id] = EmberObject.create(badgeTypeJson)) ); } diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6 index 686d98c5fbf..4d851e6e3a9 100644 --- a/app/assets/javascripts/discourse/models/composer.js.es6 +++ b/app/assets/javascripts/discourse/models/composer.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import RestModel from "discourse/models/rest"; import Topic from "discourse/models/topic"; import { throwAjaxError } from "discourse/lib/ajax-error"; @@ -215,7 +216,7 @@ const Composer = RestModel.extend({ @observes("archetype") archetypeChanged() { - return this.set("metaData", Ember.Object.create()); + return this.set("metaData", EmberObject.create()); }, // view detected user is typing @@ -677,7 +678,7 @@ const Composer = RestModel.extend({ this.setProperties({ archetypeId: opts.archetypeId || this.site.default_archetype, - metaData: opts.metaData ? Ember.Object.create(opts.metaData) : null, + metaData: opts.metaData ? EmberObject.create(opts.metaData) : null, reply: opts.reply || this.reply || "" }); diff --git a/app/assets/javascripts/discourse/models/group.js.es6 b/app/assets/javascripts/discourse/models/group.js.es6 index 05bece07f8b..27adb809f7b 100644 --- a/app/assets/javascripts/discourse/models/group.js.es6 +++ b/app/assets/javascripts/discourse/models/group.js.es6 @@ -9,6 +9,7 @@ import Category from "discourse/models/category"; import User from "discourse/models/user"; import Topic from "discourse/models/topic"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import EmberObject from "@ember/object"; const Group = RestModel.extend({ limit: 50, @@ -216,7 +217,7 @@ const Group = RestModel.extend({ return ajax(`/groups/${this.name}/logs.json`, { data: { offset, filters } }).then(results => { - return Ember.Object.create({ + return EmberObject.create({ logs: results["logs"].map(log => GroupHistory.create(log)), all_loaded: results["all_loaded"] }); @@ -241,7 +242,7 @@ const Group = RestModel.extend({ p.user = User.create(p.user); p.topic = Topic.create(p.topic); p.category = Category.findById(p.category_id); - return Ember.Object.create(p); + return EmberObject.create(p); }); }); }, diff --git a/app/assets/javascripts/discourse/models/invite.js.es6 b/app/assets/javascripts/discourse/models/invite.js.es6 index 842a04a3244..f8a4a036101 100644 --- a/app/assets/javascripts/discourse/models/invite.js.es6 +++ b/app/assets/javascripts/discourse/models/invite.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { userPath } from "discourse/lib/url"; @@ -42,7 +43,7 @@ Invite.reopenClass({ data }).then(result => { result.invites = result.invites.map(i => Invite.create(i)); - return Ember.Object.create(result); + return EmberObject.create(result); }); }, @@ -50,7 +51,7 @@ Invite.reopenClass({ if (!user) Ember.RSVP.resolve(); return ajax(userPath(`${user.username_lower}/invited_count.json`)).then( - result => Ember.Object.create(result.counts) + result => EmberObject.create(result.counts) ); }, diff --git a/app/assets/javascripts/discourse/models/login-method.js.es6 b/app/assets/javascripts/discourse/models/login-method.js.es6 index ce59db24501..6e7de67e552 100644 --- a/app/assets/javascripts/discourse/models/login-method.js.es6 +++ b/app/assets/javascripts/discourse/models/login-method.js.es6 @@ -1,7 +1,8 @@ +import EmberObject from "@ember/object"; import computed from "ember-addons/ember-computed-decorators"; import { updateCsrfToken } from "discourse/lib/ajax"; -const LoginMethod = Ember.Object.extend({ +const LoginMethod = EmberObject.extend({ @computed title() { return this.title_override || I18n.t(`login.${this.name}.title`); diff --git a/app/assets/javascripts/discourse/models/model.js.es6 b/app/assets/javascripts/discourse/models/model.js.es6 index c6a0b3ec20a..ea1c9506887 100644 --- a/app/assets/javascripts/discourse/models/model.js.es6 +++ b/app/assets/javascripts/discourse/models/model.js.es6 @@ -1,4 +1,5 @@ -const Model = Ember.Object.extend(); +import EmberObject from "@ember/object"; +const Model = EmberObject.extend(); Model.reopenClass({ extractByKey(collection, klass) { diff --git a/app/assets/javascripts/discourse/models/post.js.es6 b/app/assets/javascripts/discourse/models/post.js.es6 index a82cef491d2..3e72627a10d 100644 --- a/app/assets/javascripts/discourse/models/post.js.es6 +++ b/app/assets/javascripts/discourse/models/post.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import RestModel from "discourse/models/rest"; import { popupAjaxError } from "discourse/lib/ajax-error"; @@ -346,7 +347,7 @@ const Post = RestModel.extend({ Post.reopenClass({ munge(json) { if (json.actions_summary) { - const lookup = Ember.Object.create(); + const lookup = EmberObject.create(); // this area should be optimized, it is creating way too many objects per post json.actions_summary = json.actions_summary.map(a => { @@ -394,7 +395,7 @@ Post.reopenClass({ loadRevision(postId, version) { return ajax(`/posts/${postId}/revisions/${version}.json`).then(result => - Ember.Object.create(result) + EmberObject.create(result) ); }, diff --git a/app/assets/javascripts/discourse/models/rest.js.es6 b/app/assets/javascripts/discourse/models/rest.js.es6 index 8b731f584fd..d9199082fd5 100644 --- a/app/assets/javascripts/discourse/models/rest.js.es6 +++ b/app/assets/javascripts/discourse/models/rest.js.es6 @@ -1,4 +1,6 @@ -const RestModel = Ember.Object.extend({ +import EmberObject from "@ember/object"; + +const RestModel = EmberObject.extend({ isNew: Ember.computed.equal("__state", "new"), isCreated: Ember.computed.equal("__state", "created"), isSaving: false, diff --git a/app/assets/javascripts/discourse/models/site.js.es6 b/app/assets/javascripts/discourse/models/site.js.es6 index 1089956d6c0..2c09a478d0a 100644 --- a/app/assets/javascripts/discourse/models/site.js.es6 +++ b/app/assets/javascripts/discourse/models/site.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import computed from "ember-addons/ember-computed-decorators"; import Archetype from "discourse/models/archetype"; import PostActionType from "discourse/models/post-action-type"; @@ -179,7 +180,7 @@ Site.reopenClass(Singleton, { } if (result.post_action_types) { - result.postActionByIdLookup = Ember.Object.create(); + result.postActionByIdLookup = EmberObject.create(); result.post_action_types = result.post_action_types.map(p => { const actionType = PostActionType.create(p); result.postActionByIdLookup.set("action" + p.id, actionType); @@ -188,7 +189,7 @@ Site.reopenClass(Singleton, { } if (result.topic_flag_types) { - result.topicFlagByIdLookup = Ember.Object.create(); + result.topicFlagByIdLookup = EmberObject.create(); result.topic_flag_types = result.topic_flag_types.map(p => { const actionType = PostActionType.create(p); result.topicFlagByIdLookup.set("action" + p.id, actionType); @@ -204,9 +205,7 @@ Site.reopenClass(Singleton, { } if (result.user_fields) { - result.user_fields = result.user_fields.map(uf => - Ember.Object.create(uf) - ); + result.user_fields = result.user_fields.map(uf => EmberObject.create(uf)); } return result; diff --git a/app/assets/javascripts/discourse/models/static-page.js.es6 b/app/assets/javascripts/discourse/models/static-page.js.es6 index a8cdb2507b7..50c63e083c2 100644 --- a/app/assets/javascripts/discourse/models/static-page.js.es6 +++ b/app/assets/javascripts/discourse/models/static-page.js.es6 @@ -1,5 +1,6 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; -const StaticPage = Ember.Object.extend(); +const StaticPage = EmberObject.extend(); StaticPage.reopenClass({ find(path) { diff --git a/app/assets/javascripts/discourse/models/store.js.es6 b/app/assets/javascripts/discourse/models/store.js.es6 index 96a96f502fb..a5caad53a14 100644 --- a/app/assets/javascripts/discourse/models/store.js.es6 +++ b/app/assets/javascripts/discourse/models/store.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import RestModel from "discourse/models/rest"; import ResultSet from "discourse/models/result-set"; @@ -44,7 +45,7 @@ function findAndRemoveMap(type, id) { flushMap(); -export default Ember.Object.extend({ +export default EmberObject.extend({ _plurals: { "post-reply": "post-replies", "post-reply-history": "post_reply_histories", diff --git a/app/assets/javascripts/discourse/models/topic-details.js.es6 b/app/assets/javascripts/discourse/models/topic-details.js.es6 index 9f486f0712e..0622cacb690 100644 --- a/app/assets/javascripts/discourse/models/topic-details.js.es6 +++ b/app/assets/javascripts/discourse/models/topic-details.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import computed from "ember-addons/ember-computed-decorators"; @@ -23,7 +24,7 @@ const TopicDetails = RestModel.extend({ if (details.participants) { details.participants = details.participants.map(function(p) { p.topic = topic; - return Ember.Object.create(p); + return EmberObject.create(p); }); } diff --git a/app/assets/javascripts/discourse/models/topic-list.js.es6 b/app/assets/javascripts/discourse/models/topic-list.js.es6 index e12a90e77e1..25834624b32 100644 --- a/app/assets/javascripts/discourse/models/topic-list.js.es6 +++ b/app/assets/javascripts/discourse/models/topic-list.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import RestModel from "discourse/models/rest"; import Model from "discourse/models/model"; @@ -135,7 +136,7 @@ TopicList.reopenClass({ const categories = Discourse.Category.list(), users = Model.extractByKey(result.users, Discourse.User), - groups = Model.extractByKey(result.primary_groups, Ember.Object); + groups = Model.extractByKey(result.primary_groups, EmberObject); return result.topic_list[listKey].map(t => { t.category = categories.findBy("id", t.category_id); diff --git a/app/assets/javascripts/discourse/models/topic.js.es6 b/app/assets/javascripts/discourse/models/topic.js.es6 index 03345d77446..de72adeed84 100644 --- a/app/assets/javascripts/discourse/models/topic.js.es6 +++ b/app/assets/javascripts/discourse/models/topic.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import { flushMap } from "discourse/models/store"; import RestModel from "discourse/models/rest"; @@ -635,7 +636,7 @@ Topic.reopenClass({ createActionSummary(result) { if (result.actions_summary) { - const lookup = Ember.Object.create(); + const lookup = EmberObject.create(); result.actions_summary = result.actions_summary.map(a => { a.post = result; a.actionType = Discourse.Site.current().postActionTypeById(a.id); diff --git a/app/assets/javascripts/discourse/models/user.js.es6 b/app/assets/javascripts/discourse/models/user.js.es6 index 1665a825ff3..57c8a070b13 100644 --- a/app/assets/javascripts/discourse/models/user.js.es6 +++ b/app/assets/javascripts/discourse/models/user.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { ajax } from "discourse/lib/ajax"; import { url } from "discourse/lib/computed"; import RestModel from "discourse/models/rest"; @@ -116,7 +117,7 @@ const User = RestModel.extend({ const keys = this.user_api_keys; if (keys) { return keys.map(raw => { - let obj = Ember.Object.create(raw); + let obj = EmberObject.create(raw); obj.revoke = () => { this.revokeApiKey(obj); diff --git a/app/assets/javascripts/discourse/raw-views/list/post-count-or-badges.js.es6 b/app/assets/javascripts/discourse/raw-views/list/post-count-or-badges.js.es6 index 2f3dc5beb9f..42356a4854b 100644 --- a/app/assets/javascripts/discourse/raw-views/list/post-count-or-badges.js.es6 +++ b/app/assets/javascripts/discourse/raw-views/list/post-count-or-badges.js.es6 @@ -1,6 +1,7 @@ +import EmberObject from "@ember/object"; import { default as computed } from "ember-addons/ember-computed-decorators"; -export default Ember.Object.extend({ +export default EmberObject.extend({ postCountsPresent: Ember.computed.or("topic.unread", "topic.displayNewPosts"), showBadges: Ember.computed.and("postBadgesEnabled", "postCountsPresent"), diff --git a/app/assets/javascripts/discourse/raw-views/list/posts-count-column.js.es6 b/app/assets/javascripts/discourse/raw-views/list/posts-count-column.js.es6 index 2171251840c..2c7ca4c9b9c 100644 --- a/app/assets/javascripts/discourse/raw-views/list/posts-count-column.js.es6 +++ b/app/assets/javascripts/discourse/raw-views/list/posts-count-column.js.es6 @@ -1,7 +1,8 @@ +import EmberObject from "@ember/object"; import computed from "ember-addons/ember-computed-decorators"; import { fmt } from "discourse/lib/computed"; -export default Ember.Object.extend({ +export default EmberObject.extend({ tagName: "td", @computed("topic.like_count", "topic.posts_count") diff --git a/app/assets/javascripts/discourse/raw-views/list/visited-line.js.es6 b/app/assets/javascripts/discourse/raw-views/list/visited-line.js.es6 index 3626b17cb75..b2aac575506 100644 --- a/app/assets/javascripts/discourse/raw-views/list/visited-line.js.es6 +++ b/app/assets/javascripts/discourse/raw-views/list/visited-line.js.es6 @@ -1,6 +1,7 @@ +import EmberObject from "@ember/object"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Object.extend({ +export default EmberObject.extend({ @computed isLastVisited: function() { return this.lastVisitedTopic === this.topic; diff --git a/app/assets/javascripts/discourse/raw-views/topic-list-header-column.js.es6 b/app/assets/javascripts/discourse/raw-views/topic-list-header-column.js.es6 index 5febdd4feff..0ac85216b7f 100644 --- a/app/assets/javascripts/discourse/raw-views/topic-list-header-column.js.es6 +++ b/app/assets/javascripts/discourse/raw-views/topic-list-header-column.js.es6 @@ -1,6 +1,7 @@ +import EmberObject from "@ember/object"; import { default as computed } from "ember-addons/ember-computed-decorators"; -export default Ember.Object.extend({ +export default EmberObject.extend({ @computed localizedName() { if (this.forceName) { diff --git a/app/assets/javascripts/discourse/raw-views/topic-status.js.es6 b/app/assets/javascripts/discourse/raw-views/topic-status.js.es6 index ec334985203..8e7269bbca8 100644 --- a/app/assets/javascripts/discourse/raw-views/topic-status.js.es6 +++ b/app/assets/javascripts/discourse/raw-views/topic-status.js.es6 @@ -1,6 +1,7 @@ +import EmberObject from "@ember/object"; import computed from "ember-addons/ember-computed-decorators"; -export default Ember.Object.extend({ +export default EmberObject.extend({ showDefault: null, @computed("defaultIcon") diff --git a/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 b/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 index a6eb60b2937..19543ae481f 100644 --- a/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 +++ b/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; import showModal from "discourse/lib/show-modal"; import OpenComposer from "discourse/mixins/open-composer"; @@ -51,7 +52,7 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, { wrappedCategoriesList && wrappedCategoriesList.category_list; if (categoriesList && topicsList) { - return Ember.Object.create({ + return EmberObject.create({ categories: CategoryList.categoriesFrom( this.store, wrappedCategoriesList @@ -66,7 +67,7 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, { } // Otherwise, return the ajax result return ajax(`/categories_and_${filter}`).then(result => { - return Ember.Object.create({ + return EmberObject.create({ categories: CategoryList.categoriesFrom(this.store, result), topics: TopicList.topicsFrom(this.store, result), can_create_category: result.category_list.can_create_category, diff --git a/app/assets/javascripts/discourse/routes/user-private-messages-tags.js.es6 b/app/assets/javascripts/discourse/routes/user-private-messages-tags.js.es6 index baf5ae81d15..cfe2d026bbe 100644 --- a/app/assets/javascripts/discourse/routes/user-private-messages-tags.js.es6 +++ b/app/assets/javascripts/discourse/routes/user-private-messages-tags.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import DiscourseRoute from "discourse/routes/discourse"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; @@ -7,7 +8,7 @@ export default DiscourseRoute.extend({ const username = this.modelFor("user").get("username_lower"); return ajax(`/tags/personal_messages/${username}`) .then(result => { - return result.tags.map(tag => Ember.Object.create(tag)); + return result.tags.map(tag => EmberObject.create(tag)); }) .catch(popupAjaxError); }, diff --git a/app/assets/javascripts/discourse/services/logs-notice.js.es6 b/app/assets/javascripts/discourse/services/logs-notice.js.es6 index f70e0219927..3395489ce4d 100644 --- a/app/assets/javascripts/discourse/services/logs-notice.js.es6 +++ b/app/assets/javascripts/discourse/services/logs-notice.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { default as computed, on, @@ -7,7 +8,7 @@ import { autoUpdatingRelativeAge } from "discourse/lib/formatter"; const LOGS_NOTICE_KEY = "logs-notice-text"; -const LogsNotice = Ember.Object.extend({ +const LogsNotice = EmberObject.extend({ text: "", @on("init") diff --git a/app/assets/javascripts/discourse/services/search.js.es6 b/app/assets/javascripts/discourse/services/search.js.es6 index 2a47789da4d..dba599c6909 100644 --- a/app/assets/javascripts/discourse/services/search.js.es6 +++ b/app/assets/javascripts/discourse/services/search.js.es6 @@ -1,9 +1,10 @@ +import EmberObject from "@ember/object"; import { default as computed, observes } from "ember-addons/ember-computed-decorators"; -export default Ember.Object.extend({ +export default EmberObject.extend({ searchContextEnabled: false, // checkbox to scope search searchContext: null, term: null, 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 51e16b0bd21..9179e666801 100644 --- a/app/assets/javascripts/select-kit/components/select-kit.js.es6 +++ b/app/assets/javascripts/select-kit/components/select-kit.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Component from "@ember/component"; const { get, isNone, run, isEmpty, makeArray } = Ember; import computed from "ember-addons/ember-computed-decorators"; @@ -87,11 +88,11 @@ export default Component.extend( this.noneValue = "__none__"; this.set( "headerComponentOptions", - Ember.Object.create({ forceEscape: this.forceEscape }) + EmberObject.create({ forceEscape: this.forceEscape }) ); this.set( "rowComponentOptions", - Ember.Object.create({ + EmberObject.create({ forceEscape: this.forceEscape }) ); diff --git a/app/assets/javascripts/wizard/models/step.js.es6 b/app/assets/javascripts/wizard/models/step.js.es6 index c8c5fd1d623..cbc7edca18d 100644 --- a/app/assets/javascripts/wizard/models/step.js.es6 +++ b/app/assets/javascripts/wizard/models/step.js.es6 @@ -1,8 +1,9 @@ +import EmberObject from "@ember/object"; import computed from "ember-addons/ember-computed-decorators"; import ValidState from "wizard/mixins/valid-state"; import { ajax } from "wizard/lib/ajax"; -export default Ember.Object.extend(ValidState, { +export default EmberObject.extend(ValidState, { id: null, @computed("index") diff --git a/app/assets/javascripts/wizard/models/wizard-field.js.es6 b/app/assets/javascripts/wizard/models/wizard-field.js.es6 index 5ad88e26344..91668cbd664 100644 --- a/app/assets/javascripts/wizard/models/wizard-field.js.es6 +++ b/app/assets/javascripts/wizard/models/wizard-field.js.es6 @@ -1,6 +1,7 @@ +import EmberObject from "@ember/object"; import ValidState from "wizard/mixins/valid-state"; -export default Ember.Object.extend(ValidState, { +export default EmberObject.extend(ValidState, { id: null, type: null, value: null, diff --git a/app/assets/javascripts/wizard/models/wizard.js.es6 b/app/assets/javascripts/wizard/models/wizard.js.es6 index a4e65c6de1d..569a2d5bf7b 100644 --- a/app/assets/javascripts/wizard/models/wizard.js.es6 +++ b/app/assets/javascripts/wizard/models/wizard.js.es6 @@ -2,8 +2,9 @@ import Step from "wizard/models/step"; import WizardField from "wizard/models/wizard-field"; import { ajax } from "wizard/lib/ajax"; import computed from "ember-addons/ember-computed-decorators"; +import EmberObject from "@ember/object"; -const Wizard = Ember.Object.extend({ +const Wizard = EmberObject.extend({ @computed("steps.length") totalSteps: length => length, diff --git a/test/javascripts/admin/components/group-list-setting-test.js.es6 b/test/javascripts/admin/components/group-list-setting-test.js.es6 index f998ccbd0b0..6873262bb29 100644 --- a/test/javascripts/admin/components/group-list-setting-test.js.es6 +++ b/test/javascripts/admin/components/group-list-setting-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import selectKit from "helpers/select-kit-helper"; import componentTest from "helpers/component-test"; @@ -20,7 +21,7 @@ componentTest("default", { this.set( "setting", - Ember.Object.create({ + EmberObject.create({ allowsNone: undefined, category: "foo", default: "", diff --git a/test/javascripts/controllers/preferences-account-test.js.es6 b/test/javascripts/controllers/preferences-account-test.js.es6 index 2d40ac26f33..a0a8ae38409 100644 --- a/test/javascripts/controllers/preferences-account-test.js.es6 +++ b/test/javascripts/controllers/preferences-account-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; moduleFor("controller:preferences/account"); QUnit.test("updating of associated accounts", function(assert) { @@ -5,11 +6,11 @@ QUnit.test("updating of associated accounts", function(assert) { siteSettings: { enable_google_oauth2_logins: true }, - model: Ember.Object.create({ + model: EmberObject.create({ second_factor_enabled: true, is_anonymous: true }), - site: Ember.Object.create({ + site: EmberObject.create({ isMobileDevice: false }) }); diff --git a/test/javascripts/controllers/reorder-categories-test.js.es6 b/test/javascripts/controllers/reorder-categories-test.js.es6 index 1b653682f43..26e28180f13 100644 --- a/test/javascripts/controllers/reorder-categories-test.js.es6 +++ b/test/javascripts/controllers/reorder-categories-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { mapRoutes } from "discourse/mapping-router"; import createStore from "helpers/create-store"; @@ -16,7 +17,7 @@ QUnit.test("fixIndices set unique position number", function(assert) { categories.push(store.createRecord("category", { id: i, position: 0 })); } - const site = Ember.Object.create({ categories: categories }); + const site = EmberObject.create({ categories: categories }); const reorderCategoriesController = this.subject({ site }); reorderCategoriesController.fixIndices(); @@ -59,7 +60,7 @@ QUnit.test( const categories = [child2, parent, other, child1]; const expectedOrderSlugs = ["parent", "child2", "child1", "other"]; - const site = Ember.Object.create({ categories: categories }); + const site = EmberObject.create({ categories: categories }); const reorderCategoriesController = this.subject({ site }); reorderCategoriesController.fixIndices(); @@ -95,7 +96,7 @@ QUnit.test( }); const categories = [elem1, elem2, elem3]; - const site = Ember.Object.create({ categories: categories }); + const site = EmberObject.create({ categories: categories }); const reorderCategoriesController = this.subject({ site }); reorderCategoriesController.actions.change.call( @@ -142,7 +143,7 @@ QUnit.test( }); const categories = [elem1, child1, elem2, elem3]; - const site = Ember.Object.create({ categories: categories }); + const site = EmberObject.create({ categories: categories }); const reorderCategoriesController = this.subject({ site }); reorderCategoriesController.actions.change.call( @@ -189,7 +190,7 @@ QUnit.test( }); const categories = [elem1, child1, elem2, elem3]; - const site = Ember.Object.create({ categories: categories }); + const site = EmberObject.create({ categories: categories }); const reorderCategoriesController = this.subject({ site }); reorderCategoriesController.fixIndices(); diff --git a/test/javascripts/controllers/topic-test.js.es6 b/test/javascripts/controllers/topic-test.js.es6 index 262b300859d..f12da986660 100644 --- a/test/javascripts/controllers/topic-test.js.es6 +++ b/test/javascripts/controllers/topic-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Topic from "discourse/models/topic"; import PostStream from "discourse/models/post-stream"; import { Placeholder } from "discourse/lib/posts-with-placeholders"; @@ -191,7 +192,7 @@ QUnit.test("selectedPostsUsername", function(assert) { }); QUnit.test("showSelectedPostsAtBottom", function(assert) { - const site = Ember.Object.create({ mobileView: false }); + const site = EmberObject.create({ mobileView: false }); const model = Topic.create({ posts_count: 3 }); const controller = this.subject({ model, site }); @@ -467,7 +468,7 @@ QUnit.test("togglePostSelection", function(assert) { // }); QUnit.test("selectBelow", function(assert) { - const site = Ember.Object.create({ + const site = EmberObject.create({ post_types: { small_action: 3, whisper: 4 } }); @@ -521,7 +522,7 @@ QUnit.test( }); let destroyed; - const post = Ember.Object.create({ + const post = EmberObject.create({ id: 2, post_number: 2, can_delete: true, @@ -532,12 +533,12 @@ QUnit.test( } }); - const postStream = Ember.Object.create({ + const postStream = EmberObject.create({ stream: [2, 3, 4], posts: [post, { id: 3 }, { id: 4 }] }); - const currentUser = Ember.Object.create({ moderator: true }); + const currentUser = EmberObject.create({ moderator: true }); const model = Topic.create({ postStream }); const controller = this.subject({ model, currentUser }); diff --git a/test/javascripts/helpers/component-test.js.es6 b/test/javascripts/helpers/component-test.js.es6 index e694cb8a05b..5a571d45cd8 100644 --- a/test/javascripts/helpers/component-test.js.es6 +++ b/test/javascripts/helpers/component-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import createStore from "helpers/create-store"; import { autoLoadModules } from "discourse/initializers/auto-load-modules"; import TopicTrackingState from "discourse/models/topic-tracking-state"; @@ -15,7 +16,7 @@ export default function(name, opts) { this.registry.register("site-settings:main", Discourse.SiteSettings, { instantiate: false }); - this.registry.register("capabilities:main", Ember.Object); + this.registry.register("capabilities:main", EmberObject); this.registry.register("site:main", this.site, { instantiate: false }); this.registry.injection("component", "siteSettings", "site-settings:main"); this.registry.injection("component", "appEvents", "service:app-events"); diff --git a/test/javascripts/lib/computed-test.js.es6 b/test/javascripts/lib/computed-test.js.es6 index 6b3b8811193..0a94485f44c 100644 --- a/test/javascripts/lib/computed-test.js.es6 +++ b/test/javascripts/lib/computed-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { setting, propertyEqual, @@ -20,7 +21,7 @@ QUnit.module("lib:computed", { }); QUnit.test("setting", assert => { - var t = Ember.Object.extend({ + var t = EmberObject.extend({ vehicle: setting("vehicle"), missingProp: setting("madeUpThing") }).create(); @@ -38,7 +39,7 @@ QUnit.test("setting", assert => { }); QUnit.test("propertyEqual", assert => { - var t = Ember.Object.extend({ + var t = EmberObject.extend({ same: propertyEqual("cookies", "biscuits") }).create({ cookies: 10, @@ -51,7 +52,7 @@ QUnit.test("propertyEqual", assert => { }); QUnit.test("propertyNotEqual", assert => { - var t = Ember.Object.extend({ + var t = EmberObject.extend({ diff: propertyNotEqual("cookies", "biscuits") }).create({ cookies: 10, @@ -64,7 +65,7 @@ QUnit.test("propertyNotEqual", assert => { }); QUnit.test("fmt", assert => { - var t = Ember.Object.extend({ + var t = EmberObject.extend({ exclaimyUsername: fmt("username", "!!! %@ !!!"), multiple: fmt("username", "mood", "%@ is %@") }).create({ @@ -98,7 +99,7 @@ QUnit.test("fmt", assert => { }); QUnit.test("i18n", assert => { - var t = Ember.Object.extend({ + var t = EmberObject.extend({ exclaimyUsername: i18n("username", "!!! %@ !!!"), multiple: i18n("username", "mood", "%@ is %@") }).create({ @@ -134,7 +135,7 @@ QUnit.test("i18n", assert => { QUnit.test("url", assert => { var t, testClass; - testClass = Ember.Object.extend({ + testClass = EmberObject.extend({ userUrl: url("username", "/u/%@") }); diff --git a/test/javascripts/mixins/singleton-test.js.es6 b/test/javascripts/mixins/singleton-test.js.es6 index 0ed6c198ee6..23921ad3d34 100644 --- a/test/javascripts/mixins/singleton-test.js.es6 +++ b/test/javascripts/mixins/singleton-test.js.es6 @@ -1,9 +1,10 @@ +import EmberObject from "@ember/object"; import Singleton from "discourse/mixins/singleton"; QUnit.module("mixin:singleton"); QUnit.test("current", assert => { - var DummyModel = Ember.Object.extend({}); + var DummyModel = EmberObject.extend({}); DummyModel.reopenClass(Singleton); var current = DummyModel.current(); @@ -21,7 +22,7 @@ QUnit.test("current", assert => { }); QUnit.test("currentProp reading", assert => { - var DummyModel = Ember.Object.extend({}); + var DummyModel = EmberObject.extend({}); DummyModel.reopenClass(Singleton); var current = DummyModel.current(); @@ -38,7 +39,7 @@ QUnit.test("currentProp reading", assert => { }); QUnit.test("currentProp writing", assert => { - var DummyModel = Ember.Object.extend({}); + var DummyModel = EmberObject.extend({}); DummyModel.reopenClass(Singleton); assert.blank( @@ -65,7 +66,7 @@ QUnit.test("currentProp writing", assert => { }); QUnit.test("createCurrent", assert => { - var Shoe = Ember.Object.extend({}); + var Shoe = EmberObject.extend({}); Shoe.reopenClass(Singleton, { createCurrent: function() { return Shoe.create({ toes: 5 }); @@ -80,7 +81,7 @@ QUnit.test("createCurrent", assert => { }); QUnit.test("createCurrent that returns null", assert => { - var Missing = Ember.Object.extend({}); + var Missing = EmberObject.extend({}); Missing.reopenClass(Singleton, { createCurrent: function() { return null; diff --git a/test/javascripts/models/composer-test.js.es6 b/test/javascripts/models/composer-test.js.es6 index 34fb578044f..78c823b2bec 100644 --- a/test/javascripts/models/composer-test.js.es6 +++ b/test/javascripts/models/composer-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { currentUser } from "helpers/qunit-helpers"; import AppEvents from "discourse/services/app-events"; import Composer from "discourse/models/composer"; @@ -236,7 +237,7 @@ QUnit.test("Title length for private messages", assert => { QUnit.test("Post length for private messages with non human users", assert => { const composer = createComposer({ - topic: Ember.Object.create({ pm_with_non_human_user: true }) + topic: EmberObject.create({ pm_with_non_human_user: true }) }); assert.equal(composer.get("minimumPostLength"), 1); diff --git a/test/javascripts/models/model-test.js.es6 b/test/javascripts/models/model-test.js.es6 index f5e81acae78..f38063d6afa 100644 --- a/test/javascripts/models/model-test.js.es6 +++ b/test/javascripts/models/model-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import Model from "discourse/models/model"; QUnit.module("model:discourse"); @@ -8,10 +9,10 @@ QUnit.test( var firstObject = { id: "id_1", foo: "foo_1" }; var secondObject = { id: "id_2", foo: "foo_2" }; - var actual = Model.extractByKey([firstObject, secondObject], Ember.Object); + var actual = Model.extractByKey([firstObject, secondObject], EmberObject); var expected = { - id_1: Ember.Object.create(firstObject), - id_2: Ember.Object.create(secondObject) + id_1: EmberObject.create(firstObject), + id_2: EmberObject.create(secondObject) }; assert.ok(_.isEqual(actual, expected)); diff --git a/test/javascripts/models/topic-test.js.es6 b/test/javascripts/models/topic-test.js.es6 index e385e1e92f7..1deab13a541 100644 --- a/test/javascripts/models/topic-test.js.es6 +++ b/test/javascripts/models/topic-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { IMAGE_VERSION as v } from "pretty-text/emoji/version"; QUnit.module("model:topic"); @@ -33,7 +34,7 @@ QUnit.test("visited", assert => { }); QUnit.test("lastUnreadUrl", assert => { - const category = Ember.Object.create({ + const category = EmberObject.create({ navigate_to_first_post_after_read: true }); diff --git a/test/javascripts/widgets/post-test.js.es6 b/test/javascripts/widgets/post-test.js.es6 index 422e485a5d3..23a7b17bdf4 100644 --- a/test/javascripts/widgets/post-test.js.es6 +++ b/test/javascripts/widgets/post-test.js.es6 @@ -1,3 +1,4 @@ +import EmberObject from "@ember/object"; import { moduleForWidget, widgetTest } from "helpers/widget-test"; moduleForWidget("post"); @@ -861,7 +862,7 @@ widgetTest("pm map", { showTopicMap: true, showPMMap: true, allowedGroups: [], - allowedUsers: [Ember.Object.create({ username: "eviltrout" })] + allowedUsers: [EmberObject.create({ username: "eviltrout" })] }); }, test(assert) {