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
124f5b24
Commit
124f5b24
authored
Apr 30, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: default to full fieldlist on queries to enable querying
parent
f2ab9a4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
13 deletions
+33
-13
js/erp5_loader.js
js/erp5_loader.js
+33
-13
No files found.
js/erp5_loader.js
View file @
124f5b24
...
...
@@ -4555,19 +4555,29 @@
* Generate an array of fields from a dict
* @method makeSelectList
* @param {object} scheme of gadget to retrieve fields from
* @param {object} field_dict
* @return {array} select_list
**/
storage
.
makeSelectList
=
function
(
scheme
)
{
var
i
,
j
,
field
,
select_list
=
[];
for
(
i
=
0
;
i
<
scheme
.
length
;
i
+=
1
)
{
for
(
j
=
0
;
j
<
scheme
[
i
].
field_list
.
length
;
j
+=
1
)
{
field
=
scheme
[
i
].
field_list
[
j
];
if
(
field
.
field
&&
select_list
.
indexOf
(
field
.
field
)
===
-
1
)
{
select_list
.
push
(
field
.
field
);
storage
.
makeSelectList
=
function
(
scheme
,
field_dict
)
{
var
i
,
j
,
field
,
prop
,
select_list
=
[];
if
(
scheme
)
{
for
(
i
=
0
;
i
<
scheme
.
length
;
i
+=
1
)
{
for
(
j
=
0
;
j
<
scheme
[
i
].
field_list
.
length
;
j
+=
1
)
{
field
=
scheme
[
i
].
field_list
[
j
];
if
(
field
.
field
&&
select_list
.
indexOf
(
field
.
field
)
===
-
1
)
{
select_list
.
push
(
field
.
field
);
}
}
}
}
else
{
for
(
prop
in
field_dict
)
{
if
(
field_dict
.
hasOwnProperty
(
prop
))
{
select_list
.
push
(
prop
);
}
}
}
// if nothing is to be fetched, make sure we return at least the _id
if
(
select_list
.
length
===
0
&&
select_list
.
indexOf
(
"
_id
"
)
===
-
1
)
{
select_list
.
push
(
"
_id
"
);
...
...
@@ -6326,16 +6336,26 @@
// only fetch columns based on gadget configuration
}
else
{
if
(
pass
.
data_dict
.
field_dict
&&
storage
&&
app
.
storage_dict
.
property_dict
.
force_field_definitions
&&
pass
.
config_dict
.
scheme
)
{
// force definitions = we only get what we need
if
(
app
.
storage_dict
.
property_dict
.
force_field_definitions
&&
pass
.
config_dict
.
scheme
)
{
pass
.
data_dict
.
field_list
=
storage
.
makeSelectList
(
pass
.
config_dict
.
scheme
);
// else get all columns, otherwise we cannot search later?
}
else
{
pass
.
data_dict
.
field_list
=
storage
.
makeSelectList
(
undefined
,
pass
.
data_dict
.
field_dict
);
}
// we shouldn't have to regenerate the query here only because
// we now add the field_list
pass
.
state
.
query
=
storage
.
parseQuery
(
pass
.
config_dict
.
initial_query
,
pass
.
config_dict
.
portal_type_source
,
...
...
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