diff --git a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 index e086d85374e..9dfb5ae8bc6 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 @@ -1,3 +1,4 @@ +import { inject as service } from '@ember/service'; import Controller from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import CanCheckEmails from "discourse/mixins/can-check-emails"; @@ -8,7 +9,7 @@ import { default as computed } from "ember-addons/ember-computed-decorators"; import { fmt } from "discourse/lib/computed"; export default Controller.extend(CanCheckEmails, { - adminTools: Ember.inject.service(), + adminTools: service(), originalPrimaryGroupId: null, customGroupIdsBuffer: null, availableGroups: null, diff --git a/app/assets/javascripts/admin/controllers/admin.js.es6 b/app/assets/javascripts/admin/controllers/admin.js.es6 index 52ecf0a70bb..14174efe1f9 100644 --- a/app/assets/javascripts/admin/controllers/admin.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin.js.es6 @@ -1,8 +1,9 @@ +import { inject as service } from '@ember/service'; import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; export default Controller.extend({ - router: Ember.inject.service(), + router: service(), @computed("siteSettings.enable_group_directory") showGroups(enableGroupDirectory) { diff --git a/app/assets/javascripts/admin/services/admin-tools.js.es6 b/app/assets/javascripts/admin/services/admin-tools.js.es6 index 7f3b4d88a81..b8d0e6e805e 100644 --- a/app/assets/javascripts/admin/services/admin-tools.js.es6 +++ b/app/assets/javascripts/admin/services/admin-tools.js.es6 @@ -7,8 +7,9 @@ import { iconHTML } from "discourse-common/lib/icon-library"; import { ajax } from "discourse/lib/ajax"; import showModal from "discourse/lib/show-modal"; import { getOwner } from "discourse-common/lib/get-owner"; +import Service from "@ember/service"; -export default Ember.Service.extend({ +export default Service.extend({ init() { this._super(...arguments); diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js index b5f360228c9..f11b583d42b 100644 --- a/app/assets/javascripts/discourse-loader.js +++ b/app/assets/javascripts/discourse-loader.js @@ -12,7 +12,11 @@ var define, requirejs; inject: Ember.inject.controller }, "@ember/object": { default: Ember.Object }, - "@ember/routing/route": { default: Ember.Route } + "@ember/routing/route": { default: Ember.Route }, + "@ember/service": { + default: Ember.Service, + inject: Ember.inject.service + } }; } diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index 1657552555a..3065269b704 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -1,3 +1,4 @@ +import { inject as service } from '@ember/service'; import Component from "@ember/component"; /*global Mousetrap:true */ import { @@ -219,7 +220,7 @@ export default Component.extend({ _mouseTrap: null, showLink: true, emojiPickerIsActive: false, - emojiStore: Ember.inject.service("emoji-store"), + emojiStore: service("emoji-store"), @computed("placeholder") placeholderTranslated(placeholder) { diff --git a/app/assets/javascripts/discourse/components/d-navigation.js.es6 b/app/assets/javascripts/discourse/components/d-navigation.js.es6 index f7358ec15b1..7939eb66573 100644 --- a/app/assets/javascripts/discourse/components/d-navigation.js.es6 +++ b/app/assets/javascripts/discourse/components/d-navigation.js.es6 @@ -1,8 +1,9 @@ +import { inject as service } from '@ember/service'; import Component from "@ember/component"; import computed from "ember-addons/ember-computed-decorators"; export default Component.extend({ - router: Ember.inject.service(), + router: service(), persistedQueryParams: null, tagName: "", diff --git a/app/assets/javascripts/discourse/components/emoji-picker.js.es6 b/app/assets/javascripts/discourse/components/emoji-picker.js.es6 index 614db00529d..d1337d9f67a 100644 --- a/app/assets/javascripts/discourse/components/emoji-picker.js.es6 +++ b/app/assets/javascripts/discourse/components/emoji-picker.js.es6 @@ -1,3 +1,4 @@ +import { inject as service } from '@ember/service'; import Component from "@ember/component"; import { on, observes } from "ember-addons/ember-computed-decorators"; import { findRawTemplate } from "discourse/lib/raw-templates"; @@ -18,7 +19,7 @@ const customEmojis = _.keys(extendedEmojiList()).map(code => { export default Component.extend({ automaticPositioning: true, - emojiStore: Ember.inject.service("emoji-store"), + emojiStore: service("emoji-store"), close() { this._unbindEvents(); diff --git a/app/assets/javascripts/discourse/components/nav-item.js.es6 b/app/assets/javascripts/discourse/components/nav-item.js.es6 index 556c8085851..ab2a86a67ca 100644 --- a/app/assets/javascripts/discourse/components/nav-item.js.es6 +++ b/app/assets/javascripts/discourse/components/nav-item.js.es6 @@ -1,3 +1,4 @@ +import { inject as service } from '@ember/service'; import Component from "@ember/component"; /* You might be looking for navigation-item. */ import { iconHTML } from "discourse-common/lib/icon-library"; @@ -6,7 +7,7 @@ import computed from "ember-addons/ember-computed-decorators"; export default Component.extend({ tagName: "li", classNameBindings: ["active"], - router: Ember.inject.service(), + router: service(), @computed("label", "i18nLabel", "icon") contents(label, i18nLabel, icon) { diff --git a/app/assets/javascripts/discourse/controllers/application.js.es6 b/app/assets/javascripts/discourse/controllers/application.js.es6 index e0a5d5c90aa..8a6f1b06ce4 100644 --- a/app/assets/javascripts/discourse/controllers/application.js.es6 +++ b/app/assets/javascripts/discourse/controllers/application.js.es6 @@ -1,3 +1,4 @@ +import { inject as service } from '@ember/service'; import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import { isAppWebview, isiOSPWA } from "discourse/lib/utilities"; @@ -5,7 +6,7 @@ import { isAppWebview, isiOSPWA } from "discourse/lib/utilities"; export default Controller.extend({ showTop: true, showFooter: false, - router: Ember.inject.service(), + router: service(), @computed canSignUp() { diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index a011e8212f6..92801c6b568 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -1,3 +1,4 @@ +import { inject as service } from '@ember/service'; import { inject } from '@ember/controller'; import Controller from "@ember/controller"; import DiscourseURL from "discourse/lib/url"; @@ -78,7 +79,7 @@ export function addPopupMenuOptionsCallback(callback) { export default Controller.extend({ topicController: inject("topic"), - router: Ember.inject.service(), + router: service(), checkedMessages: false, messageCount: null, diff --git a/app/assets/javascripts/discourse/controllers/group-activity.js.es6 b/app/assets/javascripts/discourse/controllers/group-activity.js.es6 index 838045d2064..893fbc69d9f 100644 --- a/app/assets/javascripts/discourse/controllers/group-activity.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-activity.js.es6 @@ -1,5 +1,6 @@ +import { inject as service } from '@ember/service'; import Controller from "@ember/controller"; export default Controller.extend({ - router: Ember.inject.service(), + router: service(), queryParams: ["category_id"] }); diff --git a/app/assets/javascripts/discourse/controllers/group-manage.js.es6 b/app/assets/javascripts/discourse/controllers/group-manage.js.es6 index 662887935a5..b1cf11a2c97 100644 --- a/app/assets/javascripts/discourse/controllers/group-manage.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-manage.js.es6 @@ -1,8 +1,9 @@ +import { inject as service } from '@ember/service'; import Controller from "@ember/controller"; import { default as computed } from "ember-addons/ember-computed-decorators"; export default Controller.extend({ - router: Ember.inject.service(), + router: service(), @computed("model.automatic") tabs(automatic) { diff --git a/app/assets/javascripts/discourse/controllers/group-messages.js.es6 b/app/assets/javascripts/discourse/controllers/group-messages.js.es6 index 4cecbd37012..f104980c03f 100644 --- a/app/assets/javascripts/discourse/controllers/group-messages.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group-messages.js.es6 @@ -1,4 +1,5 @@ +import { inject as service } from '@ember/service'; import Controller from "@ember/controller"; export default Controller.extend({ - router: Ember.inject.service() + router: service() }); diff --git a/app/assets/javascripts/discourse/controllers/preferences.js.es6 b/app/assets/javascripts/discourse/controllers/preferences.js.es6 index 4cecbd37012..f104980c03f 100644 --- a/app/assets/javascripts/discourse/controllers/preferences.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences.js.es6 @@ -1,4 +1,5 @@ +import { inject as service } from '@ember/service'; import Controller from "@ember/controller"; export default Controller.extend({ - router: Ember.inject.service() + router: service() }); diff --git a/app/assets/javascripts/discourse/controllers/user-activity.js.es6 b/app/assets/javascripts/discourse/controllers/user-activity.js.es6 index 498f3ff8014..113076bc620 100644 --- a/app/assets/javascripts/discourse/controllers/user-activity.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-activity.js.es6 @@ -1,10 +1,11 @@ +import { inject as service } from '@ember/service'; import { inject } from '@ember/controller'; import Controller from "@ember/controller"; import { exportUserArchive } from "discourse/lib/export-csv"; export default Controller.extend({ application: inject(), - router: Ember.inject.service(), + router: service(), user: inject(), userActionType: null, diff --git a/app/assets/javascripts/discourse/controllers/user-card.js.es6 b/app/assets/javascripts/discourse/controllers/user-card.js.es6 index 4f65d3f9d82..d0fa3abf1c9 100644 --- a/app/assets/javascripts/discourse/controllers/user-card.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-card.js.es6 @@ -1,4 +1,5 @@ -import { inject } from '@ember/controller'; +import { inject as service } from "@ember/service"; +import { inject } from "@ember/controller"; import Controller from "@ember/controller"; import { default as DiscourseURL, @@ -8,7 +9,7 @@ import { export default Controller.extend({ topic: inject(), - router: Ember.inject.service(), + router: service(), actions: { togglePosts(user) { diff --git a/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 b/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 index e10ea776bac..cbce7452800 100644 --- a/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-private-messages.js.es6 @@ -1,10 +1,11 @@ +import { inject as service } from '@ember/service'; import { inject } from '@ember/controller'; import Controller from "@ember/controller"; import computed from "ember-addons/ember-computed-decorators"; import Topic from "discourse/models/topic"; export default Controller.extend({ - router: Ember.inject.service(), + router: service(), userTopicsList: inject("user-topics-list"), user: inject(), diff --git a/app/assets/javascripts/discourse/controllers/user.js.es6 b/app/assets/javascripts/discourse/controllers/user.js.es6 index a63954203bd..6913555c2f7 100644 --- a/app/assets/javascripts/discourse/controllers/user.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user.js.es6 @@ -1,3 +1,4 @@ +import { inject as service } from '@ember/service'; import { inject } from '@ember/controller'; import Controller from "@ember/controller"; import CanCheckEmails from "discourse/mixins/can-check-emails"; @@ -8,7 +9,7 @@ import { prioritizeNameInUx } from "discourse/lib/settings"; export default Controller.extend(CanCheckEmails, { indexStream: false, - router: Ember.inject.service(), + router: service(), userNotifications: inject("user-notifications"), currentPath: Ember.computed.alias("router._router.currentPath"), adminTools: optionalService(), diff --git a/app/assets/javascripts/discourse/services/app-events.js.es6 b/app/assets/javascripts/discourse/services/app-events.js.es6 index 5967568ef32..fa73e9d463f 100644 --- a/app/assets/javascripts/discourse/services/app-events.js.es6 +++ b/app/assets/javascripts/discourse/services/app-events.js.es6 @@ -1,6 +1,7 @@ import deprecated from "discourse-common/lib/deprecated"; +import Service from "@ember/service"; -export default Ember.Service.extend(Ember.Evented, { +export default Service.extend(Ember.Evented, { _events: {}, on() { diff --git a/app/assets/javascripts/discourse/services/emoji-store.js.es6 b/app/assets/javascripts/discourse/services/emoji-store.js.es6 index 7c7a5d082a7..19fbd662fc8 100644 --- a/app/assets/javascripts/discourse/services/emoji-store.js.es6 +++ b/app/assets/javascripts/discourse/services/emoji-store.js.es6 @@ -1,11 +1,12 @@ import KeyValueStore from "discourse/lib/key-value-store"; +import Service from "@ember/service"; const EMOJI_USAGE = "emojiUsage"; const EMOJI_SELECTED_DIVERSITY = "emojiSelectedDiversity"; const TRACKED_EMOJIS = 15; const STORE_NAMESPACE = "discourse_emojis_"; -export default Ember.Service.extend({ +export default Service.extend({ init() { this._super(...arguments); diff --git a/app/assets/javascripts/discourse/services/theme-settings.js.es6 b/app/assets/javascripts/discourse/services/theme-settings.js.es6 index 1ff2300f7f3..5ebe9f37057 100644 --- a/app/assets/javascripts/discourse/services/theme-settings.js.es6 +++ b/app/assets/javascripts/discourse/services/theme-settings.js.es6 @@ -1,4 +1,6 @@ -export default Ember.Service.extend({ +import Service from "@ember/service"; + +export default Service.extend({ settings: null, init() {