Commit 6fd96fae authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Don't display "ERROR" as parameter and define default

   Keep the xml_output as it is even if the form is Invalid, this allow the user force post (since it is the user decision).

   If the textarea is blank/empty, add the default xml (empty values) in place, otherwise the user cannot re-render the parameter form back.
parent c55feb7d
...@@ -609,7 +609,7 @@ ...@@ -609,7 +609,7 @@
divm.querySelector("span.error").textContent = validation.missing[missing_index].message; divm.querySelector("span.error").textContent = validation.missing[missing_index].message;
} }
} }
return "ERROR"; return xml_output;
}); });
} }
...@@ -1058,6 +1058,11 @@ ...@@ -1058,6 +1058,11 @@
content_dict.shared = 1; content_dict.shared = 1;
} }
if (text_content !== null) { if (text_content !== null) {
// Don't provide blank string since the parameter will not able to load
// itself. If the user removed the values, provide an empty parameter default.
if (text_content.value === "") {
return '<?xml version="1.0" encoding="utf-8" ?><instance></instance>';
}
return text_content.value; return text_content.value;
} }
return checkValidity(gadget); return checkValidity(gadget);
......
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1000.9806.10724.60689</string> </value> <value> <string>1000.12486.34916.20633</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1652220502.37</float> <float>1652455157.55</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment