Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
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
Hardik Juneja
jio-main
Commits
4c99f38f
Commit
4c99f38f
authored
Mar 11, 2016
by
Xiaohe Cao
Committed by
Romain Courteaud
Mar 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Storage: fix allDocs's sort_on parameter handling
parent
c4e7bbde
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
src/jio.storage/erp5storage.js
src/jio.storage/erp5storage.js
+9
-1
test/jio.storage/erp5storage.tests.js
test/jio.storage/erp5storage.tests.js
+6
-3
No files found.
src/jio.storage/erp5storage.js
View file @
4c99f38f
...
@@ -481,7 +481,8 @@
...
@@ -481,7 +481,8 @@
parsed_query
,
parsed_query
,
sub_query
,
sub_query
,
result_list
,
result_list
,
local_roles
;
local_roles
,
tmp_list
=
[];
if
(
options
.
query
)
{
if
(
options
.
query
)
{
parsed_query
=
jIO
.
QueryFactory
.
create
(
options
.
query
);
parsed_query
=
jIO
.
QueryFactory
.
create
(
options
.
query
);
...
@@ -523,6 +524,13 @@
...
@@ -523,6 +524,13 @@
}
}
}
}
if
(
options
.
sort_on
)
{
for
(
i
=
0
;
i
<
options
.
sort_on
.
length
;
i
+=
1
)
{
tmp_list
.
push
(
JSON
.
stringify
(
options
.
sort_on
[
i
]));
}
options
.
sort_on
=
tmp_list
;
}
return
jIO
.
util
.
ajax
({
return
jIO
.
util
.
ajax
({
"
type
"
:
"
GET
"
,
"
type
"
:
"
GET
"
,
"
url
"
:
UriTemplate
.
parse
(
site_hal
.
_links
.
raw_search
.
href
)
"
url
"
:
UriTemplate
.
parse
(
site_hal
.
_links
.
raw_search
.
href
)
...
...
test/jio.storage/erp5storage.tests.js
View file @
4c99f38f
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
domain
=
"
https://example.org
"
,
domain
=
"
https://example.org
"
,
traverse_template
=
domain
+
"
?mode=traverse{&relative_url,view}
"
,
traverse_template
=
domain
+
"
?mode=traverse{&relative_url,view}
"
,
search_template
=
domain
+
"
?mode=search{&query,select_list*,limit*,
"
+
search_template
=
domain
+
"
?mode=search{&query,select_list*,limit*,
"
+
"
local_roles*}
"
,
"
sort_on*,
local_roles*}
"
,
add_url
=
domain
+
"
lets?add=somedocument
"
,
add_url
=
domain
+
"
lets?add=somedocument
"
,
bulk_url
=
domain
+
"
lets?run=bulk
"
,
bulk_url
=
domain
+
"
lets?run=bulk
"
,
root_hateoas
=
JSON
.
stringify
({
root_hateoas
=
JSON
.
stringify
({
...
@@ -1102,7 +1102,9 @@
...
@@ -1102,7 +1102,9 @@
test
(
"
filter documents
"
,
function
()
{
test
(
"
filter documents
"
,
function
()
{
var
search_url
=
domain
+
"
?mode=search&query=title%3A%20%22two%22&
"
+
var
search_url
=
domain
+
"
?mode=search&query=title%3A%20%22two%22&
"
+
"
select_list=destination&select_list=source&limit=5
"
,
"
select_list=destination&select_list=source&limit=5&
"
+
"
sort_on=%5B%22title%22%2C%22descending%22%5D&
"
+
"
sort_on=%5B%22id%22%2C%22descending%22%5D
"
,
search_hateoas
=
JSON
.
stringify
({
search_hateoas
=
JSON
.
stringify
({
"
_embedded
"
:
{
"
_embedded
"
:
{
...
@@ -1142,7 +1144,8 @@
...
@@ -1142,7 +1144,8 @@
this
.
jio
.
allDocs
({
this
.
jio
.
allDocs
({
limit
:
[
5
],
limit
:
[
5
],
select_list
:
[
"
destination
"
,
"
source
"
],
select_list
:
[
"
destination
"
,
"
source
"
],
query
:
'
title: "two"
'
query
:
'
title: "two"
'
,
sort_on
:
[[
"
title
"
,
"
descending
"
],
[
"
id
"
,
"
descending
"
]]
})
})
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
deepEqual
(
result
,
{
deepEqual
(
result
,
{
...
...
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