DEV: Convert helpers to native class syntax (#27279)

This commit is contained in:
David Taylor 2024-05-31 14:40:52 +01:00 committed by GitHub
parent c0abae054d
commit 0a9be3bfd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 11 deletions

View File

@ -45,14 +45,13 @@ function routeAction(actionName, router, ...params) {
}; };
} }
export default Helper.extend({ export default class RouteAction extends Helper {
router: computed({ @computed
get() { get router() {
return getOwner(this).lookup("router:main"); return getOwner(this).lookup("router:main");
}, }
}),
compute([actionName, ...params]) { compute([actionName, ...params]) {
return routeAction(actionName, get(this, "router"), ...params); return routeAction(actionName, get(this, "router"), ...params);
}, }
}); }

View File

@ -1,6 +1,6 @@
import ArrayProxy from "@ember/array/proxy"; import ArrayProxy from "@ember/array/proxy";
export default ArrayProxy.extend({ class TopicStatusIconArrayProxy extends ArrayProxy {
render(topic, renderIcon) { render(topic, renderIcon) {
const renderIconIf = (conditionProp, name, key) => { const renderIconIf = (conditionProp, name, key) => {
if (!topic.get(conditionProp)) { if (!topic.get(conditionProp)) {
@ -17,8 +17,10 @@ export default ArrayProxy.extend({
} }
this.forEach((args) => renderIconIf(...args)); this.forEach((args) => renderIconIf(...args));
}, }
}).create({ }
export default TopicStatusIconArrayProxy.create({
content: [ content: [
["is_warning", "envelope", "warning"], ["is_warning", "envelope", "warning"],
["pinned", "thumbtack", "pinned"], ["pinned", "thumbtack", "pinned"],