Skip to content

A platform for community discussion. Free, open, simple.

FIX: Style sortable headers consistently in Data Explorer (#45105)

David Battersbyd3f55c4eb8f7
diff --git a/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/index.gjs b/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/index.gjs
index cbc942cacfa..597c26ffcb2 100644
--- a/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/index.gjs
+++ b/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/index.gjs
@@ -82,7 +82,7 @@ export default <template>
@order={{@controller.sortByProperty}}
/>
</th>
- <th class="d-table__header-cell">
+ <th class="d-table__header-cell query-created-by">
<DTableHeaderToggle
@asc={{not @controller.sortDescending}}
@automatic={{true}}
@@ -92,10 +92,10 @@ export default <template>
@order={{@controller.sortByProperty}}
/>
</th>
- <th class="d-table__header-cell">
+ <th class="d-table__header-cell query-group-names">
{{i18n "explorer.query_groups"}}
</th>
- <th class="d-table__header-cell">
+ <th class="d-table__header-cell query-created-at">
<DTableHeaderToggle
@asc={{not @controller.sortDescending}}
@automatic={{true}}
@@ -105,6 +105,7 @@ export default <template>
@order={{@controller.sortByProperty}}
/>
</th>
+ <th class="d-table__header-cell"></th>
</tr>
</thead>
<tbody class="d-table__body">
diff --git a/plugins/discourse-data-explorer/assets/stylesheets/explorer.scss b/plugins/discourse-data-explorer/assets/stylesheets/explorer.scss
index 91c4faccd87..c25779fa31c 100644
--- a/plugins/discourse-data-explorer/assets/stylesheets/explorer.scss
+++ b/plugins/discourse-data-explorer/assets/stylesheets/explorer.scss
@@ -800,6 +800,32 @@ table.group-reports {
}
.recent-queries {
+ .d-table__header-cell {
+ // DTableHeaderToggle carries directory-table header styles that don't suit d-table
+ .directory-table__column-header.sortable {
+ display: inline-flex;
+ justify-content: flex-start;
+ padding: 0;
+ border-bottom: none;
+ color: inherit;
+
+ &:hover,
+ &:focus {
+ background-color: transparent;
+ }
+
+ .header-contents {
+ text-align: left;
+ }
+ }
+
+ &.query-created-by,
+ &.query-group-names,
+ &.query-created-at {
+ width: 12.5%;
+ }
+ }
+
.d-table__row.query-row {
.d-table__overview-link {
@include viewport.until(md) {