mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: Convert admin component definitions to native class syntax (#20311)
This conversion was achieved using the ember-native-class-codemod, plus a handful of manual fixes/tweaks
This commit is contained in:
@ -1,21 +1,27 @@
|
||||
import Component from "@ember/component";
|
||||
import {
|
||||
attributeBindings,
|
||||
classNameBindings,
|
||||
classNames,
|
||||
tagName,
|
||||
} from "@ember-decorators/component";
|
||||
import { alias } from "@ember/object/computed";
|
||||
import Component from "@ember/component";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
|
||||
export default Component.extend({
|
||||
tagName: "td",
|
||||
classNames: ["admin-report-table-cell"],
|
||||
classNameBindings: ["type", "property"],
|
||||
attributeBindings: ["value:title"],
|
||||
options: null,
|
||||
@tagName("td")
|
||||
@classNames("admin-report-table-cell")
|
||||
@classNameBindings("type", "property")
|
||||
@attributeBindings("value:title")
|
||||
export default class AdminReportTableCell extends Component {
|
||||
options = null;
|
||||
|
||||
@alias("label.type") type;
|
||||
@alias("label.mainProperty") property;
|
||||
@alias("computedLabel.formattedValue") formattedValue;
|
||||
@alias("computedLabel.value") value;
|
||||
|
||||
@discourseComputed("label", "data", "options")
|
||||
computedLabel(label, data, options) {
|
||||
return label.compute(data, options || {});
|
||||
},
|
||||
|
||||
type: alias("label.type"),
|
||||
property: alias("label.mainProperty"),
|
||||
formattedValue: alias("computedLabel.formattedValue"),
|
||||
value: alias("computedLabel.value"),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user