Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0b984fe

Browse files
committedDec 19, 2024··
Added triage to timeline code
1 parent 5e08d47 commit 0b984fe

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
 

‎lib/GADS/Timeline.pm

+5
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,11 @@ sub _build_items
428428

429429
$self->_set_display_to($oldest)
430430
if $oldest > ($self->display_to || AT_BIGBANG);
431+
432+
if(scalar(@items) > 1000) # XXX Arbitrary limit
433+
{ warning __"Too many items to display on the timeline - showing first 1000 results";
434+
last;
435+
}
431436
}
432437

433438
if(!@items)

‎src/frontend/components/timeline/lib/component.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class TimelineComponent extends Component {
1212
this.el = $(this.element)
1313

1414
this.initTimeline()
15+
this.tl_request = undefined
1516
}
1617

1718
initTimeline() {
@@ -257,12 +258,13 @@ class TimelineComponent extends Component {
257258
if (is_dashboard) {
258259
url = url + '&dashboard=1&view=' + $container.data('view')
259260
}
260-
$.ajax({
261-
async: false,
261+
if(self.tl_request) self.tl_request.abort()
262+
self.tl_request = $.ajax({
262263
url: url,
263264
dataType: 'json',
264265
success: function(data) {
265266
items.add(data)
267+
self.tl_request = undefined
266268
}
267269
})
268270
}

0 commit comments

Comments
 (0)
Please sign in to comment.