mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Link site setting titles directly to their change log (#11215)
This makes it much easier to check the staff action logs for a specific site setting. A small history icon will appear when hovering over a site setting name. On click, you will be taken to the pre-filtered staff action log for the site setting.
This commit is contained in:
@@ -2,6 +2,7 @@ import Component from "@ember/component";
|
||||
import BufferedContent from "discourse/mixins/buffered-content";
|
||||
import SiteSetting from "admin/models/site-setting";
|
||||
import SettingComponent from "admin/mixins/setting-component";
|
||||
import { readOnly } from "@ember/object/computed";
|
||||
|
||||
export default Component.extend(BufferedContent, SettingComponent, {
|
||||
updateExistingUsers: null,
|
||||
@@ -12,4 +13,6 @@ export default Component.extend(BufferedContent, SettingComponent, {
|
||||
updateExistingUsers: this.updateExistingUsers,
|
||||
});
|
||||
},
|
||||
|
||||
staffLogFilter: readOnly("setting.staffLogFilter"),
|
||||
});
|
||||
|
||||
@@ -2,8 +2,21 @@ import I18n from "I18n";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import Setting from "admin/mixins/setting-object";
|
||||
import EmberObject from "@ember/object";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
|
||||
const SiteSetting = EmberObject.extend(Setting, {});
|
||||
const SiteSetting = EmberObject.extend(Setting, {
|
||||
@discourseComputed("setting")
|
||||
staffLogFilter(setting) {
|
||||
if (!setting) {
|
||||
return;
|
||||
}
|
||||
|
||||
return JSON.stringify({
|
||||
subject: setting,
|
||||
action_name: "change_site_setting",
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
SiteSetting.reopenClass({
|
||||
findAll() {
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
<div class="setting-label">
|
||||
<h3>{{settingName}}</h3>
|
||||
<h3>
|
||||
{{#if staffLogFilter}}
|
||||
{{#link-to "adminLogs.staffActionLogs" (query-params filter=staffLogFilter) title=(i18n "admin.settings.history")}}
|
||||
{{settingName}}
|
||||
<span class="history-icon">
|
||||
{{d-icon "history"}}
|
||||
</span>
|
||||
{{/link-to}}
|
||||
{{else}}
|
||||
{{settingName}}
|
||||
{{/if}}
|
||||
</h3>
|
||||
{{#if defaultIsAvailable}}
|
||||
<a href onClick={{action "setDefaultValues"}}>{{setting.setDefaultValuesLabel}}</a>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user