Ensure that query history should be listed by date/time in descending order. Fixes #5842

This commit is contained in:
Pradip Parkale 2020-10-23 15:06:56 +05:30 committed by Akshay Joshi
parent 9b4317fb25
commit 7573fac29f
2 changed files with 19 additions and 2 deletions

View File

@ -19,6 +19,7 @@ Bug fixes
*********
| `Issue #4639 <https://redmine.postgresql.org/issues/4639>`_ - Ensure that some fields should be disabled for the trigger in edit mode.
| `Issue #5842 <https://redmine.postgresql.org/issues/5842>`_ - Ensure that query history should be listed by date/time in descending order.
| `Issue #5858 <https://redmine.postgresql.org/issues/5858>`_ - Ensure that search object functionality works with case insensitive string.
| `Issue #5895 <https://redmine.postgresql.org/issues/5895>`_ - Fixed an issue where the suffix for Toast table size is not visible in the Statistics tab.
| `Issue #5911 <https://redmine.postgresql.org/issues/5911>`_ - Ensure that macros should be run on the older version of Safari and Chrome.

View File

@ -235,8 +235,24 @@ export class QueryHistoryEntries {
newItem.onClick(this.setSelectedListItem.bind(this));
newItem.render(this.is_pgadmin_queries_shown);
if (!_.isUndefined($groupEl))
$groupEl.find('.query-entries').prepend(newItem.$el);
if (!_.isUndefined($groupEl)){
let entries = $groupEl.find('.query-entries').find('.list-item');
let i=0;
if(entries.length > 0)
{
while(i<entries.length){
if(newItem.$el.attr('data-key') > $(entries[i]).attr('data-key')) {
$(newItem.$el).insertBefore(entries[i]);
break;
}else{
$(newItem.$el).insertAfter(entries[i]);
}
i++;
}
} else{
$groupEl.find('.query-entries').append(newItem.$el);
}
}
this.setSelectedListItem(newItem.$el);
}