2019-10-24 00:30:52 +08:00
|
|
|
import Component from "@ember/component";
|
2019-10-31 04:28:29 +08:00
|
|
|
import { alias } from "@ember/object/computed";
|
2019-11-08 05:38:28 +08:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2018-08-02 06:40:59 +08:00
|
|
|
|
2019-10-24 00:30:52 +08:00
|
|
|
export default Component.extend({
|
2018-08-02 06:40:59 +08:00
|
|
|
tagName: "td",
|
|
|
|
classNames: ["admin-report-table-cell"],
|
|
|
|
classNameBindings: ["type", "property"],
|
2021-11-30 19:58:42 +08:00
|
|
|
attributeBindings: ["value:title"],
|
2018-08-02 06:40:59 +08:00
|
|
|
options: null,
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("label", "data", "options")
|
2018-08-02 06:40:59 +08:00
|
|
|
computedLabel(label, data, options) {
|
|
|
|
return label.compute(data, options || {});
|
|
|
|
},
|
|
|
|
|
2019-10-31 04:28:29 +08:00
|
|
|
type: alias("label.type"),
|
|
|
|
property: alias("label.mainProperty"),
|
2022-06-21 02:02:05 +08:00
|
|
|
formattedValue: alias("computedLabel.formattedValue"),
|
2019-10-31 04:28:29 +08:00
|
|
|
value: alias("computedLabel.value"),
|
2018-08-02 06:40:59 +08:00
|
|
|
});
|