mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
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:
@ -8,6 +8,7 @@ import AdminDashboard from "admin/models/admin-dashboard";
|
||||
import Report from "admin/models/report";
|
||||
import PeriodComputationMixin from "admin/mixins/period-computation";
|
||||
import { computed } from "@ember/object";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
|
||||
function staticReport(reportType) {
|
||||
return computed("reports.[]", function() {
|
||||
@ -20,7 +21,6 @@ export default Controller.extend(PeriodComputationMixin, {
|
||||
dashboardFetchedAt: null,
|
||||
exceptionController: inject("exception"),
|
||||
logSearchQueriesEnabled: setting("log_search_queries"),
|
||||
basePath: Discourse.BaseUri,
|
||||
|
||||
@discourseComputed("siteSettings.dashboard_general_tab_activity_metrics")
|
||||
activityMetrics(metrics) {
|
||||
@ -107,7 +107,7 @@ export default Controller.extend(PeriodComputationMixin, {
|
||||
@discourseComputed
|
||||
trendingSearchDisabledLabel() {
|
||||
return I18n.t("admin.dashboard.reports.trending_search.disabled", {
|
||||
basePath: Discourse.BaseUri
|
||||
basePath: getURL("/")
|
||||
});
|
||||
},
|
||||
|
||||
@ -150,6 +150,6 @@ export default Controller.extend(PeriodComputationMixin, {
|
||||
},
|
||||
|
||||
_reportsForPeriodURL(period) {
|
||||
return Discourse.getURL(`/admin?period=${period}`);
|
||||
return getURL(`/admin?period=${period}`);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user