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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
erp5
Commits
2c71321f
Commit
2c71321f
authored
Jul 02, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Worklist: speed up URLs calculation
parent
4a857ddc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
33 deletions
+35
-33
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_worklist_js.js
...eItem/web_page_module/rjs_gadget_erp5_page_worklist_js.js
+33
-31
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_worklist_js.xml
...Item/web_page_module/rjs_gadget_erp5_page_worklist_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_worklist_js.js
View file @
2c71321f
...
...
@@ -20,29 +20,20 @@
.
declareAcquiredMethod
(
"
jio_getAttachment
"
,
"
jio_getAttachment
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlFor
List
"
,
"
getUrlForList
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
()
{
var
gadget
=
this
,
header_dict
=
{
page_title
:
'
Worklist
'
,
page_icon
:
'
tasks
'
};
action_list
;
return
gadget
.
getUrlFor
({
command
:
'
display
'
})
.
push
(
function
(
url
)
{
header_dict
.
front_url
=
url
;
return
gadget
.
updateHeader
(
header_dict
);
})
.
push
(
function
()
{
return
gadget
.
jio_getAttachment
(
'
portal_workflow
'
,
'
links
'
);
})
// Fetch worklist data
return
gadget
.
jio_getAttachment
(
'
portal_workflow
'
,
'
links
'
)
.
push
(
function
(
result
)
{
return
gadget
.
jio_getAttachment
(
// result.data.rows[0].id,
...
...
@@ -50,12 +41,15 @@
result
.
_links
.
action_worklist
.
href
);
})
// Calculate all URLs
.
push
(
function
(
links
)
{
var
action_list
=
links
.
worklist
,
query_string
,
promise_list
=
[
gadget
.
translate
(
'
All work caught up!
'
)
],
var
query_string
,
// Back URL
url_for_parameter_list
=
[{
command
:
'
display
'
}
],
display_options
,
i
;
action_list
=
links
.
worklist
;
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
query_string
=
new
URI
(
action_list
[
i
].
href
).
query
(
true
).
query
;
display_options
=
{
extended_search
:
query_string
};
...
...
@@ -73,31 +67,39 @@
page
:
'
search
'
};
}
promise_list
.
push
(
RSVP
.
all
([
gadget
.
getUrlFor
({
command
:
'
display_stored_state
'
,
options
:
display_options
}),
// Remove the counter from the title
action_list
[
i
].
name
,
action_list
[
i
].
count
]));
url_for_parameter_list
.
push
(
{
command
:
'
display_stored_state
'
,
options
:
display_options
}
);
}
return
RSVP
.
all
(
promise_list
);
return
RSVP
.
all
([
gadget
.
translate
(
'
All work caught up!
'
),
gadget
.
getUrlForList
(
url_for_parameter_list
)
]);
})
// Add in the page
.
push
(
function
(
result_list
)
{
var
line_list
=
[],
url_list
=
result_list
[
1
],
i
;
for
(
i
=
1
;
i
<
result
_list
.
length
;
i
+=
1
)
{
for
(
i
=
1
;
i
<
url
_list
.
length
;
i
+=
1
)
{
line_list
.
push
({
link
:
result_list
[
i
][
0
],
title
:
result_list
[
i
][
1
],
count
:
result_list
[
i
][
2
]
link
:
url_list
[
i
],
// Remove the counter from the title
title
:
action_list
[
i
-
1
].
name
,
count
:
action_list
[
i
-
1
].
count
});
}
gadget
.
element
.
querySelector
(
'
.document_list
'
).
innerHTML
=
table_template
({
document_list
:
line_list
,
empty_text
:
result_list
[
0
]
});
return
gadget
.
updateHeader
({
page_title
:
'
Worklist
'
,
page_icon
:
'
tasks
'
,
front_url
:
url_list
[
0
]
});
});
});
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_worklist_js.xml
View file @
2c71321f
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
968.414
23.51057.42700
</string>
</value>
<value>
<string>
968.414
41.46653.47513
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
153053
4841.9
</float>
<float>
153053
5868.66
</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