discourse/app/assets/javascripts/admin/addon/components/theme-site-setting-editor.gjs
Martin Brennan 4eb1a17ef8
FIX: Link to correct staff action logs for theme site setting (#34315)
Fixes an issue where the history link on hover for a theme site setting
would point to the staff action logs for regular site settings, not  the
theme site setting ones which include the theme name in the subject
and also have a different `change_theme_site_setting` action.

c.f.
https://meta.discourse.org/t/link-to-change-history-on-themeable-site-settings/377394
2025-08-15 11:14:05 +10:00

27 lines
713 B
Text
Vendored

import { service } from "@ember/service";
import { i18n } from "discourse-i18n";
import SiteSettingComponent from "./site-setting";
export default class ThemeSiteSettingEditor extends SiteSettingComponent {
@service toasts;
get staffLogFilter() {
return {
subject: `${this.args.model.name}: ${this.setting.setting}`,
action_name: "change_theme_site_setting",
};
}
_save() {
return this.setting
.updateSetting(this.args.model.id, this.buffered.get("value"))
.then(() => {
this.toasts.success({
data: {
message: i18n("admin.customize.theme.theme_site_setting_saved"),
},
duration: "short",
});
});
}
}