mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: Set resolver options on the legacy resolver (#17440)
This commit is contained in:
parent
e15c63027f
commit
6c3e262a7c
@ -1,5 +1,6 @@
|
|||||||
import Mobile from "discourse/lib/mobile";
|
import Mobile from "discourse/lib/mobile";
|
||||||
import { setResolverOption } from "discourse-common/resolver";
|
import { setResolverOption } from "discourse-common/resolver";
|
||||||
|
import { setResolverOption as setLegacyResolverOption } from "discourse-common/lib/legacy-resolver";
|
||||||
|
|
||||||
// Initializes the `Mobile` helper object.
|
// Initializes the `Mobile` helper object.
|
||||||
export default {
|
export default {
|
||||||
@ -14,5 +15,6 @@ export default {
|
|||||||
site.set("isMobileDevice", Mobile.isMobileDevice);
|
site.set("isMobileDevice", Mobile.isMobileDevice);
|
||||||
|
|
||||||
setResolverOption("mobileView", Mobile.mobileView);
|
setResolverOption("mobileView", Mobile.mobileView);
|
||||||
|
setLegacyResolverOption("mobileView", Mobile.mobileView);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,6 @@ import { autoLoadModules } from "discourse/initializers/auto-load-modules";
|
|||||||
import QUnit, { test } from "qunit";
|
import QUnit, { test } from "qunit";
|
||||||
import { setupRenderingTest as emberSetupRenderingTest } from "ember-qunit";
|
import { setupRenderingTest as emberSetupRenderingTest } from "ember-qunit";
|
||||||
import { currentSettings } from "discourse/tests/helpers/site-settings";
|
import { currentSettings } from "discourse/tests/helpers/site-settings";
|
||||||
import { clearResolverOptions } from "discourse-common/resolver";
|
|
||||||
import { testCleanup } from "discourse/tests/helpers/qunit-helpers";
|
import { testCleanup } from "discourse/tests/helpers/qunit-helpers";
|
||||||
|
|
||||||
export function setupRenderingTest(hooks) {
|
export function setupRenderingTest(hooks) {
|
||||||
@ -22,7 +21,6 @@ export function setupRenderingTest(hooks) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.container = this.owner;
|
this.container = this.owner;
|
||||||
clearResolverOptions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.site = Site.current();
|
this.site = Site.current();
|
||||||
|
@ -47,6 +47,7 @@ import sinon from "sinon";
|
|||||||
import siteFixtures from "discourse/tests/fixtures/site-fixtures";
|
import siteFixtures from "discourse/tests/fixtures/site-fixtures";
|
||||||
import { clearExtraKeyboardShortcutHelp } from "discourse/lib/keyboard-shortcuts";
|
import { clearExtraKeyboardShortcutHelp } from "discourse/lib/keyboard-shortcuts";
|
||||||
import { clearResolverOptions } from "discourse-common/resolver";
|
import { clearResolverOptions } from "discourse-common/resolver";
|
||||||
|
import { clearResolverOptions as clearLegacyResolverOptions } from "discourse-common/lib/legacy-resolver";
|
||||||
import { clearNavItems } from "discourse/models/nav-item";
|
import { clearNavItems } from "discourse/models/nav-item";
|
||||||
import {
|
import {
|
||||||
cleanUpComposerUploadHandler,
|
cleanUpComposerUploadHandler,
|
||||||
@ -192,6 +193,8 @@ export function testCleanup(container, app) {
|
|||||||
clearTagDecorateCallbacks();
|
clearTagDecorateCallbacks();
|
||||||
clearBlockDecorateCallbacks();
|
clearBlockDecorateCallbacks();
|
||||||
clearTextDecorateCallbacks();
|
clearTextDecorateCallbacks();
|
||||||
|
clearResolverOptions();
|
||||||
|
clearLegacyResolverOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function discourseModule(name, options) {
|
export function discourseModule(name, options) {
|
||||||
@ -207,8 +210,8 @@ export function discourseModule(name, options) {
|
|||||||
this.registry = this.container.registry;
|
this.registry = this.container.registry;
|
||||||
this.owner = this.container;
|
this.owner = this.container;
|
||||||
this.siteSettings = currentSettings();
|
this.siteSettings = currentSettings();
|
||||||
clearResolverOptions();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
hooks.afterEach(() => testCleanup(this.container));
|
hooks.afterEach(() => testCleanup(this.container));
|
||||||
|
|
||||||
this.getController = function (controllerName, properties) {
|
this.getController = function (controllerName, properties) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user