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
6824aea8
Commit
6824aea8
authored
Mar 30, 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
a06e1342
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
20 deletions
+35
-20
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
...ateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
+9
-5
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
+26
-15
No files found.
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
View file @
6824aea8
...
@@ -585,6 +585,7 @@
...
@@ -585,6 +585,7 @@
}
else
{
}
else
{
schema_p
=
schema_path
;
schema_p
=
schema_path
;
}
}
// XXX check oneOf anyOf allOf length >= 1 and generate exception if not
if
(
schema
.
anyOf
!==
undefined
)
{
if
(
schema
.
anyOf
!==
undefined
)
{
return
anyOf
(
g
,
schema
.
anyOf
,
schema_p
+
'
/anyOf
'
,
path
,
schema
);
return
anyOf
(
g
,
schema
.
anyOf
,
schema_p
+
'
/anyOf
'
,
path
,
schema
);
}
}
...
@@ -863,6 +864,9 @@
...
@@ -863,6 +864,9 @@
})
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
if
(
!
options
)
{
options
=
{};
}
var
z
=
{
var
z
=
{
saveOrigValue
:
options
.
saveOrigValue
,
saveOrigValue
:
options
.
saveOrigValue
,
editable
:
options
.
editable
===
undefined
?
true
:
options
.
editable
editable
:
options
.
editable
===
undefined
?
true
:
options
.
editable
...
@@ -980,13 +984,10 @@
...
@@ -980,13 +984,10 @@
return
g
.
printErrors
();
return
g
.
printErrors
();
})
})
.
push
(
function
()
{
.
push
(
function
()
{
if
(
g
.
props
.
form_gadget
.
props
.
changed
)
{
if
(
g
.
props
.
form_gadget
.
props
.
changed
.
length
>
0
)
{
g
.
notifyChange
();
g
.
notifyChange
();
}
}
})
})
.
push
(
function
()
{
return
g
;
})
.
push
(
undefined
,
function
(
err
)
{
.
push
(
undefined
,
function
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
});
});
...
@@ -1027,10 +1028,13 @@
...
@@ -1027,10 +1028,13 @@
ignore_incorrect
:
opt
.
ignore_incorrect
ignore_incorrect
:
opt
.
ignore_incorrect
})
})
.
push
(
function
()
{
.
push
(
function
()
{
if
(
gadget
.
props
.
changed
)
{
if
(
gadget
.
props
.
changed
.
length
>
0
)
{
value
=
undefined
;
value
=
undefined
;
}
}
return
gadget
.
reValidate
(
value
,
opt
.
schema
);
return
gadget
.
reValidate
(
value
,
opt
.
schema
);
})
.
push
(
function
()
{
return
gadget
.
props
.
changed
;
});
});
});
});
})
})
...
...
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform/gadget_json_generated_form_child.js.js
View file @
6824aea8
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
if
(
json_document
!==
undefined
&&
!
selected
)
{
if
(
json_document
!==
undefined
&&
!
selected
)
{
if
(
g
.
props
.
ignore_incorrect
)
{
if
(
g
.
props
.
ignore_incorrect
)
{
empty_option
.
selected
=
true
;
empty_option
.
selected
=
true
;
g
.
props
.
changed
=
true
;
g
.
props
.
changed
.
push
(
input
)
;
}
else
{
}
else
{
// save original json_document even if it
// save original json_document even if it
// not support with schema
// not support with schema
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
if
(
json_document
!==
undefined
&&
!
selected
)
{
if
(
json_document
!==
undefined
&&
!
selected
)
{
if
(
g
.
props
.
ignore_incorrect
)
{
if
(
g
.
props
.
ignore_incorrect
)
{
empty_option
.
selected
=
true
;
empty_option
.
selected
=
true
;
g
.
props
.
changed
=
true
;
g
.
props
.
changed
.
push
(
input
)
;
}
else
{
}
else
{
// save original json_document even if it
// save original json_document even if it
// not support with schema
// not support with schema
...
@@ -259,9 +259,10 @@
...
@@ -259,9 +259,10 @@
ser_doc
=
JSON
.
stringify
(
json_document
),
ser_doc
=
JSON
.
stringify
(
json_document
),
ser_const
=
JSON
.
stringify
(
schema
.
const
);
ser_const
=
JSON
.
stringify
(
schema
.
const
);
input
.
setAttribute
(
'
readonly
'
,
true
);
input
.
setAttribute
(
'
readonly
'
,
true
);
if
(
json_document
===
undefined
||
deepEqual
(
json_document
,
schema
.
const
))
{
if
(
json_document
===
undefined
||
g
.
props
.
ignore_incorrect
||
if
(
json_document
===
undefined
)
{
deepEqual
(
json_document
,
schema
.
const
))
{
g
.
props
.
changed
=
true
;
if
(
json_document
===
undefined
||
!
deepEqual
(
json_document
,
schema
.
const
))
{
g
.
props
.
changed
.
push
(
input
);
}
}
input
.
setAttribute
(
'
data-origin-value
'
,
ser_const
);
input
.
setAttribute
(
'
data-origin-value
'
,
ser_const
);
if
(
schema
.
title
)
{
if
(
schema
.
title
)
{
...
@@ -358,8 +359,9 @@
...
@@ -358,8 +359,9 @@
}
}
})
})
.
push
(
function
()
{
.
push
(
function
()
{
if
(
form_gadget
.
props
.
changed
)
{
if
(
form_gadget
.
props
.
changed
.
length
>
0
)
{
g
.
props
.
changed
=
true
;
// XXX not exactly path changed element
g
.
props
.
changed
.
push
(
parent_path
);
}
}
return
form_gadget
.
element
;
return
form_gadget
.
element
;
});
});
...
@@ -1001,7 +1003,7 @@
...
@@ -1001,7 +1003,7 @@
const
:
json_document
const
:
json_document
};
};
}
else
{
}
else
{
gadget
.
props
.
changed
=
true
;
gadget
.
props
.
changed
.
push
(
first_path
)
;
}
}
}
}
if
(
type
===
undefined
&&
json_document
!==
undefined
)
{
if
(
type
===
undefined
&&
json_document
!==
undefined
)
{
...
@@ -1583,15 +1585,15 @@
...
@@ -1583,15 +1585,15 @@
return
queue
;
return
queue
;
})
})
.
push
(
function
()
{
.
push
(
function
()
{
if
(
g
.
props
.
ignore_incorrect
)
{
g
.
props
.
changed
=
true
;
return
;
}
var
key
,
var
key
,
queue
=
RSVP
.
Queue
();
queue
=
RSVP
.
Queue
();
for
(
key
in
json_document
)
{
for
(
key
in
json_document
)
{
if
(
json_document
.
hasOwnProperty
(
key
))
{
if
(
json_document
.
hasOwnProperty
(
key
))
{
if
(
!
used_properties
.
hasOwnProperty
(
key
))
{
if
(
!
used_properties
.
hasOwnProperty
(
key
))
{
if
(
g
.
props
.
ignore_incorrect
)
{
g
.
props
.
changed
.
push
(
path
);
return
;
}
queue
queue
.
push
(
.
push
(
addSubForm
.
bind
(
g
,
{
addSubForm
.
bind
(
g
,
{
...
@@ -2106,7 +2108,7 @@
...
@@ -2106,7 +2108,7 @@
if
(
opt
.
ignore_incorrect
!==
undefined
)
{
if
(
opt
.
ignore_incorrect
!==
undefined
)
{
g
.
props
.
ignore_incorrect
=
opt
.
ignore_incorrect
;
g
.
props
.
ignore_incorrect
=
opt
.
ignore_incorrect
;
}
}
g
.
props
.
changed
=
false
;
g
.
props
.
changed
=
[]
;
g
.
props
.
inputs
=
[];
g
.
props
.
inputs
=
[];
g
.
props
.
add_buttons
=
[];
g
.
props
.
add_buttons
=
[];
g
.
props
.
add_custom_data
=
{};
g
.
props
.
add_custom_data
=
{};
...
@@ -2132,9 +2134,15 @@
...
@@ -2132,9 +2134,15 @@
for
(
i
=
0
;
i
<
for_delete
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
for_delete
.
length
;
i
+=
1
)
{
root
.
removeChild
(
for_delete
[
i
]);
root
.
removeChild
(
for_delete
[
i
]);
}
}
if
(
g
.
props
.
changed
)
{
if
(
g
.
props
.
changed
.
length
>
0
)
{
value
=
undefined
;
value
=
undefined
;
}
}
g
.
props
.
changed
=
g
.
props
.
changed
.
map
(
function
(
el
)
{
if
(
el
.
name
)
{
return
el
.
name
;
}
return
el
;
});
return
g
.
checkValidity
(
value
);
return
g
.
checkValidity
(
value
);
})
})
.
push
(
function
()
{
.
push
(
function
()
{
...
@@ -2174,10 +2182,13 @@
...
@@ -2174,10 +2182,13 @@
input
.
removeAttribute
(
'
data-const-value
'
);
input
.
removeAttribute
(
'
data-const-value
'
);
changed
=
true
;
changed
=
true
;
}
}
break
;
}
}
}
}
if
(
changed
)
{
if
(
changed
)
{
return
this
.
rootNotifyChange
();
return
this
.
rootNotifyChange
({
path
:
input
.
name
});
}
}
})
})
...
...
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