mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 19:25:41 +08:00

`discourse-common` was created in the past to share logic between the 'wizard' app and the main 'discourse' app. Since then, the wizard has been consolidated into the main app, so the separation of `discourse-common` is no longer useful. This commit moves `discourse-common/(lib|utils)/*` into `discourse/lib/*`, adds shims for the imports, and updates existing uses in core.
25 lines
781 B
JavaScript
25 lines
781 B
JavaScript
import Component from "@ember/component";
|
|
import {
|
|
attributeBindings,
|
|
classNameBindings,
|
|
classNames,
|
|
tagName,
|
|
} from "@ember-decorators/component";
|
|
import discourseComputed from "discourse/lib/decorators";
|
|
|
|
@tagName("th")
|
|
@classNames("admin-report-table-header")
|
|
@classNameBindings("label.mainProperty", "label.type", "isCurrentSort")
|
|
@attributeBindings("label.title:title")
|
|
export default class AdminReportTableHeader extends Component {
|
|
@discourseComputed("currentSortLabel.sortProperty", "label.sortProperty")
|
|
isCurrentSort(currentSortField, labelSortField) {
|
|
return currentSortField === labelSortField;
|
|
}
|
|
|
|
@discourseComputed("currentSortDirection")
|
|
sortIcon(currentSortDirection) {
|
|
return currentSortDirection === 1 ? "caret-up" : "caret-down";
|
|
}
|
|
}
|