Follow up to 8c2fa99f782314ce1fde025090571ecb07f8b812.

Follow up to 8c2fa99f782314ce1fde025090571ecb07f8b812.

/search_logs/term?term is alittle weird looking but unless we add proper slug support to term, we’re going to have to live with this first.

diff --git a/app/assets/javascripts/admin/routes/admin-route-map.js.es6 b/app/assets/javascripts/admin/routes/admin-route-map.js.es6
index b302b1b..688091e 100644
--- a/app/assets/javascripts/admin/routes/admin-route-map.js.es6
+++ b/app/assets/javascripts/admin/routes/admin-route-map.js.es6
@@ -133,7 +133,7 @@ export default function() {
           { path: "/search_logs", resetNamespace: true },
           function() {
             this.route("index", { path: "/" });
-            this.route("term", { path: "/term/:term" });
+            this.route("term", { path: "/term" });
           }
         );
         this.route(
diff --git a/app/assets/javascripts/admin/routes/admin-search-logs-term.js.es6 b/app/assets/javascripts/admin/routes/admin-search-logs-term.js.es6
index 54c145a..40d3e25 100644
--- a/app/assets/javascripts/admin/routes/admin-search-logs-term.js.es6
+++ b/app/assets/javascripts/admin/routes/admin-search-logs-term.js.es6
@@ -4,6 +4,7 @@ import { translateResults } from "discourse/lib/search";
 
 export default Discourse.Route.extend({
   queryParams: {
+    term: { refreshModel: true },
     period: { refreshModel: true },
     searchType: { refreshModel: true }
   },
diff --git a/app/assets/javascripts/admin/templates/search-logs-index.hbs b/app/assets/javascripts/admin/templates/search-logs-index.hbs
index f323f80..cb6c90a 100644
--- a/app/assets/javascripts/admin/templates/search-logs-index.hbs
+++ b/app/assets/javascripts/admin/templates/search-logs-index.hbs
@@ -16,7 +16,9 @@
       {{#each model as |item|}}
         <tr class="admin-list-item">
           <td class="col term">
-            {{#link-to 'adminSearchLogs.term' item.term}}{{item.term}}{{/link-to}}
+            {{#link-to 'adminSearchLogs.term' (query-params term=item.term) class="test"}}
+              {{item.term}}
+            {{/link-to}}
           </td>
           <td class="col"><div class="label">{{i18n 'admin.logs.search_logs.searches'}}</div>{{item.searches}}</td>
           <td class="col"><div class="label">{{i18n 'admin.logs.search_logs.click_through_rate'}}</div>{{item.ctr}}%</td>
diff --git a/test/javascripts/acceptance/admin-search-log-term-test.js.es6 b/test/javascripts/acceptance/admin-search-log-term-test.js.es6
index 29fce43..d5a2fcb 100644
--- a/test/javascripts/acceptance/admin-search-log-term-test.js.es6
+++ b/test/javascripts/acceptance/admin-search-log-term-test.js.es6
@@ -2,7 +2,7 @@ import { acceptance } from "helpers/qunit-helpers";
 acceptance("Admin - Search Log Term", { loggedIn: true });
 
 QUnit.test("show search log term details", async assert => {
-  await visit("/admin/logs/search_logs/term/ruby");
+  await visit("/admin/logs/search_logs/term?term=ruby");
 
   assert.ok($("div.search-logs-filter").length, "has the search type filter");
   assert.ok(exists("canvas.chartjs-render-monitor"), "has graph canvas");
diff --git a/test/javascripts/acceptance/admin-search-logs-test.js.es6 b/test/javascripts/acceptance/admin-search-logs-test.js.es6
index 78b69a2..ceab951 100644
--- a/test/javascripts/acceptance/admin-search-logs-test.js.es6
+++ b/test/javascripts/acceptance/admin-search-logs-test.js.es6
@@ -5,8 +5,16 @@ QUnit.test("show search logs", async assert => {
   await visit("/admin/logs/search_logs");
 
   assert.ok($("table.search-logs-list.grid").length, "has the div class");
+
   assert.ok(
     exists(".search-logs-list .admin-list-item .col"),
     "has a list of search logs"
   );
+
+  await click(".term a");
+
+  assert.ok(
+    $("div.search-logs-filter").length,
+    "it should show the search log term page"
+  );
 });

GitHub sha: 947495e7