mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 03:10:46 -06:00
DEV: Remove 'htmlSafe' string prototype extensions (#16828)
Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
This commit is contained in:
parent
85ceafb4dc
commit
4e622c9fd8
@ -10,6 +10,7 @@ import deprecated from "discourse-common/lib/deprecated";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
|
||||
const Site = RestModel.extend({
|
||||
isReadOnly: alias("is_readonly"),
|
||||
@ -48,7 +49,7 @@ const Site = RestModel.extend({
|
||||
if (!isEmpty(siteFields)) {
|
||||
return siteFields.map((f) => {
|
||||
let value = fields ? fields[f.id.toString()] : null;
|
||||
value = value || "—".htmlSafe();
|
||||
value = value || htmlSafe("—");
|
||||
return { name: f.name, value };
|
||||
});
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import { isEmpty } from "@ember/utils";
|
||||
import { longDate } from "discourse/lib/formatter";
|
||||
import { url } from "discourse/lib/computed";
|
||||
import { userPath } from "discourse/lib/url";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
|
||||
export const SECOND_FACTOR_METHODS = {
|
||||
TOTP: 1,
|
||||
@ -176,9 +177,9 @@ const User = RestModel.extend({
|
||||
@discourseComputed("profile_background_upload_url")
|
||||
profileBackgroundUrl(bgUrl) {
|
||||
if (isEmpty(bgUrl) || !this.siteSettings.allow_profile_backgrounds) {
|
||||
return "".htmlSafe();
|
||||
return htmlSafe("");
|
||||
}
|
||||
return ("background-image: url(" + getURLWithCDN(bgUrl) + ")").htmlSafe();
|
||||
return htmlSafe("background-image: url(" + getURLWithCDN(bgUrl) + ")");
|
||||
},
|
||||
|
||||
@discourseComputed()
|
||||
|
@ -5,6 +5,7 @@ import { findOrResetCachedTopicList } from "discourse/lib/cached-topic-list";
|
||||
import { action } from "@ember/object";
|
||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
|
||||
export const NEW_FILTER = "new";
|
||||
export const UNREAD_FILTER = "unread";
|
||||
@ -85,10 +86,12 @@ export default (inboxType, path, filter) => {
|
||||
|
||||
emptyState() {
|
||||
const title = I18n.t("user.no_messages_title");
|
||||
const body = I18n.t("user.no_messages_body", {
|
||||
aboutUrl: getURL("/about"),
|
||||
icon: iconHTML("envelope"),
|
||||
}).htmlSafe();
|
||||
const body = htmlSafe(
|
||||
I18n.t("user.no_messages_body", {
|
||||
aboutUrl: getURL("/about"),
|
||||
icon: iconHTML("envelope"),
|
||||
})
|
||||
);
|
||||
return { title, body };
|
||||
},
|
||||
|
||||
|
@ -2,18 +2,21 @@ import UserActivityStreamRoute from "discourse/routes/user-activity-stream";
|
||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import I18n from "I18n";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
|
||||
export default UserActivityStreamRoute.extend({
|
||||
userActionType: null,
|
||||
|
||||
emptyState() {
|
||||
const title = I18n.t("user_activity.no_activity_title");
|
||||
const body = I18n.t("user_activity.no_activity_body", {
|
||||
topUrl: getURL("/top"),
|
||||
categoriesUrl: getURL("/categories"),
|
||||
preferencesUrl: getURL("/my/preferences"),
|
||||
heartIcon: iconHTML("heart"),
|
||||
}).htmlSafe();
|
||||
const body = htmlSafe(
|
||||
I18n.t("user_activity.no_activity_body", {
|
||||
topUrl: getURL("/top"),
|
||||
categoriesUrl: getURL("/categories"),
|
||||
preferencesUrl: getURL("/my/preferences"),
|
||||
heartIcon: iconHTML("heart"),
|
||||
})
|
||||
);
|
||||
|
||||
return { title, body };
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user