Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
nexedi
ecommerce-ui
Commits
755a962a
Commit
755a962a
authored
Apr 08, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: fix handling of sample data into storage.write
parent
ca3b5d5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
js/erp5_loader.js
js/erp5_loader.js
+14
-9
No files found.
js/erp5_loader.js
View file @
755a962a
...
...
@@ -4011,18 +4011,18 @@
action
=
(
obj
.
state
.
url_pointer
||
storage
.
obj
)[
pointer
];
config
=
{};
prefix
=
obj
.
id
+
"
_
"
;
valid
=
storage
.
validate
(
form
);
valid
=
obj
.
sample_store
||
storage
.
validate
(
form
);
if
(
valid
)
{
data
=
storage
.
parseForm
(
valid
,
prefix
,
true
);
data
=
obj
.
sample_data
||
storage
.
parseForm
(
valid
,
prefix
,
true
);
// TODO: remove, used for update scope, which does not honor form definition
if
(
obj
.
force_data
)
{
config
.
_force_data
=
true
;
}
if
(
form
.
identifier
)
{
if
(
obj
.
sample_data
.
_id
||
form
.
identifier
)
{
// PUT > set id, method and view
data
.
_id
=
form
.
identifier
.
value
;
data
.
_id
=
obj
.
sample_data
.
_id
||
form
.
identifier
.
value
;
method
=
"
put
"
;
config
.
_view
=
obj
.
state
.
view
;
}
...
...
@@ -5879,7 +5879,7 @@
if
(
reply
.
response
)
{
if
(
util
.
parse
(
reply
.
response
).
data
.
total_rows
===
0
)
{
return
util
.
ajax
(
{
"
url
"
:
"
data/
"
+
pass
.
config
.
portal_type_title
+
"
_sample.json
"
}
{
"
url
"
:
"
data/
"
+
pass
.
config
_dict
.
portal_type_title
+
"
_sample.json
"
}
)
// STORE SAMPLE DATA HERE!
.
then
(
function
(
e
)
{
...
...
@@ -5895,16 +5895,21 @@
// NOTE: do we still validate against field_dict?
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
record
=
response
[
i
];
record
.
portal_type
=
pass
.
config_dict
.
initial_query
;
promise_list
[
i
]
=
storage
.
write
(
record
);
record
.
portal_type
=
pass
.
config_dict
.
portal_type_source
;
promise_list
[
i
]
=
storage
.
write
({
"
sample_data
"
:
record
,
"
sample_store
"
:
true
,
"
state
"
:
{}
});
}
return
RSVP
.
all
(
promise_list
)
.
then
(
function
(
response_list
)
{
if
(
!
response_list
[
0
])
{
util
.
loader
(
""
,
"
status_dict.internal_error
"
,
"
ban-circle
"
);
app
.
util
.
loader
(
""
,
"
status_dict.internal_error
"
,
"
ban-circle
"
);
}
else
{
util
.
loader
(
""
,
"
status_dict.success
"
,
"
check
"
);
app
.
util
.
loader
(
""
,
"
status_dict.success
"
,
"
check
"
);
}
// just return pass and continue
return
{
...
...
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