DEV: Clean up imports (#28060)

* `@ember/owner` instead of `@ember/application`
* `discourse-i18n` instead of `I18n`
* `{ service } from "@ember/service"` instead of `inject as service`
This commit is contained in:
Jarek Radosz 2024-07-25 15:09:06 +02:00 committed by GitHub
parent c4845acf5e
commit 038e5deb2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
269 changed files with 280 additions and 280 deletions

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error"; import { popupAjaxError } from "discourse/lib/ajax-error";
import i18n from "discourse-common/helpers/i18n"; import i18n from "discourse-common/helpers/i18n";

View File

@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";
import { fn } from "@ember/helper"; import { fn } from "@ember/helper";
import { on } from "@ember/modifier"; import { on } from "@ember/modifier";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import { htmlSafe } from "@ember/template"; import { htmlSafe } from "@ember/template";
import { not } from "truth-helpers"; import { not } from "truth-helpers";
import DButton from "discourse/components/d-button"; import DButton from "discourse/components/d-button";

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing"; import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import concatClass from "discourse/helpers/concat-class"; import concatClass from "discourse/helpers/concat-class";
import I18n from "discourse-i18n"; import I18n from "discourse-i18n";

View File

@ -1,5 +1,5 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav"; import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";
import NavItem from "discourse/components/nav-item"; import NavItem from "discourse/components/nav-item";
import i18n from "discourse-common/helpers/i18n"; import i18n from "discourse-common/helpers/i18n";

View File

@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { cancel } from "@ember/runloop"; import { cancel } from "@ember/runloop";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import { isEmpty } from "@ember/utils"; import { isEmpty } from "@ember/utils";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner"; import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
import SiteSettingFilter from "discourse/lib/site-setting-filter"; import SiteSettingFilter from "discourse/lib/site-setting-filter";

View File

@ -1,5 +1,5 @@
import Route from "@ember/routing/route"; import Route from "@ember/routing/route";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
export default class AdminPluginsShowIndexRoute extends Route { export default class AdminPluginsShowIndexRoute extends Route {
@service router; @service router;

View File

@ -1,5 +1,5 @@
import Route from "@ember/routing/route"; import Route from "@ember/routing/route";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import SiteSetting from "admin/models/site-setting"; import SiteSetting from "admin/models/site-setting";
export default class AdminPluginsShowSettingsRoute extends Route { export default class AdminPluginsShowSettingsRoute extends Route {

View File

@ -1,5 +1,5 @@
import Route from "@ember/routing/route"; import Route from "@ember/routing/route";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";
import { sanitize } from "discourse/lib/text"; import { sanitize } from "discourse/lib/text";
import AdminPlugin from "admin/models/admin-plugin"; import AdminPlugin from "admin/models/admin-plugin";

View File

@ -1,14 +1,14 @@
import { getOwner as emberGetOwner, setOwner } from "@ember/application"; import { getOwner as emberGetOwner, setOwner } from "@ember/owner";
import deprecated from "discourse-common/lib/deprecated"; import deprecated from "discourse-common/lib/deprecated";
let _default = {}; let _default = {};
/** /**
* Works similarly to { getOwner } from `@ember/application`, but has a fallback * Works similarly to { getOwner } from `@ember/owner`, but has a fallback
* when the passed object doesn't have an owner. * when the passed object doesn't have an owner.
* *
* This exists for historical reasons. Ideally, any uses of it should be updated to use * This exists for historical reasons. Ideally, any uses of it should be updated to use
* the official `@ember/application` implementation. * the official `@ember/owner` implementation.
*/ */
export function getOwnerWithFallback(obj) { export function getOwnerWithFallback(obj) {
if (emberGetOwner) { if (emberGetOwner) {

View File

@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";
import { array, fn } from "@ember/helper"; import { array, fn } from "@ember/helper";
import { action } from "@ember/object"; import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert"; import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import DButton from "discourse/components/d-button"; import DButton from "discourse/components/d-button";
import DropdownMenu from "discourse/components/dropdown-menu"; import DropdownMenu from "discourse/components/dropdown-menu";
import BookmarkModal from "discourse/components/modal/bookmark"; import BookmarkModal from "discourse/components/modal/bookmark";

View File

@ -1,7 +1,7 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import EmberObject, { computed } from "@ember/object"; import EmberObject, { computed } from "@ember/object";
import { alias } from "@ember/object/computed"; import { alias } from "@ember/object/computed";
import { getOwner } from "@ember/owner";
import { next, schedule, throttle } from "@ember/runloop"; import { next, schedule, throttle } from "@ember/runloop";
import { BasePlugin } from "@uppy/core"; import { BasePlugin } from "@uppy/core";
import $ from "jquery"; import $ from "jquery";

View File

@ -1,5 +1,5 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { getOwner } from "@ember/owner";
import deprecated from "discourse-common/lib/deprecated"; import deprecated from "discourse-common/lib/deprecated";
import discourseComputed from "discourse-common/utils/decorators"; import discourseComputed from "discourse-common/utils/decorators";

View File

@ -1,5 +1,5 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { getOwner } from "@ember/owner";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { getCustomHTML } from "discourse/helpers/custom-html"; import { getCustomHTML } from "discourse/helpers/custom-html";
import deprecated from "discourse-common/lib/deprecated"; import deprecated from "discourse-common/lib/deprecated";

View File

@ -1,6 +1,6 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { alias } from "@ember/object/computed"; import { alias } from "@ember/object/computed";
import { getOwner } from "@ember/owner";
import { schedule, scheduleOnce } from "@ember/runloop"; import { schedule, scheduleOnce } from "@ember/runloop";
import { isBlank } from "@ember/utils"; import { isBlank } from "@ember/utils";
import $ from "jquery"; import $ from "jquery";

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import { isEmpty } from "@ember/utils"; import { isEmpty } from "@ember/utils";
import ItsATrap from "@discourse/itsatrap"; import ItsATrap from "@discourse/itsatrap";
import { import {

View File

@ -4,7 +4,7 @@ import { fn } from "@ember/helper";
import { on } from "@ember/modifier"; import { on } from "@ember/modifier";
import { action, getProperties } from "@ember/object"; import { action, getProperties } from "@ember/object";
import { LinkTo } from "@ember/routing"; import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import { or } from "truth-helpers"; import { or } from "truth-helpers";
import Form from "discourse/components/form"; import Form from "discourse/components/form";
import formatDate from "discourse/helpers/format-date"; import formatDate from "discourse/helpers/format-date";
@ -13,7 +13,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { GROUP_SMTP_SSL_MODES } from "discourse/lib/constants"; import { GROUP_SMTP_SSL_MODES } from "discourse/lib/constants";
import emailProviderDefaultSettings from "discourse/lib/email-provider-default-settings"; import emailProviderDefaultSettings from "discourse/lib/email-provider-default-settings";
import i18n from "discourse-common/helpers/i18n"; import i18n from "discourse-common/helpers/i18n";
import I18n from "I18n"; import I18n from "discourse-i18n";
export default class GroupSmtpEmailSettings extends Component { export default class GroupSmtpEmailSettings extends Component {
@service currentUser; @service currentUser;

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { getOwner } from "@ember/application";
import { hash } from "@ember/helper"; import { hash } from "@ember/helper";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { getOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { modifier as modifierFn } from "ember-modifier"; import { modifier as modifierFn } from "ember-modifier";
import { and, eq, not, or } from "truth-helpers"; import { and, eq, not, or } from "truth-helpers";

View File

@ -1,5 +1,5 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { getOwner } from "@ember/owner";
import ClickTrack from "discourse/lib/click-track"; import ClickTrack from "discourse/lib/click-track";
export default Component.extend({ export default Component.extend({

View File

@ -1,9 +1,9 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { getOwner } from "@ember/application";
import { Input } from "@ember/component"; import { Input } from "@ember/component";
import { on } from "@ember/modifier"; import { on } from "@ember/modifier";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { getOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { htmlSafe } from "@ember/template"; import { htmlSafe } from "@ember/template";
import { Promise } from "rsvp"; import { Promise } from "rsvp";

View File

@ -1,7 +1,7 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { readOnly } from "@ember/object/computed"; import { readOnly } from "@ember/object/computed";
import { getOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import CreateInvite from "discourse/components/modal/create-invite"; import CreateInvite from "discourse/components/modal/create-invite";
import { longDateNoYear } from "discourse/lib/formatter"; import { longDateNoYear } from "discourse/lib/formatter";

View File

@ -1,6 +1,6 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { action, set } from "@ember/object"; import { action, set } from "@ember/object";
import { getOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { classify, dasherize } from "@ember/string"; import { classify, dasherize } from "@ember/string";
import ExplainReviewableModal from "discourse/components/modal/explain-reviewable"; import ExplainReviewableModal from "discourse/components/modal/explain-reviewable";

View File

@ -1,5 +1,5 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import avatar from "discourse/helpers/bound-avatar-template"; import avatar from "discourse/helpers/bound-avatar-template";
import { userPath } from "discourse/lib/url"; import { userPath } from "discourse/lib/url";
import i18n from "discourse-common/helpers/i18n"; import i18n from "discourse-common/helpers/i18n";

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { fn } from "@ember/helper"; import { fn } from "@ember/helper";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { inject as service } from "@ember/service"; import { service } from "@ember/service";
import { and, not, or } from "truth-helpers"; import { and, not, or } from "truth-helpers";
import DButton from "discourse/components/d-button"; import DButton from "discourse/components/d-button";
import DropdownMenu from "discourse/components/dropdown-menu"; import DropdownMenu from "discourse/components/dropdown-menu";

View File

@ -1,7 +1,7 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { computed } from "@ember/object"; import { computed } from "@ember/object";
import { alias, or } from "@ember/object/computed"; import { alias, or } from "@ember/object/computed";
import { getOwner } from "@ember/owner";
import { NotificationLevels } from "discourse/lib/notification-levels"; import { NotificationLevels } from "discourse/lib/notification-levels";
import { getTopicFooterButtons } from "discourse/lib/register-topic-footer-button"; import { getTopicFooterButtons } from "discourse/lib/register-topic-footer-button";
import { getTopicFooterDropdowns } from "discourse/lib/register-topic-footer-dropdown"; import { getTopicFooterDropdowns } from "discourse/lib/register-topic-footer-dropdown";

View File

@ -1,7 +1,7 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { alias } from "@ember/object/computed"; import { alias } from "@ember/object/computed";
import { on } from "@ember/object/evented"; import { on } from "@ember/object/evented";
import { getOwner } from "@ember/owner";
import { schedule } from "@ember/runloop"; import { schedule } from "@ember/runloop";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { htmlSafe } from "@ember/template"; import { htmlSafe } from "@ember/template";

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { cached, tracked } from "@glimmer/tracking"; import { cached, tracked } from "@glimmer/tracking";
import { getOwner } from "@ember/application";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { getOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { wantsNewWindow } from "discourse/lib/intercept-click"; import { wantsNewWindow } from "discourse/lib/intercept-click";
import UserMenuTab, { CUSTOM_TABS_CLASSES } from "discourse/lib/user-menu/tab"; import UserMenuTab, { CUSTOM_TABS_CLASSES } from "discourse/lib/user-menu/tab";

View File

@ -1,6 +1,6 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import { on } from "@ember/object/evented"; import { on } from "@ember/object/evented";
import { getOwner } from "@ember/owner";
import { later } from "@ember/runloop"; import { later } from "@ember/runloop";
import { service } from "@ember/service"; import { service } from "@ember/service";
import $ from "jquery"; import $ from "jquery";

View File

@ -1,5 +1,5 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { schedule } from "@ember/runloop"; import { schedule } from "@ember/runloop";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { modifier } from "ember-modifier"; import { modifier } from "ember-modifier";

View File

@ -17,7 +17,7 @@ import FKSection from "discourse/form-kit/components/fk/section";
import { VALIDATION_TYPES } from "discourse/form-kit/lib/constants"; import { VALIDATION_TYPES } from "discourse/form-kit/lib/constants";
import FKFieldData from "discourse/form-kit/lib/fk-field-data"; import FKFieldData from "discourse/form-kit/lib/fk-field-data";
import FKFormData from "discourse/form-kit/lib/fk-form-data"; import FKFormData from "discourse/form-kit/lib/fk-form-data";
import I18n from "I18n"; import I18n from "discourse-i18n";
class FKForm extends Component { class FKForm extends Component {
@service dialog; @service dialog;

View File

@ -1,6 +1,6 @@
import { getOwner, setOwner } from "@ember/application";
import Helper from "@ember/component/helper"; import Helper from "@ember/component/helper";
import { registerDestructor } from "@ember/destroyable"; import { registerDestructor } from "@ember/destroyable";
import { getOwner, setOwner } from "@ember/owner";
import { schedule } from "@ember/runloop"; import { schedule } from "@ember/runloop";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { htmlSafe } from "@ember/template"; import { htmlSafe } from "@ember/template";

View File

@ -1,9 +1,9 @@
/* eslint-disable ember/no-private-routing-service */ /* eslint-disable ember/no-private-routing-service */
import { getOwner } from "@ember/application";
import { A } from "@ember/array"; import { A } from "@ember/array";
import Helper from "@ember/component/helper"; import Helper from "@ember/component/helper";
import { assert, runInDebug } from "@ember/debug"; import { assert, runInDebug } from "@ember/debug";
import { computed, get } from "@ember/object"; import { computed, get } from "@ember/object";
import { getOwner } from "@ember/owner";
import { join } from "@ember/runloop"; import { join } from "@ember/runloop";
function getCurrentRouteInfos(router) { function getCurrentRouteInfos(router) {

View File

@ -1,4 +1,4 @@
import { setOwner } from "@ember/application"; import { setOwner } from "@ember/owner";
import Handlebars from "handlebars"; import Handlebars from "handlebars";
import { import {
createHelperContext, createHelperContext,

View File

@ -1,5 +1,5 @@
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { getOwner, setOwner } from "@ember/application"; import { getOwner, setOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { TrackedArray } from "@ember-compat/tracked-built-ins"; import { TrackedArray } from "@ember-compat/tracked-built-ins";
import { NotificationLevels } from "discourse/lib/notification-levels"; import { NotificationLevels } from "discourse/lib/notification-levels";

View File

@ -5,8 +5,8 @@ styleguide to use them, and eventually to generate dummy data
in a placeholder component. It should not be used for any other case. in a placeholder component. It should not be used for any other case.
*/ */
import { setOwner } from "@ember/application";
import ApplicationInstance from "@ember/application/instance"; import ApplicationInstance from "@ember/application/instance";
import { setOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { getLoadedFaker } from "discourse/lib/load-faker"; import { getLoadedFaker } from "discourse/lib/load-faker";

View File

@ -1,4 +1,4 @@
import { setOwner } from "@ember/application"; import { setOwner } from "@ember/owner";
import { debounce } from "@ember/runloop"; import { debounce } from "@ember/runloop";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";
import { getHashtagTypeClasses } from "discourse/lib/hashtag-type-registry"; import { getHashtagTypeClasses } from "discourse/lib/hashtag-type-registry";

View File

@ -1,7 +1,7 @@
import { getOwner } from "@ember/application";
import Component from "@ember/component"; import Component from "@ember/component";
import Controller from "@ember/controller"; import Controller from "@ember/controller";
import EmberObject, { computed } from "@ember/object"; import EmberObject, { computed } from "@ember/object";
import { getOwner } from "@ember/owner";
import Route from "@ember/routing/route"; import Route from "@ember/routing/route";
import Service from "@ember/service"; import Service from "@ember/service";
import RestAdapter from "discourse/adapters/rest"; import RestAdapter from "discourse/adapters/rest";

View File

@ -1,4 +1,4 @@
import { getOwner, setOwner } from "@ember/application"; import { getOwner, setOwner } from "@ember/owner";
import { run, throttle } from "@ember/runloop"; import { run, throttle } from "@ember/runloop";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";
import { headerOffset } from "discourse/lib/offset-calculator"; import { headerOffset } from "discourse/lib/offset-calculator";

View File

@ -1,5 +1,5 @@
import { getOwner } from "@ember/application";
import { computed } from "@ember/object"; import { computed } from "@ember/object";
import { getOwner } from "@ember/owner";
import { dasherize } from "@ember/string"; import { dasherize } from "@ember/string";
export default function (name) { export default function (name) {

View File

@ -1,7 +1,7 @@
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { setOwner } from "@ember/application";
import { inject as controller } from "@ember/controller"; import { inject as controller } from "@ember/controller";
import { inject as service } from "@ember/service"; import { setOwner } from "@ember/owner";
import { service } from "@ember/service";
import { import {
CLOSE_INITIATED_BY_BUTTON, CLOSE_INITIATED_BY_BUTTON,
CLOSE_INITIATED_BY_ESC, CLOSE_INITIATED_BY_ESC,

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { schedule } from "@ember/runloop"; import { schedule } from "@ember/runloop";
let counter = 0; let counter = 0;

View File

@ -1,5 +1,5 @@
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { setOwner } from "@ember/application"; import { setOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import AboutSectionLink from "discourse/lib/sidebar/common/community-section/about-section-link"; import AboutSectionLink from "discourse/lib/sidebar/common/community-section/about-section-link";
import BadgesSectionLink from "discourse/lib/sidebar/common/community-section/badges-section-link"; import BadgesSectionLink from "discourse/lib/sidebar/common/community-section/badges-section-link";

View File

@ -1,5 +1,5 @@
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { setOwner } from "@ember/application"; import { setOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { isPresent } from "@ember/utils"; import { isPresent } from "@ember/utils";
import SidebarSectionForm from "discourse/components/modal/sidebar-section-form"; import SidebarSectionForm from "discourse/components/modal/sidebar-section-form";

View File

@ -1,7 +1,7 @@
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { setOwner } from "@ember/application";
import { inject as controller } from "@ember/controller"; import { inject as controller } from "@ember/controller";
import { inject as service } from "@ember/service"; import { setOwner } from "@ember/owner";
import { service } from "@ember/service";
import { BookmarkFormData } from "discourse/lib/bookmark-form-data"; import { BookmarkFormData } from "discourse/lib/bookmark-form-data";
import Bookmark from "discourse/models/bookmark"; import Bookmark from "discourse/models/bookmark";

View File

@ -1,6 +1,6 @@
/* eslint-disable ember/no-private-routing-service */ /* eslint-disable ember/no-private-routing-service */
import { setOwner } from "@ember/application";
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import { setOwner } from "@ember/owner";
import { next, schedule } from "@ember/runloop"; import { next, schedule } from "@ember/runloop";
import { isEmpty } from "@ember/utils"; import { isEmpty } from "@ember/utils";
import $ from "jquery"; import $ from "jquery";

View File

@ -1,4 +1,4 @@
import { setOwner } from "@ember/application"; import { setOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { until } from "discourse/lib/formatter"; import { until } from "discourse/lib/formatter";
import { emojiUnescape } from "discourse/lib/text"; import { emojiUnescape } from "discourse/lib/text";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
export async function waitForClosedKeyboard(context) { export async function waitForClosedKeyboard(context) {
if (!window.visualViewport) { if (!window.visualViewport) {

View File

@ -1,7 +1,7 @@
import { getOwner } from "@ember/application";
import { warn } from "@ember/debug"; import { warn } from "@ember/debug";
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import Mixin from "@ember/object/mixin"; import Mixin from "@ember/object/mixin";
import { getOwner } from "@ember/owner";
import { run } from "@ember/runloop"; import { run } from "@ember/runloop";
import { service } from "@ember/service"; import { service } from "@ember/service";
import Uppy from "@uppy/core"; import Uppy from "@uppy/core";

View File

@ -1,7 +1,7 @@
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { setOwner } from "@ember/application";
import { warn } from "@ember/debug"; import { warn } from "@ember/debug";
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import { setOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import Uppy from "@uppy/core"; import Uppy from "@uppy/core";
import { isVideo } from "discourse/lib/uploads"; import { isVideo } from "discourse/lib/uploads";

View File

@ -1,8 +1,8 @@
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { getOwner, setOwner } from "@ember/application";
import { warn } from "@ember/debug"; import { warn } from "@ember/debug";
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import { equal } from "@ember/object/computed"; import { equal } from "@ember/object/computed";
import { getOwner, setOwner } from "@ember/owner";
import { Promise } from "rsvp"; import { Promise } from "rsvp";
import { getOwnerWithFallback } from "discourse-common/lib/get-owner"; import { getOwnerWithFallback } from "discourse-common/lib/get-owner";

View File

@ -1,10 +1,10 @@
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { getOwner, setOwner } from "@ember/application";
import { A } from "@ember/array"; import { A } from "@ember/array";
import EmberObject, { computed, get, getProperties } from "@ember/object"; import EmberObject, { computed, get, getProperties } from "@ember/object";
import { dependentKeyCompat } from "@ember/object/compat"; import { dependentKeyCompat } from "@ember/object/compat";
import { alias, equal, filterBy, gt, mapBy, or } from "@ember/object/computed"; import { alias, equal, filterBy, gt, mapBy, or } from "@ember/object/computed";
import Evented from "@ember/object/evented"; import Evented from "@ember/object/evented";
import { getOwner, setOwner } from "@ember/owner";
import { cancel } from "@ember/runloop"; import { cancel } from "@ember/runloop";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { camelize } from "@ember/string"; import { camelize } from "@ember/string";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { service } from "@ember/service"; import { service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse"; import DiscourseRoute from "discourse/routes/discourse";

View File

@ -1,4 +1,4 @@
import Service, { inject as service } from "@ember/service"; import Service, { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error"; import { popupAjaxError } from "discourse/lib/ajax-error";
import Bookmark from "discourse/models/bookmark"; import Bookmark from "discourse/models/bookmark";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import Service, { service } from "@ember/service"; import Service, { service } from "@ember/service";
import $ from "jquery"; import $ from "jquery";
import { getAndClearUnhandledThemeErrors } from "discourse/app"; import { getAndClearUnhandledThemeErrors } from "discourse/app";

View File

@ -1,4 +1,4 @@
import Service, { inject as service } from "@ember/service"; import Service, { service } from "@ember/service";
export default class RestrictedRouting extends Service { export default class RestrictedRouting extends Service {
@service currentUser; @service currentUser;

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { scheduleOnce } from "@ember/runloop"; import { scheduleOnce } from "@ember/runloop";
export default class ComponentConnector { export default class ComponentConnector {

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { next } from "@ember/runloop"; import { next } from "@ember/runloop";
export default class Connector { export default class Connector {

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { Promise } from "rsvp"; import { Promise } from "rsvp";
import { h } from "virtual-dom"; import { h } from "virtual-dom";

View File

@ -1,5 +1,5 @@
import { getOwner, setOwner } from "@ember/application";
import { get } from "@ember/object"; import { get } from "@ember/object";
import { getOwner, setOwner } from "@ember/owner";
import { camelize } from "@ember/string"; import { camelize } from "@ember/string";
import { Promise } from "rsvp"; import { Promise } from "rsvp";
import { h } from "virtual-dom"; import { h } from "virtual-dom";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { visit } from "@ember/test-helpers"; import { visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import Sinon from "sinon"; import Sinon from "sinon";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, fillIn, settled, visit } from "@ember/test-helpers"; import { click, fillIn, settled, visit } from "@ember/test-helpers";
import { skip, test } from "qunit"; import { skip, test } from "qunit";
import { Promise } from "rsvp"; import { Promise } from "rsvp";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { visit } from "@ember/test-helpers"; import { visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import Site from "discourse/models/site"; import Site from "discourse/models/site";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, settled, visit } from "@ember/test-helpers"; import { click, settled, visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { setDefaultHomepage } from "discourse/lib/utilities"; import { setDefaultHomepage } from "discourse/lib/utilities";

View File

@ -1,4 +1,4 @@
import { getOwner, setOwner } from "@ember/application"; import { getOwner, setOwner } from "@ember/owner";
import Service, { service } from "@ember/service"; import Service, { service } from "@ember/service";
import { test } from "qunit"; import { test } from "qunit";
import RestModel from "discourse/models/rest"; import RestModel from "discourse/models/rest";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { import {
currentRouteName, currentRouteName,
getSettledState, getSettledState,

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { getOwner } from "@ember/application";
import { on } from "@ember/modifier"; import { on } from "@ember/modifier";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { getOwner } from "@ember/owner";
import { click, settled, triggerKeyEvent, visit } from "@ember/test-helpers"; import { click, settled, triggerKeyEvent, visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import DModal, { import DModal, {

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, currentURL, visit } from "@ember/test-helpers"; import { click, currentURL, visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import NotificationFixtures from "discourse/tests/fixtures/notification-fixtures"; import NotificationFixtures from "discourse/tests/fixtures/notification-fixtures";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, visit } from "@ember/test-helpers"; import { click, visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, currentURL, visit } from "@ember/test-helpers"; import { click, currentURL, visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import sinon from "sinon"; import sinon from "sinon";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, render } from "@ember/test-helpers"; import { click, render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { import {
click, click,
find, find,

View File

@ -1,5 +1,5 @@
import { getOwner } from "@ember/application";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { getOwner } from "@ember/owner";
import { render, triggerEvent } from "@ember/test-helpers"; import { render, triggerEvent } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test"; import { setupRenderingTest } from "discourse/tests/helpers/component-test";

View File

@ -2,7 +2,7 @@ import { click, render } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import Form from "discourse/components/form"; import Form from "discourse/components/form";
import { setupRenderingTest } from "discourse/tests/helpers/component-test"; import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import I18n from "I18n"; import I18n from "discourse-i18n";
module("Integration | Component | FormKit | Layout | Submit", function (hooks) { module("Integration | Component | FormKit | Layout | Submit", function (hooks) {
setupRenderingTest(hooks); setupRenderingTest(hooks);

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import HomeLogo from "discourse/components/header/home-logo"; import HomeLogo from "discourse/components/header/home-logo";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, render } from "@ember/test-helpers"; import { click, render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import LigthDarkImg from "discourse/components/light-dark-img"; import LigthDarkImg from "discourse/components/light-dark-img";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, fillIn, render } from "@ember/test-helpers"; import { click, fillIn, render } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import ReorderCategories from "discourse/components/modal/reorder-categories"; import ReorderCategories from "discourse/components/modal/reorder-categories";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, fillIn, render } from "@ember/test-helpers"; import { click, fillIn, render } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import RequestGroupMembershipForm from "discourse/components/modal/request-group-membership-form"; import RequestGroupMembershipForm from "discourse/components/modal/request-group-membership-form";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, render } from "@ember/test-helpers"; import { click, render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,5 +1,5 @@
// deprecated in favor of discourse/tests/integration/components/home-logo-test.gjs // deprecated in favor of discourse/tests/integration/components/home-logo-test.gjs
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import MountWidget from "discourse/components/mount-widget"; import MountWidget from "discourse/components/mount-widget";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render } from "@ember/test-helpers"; import { render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,5 +1,5 @@
import { getOwner } from "@ember/application";
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import { getOwner } from "@ember/owner";
import { click, render, triggerEvent } from "@ember/test-helpers"; import { click, render, triggerEvent } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { click, render } from "@ember/test-helpers"; import { click, render } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking"; import { tracked } from "@glimmer/tracking";
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { render, settled } from "@ember/test-helpers"; import { render, settled } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import RenderGlimmerContainer from "discourse/components/render-glimmer-container"; import RenderGlimmerContainer from "discourse/components/render-glimmer-container";

View File

@ -3,7 +3,7 @@ import Application from "../app";
import "./loader-shims"; import "./loader-shims";
/* eslint-enable simple-import-sort/imports */ /* eslint-enable simple-import-sort/imports */
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { import {
getSettledState, getSettledState,
isSettled, isSettled,

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { settled } from "@ember/test-helpers"; import { settled } from "@ember/test-helpers";
import { setupTest } from "ember-qunit"; import { setupTest } from "ember-qunit";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,5 +1,5 @@
import { getOwner } from "@ember/application";
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import { getOwner } from "@ember/owner";
import { next } from "@ember/runloop"; import { next } from "@ember/runloop";
import { settled } from "@ember/test-helpers"; import { settled } from "@ember/test-helpers";
import { setupTest } from "ember-qunit"; import { setupTest } from "ember-qunit";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { setupTest } from "ember-qunit"; import { setupTest } from "ember-qunit";
import { module, test } from "qunit"; import { module, test } from "qunit";
import { buildQuote } from "discourse/lib/quote"; import { buildQuote } from "discourse/lib/quote";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { setupTest } from "ember-qunit"; import { setupTest } from "ember-qunit";
import $ from "jquery"; import $ from "jquery";
import { module, test } from "qunit"; import { module, test } from "qunit";

View File

@ -1,5 +1,5 @@
import { getOwner } from "@ember/application";
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import { getOwner } from "@ember/owner";
import { setupTest } from "ember-qunit"; import { setupTest } from "ember-qunit";
import { module, test } from "qunit"; import { module, test } from "qunit";
import sinon from "sinon"; import sinon from "sinon";

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { setupTest } from "ember-qunit"; import { setupTest } from "ember-qunit";
import { emojiSearch } from "pretty-text/emoji"; import { emojiSearch } from "pretty-text/emoji";
import { IMAGE_VERSION as v } from "pretty-text/emoji/version"; import { IMAGE_VERSION as v } from "pretty-text/emoji/version";

View File

@ -1,7 +1,7 @@
import { setupTest } from "ember-qunit"; import { setupTest } from "ember-qunit";
import { module, test } from "qunit"; import { module, test } from "qunit";
import Validator from "discourse/form-kit/lib/validator"; import Validator from "discourse/form-kit/lib/validator";
import I18n from "I18n"; import I18n from "discourse-i18n";
module("Unit | Lib | FormKit | Validator", function (hooks) { module("Unit | Lib | FormKit | Validator", function (hooks) {
setupTest(hooks); setupTest(hooks);

View File

@ -1,4 +1,4 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/owner";
import { setupTest } from "ember-qunit"; import { setupTest } from "ember-qunit";
import { module, test } from "qunit"; import { module, test } from "qunit";
import { import {

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