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
Léo-Paul Géneau
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
Show 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 @@
...
@@ -20,29 +20,20 @@
.
declareAcquiredMethod
(
"
jio_getAttachment
"
,
"
jio_getAttachment
"
)
.
declareAcquiredMethod
(
"
jio_getAttachment
"
,
"
jio_getAttachment
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlFor
List
"
,
"
getUrlForList
"
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
()
{
.
declareMethod
(
"
render
"
,
function
()
{
var
gadget
=
this
,
var
gadget
=
this
,
header_dict
=
{
action_list
;
page_title
:
'
Worklist
'
,
page_icon
:
'
tasks
'
};
return
gadget
.
getUrlFor
({
command
:
'
display
'
})
// Fetch worklist data
.
push
(
function
(
url
)
{
header_dict
.
front_url
=
url
;
return
gadget
.
updateHeader
(
header_dict
);
})
.
push
(
function
()
{
return
gadget
.
jio_getAttachment
(
return
gadget
.
jio_getAttachment
(
'
portal_workflow
'
,
'
portal_workflow
'
,
'
links
'
'
links
'
);
)
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
return
gadget
.
jio_getAttachment
(
return
gadget
.
jio_getAttachment
(
// result.data.rows[0].id,
// result.data.rows[0].id,
...
@@ -50,12 +41,15 @@
...
@@ -50,12 +41,15 @@
result
.
_links
.
action_worklist
.
href
result
.
_links
.
action_worklist
.
href
);
);
})
})
// Calculate all URLs
.
push
(
function
(
links
)
{
.
push
(
function
(
links
)
{
var
action_list
=
links
.
worklist
,
var
query_string
,
query_string
,
// Back URL
promise_list
=
[
gadget
.
translate
(
'
All work caught up!
'
)
],
url_for_parameter_list
=
[{
command
:
'
display
'
}
],
display_options
,
display_options
,
i
;
i
;
action_list
=
links
.
worklist
;
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
query_string
=
new
URI
(
action_list
[
i
].
href
).
query
(
true
).
query
;
query_string
=
new
URI
(
action_list
[
i
].
href
).
query
(
true
).
query
;
display_options
=
{
extended_search
:
query_string
};
display_options
=
{
extended_search
:
query_string
};
...
@@ -73,31 +67,39 @@
...
@@ -73,31 +67,39 @@
page
:
'
search
'
page
:
'
search
'
};
};
}
}
promise_list
.
push
(
RSVP
.
all
([
url_for_parameter_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
display_stored_state
'
,
options
:
display_options
}),
{
command
:
'
display_stored_state
'
,
options
:
display_options
}
// Remove the counter from the title
);
action_list
[
i
].
name
,
action_list
[
i
].
count
]));
}
}
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
)
{
.
push
(
function
(
result_list
)
{
var
line_list
=
[],
var
line_list
=
[],
url_list
=
result_list
[
1
],
i
;
i
;
for
(
i
=
1
;
i
<
result
_list
.
length
;
i
+=
1
)
{
for
(
i
=
1
;
i
<
url
_list
.
length
;
i
+=
1
)
{
line_list
.
push
({
line_list
.
push
({
link
:
result_list
[
i
][
0
],
link
:
url_list
[
i
],
title
:
result_list
[
i
][
1
],
// Remove the counter from the title
count
:
result_list
[
i
][
2
]
title
:
action_list
[
i
-
1
].
name
,
count
:
action_list
[
i
-
1
].
count
});
});
}
}
gadget
.
element
.
querySelector
(
'
.document_list
'
).
innerHTML
=
gadget
.
element
.
querySelector
(
'
.document_list
'
).
innerHTML
=
table_template
({
table_template
({
document_list
:
line_list
,
document_list
:
line_list
,
empty_text
:
result_list
[
0
]
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 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
153053
4841.9
</float>
<float>
153053
5868.66
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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