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

Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
This commit is contained in:
Isaac Janzen
2022-05-13 14:58:26 -05:00
committed by GitHub
parent 9eadabe9fc
commit 85ceafb4dc
33 changed files with 179 additions and 110 deletions
@@ -2,15 +2,18 @@ import SelectedNameComponent from "select-kit/components/selected-name";
import { categoryBadgeHTML } from "discourse/helpers/category-link";
import { computed } from "@ember/object";
import layout from "select-kit/templates/components/multi-select/selected-category";
import { htmlSafe } from "@ember/template";
export default SelectedNameComponent.extend({
classNames: ["selected-category"],
layout,
badge: computed("item", function () {
return categoryBadgeHTML(this.item, {
allowUncategorized: true,
link: false,
}).htmlSafe();
return htmlSafe(
categoryBadgeHTML(this.item, {
allowUncategorized: true,
link: false,
})
);
}),
});
@@ -1,11 +1,14 @@
import SelectedNameComponent from "select-kit/components/selected-name";
import discourseComputed from "discourse-common/utils/decorators";
import { htmlSafe } from "@ember/template";
export default SelectedNameComponent.extend({
classNames: ["select-kit-selected-color"],
@discourseComputed("name")
footerContent(name) {
return `<span class="color-preview" style="background:#${name}"></span>`.htmlSafe();
return htmlSafe(
`<span class="color-preview" style="background:#${name}"></span>`
);
},
});