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
Jérome Perrin
rjs_json_form
Commits
47d96a14
Commit
47d96a14
authored
Sep 19, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
title rendering fixed for complex fields (fields which use schema_arr for render)
parent
077403f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
jsonform.gadget.js
jsonform.gadget.js
+21
-3
jsonform/gadget_json_generated_form_child.js
jsonform/gadget_json_generated_form_child.js
+10
-5
No files found.
jsonform.gadget.js
View file @
47d96a14
...
...
@@ -346,6 +346,15 @@
x
=
{};
}
else
if
(
!
doesntcopy
)
{
x
=
JSON
.
parse
(
JSON
.
stringify
(
x
));
if
(
x
.
anyOf
)
{
delete
x
.
anyOf
;
}
if
(
x
.
oneOf
)
{
delete
x
.
oneOf
;
}
if
(
x
.
allOf
)
{
delete
x
.
allOf
;
}
}
if
(
y
===
true
)
{
y
=
{};
...
...
@@ -515,7 +524,7 @@
var
i
,
arr
=
[];
for
(
i
=
0
;
i
<
schema_array
.
length
;
i
+=
1
)
{
arr
.
push
(
expandSchema
(
g
,
mergeSchemas
(
schema_array
[
i
],
base_schema
)
,
schema_path
+
'
/
'
+
i
.
toString
()));
arr
.
push
(
expandSchema
(
g
,
schema_array
[
i
]
,
schema_path
+
'
/
'
+
i
.
toString
()));
}
return
RSVP
.
all
(
arr
);
})
...
...
@@ -529,6 +538,13 @@
// or(any, restricted, restricted, .. ) simplify to any
return
[
arr
[
i
][
z
]];
}
if
(
base_schema
.
title
)
{
arr
[
i
][
z
].
title
=
base_schema
.
title
;
}
if
(
base_schema
.
description
)
{
arr
[
i
][
z
].
description
=
base_schema
.
description
;
}
arr
[
i
][
z
].
schema
=
mergeSchemas
(
base_schema
,
arr
[
i
][
z
].
schema
);
schema_arr
.
push
(
arr
[
i
][
z
]);
}
}
...
...
@@ -577,15 +593,17 @@
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
[{
title
:
ref
||
schema
.
title
,
title
:
schema
.
title
,
ref
:
ref
,
schema
:
schema
,
schema_path
:
schema_path
}];
});
};
function
schema_arr_marker
(
schema_arr
)
{
var
i
;
// XXX need cleanup false schema before
for
(
i
=
0
;
i
<
schema_arr
.
length
;
i
+=
1
)
{
if
(
!
schema_arr
[
i
].
schema
.
hasOwnProperty
(
'
const
'
))
{
schema_arr
[
0
].
is_arr_of_const
=
false
;
...
...
jsonform/gadget_json_generated_form_child.js
View file @
47d96a14
...
...
@@ -433,6 +433,8 @@
// add propertyName to title
if
(
schema_array
[
i
].
title
&&
schema_array
.
length
>
1
)
{
schema_array
[
i
].
title
=
property_name
+
'
/
'
+
schema_array
[
i
].
title
;
}
else
if
(
schema_array
[
i
].
ref
&&
schema_array
.
length
>
1
)
{
schema_array
[
i
].
title
=
property_name
+
'
/
'
+
schema_array
[
i
].
ref
;
}
else
{
schema_array
[
i
].
title
=
property_name
;
}
...
...
@@ -844,14 +846,15 @@
input
,
schema
,
schema_path
,
schema_ob
,
first_path
,
type_changed
,
queue
=
RSVP
.
Queue
();
// XXX if (ret_arr.length > 1) notify user
schema
=
schemaArrFilteredByDocument
(
schema_arr
,
json_document
)[
0
];
schema
_path
=
schema
.
schema_path
;
schema
=
schema
.
schema
;
schema
_ob
=
schemaArrFilteredByDocument
(
schema_arr
,
json_document
)[
0
];
schema
=
schema_ob
.
schema
;
schema
_path
=
schema_ob
.
schema_path
;
if
(
schema_path
===
'
/
'
)
{
schema_path
=
''
;
...
...
@@ -903,7 +906,9 @@
div
=
document
.
createElement
(
"
div
"
);
div
.
setAttribute
(
"
class
"
,
"
jsonformfield ui-field-contain
"
);
div
.
title
=
schema
.
description
;
if
(
schema
.
description
)
{
div
.
title
=
schema
.
description
;
}
// if (key && !first_path) {
if
(
options
.
delete_button
===
true
)
{
delete_button
=
createElement
(
"
span
"
,
...
...
@@ -924,7 +929,7 @@
}
}
label_text
=
[
key
,
schema
.
title
]
label_text
=
[
key
,
schema
_ob
.
title
]
.
filter
(
function
(
v
)
{
return
v
;
})
.
join
(
"
"
)
// use non-breaking hyphen
...
...
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