A platform for community discussion. Free, open, simple.
UX: Align Data Explorer queries list with admin UI guidelines (#44950)
David Battersby21df76489024
diff --git a/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/edit.gjs b/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/edit.gjsindex 127cb3f002d..0bcf6477f0c 100644--- a/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/edit.gjs+++ b/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/edit.gjs@@ -43,7 +43,7 @@ export default class QueriesEdit extends Component {<div class="admin-detail"><div class="query-edit__top-bar"><BackButton- @label="explorer.queries"+ @label="explorer.back_to_queries"@route="adminPlugins.show.explorer.index"/>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.gjsindex 52897ddf68a..a42d29536af 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@@ -12,7 +12,6 @@ import DTableHeaderToggle from "discourse/ui-kit/d-table-header-toggle";import DUserLink from "discourse/ui-kit/d-user-link";import dAgeWithTooltip from "discourse/ui-kit/helpers/d-age-with-tooltip";import dAvatar from "discourse/ui-kit/helpers/d-avatar";-import dIcon from "discourse/ui-kit/helpers/d-icon";import { i18n } from "discourse-i18n";import ShareReport from "discourse/plugins/discourse-data-explorer/discourse/components/share-report";@@ -48,15 +47,6 @@ export default <template>@onResetFilters={{@controller.onResetFilters}}@onTextFilterChange={{@controller.onTextFilterChange}}>- <:aboveFilters>- {{#if @controller.othersDirty}}- <div class="warning">- {{dIcon "triangle-exclamation"}}- {{i18n "explorer.others_dirty"}}- </div>- {{/if}}- </:aboveFilters>-<:additionalFilters><DMultiSelectclass="query-tag-filter"@@ -77,65 +67,44 @@ export default <template><DLoadMore @action={{@controller.loadMore}}><div class="container discourse-data-explorer-query-list"><table class="d-table recent-queries">- <thead class="d-table__header heading-container">- <th class="col heading name">- <div- class="heading-toggle"- role="button"- {{on "click" (fn @controller.updateSortProperty "name")}}- >+ <thead class="d-table__header">+ <tr class="d-table__row">+ <th class="d-table__header-cell"><DTableHeaderToggle@asc={{not @controller.sortDescending}}- @automatic="true"+ @automatic={{true}}@field="name"@labelKey="explorer.query_name"- @order={{@controller.order}}+ @onToggle={{@controller.updateSortProperty}}+ @order={{@controller.sortByProperty}}/>- </div>- </th>- <th class="col heading created-by">- <div- class="heading-toggle"- role="button"- {{on- "click"- (fn @controller.updateSortProperty "username")- }}- >+ </th>+ <th class="d-table__header-cell"><DTableHeaderToggle@asc={{not @controller.sortDescending}}- @automatic="true"+ @automatic={{true}}@field="username"@labelKey="explorer.query_user"- @order={{@controller.order}}+ @onToggle={{@controller.updateSortProperty}}+ @order={{@controller.sortByProperty}}/>- </div>- </th>- <th class="col heading group-names">- <div class="group-names-header">+ </th>+ <th class="d-table__header-cell">{{i18n "explorer.query_groups"}}- </div>- </th>- <th class="col heading created-at">- <div- class="heading-toggle"- role="button"- {{on- "click"- (fn @controller.updateSortProperty "last_run_at")- }}- >+ </th>+ <th class="d-table__header-cell"><DTableHeaderToggle@asc={{not @controller.sortDescending}}- @automatic="true"+ @automatic={{true}}@field="last_run_at"@labelKey="explorer.query_time"- @order={{@controller.order}}+ @onToggle={{@controller.updateSortProperty}}+ @order={{@controller.sortByProperty}}/>- </div>- </th>+ </th>+ </tr></thead>- <tbody>+ <tbody class="d-table__body">{{#each filteredQueries as |query|}}<tr class="d-table__row query-row"><td class="d-table__cell --overview">@@ -215,7 +184,7 @@ export default <template>-{{/if}}</td>- <td class="d-table__cell-controls">+ <td class="d-table__cell --controls"><div class="d-table__cell-actions"><LinkToclass="btn btn-text btn-default btn-small"@@ -230,14 +199,8 @@ export default <template>{{/if}}</LinkTo></div>-</td></tr>- {{else}}- <br />- <em class="no-search-results">- {{i18n "explorer.no_search_results"}}- </em>{{/each}}</tbody></table>@@ -247,8 +210,6 @@ export default <template><DConditionalLoadingSpinner@condition={{@controller.model.loadingMore}}/>-- <div class="explorer-pad-bottom"></div>{{/if}}</:content></DFilterControls>diff --git a/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/new.gjs b/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/new.gjsindex 5ef00877880..6f849435c68 100644--- a/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/new.gjs+++ b/plugins/discourse-data-explorer/admin/assets/javascripts/admin/templates/admin-plugins/show/explorer/new.gjs@@ -20,7 +20,7 @@ export default <template><div class="admin-detail"><div class="query-new__top-bar"><BackButton- @label="explorer.queries"+ @label="explorer.back_to_queries"@route="adminPlugins.show.explorer.index"/>@@ -141,7 +141,7 @@ export default <template>/><label class="query-new__field-label">- {{i18n "explorer.description_placeholder"}}+ {{i18n "explorer.query_description"}}<span class="query-new__optional">({{i18n "explorer.ai.optional"}})</span>@@ -214,7 +214,7 @@ export default <template><form.Field@format="full"@name="description"- @title={{i18n "explorer.description_placeholder"}}+ @title={{i18n "explorer.query_description"}}@type="textarea"as |field|>diff --git a/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer.js b/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer.jsindex 7c10dbcd2d7..f25bae9bce3 100644--- a/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer.js+++ b/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer.js@@ -11,4 +11,8 @@ export default class extends DiscourseRoute {});}}++ titleToken() {+ return i18n("explorer.queries");+ }}diff --git a/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer/edit.js b/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer/edit.jsindex 723b9347199..240fb47ff68 100644--- a/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer/edit.js+++ b/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer/edit.js@@ -78,4 +78,8 @@ export default class AdminPluginsExplorerQueriesDetails extends DiscourseRoute {controller.releasePanes();}}++ titleToken() {+ return this.currentModel?.model?.name;+ }}diff --git a/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer/new.js b/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer/new.jsindex 3c75932742c..d87f066f5e8 100644--- a/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer/new.js+++ b/plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/show/explorer/new.js@@ -1,5 +1,6 @@import { ajax } from "discourse/lib/ajax";import DiscourseRoute from "discourse/routes/discourse";+import { i18n } from "discourse-i18n";export default class AdminPluginsExplorerNew extends DiscourseRoute {async model() {@@ -26,4 +27,8 @@ export default class AdminPluginsExplorerNew extends DiscourseRoute {resetController(controller) {controller.resetState();}++ titleToken() {+ return i18n("explorer.new_query");+ }}diff --git a/plugins/discourse-data-explorer/assets/stylesheets/explorer.scss b/plugins/discourse-data-explorer/assets/stylesheets/explorer.scssindex ddb1a763e67..1975fd2f33d 100644--- a/plugins/discourse-data-explorer/assets/stylesheets/explorer.scss+++ b/plugins/discourse-data-explorer/assets/stylesheets/explorer.scss@@ -860,38 +860,6 @@ table.group-reports {}.recent-queries {- thead {- .created-by {- width: 15%;- }-- .group-names {- width: 15%;-- .group-names-header {- position: absolute;- bottom: 8px;- left: 6px;- }- }-- .created-at {- width: 15%;- }-- .heading {- position: relative;- color: var(--primary-medium);- padding: 50px 0 0 0;-- .heading-toggle {- bottom: 0;- position: absolute;- display: inline-block;- }- }- }-.d-table__row.query-row {.d-table__overview-link {@include viewport.until(md) {@@ -948,10 +916,6 @@ table.group-reports {.query-row:hover {background-color: inherit;}-- .no-search-results {- color: var(--primary-medium);- }}.result-about {@@ -991,10 +955,6 @@ table.group-reports {white-space: nowrap;}-.explorer-pad-bottom {- margin-bottom: 200px;-}-.share-report {cursor: pointer;diff --git a/plugins/discourse-data-explorer/config/locales/client.en.yml b/plugins/discourse-data-explorer/config/locales/client.en.ymlindex 80860f896ed..13bfa8d5875 100644--- a/plugins/discourse-data-explorer/config/locales/client.en.yml+++ b/plugins/discourse-data-explorer/config/locales/client.en.yml@@ -26,6 +26,7 @@ en:default_query_notice: "This is a default query, the SQL cannot be edited. To edit the SQL, create a new query."view_query: "View"queries: "Queries"+ back_to_queries: "Back to queries"query_created: "Query created!"mode:label: "Query authoring mode"@@ -36,7 +37,7 @@ en:hidden_relation: "You do not have access to this content."allow_groups: "Allow groups to access this query"title: "Data Explorer"- create: "Create"+ create: "Create query"new_query: "New query"create_placeholder: "Query name..."description_placeholder: "Enter a description here"@@ -57,7 +58,7 @@ en:sql_label: "SQL"optional: "optional"import:- label: "Import"+ label: "Import query"unparseable_json: "Unparseable JSON file."wrong_json: "Wrong JSON file. A JSON file should contain a 'query' object, which should at least have an 'sql' property."help:@@ -142,7 +143,6 @@ en:results_json: "Results (JSON)"results_csv: "Results (CSV)"query_json: "Query definition (JSON)"- others_dirty: "A query has unsaved changes that will be lost if you navigate away."run_time: "Query completed in %{value} ms."cached_result_notice: "Showing cached results from %{relative_time}."result_count:@@ -163,7 +163,7 @@ en:column: "Column %{number}"save_params: "Set defaults"reset_params: "Reset"- search_placeholder: "Search..."+ search_placeholder: "Search queries…"filter_by_tag: "Filter by tag"filter_by_this_tag: "Filter the list by this tag"no_search_results: "Sorry, we couldn't find any results matching your text."