Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
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
Yaxel Perez
jio
Commits
ee320069
Commit
ee320069
authored
Jun 14, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5storage] Remove one not needed queue
parent
86970117
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
49 deletions
+46
-49
src/jio.storage/erp5storage.js
src/jio.storage/erp5storage.js
+46
-49
No files found.
src/jio.storage/erp5storage.js
View file @
ee320069
...
@@ -73,59 +73,56 @@
...
@@ -73,59 +73,56 @@
};
};
function
extractPropertyFromFormJSON
(
json
)
{
function
extractPropertyFromFormJSON
(
json
)
{
return
new
RSVP
.
Queue
()
var
form
=
json
.
_embedded
.
_view
,
.
push
(
function
()
{
converted_json
=
{
var
form
=
json
.
_embedded
.
_view
,
portal_type
:
json
.
_links
.
type
.
name
converted_json
=
{
},
portal_type
:
json
.
_links
.
type
.
name
form_data_json
=
{},
},
field
,
form_data_json
=
{},
key
,
field
,
prefix_length
,
key
,
result
;
prefix_length
,
result
;
if
(
json
.
_links
.
hasOwnProperty
(
'
parent
'
))
{
converted_json
.
parent_relative_url
=
new
URI
(
json
.
_links
.
parent
.
href
).
segment
(
2
);
}
if
(
json
.
_links
.
hasOwnProperty
(
'
parent
'
))
{
form_data_json
.
form_id
=
{
converted_json
.
parent_relative_url
=
"
key
"
:
[
form
.
form_id
.
key
],
new
URI
(
json
.
_links
.
parent
.
href
).
segment
(
2
);
"
default
"
:
form
.
form_id
[
"
default
"
]
};
// XXX How to store datetime
for
(
key
in
form
)
{
if
(
form
.
hasOwnProperty
(
key
))
{
field
=
form
[
key
];
prefix_length
=
0
;
if
(
key
.
indexOf
(
'
my_
'
)
===
0
&&
field
.
editable
)
{
prefix_length
=
3
;
}
}
if
(
key
.
indexOf
(
'
your_
'
)
===
0
)
{
form_data_json
.
form_id
=
{
prefix_length
=
5
;
"
key
"
:
[
form
.
form_id
.
key
],
"
default
"
:
form
.
form_id
[
"
default
"
]
};
// XXX How to store datetime
for
(
key
in
form
)
{
if
(
form
.
hasOwnProperty
(
key
))
{
field
=
form
[
key
];
prefix_length
=
0
;
if
(
key
.
indexOf
(
'
my_
'
)
===
0
&&
field
.
editable
)
{
prefix_length
=
3
;
}
if
(
key
.
indexOf
(
'
your_
'
)
===
0
)
{
prefix_length
=
5
;
}
if
((
prefix_length
!==
0
)
&&
(
allowed_field_dict
.
hasOwnProperty
(
field
.
type
)))
{
form_data_json
[
key
.
substring
(
prefix_length
)]
=
{
"
default
"
:
field
[
"
default
"
],
"
key
"
:
field
.
key
};
converted_json
[
key
.
substring
(
prefix_length
)]
=
field
[
"
default
"
];
}
}
}
}
if
((
prefix_length
!==
0
)
&&
result
=
{
(
allowed_field_dict
.
hasOwnProperty
(
field
.
type
)))
{
data
:
converted_json
,
form_data_json
[
key
.
substring
(
prefix_length
)]
=
{
form_data
:
form_data_json
"
default
"
:
field
[
"
default
"
],
};
"
key
"
:
field
.
key
if
(
form
.
hasOwnProperty
(
'
_actions
'
)
&&
};
form
.
_actions
.
hasOwnProperty
(
'
put
'
))
{
converted_json
[
key
.
substring
(
prefix_length
)]
=
field
[
"
default
"
];
result
.
action_href
=
form
.
_actions
.
put
.
href
;
}
}
return
result
;
}
});
}
result
=
{
data
:
converted_json
,
form_data
:
form_data_json
};
if
(
form
.
hasOwnProperty
(
'
_actions
'
)
&&
form
.
_actions
.
hasOwnProperty
(
'
put
'
))
{
result
.
action_href
=
form
.
_actions
.
put
.
href
;
}
return
result
;
}
}
function
extractPropertyFromForm
(
context
,
id
)
{
function
extractPropertyFromForm
(
context
,
id
)
{
...
...
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