DEV: Remove 'htmlSafe' string prototype extensions (#344)

Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
This commit is contained in:
Isaac Janzen 2022-06-01 11:08:26 -05:00 committed by GitHub
parent 0d2a02a0db
commit 201f115387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -8,6 +8,7 @@ import { action } from "@ember/object";
import getURL from "discourse-common/lib/get-url"; import getURL from "discourse-common/lib/get-url";
import { iconHTML } from "discourse-common/lib/icon-library"; import { iconHTML } from "discourse-common/lib/icon-library";
import I18n from "I18n"; import I18n from "I18n";
import { htmlSafe } from "@ember/template";
export default UserTopicsList.extend({ export default UserTopicsList.extend({
user: controller(), user: controller(),
@ -29,10 +30,12 @@ export default UserTopicsList.extend({
@discourseComputed @discourseComputed
emptyStateBody() { emptyStateBody() {
return I18n.t("user.no_assignments_body", { return htmlSafe(
preferencesUrl: getURL("/my/preferences/notifications"), I18n.t("user.no_assignments_body", {
icon: iconHTML("user-plus"), preferencesUrl: getURL("/my/preferences/notifications"),
}).htmlSafe(); icon: iconHTML("user-plus"),
})
);
}, },
refreshModel() { refreshModel() {

View File

@ -9,6 +9,7 @@ import getURL from "discourse-common/lib/get-url";
import { postUrl } from "discourse/lib/utilities"; import { postUrl } from "discourse/lib/utilities";
import { h } from "virtual-dom"; import { h } from "virtual-dom";
import I18n from "I18n"; import I18n from "I18n";
import { htmlSafe } from "@ember/template";
const ICON = "user-plus"; const ICON = "user-plus";
const GROUP_ICON = "group-plus"; const GROUP_ICON = "group-plus";
@ -22,10 +23,12 @@ createWidget("no-quick-access-assignments", {
new RawHtml({ new RawHtml({
html: html:
"<p>" + "<p>" +
I18n.t("user.no_assignments_body", { htmlSafe(
preferencesUrl: getURL("/my/preferences/notifications"), I18n.t("user.no_assignments_body", {
icon: iconHTML(ICON), preferencesUrl: getURL("/my/preferences/notifications"),
}).htmlSafe() + icon: iconHTML(ICON),
})
) +
"</p>", "</p>",
}) })
), ),