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
Labels
Merge Requests
144
Merge Requests
144
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
61d79156
Commit
61d79156
authored
Feb 28, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_project_ui: drop string queries
parent
8fcfe975
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
21 deletions
+76
-21
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.js
..._page_module/project_gadget_page_project_front_page_js.js
+49
-13
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.xml
...page_module/project_gadget_page_project_front_page_js.xml
+2
-2
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.js
...em/web_page_module/project_gadget_page_project_page_js.js
+23
-4
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.xml
...m/web_page_module/project_gadget_page_project_page_js.xml
+2
-2
No files found.
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.js
View file @
61d79156
...
...
@@ -26,6 +26,25 @@
const
PORTAL_TYPE_LIST
=
[
"
Task
"
,
"
Bug
"
,
"
Task Report
"
];
const
VALID_STATE_LIST
=
[
"
planned
"
,
"
auto_planned
"
,
"
ordered
"
,
"
confirmed
"
,
"
ready
"
,
"
stopped
"
,
"
started
"
,
"
submitted
"
,
"
validated
"
];
function
createMultipleSimpleOrQuery
(
key
,
value_list
)
{
var
i
,
search_query
,
query_list
=
[];
for
(
i
=
0
;
i
<
value_list
.
length
;
i
+=
1
)
{
query_list
.
push
(
new
SimpleQuery
({
key
:
key
,
operator
:
""
,
type
:
"
simple
"
,
value
:
value_list
[
i
]
}));
}
return
new
ComplexQuery
({
operator
:
"
OR
"
,
query_list
:
query_list
,
type
:
"
complex
"
});
}
function
getProjectId
(
id
)
{
var
segments
=
id
.
split
(
"
/
"
);
if
(
segments
.
length
===
2
)
{
...
...
@@ -62,20 +81,31 @@
}
function
getProjectDocumentList
(
gadget
,
limit_date
)
{
var
document_query
;
document_query
=
Query
.
objectToSearchText
(
new
SimpleQuery
({
var
query_list
=
[],
document_query
;
query_list
.
push
(
new
SimpleQuery
({
key
:
"
source_project__validation_state
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
"
validated
"
}));
document_query
+=
'
AND simulation_state: ("
'
+
VALID_STATE_LIST
.
join
(
'
", "
'
)
+
'
")
'
;
document_query
+=
'
AND portal_type: ("
'
+
PORTAL_TYPE_LIST
.
join
(
'
", "
'
)
+
'
")
'
;
query_list
.
push
(
createMultipleSimpleOrQuery
(
'
portal_type
'
,
PORTAL_TYPE_LIST
))
;
query_list
.
push
(
createMultipleSimpleOrQuery
(
'
simulation_state
'
,
VALID_STATE_LIST
))
;
if
(
limit_date
)
{
document_query
+=
'
AND modification_date: < "
'
+
limit_date
+
'
"
'
;
query_list
.
push
(
new
SimpleQuery
({
key
:
"
modification_date
"
,
operator
:
"
<
"
,
type
:
"
simple
"
,
value
:
limit_date
}));
}
document_query
=
new
ComplexQuery
({
operator
:
"
AND
"
,
query_list
:
query_list
,
type
:
"
complex
"
});
return
gadget
.
jio_allDocs
({
query
:
document_query
,
query
:
Query
.
objectToSearchText
(
document_query
)
,
limit
:
QUERY_LIMIT
,
select_list
:
[
'
source_project__relative_url
'
,
'
portal_type
'
,
'
count(*)
'
],
group_by
:
[
'
portal_type
'
,
'
source_project__relative_url
'
],
...
...
@@ -352,16 +382,22 @@
var
gadget
=
this
,
i
,
test_list
,
test_result_query
=
Query
.
objectToSearchText
(
getComplexQuery
({
"
portal_type
"
:
"
Test Result
"
,
"
source_project__validation_state
"
:
"
validated
"
},
"
AND
"
)),
query_list
=
[],
test_result_query
,
test_state_list
=
[
"
failed
"
,
"
stopped
"
,
"
public_stopped
"
];
test_result_query
+=
'
AND simulation_state: ("
'
+
test_state_list
.
join
(
'
", "
'
)
+
'
")
'
;
query_list
.
push
(
getComplexQuery
({
"
portal_type
"
:
"
Test Result
"
,
"
source_project__validation_state
"
:
"
validated
"
},
"
AND
"
));
query_list
.
push
(
createMultipleSimpleOrQuery
(
'
simulation_state
'
,
test_state_list
));
test_result_query
=
new
ComplexQuery
({
operator
:
"
AND
"
,
query_list
:
query_list
,
type
:
"
complex
"
});
return
gadget
.
jio_allDocs
({
query
:
test_result_query
,
query
:
Query
.
objectToSearchText
(
test_result_query
)
,
limit
:
QUERY_LIMIT
,
select_list
:
[
'
source_project__relative_url
'
,
'
portal_type
'
],
select_list
:
[
'
source_project__relative_url
'
,
'
portal_type
'
,
'
modification_date
'
],
group_by
:
[
'
source_project__relative_url
'
],
sort_on
:
[[
"
modification_date
"
,
"
descending
"
]]
})
...
...
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_front_page_js.xml
View file @
61d79156
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
982.9
532.59635.1928
</string>
</value>
<value>
<string>
982.9
608.57814.23773
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
158289
4107.51
</float>
<float>
158289
8723.9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.js
View file @
61d79156
...
...
@@ -39,6 +39,25 @@
return
view_list
.
filter
(
d
=>
d
.
name
===
name
)[
0
].
href
;
}
function
createMultipleSimpleOrQuery
(
key
,
value_list
)
{
var
i
,
search_query
,
query_list
=
[];
for
(
i
=
0
;
i
<
value_list
.
length
;
i
+=
1
)
{
query_list
.
push
(
new
SimpleQuery
({
key
:
key
,
operator
:
""
,
type
:
"
simple
"
,
value
:
value_list
[
i
]
}));
}
return
new
ComplexQuery
({
operator
:
"
OR
"
,
query_list
:
query_list
,
type
:
"
complex
"
});
}
function
setLatestTestResult
(
gadget
,
svg_element
,
project_jio_key
)
{
var
query
=
createProjectQuery
(
project_jio_key
,
[[
"
portal_type
"
,
"
Test Result
"
]]);
...
...
@@ -146,17 +165,17 @@
type
:
"
simple
"
,
value
:
"
publication_section/
"
+
publication_section
}));
query
=
Query
.
objectToSearchText
(
new
ComplexQuery
({
query_list
.
push
(
createMultipleSimpleOrQuery
(
'
validation_state
'
,
VALID_STATE_LIST
));
query
=
new
ComplexQuery
({
operator
:
"
AND
"
,
query_list
:
query_list
,
type
:
"
complex
"
}));
query
+=
'
AND validation_state: ("
'
+
VALID_STATE_LIST
.
join
(
'
", "
'
)
+
'
")
'
;
});
return
gadget
.
getUrlFor
({
command
:
'
push_history
'
,
options
:
{
page
:
"
project_redirector
"
}})
.
push
(
function
(
url
)
{
redirector_ulr
=
url
;
return
gadget
.
jio_allDocs
({
query
:
query
,
query
:
Query
.
objectToSearchText
(
query
)
,
select_list
:
[
'
text_content
'
]
});
})
...
...
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_page_project_page_js.xml
View file @
61d79156
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
982.9
357.4568.2041
1
</string>
</value>
<value>
<string>
982.9
606.8399.2210
1
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
15828
83478.48
</float>
<float>
15828
98299.44
</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