Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
nexedi
dream
Commits
e139e037
Commit
e139e037
authored
Jan 05, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fieldset corrected to handle values of expandalbe fields (containing multiple expandable fields)
parent
aa8f4785
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
dream/platform/src/fieldset/fieldset.js
dream/platform/src/fieldset/fieldset.js
+30
-1
No files found.
dream/platform/src/fieldset/fieldset.js
View file @
e139e037
...
@@ -91,6 +91,7 @@
...
@@ -91,6 +91,7 @@
queue
=
new
RSVP
.
Queue
()
queue
=
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
var
reserved_keys
=
[];
if
(
node_id
)
{
if
(
node_id
)
{
addField
(
'
id
'
,
{
'
type
'
:
'
string
'
},
node_id
);
addField
(
'
id
'
,
{
'
type
'
:
'
string
'
},
node_id
);
}
}
...
@@ -99,7 +100,8 @@
...
@@ -99,7 +100,8 @@
var
property_definition
=
var
property_definition
=
options
.
property_definition
.
properties
[
property_name
],
options
.
property_definition
.
properties
[
property_name
],
value
,
value
,
i
=
0
,
property
;
i
=
0
,
property
,
index
;
if
(
property_definition
)
{
if
(
property_definition
)
{
value
=
property_definition
.
default
||
{};
value
=
property_definition
.
default
||
{};
if
(
property_definition
.
allOf
)
{
if
(
property_definition
.
allOf
)
{
...
@@ -122,6 +124,33 @@
...
@@ -122,6 +124,33 @@
console
.
log
(
options
);
console
.
log
(
options
);
console
.
log
(
options
.
value
);
console
.
log
(
options
.
value
);
console
.
log
(
property_name
);
console
.
log
(
property_name
);
// XXX if the field is complex then the value may be complex
// eg options.value > "time_to_failure":{},"time_to_repair":{}...
// while the property_names are abstract as allOf_1 corresponding
// to (for example) time_to_failure
if
(
options
.
property_definition
.
properties
[
property_name
].
allOf
)
{
if
((
options
.
value
||
{})[
property_name
]
===
undefined
)
{
if
(
typeof
options
.
value
===
'
object
'
)
{
if
(
Object
.
keys
(
options
.
value
).
length
>
0
)
{
for
(
index
=
0
;
index
<
Object
.
keys
(
options
.
value
).
length
-
1
;
index
+=
1
)
{
if
(
!
(
reserved_keys
.
indexOf
(
Object
.
keys
(
options
.
value
)[
index
])
>
-
1
))
{
reserved_keys
.
push
(
Object
.
keys
(
options
.
value
)[
index
]
);
value
=
options
.
value
[
Object
.
keys
(
options
.
value
)[
index
]];
break
;
}
}
}
}
}
}
value
=
(
options
.
value
||
{})[
property_name
]
===
undefined
value
=
(
options
.
value
||
{})[
property_name
]
===
undefined
?
value
:
options
.
value
[
property_name
];
?
value
:
options
.
value
[
property_name
];
if
(
property_name
!==
'
coordinate
'
if
(
property_name
!==
'
coordinate
'
...
...
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