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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
erp5
Commits
6b072483
Commit
6b072483
authored
Apr 23, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_json_form] update from
https://lab.nexedi.com/bk/rjs_json_form
parent
fd261ee0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
48 deletions
+60
-48
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
+60
-48
No files found.
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform/gadget_json_generated_form_child.js.js
View file @
6b072483
...
...
@@ -305,7 +305,8 @@
property_name
,
parent_path
,
scope
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
scope
=
generateUid
(
g
);
parent_path
=
options
.
parent_path
;
if
(
options
.
parent_type
!==
"
array
"
)
{
...
...
@@ -314,21 +315,18 @@
property_name
=
input_element
.
value
;
}
if
(
!
property_name
)
{
// XXX notify user
// you can't create property without property_name
return
RSVP
.
Queue
();
throw
new
Error
(
"
can't create property without name
"
);
}
if
(
g
.
props
.
objects
[
parent_path
].
hasOwnProperty
(
property_name
)
&&
g
.
props
.
objects
[
parent_path
][
property_name
]
!==
""
)
{
// XXX notify user
// you can't create property with existed property_name
return
RSVP
.
Queue
();
throw
new
Error
(
"
you can't create property with existed name
"
);
}
if
(
input_element
)
{
input_element
.
value
=
""
;
}
}
return
g
.
declareGadget
(
'
gadget_json_generated_form_child.html
'
,
{
scope
:
scope
})
return
g
.
declareGadget
(
'
gadget_json_generated_form_child.html
'
,
{
scope
:
scope
});
})
.
push
(
function
(
form_gadget
)
{
form_gadget
.
element
.
setAttribute
(
"
data-gadget-parent-scope
"
,
g
.
element
.
getAttribute
(
"
data-gadget-scope
"
));
...
...
@@ -663,6 +661,9 @@
return
event
(
schema_alternatives
[
value
[
scope
]].
value
);
})
.
push
(
function
(
v
)
{
if
(
v
)
{
return
RSVP
.
Queue
()
.
push
(
function
()
{
notify
.
scope
=
v
.
scope
;
notify
.
path
=
v
.
path
;
if
(
rerender
)
{
...
...
@@ -676,6 +677,8 @@
.
push
(
function
()
{
return
gadget
.
rootNotifyChange
(
notify
);
});
}
});
},
rerender
:
function
()
{
return
RSVP
.
Queue
()
...
...
@@ -722,6 +725,9 @@
};
return
event
(
schema_alternatives
[
0
].
value
)
.
push
(
function
(
v
)
{
if
(
v
)
{
return
RSVP
.
Queue
()
.
push
(
function
()
{
notify
.
scope
=
v
.
scope
;
notify
.
path
=
v
.
path
;
if
(
rerender
)
{
...
...
@@ -737,6 +743,8 @@
}
return
gadget
.
rootNotifyChange
(
notify
);
});
}
});
},
rerender
:
function
()
{
return
RSVP
.
Queue
()
...
...
@@ -1269,7 +1277,11 @@
type
:
value
.
type
,
schema_arr
:
[
value
]
})
.
push
(
element_append
);
.
push
(
element_append
)
.
push
(
undefined
,
function
(
err
)
{
// XXX notify user
console
.
error
(
err
);
});
});
});
return
queue
;
...
...
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