mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 23:49:34 +08:00
DEV: Allow typed objects theme settings to be saved via settings editor (#26100)
Why this change? On the `/admin/customize/themes/<:id>` route, we allow admins to edit all settings via a settings editor. Prior to this change, trying to edit and save a typed objects theme settings will result in an error on the server.
This commit is contained in:

committed by
GitHub

parent
17a60be189
commit
8d4f405da4
@ -6,6 +6,7 @@ import {
|
||||
mapBy,
|
||||
match,
|
||||
notEmpty,
|
||||
readOnly,
|
||||
} from "@ember/object/computed";
|
||||
import { service } from "@ember/service";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
@ -43,6 +44,7 @@ export default class AdminCustomizeThemesShowController extends Controller {
|
||||
@notEmpty("settings") hasSettings;
|
||||
@notEmpty("translations") hasTranslations;
|
||||
@match("model.remote_theme.remote_url", /^http(s)?:\/\//) sourceIsHttp;
|
||||
@readOnly("model.settings") settings;
|
||||
|
||||
@discourseComputed("model.component", "model.remote_theme")
|
||||
showCheckboxes() {
|
||||
@ -146,11 +148,6 @@ export default class AdminCustomizeThemesShowController extends Controller {
|
||||
return `admin.customize.theme.convert_${type}_tooltip`;
|
||||
}
|
||||
|
||||
@discourseComputed("model.settings")
|
||||
settings(settings) {
|
||||
return settings.map((setting) => ThemeSettings.create(setting));
|
||||
}
|
||||
|
||||
@discourseComputed("model.translations")
|
||||
translations(translations) {
|
||||
return translations.map((setting) =>
|
||||
|
Reference in New Issue
Block a user