DEV: Move Discourse.getURL and related functions to a module (#9966)

* DEV: Move `Discourse.getURL` and related functions to a module

* DEV: Remove `Discourse.getURL` and `Discourse.getURLWithCDN`

* FIX: `get-url` is required for server side code

* DEV: Deprecate `BaseUri` too.
This commit is contained in:
Robin Ward
2020-06-03 12:45:26 -04:00
committed by GitHub
parent d27b877a40
commit ba00cc8ec4
90 changed files with 401 additions and 260 deletions
+4 -3
View File
@@ -1,4 +1,5 @@
import { moduleForWidget, widgetTest } from "helpers/widget-test";
import { setPrefix } from "discourse-common/lib/get-url";
moduleForWidget("home-logo");
@@ -101,7 +102,7 @@ widgetTest("mobile without logo", {
widgetTest("basics, subfolder", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
Discourse.BaseUri = "/forum";
setPrefix("/forum");
this.siteSettings.site_logo_url = bigLogo;
this.siteSettings.site_logo_small_url = smallLogo;
this.siteSettings.title = title;
@@ -118,7 +119,7 @@ widgetTest("basics, subfolder", {
widgetTest("basics, subfolder - minimized", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
Discourse.BaseUri = "/forum";
setPrefix("/forum");
this.siteSettings.site_logo_url = bigLogo;
this.siteSettings.site_logo_small_url = smallLogo;
this.siteSettings.title = title;
@@ -135,7 +136,7 @@ widgetTest("basics, subfolder - minimized", {
widgetTest("mobile logo, subfolder", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
Discourse.BaseUri = "/forum";
setPrefix("/forum");
this.siteSettings.site_mobile_logo_url = mobileLogo;
this.siteSettings.site_logo_small_url = smallLogo;
this.site.mobileView = true;