From 5be78bb2d9a7f1f3d6191edfcab37dc4e195531e Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 12 Nov 2020 13:31:28 +0000 Subject: [PATCH] FIX: Use `filters` parameter instead of `filter` for staff action log (#11217) Fixing this also means that ember takes care of JSON encoding the query parameter Follow-up to a4441b3984e4f518d8cddd7111e9b07eff5c0155 --- app/assets/javascripts/admin/addon/models/site-setting.js | 4 ++-- .../admin/addon/templates/components/site-setting.hbs | 2 +- .../discourse/tests/acceptance/admin-site-settings-test.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/admin/addon/models/site-setting.js b/app/assets/javascripts/admin/addon/models/site-setting.js index 739540f10bd..350281e6162 100644 --- a/app/assets/javascripts/admin/addon/models/site-setting.js +++ b/app/assets/javascripts/admin/addon/models/site-setting.js @@ -11,10 +11,10 @@ const SiteSetting = EmberObject.extend(Setting, { return; } - return JSON.stringify({ + return { subject: setting, action_name: "change_site_setting", - }); + }; }, }); diff --git a/app/assets/javascripts/admin/addon/templates/components/site-setting.hbs b/app/assets/javascripts/admin/addon/templates/components/site-setting.hbs index f17c06e8f60..cf6d07a6db9 100644 --- a/app/assets/javascripts/admin/addon/templates/components/site-setting.hbs +++ b/app/assets/javascripts/admin/addon/templates/components/site-setting.hbs @@ -1,7 +1,7 @@

{{#if staffLogFilter}} - {{#link-to "adminLogs.staffActionLogs" (query-params filter=staffLogFilter) title=(i18n "admin.settings.history")}} + {{#link-to "adminLogs.staffActionLogs" (query-params filters=staffLogFilter) title=(i18n "admin.settings.history")}} {{settingName}} {{d-icon "history"}} diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-site-settings-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-site-settings-test.js index fc94ab154eb..993039354c7 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/admin-site-settings-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/admin-site-settings-test.js @@ -47,7 +47,7 @@ acceptance("Admin - Site Settings", function (needs) { assert.equal( queryAll(".row.setting .setting-label h3 a").attr("href"), - "/admin/logs/staff_action_logs?filter=%7B%22subject%22%3A%22title%22%2C%22action_name%22%3A%22change_site_setting%22%7D", + "/admin/logs/staff_action_logs?filters=%7B%22subject%22%3A%22title%22%2C%22action_name%22%3A%22change_site_setting%22%7D", "it links to the staff action log" ); });