diff --git a/src/ui/client/dashboard/components/Form/Raw.vue b/src/ui/client/dashboard/components/Form/Raw.vue
index 64086fffe..cd22596df 100644
--- a/src/ui/client/dashboard/components/Form/Raw.vue
+++ b/src/ui/client/dashboard/components/Form/Raw.vue
@@ -79,10 +79,11 @@ const data = reactive({
jsonReady = "{" + jsonReady.slice(0, -1) + "}";
try {
- const data = JSON.parse(jsonReady);
- rawForm.setTemplate(data);
+ const json = JSON.parse(jsonReady);
+ rawForm.setTemplate(json);
return true;
} catch (e) {
+ console.log(e);
return false;
}
}),
@@ -116,7 +117,6 @@ function json2raw(json) {
}
const editorData = {
- value: data.str,
name: `raw-editor-${uuidv4()}`,
label: `raw-editor-${uuidv4()}`,
hideLabel: true,
@@ -150,7 +150,11 @@ onBeforeMount(() => {
- (data.str = v)" v-bind="editorData" />
+ (data.str = v)"
+ v-bind="editorData"
+ :value="data.str"
+ />
diff --git a/src/ui/client/dashboard/store/form.js b/src/ui/client/dashboard/store/form.js
index 2134347e9..1f7d579a4 100644
--- a/src/ui/client/dashboard/store/form.js
+++ b/src/ui/client/dashboard/store/form.js
@@ -30,10 +30,24 @@ export const createFormStore = (storeName, formType) => {
*/
function setTemplate(template) {
if (!_isFormTypeAllowed(["advanced", "easy", "raw"])) return;
+
template.value = template;
templateBase.value = template;
- templateUI.value = JSON.parse(JSON.stringify(template));
- templateUIFormat.value = JSON.parse(JSON.stringify(template));
+ templateUI.value = template;
+ templateUIFormat.value = template;
+
+ // console.log("template", type.value, template);
+ // console.log(typeof template);
+ // const formattedData = {};
+ // // Loop dict items
+ // for (const [key, value] of Object.entries(template)) {
+ // // Case key "value" is here, we are directly on the right level (and maybe on the raw mode)
+ // if (value?.value) {
+ // }
+ // console.log(key, value);
+ // formattedData[key] = value;
+ // if (!value?.settings || value?.multiples) continue;
+ // }
}
/**
@@ -292,6 +306,8 @@ export const createFormStore = (storeName, formType) => {
*/
function submitForm() {
if (!_isFormTypeAllowed(["advanced", "easy", "raw"])) return;
+ console.log("submitForm");
+ const formattedData = {};
}
/**