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
Roque
jio
Commits
be5913c7
Commit
be5913c7
authored
Jul 10, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_storage] Fix role and domain parsing
parent
b9395035
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
src/jio.storage/erp5storage.js
src/jio.storage/erp5storage.js
+2
-0
test/jio.storage/erp5storage.tests.js
test/jio.storage/erp5storage.tests.js
+53
-0
No files found.
src/jio.storage/erp5storage.js
View file @
be5913c7
...
@@ -521,6 +521,7 @@
...
@@ -521,6 +521,7 @@
parsed_query
.
query_list
.
splice
(
i
,
1
);
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
local_role_found
=
true
;
local_role_found
=
true
;
sub_query
=
parsed_query
.
query_list
[
i
];
}
else
{
}
else
{
result_list
=
isMultipleLocalRoles
(
sub_query
);
result_list
=
isMultipleLocalRoles
(
sub_query
);
if
(
result_list
)
{
if
(
result_list
)
{
...
@@ -528,6 +529,7 @@
...
@@ -528,6 +529,7 @@
parsed_query
.
query_list
.
splice
(
i
,
1
);
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
local_role_found
=
true
;
local_role_found
=
true
;
sub_query
=
parsed_query
.
query_list
[
i
];
}
}
}
}
}
}
...
...
test/jio.storage/erp5storage.tests.js
View file @
be5913c7
...
@@ -2076,6 +2076,59 @@
...
@@ -2076,6 +2076,59 @@
});
});
});
});
test
(
"
extract local_roles and selection_domain
"
,
function
()
{
var
search_url
=
domain
+
"
?mode=search&
"
+
"
query=&
"
+
"
select_list=uid&limit=5&
"
+
"
local_roles=Assignee&
"
+
"
selection_domain=%7B%22region%22%3A%22foo%2Fbar%22%7D
"
,
search_hateoas
=
JSON
.
stringify
({
"
_embedded
"
:
{
"
contents
"
:
[]
}
}),
server
=
this
.
server
;
this
.
server
.
respondWith
(
"
GET
"
,
domain
,
[
200
,
{
"
Content-Type
"
:
"
application/hal+json
"
},
root_hateoas
]);
this
.
server
.
respondWith
(
"
GET
"
,
search_url
,
[
200
,
{
"
Content-Type
"
:
"
application/hal+json
"
},
search_hateoas
]);
stop
();
expect
(
10
);
this
.
jio
.
allDocs
({
limit
:
[
5
],
select_list
:
[
"
uid
"
],
query
:
'
local_roles:"Assignee" AND selection_domain_region:"foo/bar"
'
})
.
then
(
function
(
result
)
{
deepEqual
(
result
,
{
data
:
{
rows
:
[],
total_rows
:
0
}
},
"
Check document
"
);
equal
(
server
.
requests
.
length
,
2
);
equal
(
server
.
requests
[
0
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
0
].
url
,
domain
);
equal
(
server
.
requests
[
0
].
requestBody
,
undefined
);
equal
(
server
.
requests
[
0
].
withCredentials
,
true
);
equal
(
server
.
requests
[
1
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
1
].
url
,
search_url
);
equal
(
server
.
requests
[
1
].
requestBody
,
undefined
);
equal
(
server
.
requests
[
1
].
withCredentials
,
true
);
})
.
fail
(
function
(
error
)
{
ok
(
false
,
error
);
})
.
always
(
function
()
{
start
();
});
});
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// erp5Storage.put
// erp5Storage.put
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
...
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