Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
erp5
Commits
dbd5c0d0
Commit
dbd5c0d0
authored
Mar 06, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Replicate jio 3.27.0 changes
parent
59622856
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
43 deletions
+93
-43
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.js
...athTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.js
+91
-41
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.xml
...thTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.js
View file @
dbd5c0d0
/*global window, rJS, RSVP, UriTemplate, URI,
Query,
SimpleQuery, ComplexQuery, jIO */
/*global window, rJS, RSVP, UriTemplate, URI, SimpleQuery, ComplexQuery, jIO */
/*jslint indent: 2, maxerr: 3, nomen: true */
(
function
(
window
,
rJS
,
RSVP
,
UriTemplate
,
URI
,
Query
,
SimpleQuery
,
ComplexQuery
,
jIO
)
{
(
function
(
window
,
rJS
,
RSVP
,
UriTemplate
,
URI
,
SimpleQuery
,
ComplexQuery
,
jIO
)
{
"
use strict
"
;
function
wrapJioCall
(
gadget
,
method_name
,
argument_list
)
{
...
...
@@ -42,12 +42,26 @@
function
isSingleLocalRoles
(
parsed_query
)
{
if
((
parsed_query
instanceof
SimpleQuery
)
&&
(
parsed_query
.
operator
===
undefined
)
&&
(
parsed_query
.
key
===
'
local_roles
'
))
{
// local_roles:"Assignee"
return
parsed_query
.
value
;
}
}
function
isSingleDomain
(
parsed_query
)
{
if
((
parsed_query
instanceof
SimpleQuery
)
&&
(
parsed_query
.
operator
===
undefined
)
&&
(
parsed_query
.
key
!==
undefined
)
&&
(
parsed_query
.
key
.
indexOf
(
'
selection_domain_
'
)
===
0
))
{
// domain_region:"europe/france"
var
result
=
{};
result
[
parsed_query
.
key
.
slice
(
'
selection_domain_
'
.
length
)]
=
parsed_query
.
value
;
return
result
;
}
}
function
isMultipleLocalRoles
(
parsed_query
)
{
var
i
,
sub_query
,
...
...
@@ -59,6 +73,7 @@
for
(
i
=
0
;
i
<
parsed_query
.
query_list
.
length
;
i
+=
1
)
{
sub_query
=
parsed_query
.
query_list
[
i
];
if
((
sub_query
instanceof
SimpleQuery
)
&&
(
sub_query
.
key
!==
undefined
)
&&
(
sub_query
.
key
===
'
local_roles
'
))
{
local_role_list
.
push
(
sub_query
.
value
);
}
else
{
...
...
@@ -104,76 +119,111 @@
});
})
.
declareMethod
(
'
allDocs
'
,
function
(
option
_dict
)
{
.
declareMethod
(
'
allDocs
'
,
function
(
option
s
)
{
// throw new Error('do not use all docs');
if
(
option
_dict
.
list_method_template
===
undefined
)
{
if
(
option
s
.
list_method_template
===
undefined
)
{
return
wrapJioCall
(
this
,
'
allDocs
'
,
arguments
);
}
var
query
=
option
_dict
.
query
,
var
query
=
option
s
.
query
,
i
,
key
,
parsed_query
,
sub_query
,
result_list
,
tmp_list
=
[],
local_roles
;
if
(
option_dict
.
query
)
{
parsed_query
=
jIO
.
QueryFactory
.
create
(
option_dict
.
query
);
local_roles
,
local_role_found
=
false
,
selection_domain
,
sort_list
=
[];
if
(
options
.
query
)
{
parsed_query
=
jIO
.
QueryFactory
.
create
(
options
.
query
);
result_list
=
isSingleLocalRoles
(
parsed_query
);
if
(
result_list
)
{
query
=
undefined
;
local_roles
=
result_list
;
}
else
{
result_list
=
isMultipleLocalRoles
(
parsed_query
);
result_list
=
isSingleDomain
(
parsed_query
);
if
(
result_list
)
{
query
=
undefined
;
local_roles
=
result_list
;
}
else
if
((
parsed_query
instanceof
ComplexQuery
)
&&
(
parsed_query
.
operator
===
'
AND
'
))
{
// portal_type:"Person" AND local_roles:"Assignee"
for
(
i
=
0
;
i
<
parsed_query
.
query_list
.
length
;
i
+=
1
)
{
sub_query
=
parsed_query
.
query_list
[
i
];
result_list
=
isSingleLocalRoles
(
sub_query
);
if
(
result_list
)
{
local_roles
=
result_list
;
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
Query
.
objectToSearchText
(
parsed_query
);
i
=
parsed_query
.
query_list
.
length
;
}
else
{
result_list
=
isMultipleLocalRoles
(
sub_query
);
selection_domain
=
result_list
;
}
else
{
result_list
=
isMultipleLocalRoles
(
parsed_query
);
if
(
result_list
)
{
query
=
undefined
;
local_roles
=
result_list
;
}
else
if
((
parsed_query
instanceof
ComplexQuery
)
&&
(
parsed_query
.
operator
===
'
AND
'
))
{
// portal_type:"Person" AND local_roles:"Assignee"
// AND selection_domain_region:"europe/france"
for
(
i
=
0
;
i
<
parsed_query
.
query_list
.
length
;
i
+=
1
)
{
sub_query
=
parsed_query
.
query_list
[
i
];
if
(
!
local_role_found
)
{
result_list
=
isSingleLocalRoles
(
sub_query
);
if
(
result_list
)
{
local_roles
=
result_list
;
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
local_role_found
=
true
;
}
else
{
result_list
=
isMultipleLocalRoles
(
sub_query
);
if
(
result_list
)
{
local_roles
=
result_list
;
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
local_role_found
=
true
;
}
}
}
result_list
=
isSingleDomain
(
sub_query
);
if
(
result_list
)
{
local_roles
=
result_list
;
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
Query
.
objectToSearchText
(
parsed_query
);
i
=
parsed_query
.
query_list
.
length
;
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
if
(
selection_domain
)
{
for
(
key
in
result_list
)
{
if
(
result_list
.
hasOwnProperty
(
key
))
{
selection_domain
[
key
]
=
result_list
[
key
];
}
}
}
else
{
selection_domain
=
result_list
;
}
i
-=
1
;
}
}
}
}
}
option_dict
.
query
=
query
;
option_dict
.
local_roles
=
local_roles
;
}
if
(
option_dict
.
sort_on
)
{
for
(
i
=
0
;
i
<
option_dict
.
sort_on
.
length
;
i
+=
1
)
{
tmp_list
.
push
(
JSON
.
stringify
(
option_dict
.
sort_on
[
i
]));
if
(
options
.
sort_on
)
{
for
(
i
=
0
;
i
<
options
.
sort_on
.
length
;
i
+=
1
)
{
sort_list
.
push
(
JSON
.
stringify
(
options
.
sort_on
[
i
]));
}
option_dict
.
sort_on
=
tmp_list
;
}
if
(
selection_domain
)
{
selection_domain
=
JSON
.
stringify
(
selection_domain
);
}
options
.
query
=
query
;
options
.
sort_on
=
sort_list
;
options
.
local_roles
=
local_roles
;
options
.
selection_domain
=
selection_domain
;
return
wrapJioCall
(
this
,
'
getAttachment
'
,
[
// XXX Ugly hardcoded meaningless id...
"
erp5
"
,
new
UriTemplate
.
parse
(
option
_dict
.
list_method_template
)
.
expand
(
option
_dict
),
new
UriTemplate
.
parse
(
option
s
.
list_method_template
)
.
expand
(
option
s
),
{
format
:
"
json
"
}
]
)
...
...
@@ -224,4 +274,4 @@
return
wrapJioCall
(
this
,
'
post
'
,
[
doc
]);
});
}(
window
,
rJS
,
RSVP
,
UriTemplate
,
URI
,
Query
,
SimpleQuery
,
ComplexQuery
,
jIO
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
UriTemplate
,
URI
,
SimpleQuery
,
ComplexQuery
,
jIO
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.xml
View file @
dbd5c0d0
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
3.59331.40212.55432
</string>
</value>
<value>
<string>
96
5.65535.18355.17288
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
12454358.3
3
</float>
<float>
15
20357812.7
3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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