From 5edb8ea7f86107e68e795681d64757f40d80fbc5 Mon Sep 17 00:00:00 2001 From: Rishabh Nambiar <5862206+rishabhnambiar@users.noreply.github.com> Date: Fri, 31 Aug 2018 23:41:33 +0530 Subject: [PATCH] UX: Make Explorer UI similar to User Activity and Groups pages --- .../controllers/admin-plugins-explorer.js.es6 | 10 +- .../templates/admin/plugins-explorer.hbs | 101 ++++++++++-------- assets/stylesheets/explorer.scss | 48 ++++----- 3 files changed, 85 insertions(+), 74 deletions(-) diff --git a/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 index 613577a..3c40d98 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 @@ -11,13 +11,14 @@ export default Ember.Controller.extend({ showResults: false, hideSchema: false, loading: false, - explain: false, saveDisabled: Ember.computed.not('selectedItem.dirty'), runDisabled: Ember.computed.alias('selectedItem.dirty'), results: Em.computed.alias('selectedItem.results'), + asc: null, + order: null, editing: false, everEditing: false, showRecentQueries: true, @@ -98,8 +99,13 @@ export default Ember.Controller.extend({ }, goHome() { + this.setProperties({ + asc: null, + order: null, + selectedQueryId: null, + sortBy: ['last_run_at:desc'] + }); this.send('refreshModel'); - this.set('selectedQueryId', null); this.transitionToRoute('adminPlugins.explorer'); }, diff --git a/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs b/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs index ccc3129..541cdaa 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs @@ -145,53 +145,60 @@ {{#if showRecentQueries}} {{#if sortedQueries.length}} -
- {{d-icon "sort"}} - {{i18n 'explorer.query_name'}} - | -- {{d-icon "sort"}} - {{i18n 'explorer.query_user'}} - | -- {{d-icon "sort"}} - {{i18n 'explorer.query_time'}} - | - -
---|---|---|
-
- {{query.name}}
- - - - |
-
- {{#if query.username}}
-
- |
-
- {{#if query.last_run_at}}
- |
-
+
+ {{directory-toggle field="name" labelKey="explorer.query_name" order=order asc=asc}}
+
+ |
+
+
+ {{directory-toggle field="username" labelKey="explorer.query_user" order=order asc=asc}}
+
+ |
+
+
+ {{directory-toggle field="last_run_at" labelKey="explorer.query_time" order=order asc=desc}}
+
+ |
+
+
---|---|---|
+
+ {{query.name}}
+ + + + |
+
+ {{#if query.username}}
+
+ |
+
+ {{#if query.last_run_at}}
+ |
+