Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.core
Commits
3e65d87c
Commit
3e65d87c
authored
Apr 26, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: ensure getContent is called before re-render the form
This ensure data is saved before render a new form.
parent
49b6f64a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
19 deletions
+36
-19
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_json_form_js.js
...web_page_module/rjs_gadget_erp5_page_slap_json_form_js.js
+4
-0
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_json_form_js.xml
...eb_page_module/rjs_gadget_erp5_page_slap_json_form_js.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_parameter_form_js.js
...age_module/rjs_gadget_erp5_page_slap_parameter_form_js.js
+28
-15
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_parameter_form_js.xml
...ge_module/rjs_gadget_erp5_page_slap_parameter_form_js.xml
+2
-2
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_json_form_js.js
View file @
3e65d87c
...
...
@@ -499,6 +499,10 @@
.
declareMethod
(
"
validateJSON
"
,
function
(
schema_url
,
generated_json
)
{
return
this
.
getDeclaredGadget
(
'
json_form_load_schema
'
)
.
push
(
function
(
gadget
)
{
if
(
schema_url
===
undefined
)
{
// Skip validation if no schema is provided.
return
{
errors
:
[]};
}
return
gadget
.
validateJSON
(
undefined
,
schema_url
,
generated_json
);
});
})
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_json_form_js.xml
View file @
3e65d87c
...
...
@@ -282,7 +282,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
7.63610.61612.6246
</string>
</value>
<value>
<string>
100
8.808.61596.8721
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -302,7 +302,7 @@
</tuple>
<state>
<tuple>
<float>
1682
455523.98
</float>
<float>
1682
619529.51
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_parameter_form_js.js
View file @
3e65d87c
...
...
@@ -153,14 +153,13 @@
div_error
,
textarea
,
show_text_button
=
g
.
element
.
querySelector
(
"
button.slapos-show-raw-parameter
"
),
show_form_button
=
g
.
element
.
querySelector
(
"
button.slapos-show-form
"
);
;
show_form_button
=
g
.
element
.
querySelector
(
"
button.slapos-show-form
"
);
show_text_button
.
disabled
=
1
;
show_text_button
.
classList
.
remove
(
"
ui-icon-code
"
);
show_text_button
.
classList
.
add
(
"
ui-icon-spinner
"
);
show_form_button
.
disabled
=
0
;
if
(
error_text
)
{
div_error
=
domsugar
(
'
div
'
,
{
'
class
'
:
'
error
'
...
...
@@ -412,16 +411,24 @@
'
text/xml
'
).
querySelector
(
"
parameter[id='_']
"
);
parameter_list
=
parseDocumentStringOrFail
(
parameter_xml
,
'
text/xml
'
).
querySelectorAll
(
"
parameter
"
);
if
(
parameter_entry
!==
null
)
{
if
(
parameter_entry
.
textContent
!==
"
{}
"
)
{
throw
new
Error
(
"
The current parameter values should NOT contains _ parameter (xml).
"
);
}
parseDocumentStringOrFail
(
parameter_xml
,
'
text/xml
'
).
querySelectorAll
(
"
parameter
"
)
.
forEach
(
function
(
element
,
index
)
{
}
parameter_list
.
forEach
(
function
(
element
,
index
)
{
if
(
!
((
element
.
id
===
"
_
"
)
&&
(
element
.
textContent
===
"
{}
"
))
)
{
parameter_dict
[
element
.
id
]
=
element
.
textContent
;
});
}
}
);
}
else
{
throw
new
Error
(
"
Unknown serialisation:
"
+
serialisation
);
}
...
...
@@ -455,6 +462,8 @@
.
fail
(
function
(
error
)
{
console
.
warn
(
error
);
console
.
log
(
error
.
stack
);
show_form_button
.
classList
.
remove
(
"
ui-icon-spinner
"
);
show_form_button
.
classList
.
add
(
"
ui-icon-th-list
"
);
return
renderDisplayRawXml
(
gadget
,
error
.
toString
());
});
}
...
...
@@ -549,11 +558,15 @@
if
(
evt
.
target
===
software_type_element
)
{
parameter_shared
.
value
=
software_type_element
.
selectedOptions
[
0
][
"
data-shared
"
];
// call get content to ensure data is saved.
return
gadget
.
getContent
()
.
push
(
function
()
{
return
gadget
.
changeState
({
softwareindex
:
software_type_element
.
selectedOptions
[
0
][
"
data-id
"
],
// Force refresh in any case
render_timestamp
:
new
Date
().
getTime
()
});
});
}
},
false
,
false
)
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_parameter_form_js.xml
View file @
3e65d87c
...
...
@@ -284,7 +284,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1007.6
3580.6957.21418
</string>
</value>
<value>
<string>
1007.6
4857.33700.1467
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -304,7 +304,7 @@
</tuple>
<state>
<tuple>
<float>
1682
453675.95
</float>
<float>
1682
532947.32
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment