Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
cff0e2ce
Commit
cff0e2ce
authored
Mar 14, 2019
by
Boris Kocherov
Committed by
Romain Courteaud
Apr 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_json_form] update from
https://lab.nexedi.com/bk/rjs_json_form
parent
4d2855f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
...ateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
+26
-1
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform/gadget_json_generated_form_child.js.js
...json_form/jsonform/gadget_json_generated_form_child.js.js
+15
-0
No files found.
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
View file @
cff0e2ce
...
@@ -272,7 +272,7 @@
...
@@ -272,7 +272,7 @@
hash
=
url
.
hash
;
hash
=
url
.
hash
;
url
=
url
.
href
;
url
=
url
.
href
;
if
(
download_url
.
startsWith
(
"
urn:jio:
"
))
{
if
(
download_url
.
startsWith
(
"
urn:jio:
"
))
{
external_reference
=
true
;
external_reference
=
download_url
;
queue
=
RSVP
.
Queue
()
queue
=
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
return
g
.
resolveExternalReference
(
download_url
,
schema_path
,
path
);
return
g
.
resolveExternalReference
(
download_url
,
schema_path
,
path
);
...
@@ -706,6 +706,31 @@
...
@@ -706,6 +706,31 @@
this
.
props
.
errors
[
arr
[
1
]]
=
arr
[
0
];
this
.
props
.
errors
[
arr
[
1
]]
=
arr
[
0
];
}
}
})
})
.
declareMethod
(
'
getSubGadget
'
,
function
(
scope
)
{
// recursive getDeclaredGadget
// work only if subgadget scope contain parent
// scope as prefix
// example:
// gadget: scope1234
// subgadet: scope1234_subgadgetscope1
// subsubgadet: scope1234_subgadgetscope1_subsubgadetscope
var
i
,
gadget
=
this
,
scope_arr
=
scope
.
split
(
'
_
'
),
queue
=
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
props
.
form_gadget
;
});
function
getDeclaredGadget
(
scope
)
{
return
function
(
g
)
{
return
g
.
getDeclaredGadget
(
scope
);
};
}
for
(
i
=
2
;
i
<=
scope_arr
.
length
;
i
+=
1
)
{
queue
.
push
(
getDeclaredGadget
(
scope_arr
.
slice
(
0
,
i
).
join
(
'
_
'
)));
}
return
queue
;
})
.
declareMethod
(
'
getGadgetByPath
'
,
function
(
path
)
{
.
declareMethod
(
'
getGadgetByPath
'
,
function
(
path
)
{
return
this
.
props
.
form_gadget
.
getGadgetByPath
(
path
||
"
/
"
);
return
this
.
props
.
form_gadget
.
getGadgetByPath
(
path
||
"
/
"
);
})
})
...
...
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform/gadget_json_generated_form_child.js.js
View file @
cff0e2ce
...
@@ -348,6 +348,15 @@
...
@@ -348,6 +348,15 @@
ignore_incorrect
:
g
.
props
.
ignore_incorrect
,
ignore_incorrect
:
g
.
props
.
ignore_incorrect
,
scope
:
scope
scope
:
scope
})
})
.
push
(
function
()
{
if
(
options
.
schema_arr
.
external_reference
)
{
return
form_gadget
.
rootNotifyChange
({
scope
:
scope
,
action
:
"
render
"
,
path
:
"
/
"
});
}
})
.
push
(
function
()
{
.
push
(
function
()
{
if
(
form_gadget
.
props
.
changed
)
{
if
(
form_gadget
.
props
.
changed
)
{
g
.
props
.
changed
=
true
;
g
.
props
.
changed
=
true
;
...
@@ -535,6 +544,7 @@
...
@@ -535,6 +544,7 @@
return
schema_arr
;
return
schema_arr
;
}
}
ret_arr
[
0
].
circular
=
circular
;
ret_arr
[
0
].
circular
=
circular
;
ret_arr
.
external_reference
=
schema_arr
.
external_reference
;
return
ret_arr
;
return
ret_arr
;
}
}
return
schema_arr
;
return
schema_arr
;
...
@@ -1818,6 +1828,7 @@
...
@@ -1818,6 +1828,7 @@
scope
:
v
.
scope
||
g
.
element
.
getAttribute
(
"
data-gadget-scope
"
),
scope
:
v
.
scope
||
g
.
element
.
getAttribute
(
"
data-gadget-scope
"
),
rel_path
:
v
.
path
,
rel_path
:
v
.
path
,
path
:
p
,
path
:
p
,
ref
:
g
.
props
.
schema_arr
.
external_reference
,
action
:
v
.
action
action
:
v
.
action
});
});
});
});
...
@@ -1833,6 +1844,7 @@
...
@@ -1833,6 +1844,7 @@
);
);
}
}
tasks
.
push
(
g
.
notifyInvalid
([],
g
.
element
.
getAttribute
(
"
data-gadget-scope
"
)));
tasks
.
push
(
g
.
notifyInvalid
([],
g
.
element
.
getAttribute
(
"
data-gadget-scope
"
)));
g
.
props
.
deleted
=
true
;
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
return
RSVP
.
all
(
tasks
);
return
RSVP
.
all
(
tasks
);
...
@@ -2315,6 +2327,9 @@
...
@@ -2315,6 +2327,9 @@
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
var
g
=
this
;
var
g
=
this
;
if
(
g
.
props
.
deleted
)
{
return
;
}
return
getFormValuesAsJSONDict
(
g
)
return
getFormValuesAsJSONDict
(
g
)
.
push
(
function
(
data
)
{
.
push
(
function
(
data
)
{
if
(
g
.
props
.
updatePropertySelectors
)
{
if
(
g
.
props
.
updatePropertySelectors
)
{
...
...
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