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
d727a4ad
Commit
d727a4ad
authored
Jul 02, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] History: speed up URLs calculation
parent
2c71321f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
39 deletions
+44
-39
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_history_js.js
...teItem/web_page_module/rjs_gadget_erp5_page_history_js.js
+41
-36
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_history_js.xml
...eItem/web_page_module/rjs_gadget_erp5_page_history_js.xml
+3
-3
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_history_js.js
View file @
d727a4ad
...
...
@@ -19,7 +19,7 @@
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlFor
List
"
,
"
getUrlForList
"
)
/////////////////////////////////////////////////////////////////
// declared methods
...
...
@@ -27,56 +27,56 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
id_list
=
options
.
id_list
||
[],
header_dict
=
{
page_title
:
'
History
'
,
page_icon
:
'
history
'
}
;
j
,
query_list
=
[]
,
queue
,
row_list
;
return
gadget
.
getUrlFor
({
command
:
'
display
'
})
.
push
(
function
(
front_url
)
{
header_dict
.
front_url
=
front_url
;
return
gadget
.
updateHeader
(
header_dict
);
})
.
push
(
function
()
{
var
i
,
query_list
=
[];
for
(
i
=
0
;
i
<
id_list
.
length
;
i
+=
1
)
{
query_list
.
push
(
new
SimpleQuery
({
key
:
'
relative_url
'
,
value
:
id_list
[
i
]}));
}
if
(
i
===
0
)
{
for
(
j
=
0
;
j
<
id_list
.
length
;
j
+=
1
)
{
query_list
.
push
(
new
SimpleQuery
({
key
:
'
relative_url
'
,
value
:
id_list
[
j
]
}));
}
if
(
j
===
0
)
{
queue
=
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
{
data
:
{
rows
:
[]
}
};
}
return
gadget
.
jio_allDocs
({
query
:
Query
.
objectToSearchText
(
new
ComplexQuery
({
operator
:
'
OR
'
,
query_list
:
query_list
})),
select_list
:
[
"
title
"
,
"
translated_portal_type
"
],
limit
:
id_list
.
length
});
})
}
else
{
queue
=
gadget
.
jio_allDocs
({
query
:
Query
.
objectToSearchText
(
new
ComplexQuery
({
operator
:
'
OR
'
,
query_list
:
query_list
})),
select_list
:
[
"
title
"
,
"
translated_portal_type
"
],
limit
:
id_list
.
length
});
}
return
queue
.
push
(
function
(
result
)
{
var
result_list
=
[
],
var
url_for_parameter_list
=
[{
command
:
'
display
'
}
],
i
;
for
(
i
=
0
;
i
<
result
.
data
.
rows
.
length
;
i
+=
1
)
{
result_list
.
push
(
RSVP
.
all
([
gadget
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
jio_key
:
result
.
data
.
rows
[
i
].
id
}}),
result
.
data
.
rows
[
i
].
value
,
result
.
data
.
rows
[
i
].
id
])
);
row_list
=
result
.
data
.
rows
;
for
(
i
=
0
;
i
<
row_list
.
length
;
i
+=
1
)
{
url_for_parameter_list
.
push
({
command
:
'
display
'
,
options
:
{
jio_key
:
row_list
[
i
].
id
}
}
);
}
return
RSVP
.
all
(
result
_list
);
return
gadget
.
getUrlForList
(
url_for_parameter
_list
);
})
.
push
(
function
(
result
_list
)
{
.
push
(
function
(
url
_list
)
{
var
i
,
document_list
=
[],
document_dict
=
{};
for
(
i
=
0
;
i
<
result_list
.
length
;
i
+=
1
)
{
document_dict
[
result_list
[
i
][
2
]]
=
{
link
:
result_list
[
i
][
0
],
title
:
(
result_list
[
i
][
1
].
title
||
result_list
[
i
][
2
])
+
"
(
"
+
result_list
[
i
][
1
].
translated_portal_type
+
"
)
"
for
(
i
=
1
;
i
<
url_list
.
length
;
i
+=
1
)
{
document_dict
[
row_list
[
i
-
1
].
id
]
=
{
link
:
url_list
[
i
],
title
:
(
row_list
[
i
-
1
].
value
.
title
||
row_list
[
i
-
1
].
id
)
+
"
(
"
+
row_list
[
i
-
1
].
value
.
translated_portal_type
+
"
)
"
};
}
// Sort by access time
...
...
@@ -88,6 +88,11 @@
gadget
.
element
.
querySelector
(
'
.document_list
'
).
innerHTML
=
table_template
(
{
document_list
:
document_list
}
);
return
gadget
.
updateHeader
({
page_title
:
'
History
'
,
page_icon
:
'
history
'
,
front_url
:
url_list
[
0
]
});
});
});
}(
window
,
rJS
,
RSVP
,
Handlebars
,
SimpleQuery
,
ComplexQuery
,
Query
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_history_js.xml
View file @
d727a4ad
...
...
@@ -216,7 +216,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
superkato
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
6.40160.48147.18688
</string>
</value>
<value>
<string>
96
8.41630.8511.54391
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
22767706.51
</float>
<float>
15
30547123.46
</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