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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
17066fa5
Commit
17066fa5
authored
Nov 29, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: JSON Editor receives a string rather them a json
parent
e10a0e3c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
61 deletions
+15
-61
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_parameter_form.js.js
...s/slapos_cloud/gadget_erp5_page_slap_parameter_form.js.js
+15
-6
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ref-parser.min.js.js
...mplateItem/portal_skins/slapos_cloud/ref-parser.min.js.js
+0
-27
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ref-parser.min.js.xml
...plateItem/portal_skins/slapos_cloud/ref-parser.min.js.xml
+0
-28
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_parameter_form.js.js
View file @
17066fa5
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
"
use strict
"
;
"
use strict
"
;
var
DISPLAY_JSON_FORM
=
'
display_json_form
'
,
var
DISPLAY_JSON_FORM
=
'
display_json_form
'
,
DISPLAY_RAW_XML
=
'
display_raw_xml
'
;
DISPLAY_RAW_XML
=
'
display_raw_xml
'
,
PARAMETER_KEY
=
'
parameter_key
'
;
//////////////////////////////////////////
//////////////////////////////////////////
// ParserError
// ParserError
...
@@ -130,6 +131,12 @@
...
@@ -130,6 +131,12 @@
.
push
(
function
(
gadget
)
{
.
push
(
function
(
gadget
)
{
return
gadget
.
getContent
();
return
gadget
.
getContent
();
})
})
.
push
(
function
(
json_dict
)
{
if
(
json_dict
&&
(
json_dict
[
PARAMETER_KEY
]
!==
undefined
))
{
return
JSON
.
parse
(
json_dict
[
PARAMETER_KEY
]);
}
return
{};
})
.
push
(
function
(
json_dict
)
{
.
push
(
function
(
json_dict
)
{
var
parameter_hash_input
=
g
.
element
.
querySelectorAll
(
'
.parameter_hash_output
'
)[
0
],
var
parameter_hash_input
=
g
.
element
.
querySelectorAll
(
'
.parameter_hash_output
'
)[
0
],
serialisation_type
=
getSerialisationTypeFromForm
(
g
.
element
),
serialisation_type
=
getSerialisationTypeFromForm
(
g
.
element
),
...
@@ -442,13 +449,14 @@
...
@@ -442,13 +449,14 @@
prefix
=
json_url
.
split
(
json_url_uri
.
path
())[
0
]
+
prefix
.
join
(
"
/
"
);
prefix
=
json_url
.
split
(
json_url_uri
.
path
())[
0
]
+
prefix
.
join
(
"
/
"
);
parameter_json_schema_url
=
prefix
+
"
/
"
+
parameter_json_schema_url
;
parameter_json_schema_url
=
prefix
+
"
/
"
+
parameter_json_schema_url
;
}
}
// loadJSONSchema is there to ensure that the JSON from a proper serialisation
//
return
gadget
.
loadJSONSchema
(
parameter_json_schema_url
,
serialisation
)
return
gadget
.
loadJSONSchema
(
parameter_json_schema_url
,
serialisation
)
.
push
(
function
(
json
)
{
.
push
(
function
()
{
// Reset failover text area
// Reset failover text area
domsugar
(
gadget
.
element
.
querySelector
(
'
div.failover-textarea
'
));
domsugar
(
gadget
.
element
.
querySelector
(
'
div.failover-textarea
'
));
return
gadget
.
renderSubForm
(
return
gadget
.
renderSubForm
(
parameter_json_schema_url
,
parameter_json_schema_url
,
json
,
parameter_dict
,
parameter_dict
,
editable
editable
);
);
...
@@ -489,13 +497,14 @@
...
@@ -489,13 +497,14 @@
});
});
})
})
.
declareMethod
(
"
renderSubForm
"
,
function
(
parameter_json_schema_url
,
json_field
,
default_dict
,
editable
)
{
.
declareMethod
(
"
renderSubForm
"
,
function
(
parameter_json_schema_url
,
default_dict
,
editable
)
{
return
this
.
getDeclaredGadget
(
'
json_form
'
)
return
this
.
getDeclaredGadget
(
'
json_form
'
)
.
push
(
function
(
gadget
)
{
.
push
(
function
(
gadget
)
{
return
gadget
.
render
({
return
gadget
.
render
({
schema_url
:
parameter_json_schema_url
,
schema_url
:
parameter_json_schema_url
,
json_field
:
json_field
,
key
:
PARAMETER_KEY
,
default_dict
:
default_dict
,
// value is always string
value
:
JSON
.
stringify
(
default_dict
),
editable
:
editable
editable
:
editable
});
});
});
});
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ref-parser.min.js.js
deleted
100644 → 0
View file @
e10a0e3c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ref-parser.min.js.xml
deleted
100644 → 0
View file @
e10a0e3c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
ref-parser.min.js
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/javascript
</string>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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