FEATURE: JSON editor for theme settings (#21647)

provide the ability to edit theme settings in the json editor, and also copy them as a text file so they can be pasted into another instance.

Reference: /t/65023
This commit is contained in:
marstall
2023-07-27 13:48:59 -04:00
committed by GitHub
parent a44378a1b6
commit 80f5018924
9 changed files with 450 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import { makeArray } from "discourse-common/lib/helpers";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { url } from "discourse/lib/computed";
import ThemeSettingsEditor from "admin/components/theme-settings-editor";
import ThemeUploadAddModal from "../components/theme-upload-add";
const THEME_UPLOAD_VAR = 2;
@ -251,6 +252,11 @@ export default class AdminCustomizeThemesShowController extends Controller {
return userId > 0 && !defaultTheme;
}
@action
refreshModel() {
this.send("routeRefreshModel");
}
@action
updateToLatest() {
this.set("updatingRemote", true);
@ -396,6 +402,16 @@ export default class AdminCustomizeThemesShowController extends Controller {
});
}
@action
showThemeSettingsEditor() {
this.dialog.alert({
title: "Edit Settings",
bodyComponent: ThemeSettingsEditor,
bodyComponentModel: { model: this.model, controller: this },
class: "theme-settings-editor-dialog",
});
}
@action
switchType() {
const relatives = this.get("model.component")