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