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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
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 @@
...
@@ -19,7 +19,7 @@
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlFor
List
"
,
"
getUrlForList
"
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
...
@@ -27,56 +27,56 @@
...
@@ -27,56 +27,56 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
var
gadget
=
this
,
id_list
=
options
.
id_list
||
[],
id_list
=
options
.
id_list
||
[],
header_dict
=
{
j
,
page_title
:
'
History
'
,
query_list
=
[]
,
page_icon
:
'
history
'
queue
,
}
;
row_list
;
return
gadget
.
getUrlFor
({
command
:
'
display
'
})
for
(
j
=
0
;
j
<
id_list
.
length
;
j
+=
1
)
{
.
push
(
function
(
front_url
)
{
query_list
.
push
(
new
SimpleQuery
({
header_dict
.
front_url
=
front_url
;
key
:
'
relative_url
'
,
return
gadget
.
updateHeader
(
header_dict
);
value
:
id_list
[
j
]
})
}));
.
push
(
function
()
{
}
var
i
,
if
(
j
===
0
)
{
query_list
=
[];
queue
=
new
RSVP
.
Queue
()
for
(
i
=
0
;
i
<
id_list
.
length
;
i
+=
1
)
{
.
push
(
function
()
{
query_list
.
push
(
new
SimpleQuery
({
key
:
'
relative_url
'
,
value
:
id_list
[
i
]}));
}
if
(
i
===
0
)
{
return
{
return
{
data
:
{
data
:
{
rows
:
[]
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
)
{
.
push
(
function
(
result
)
{
var
result_list
=
[
],
var
url_for_parameter_list
=
[{
command
:
'
display
'
}
],
i
;
i
;
for
(
i
=
0
;
i
<
result
.
data
.
rows
.
length
;
i
+=
1
)
{
row_list
=
result
.
data
.
rows
;
result_list
.
push
(
RSVP
.
all
([
for
(
i
=
0
;
i
<
row_list
.
length
;
i
+=
1
)
{
gadget
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
jio_key
:
result
.
data
.
rows
[
i
].
id
}}),
url_for_parameter_list
.
push
({
result
.
data
.
rows
[
i
].
value
,
command
:
'
display
'
,
result
.
data
.
rows
[
i
].
id
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
,
var
i
,
document_list
=
[],
document_list
=
[],
document_dict
=
{};
document_dict
=
{};
for
(
i
=
0
;
i
<
result_list
.
length
;
i
+=
1
)
{
for
(
i
=
1
;
i
<
url_list
.
length
;
i
+=
1
)
{
document_dict
[
result_list
[
i
][
2
]]
=
{
document_dict
[
row_list
[
i
-
1
].
id
]
=
{
link
:
result_list
[
i
][
0
],
link
:
url_list
[
i
],
title
:
(
result_list
[
i
][
1
].
title
||
result_list
[
i
][
2
])
+
"
(
"
+
result_list
[
i
][
1
].
translated_portal_type
+
"
)
"
title
:
(
row_list
[
i
-
1
].
value
.
title
||
row_list
[
i
-
1
].
id
)
+
"
(
"
+
row_list
[
i
-
1
].
value
.
translated_portal_type
+
"
)
"
};
};
}
}
// Sort by access time
// Sort by access time
...
@@ -88,6 +88,11 @@
...
@@ -88,6 +88,11 @@
gadget
.
element
.
querySelector
(
'
.document_list
'
).
innerHTML
=
table_template
(
gadget
.
element
.
querySelector
(
'
.document_list
'
).
innerHTML
=
table_template
(
{
document_list
:
document_list
}
{
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
));
}(
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 @@
...
@@ -216,7 +216,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
superkato
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<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>
15
22767706.51
</float>
<float>
15
30547123.46
</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