Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
cf7bf0b7
Commit
cf7bf0b7
authored
Mar 05, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`patternProperties` can be mixed with `properties` in `object`
parent
7e8a631e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
README.md
README.md
+1
-1
gadget_json_generated_form.js
gadget_json_generated_form.js
+13
-16
No files found.
README.md
View file @
cf7bf0b7
...
@@ -80,7 +80,7 @@ Below is the list of JSON Schema validation properties and current supported sta
...
@@ -80,7 +80,7 @@ Below is the list of JSON Schema validation properties and current supported sta
*
`patternProperties`
*
`patternProperties`
-
**fixed**
values can be only
`object`
types
-
**fixed**
values can be only
`object`
types
-
add buttons for remove existed
`patternProperties`
-
add buttons for remove existed
`patternProperties`
-
can not be mixed with
`properties`
-
**fixed**
can not be mixed with
`properties`
-
only regex .
*
in keys is supported
-
only regex .
*
in keys is supported
*
`properties`
*
`properties`
*
`required`
*
`required`
...
...
gadget_json_generated_form.js
View file @
cf7bf0b7
...
@@ -212,6 +212,18 @@
...
@@ -212,6 +212,18 @@
default_dict
=
{};
default_dict
=
{};
}
}
for
(
key
in
json_field
.
properties
)
{
if
(
json_field
.
properties
.
hasOwnProperty
(
key
))
{
default_used_list
.
push
(
key
);
if
(
json_field
.
properties
[
key
].
default
!==
undefined
)
{
json_field
.
properties
[
key
].
info
=
'
(default =
'
+
json_field
.
properties
[
key
].
default
+
'
)
'
;
}
queue
.
push
(
render_field
.
bind
(
gadget
,
gadget
,
key
,
path
,
json_field
.
properties
[
key
],
default_dict
[
key
],
root
)
);
}
}
if
(
json_field
.
patternProperties
!==
undefined
)
{
if
(
json_field
.
patternProperties
!==
undefined
)
{
if
(
json_field
.
patternProperties
[
'
.*
'
]
!==
undefined
)
{
if
(
json_field
.
patternProperties
[
'
.*
'
]
!==
undefined
)
{
...
@@ -219,8 +231,6 @@
...
@@ -219,8 +231,6 @@
div
.
setAttribute
(
"
class
"
,
"
subfield
"
);
div
.
setAttribute
(
"
class
"
,
"
subfield
"
);
div
.
title
=
json_field
.
description
;
div
.
title
=
json_field
.
description
;
/* console.log(key); */
div_input
=
document
.
createElement
(
"
div
"
);
div_input
=
document
.
createElement
(
"
div
"
);
div_input
.
setAttribute
(
"
class
"
,
"
input
"
);
div_input
.
setAttribute
(
"
class
"
,
"
input
"
);
...
@@ -242,9 +252,8 @@
...
@@ -242,9 +252,8 @@
div
.
appendChild
(
div_input
);
div
.
appendChild
(
div_input
);
for
(
key
in
default_dict
)
{
for
(
key
in
default_dict
)
{
if
(
default_dict
.
hasOwnProperty
(
key
))
{
if
(
default_dict
.
hasOwnProperty
(
key
)
&&
default_used_list
.
indexOf
(
key
)
<
0
)
{
default_used_list
.
push
(
key
);
default_used_list
.
push
(
key
);
// div.appendChild(div_input);
queue
queue
.
push
(
.
push
(
addSubForm
.
bind
(
gadget
,
gadget
,
{
addSubForm
.
bind
(
gadget
,
gadget
,
{
...
@@ -261,18 +270,6 @@
...
@@ -261,18 +270,6 @@
}
}
}
}
for
(
key
in
json_field
.
properties
)
{
if
(
json_field
.
properties
.
hasOwnProperty
(
key
))
{
default_used_list
.
push
(
key
);
if
(
json_field
.
properties
[
key
].
default
!==
undefined
)
{
json_field
.
properties
[
key
].
info
=
'
(default =
'
+
json_field
.
properties
[
key
].
default
+
'
)
'
;
}
queue
.
push
(
render_field
.
bind
(
gadget
,
gadget
,
key
,
path
,
json_field
.
properties
[
key
],
default_dict
[
key
],
root
)
);
}
}
for
(
key
in
default_dict
)
{
for
(
key
in
default_dict
)
{
if
(
default_dict
.
hasOwnProperty
(
key
))
{
if
(
default_dict
.
hasOwnProperty
(
key
))
{
if
(
default_used_list
.
indexOf
(
key
)
<
0
)
{
if
(
default_used_list
.
indexOf
(
key
)
<
0
)
{
...
...
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