DEV: Add experimental json_scheme site setting type (#12226)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { action } from "@ember/object";
|
||||
import Component from "@ember/component";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
|
||||
export default Component.extend({
|
||||
@action
|
||||
launchJsonEditorModal() {
|
||||
const schemaModal = showModal("json-schema-editor", {
|
||||
model: {
|
||||
value: this.value,
|
||||
settingName: this.setting.setting,
|
||||
jsonSchema: this.setting.json_schema,
|
||||
},
|
||||
});
|
||||
|
||||
schemaModal.set("onClose", () => {
|
||||
this.set("value", schemaModal.model.value);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,5 +1,11 @@
|
||||
{{#if setting.textarea}}
|
||||
{{textarea value=value classNames="input-setting-textarea"}}
|
||||
{{else if setting.json_schema}}
|
||||
{{d-button
|
||||
action=(action "launchJsonEditorModal")
|
||||
icon="pencil-alt"
|
||||
label="admin.site_settings.json_schema.edit"
|
||||
}}
|
||||
{{else if isSecret}}
|
||||
{{input type="password" value=value classNames="input-setting-string"}}
|
||||
{{else}}
|
||||
|
||||
Reference in New Issue
Block a user