mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure sort/filter dialog should display proper message after losing database connection. Fixes #3561
This commit is contained in:
committed by
Akshay Joshi
parent
0f17b4f738
commit
25679fd542
@@ -7,17 +7,32 @@ import Backform from 'pgadmin.backform';
|
||||
import axios from 'axios';
|
||||
import queryToolActions from 'sources/sqleditor/query_tool_actions';
|
||||
import filterDialogModel from 'sources/sqleditor/filter_dialog_model';
|
||||
import {handleQueryToolAjaxError} from 'sources/sqleditor/query_tool_http_error_handler';
|
||||
|
||||
let FilterDialog = {
|
||||
'dialog': function(handler) {
|
||||
geturl: function(transId, reconnect) {
|
||||
let url = url_for('sqleditor.get_filter_data', {
|
||||
'trans_id': transId,
|
||||
});
|
||||
|
||||
if(reconnect) {
|
||||
url += '?connect=1';
|
||||
}
|
||||
|
||||
return url;
|
||||
},
|
||||
|
||||
'dialog': function(handler, reconnect) {
|
||||
let title = gettext('Sort/Filter options');
|
||||
axios.get(
|
||||
url_for('sqleditor.get_filter_data', {
|
||||
'trans_id': handler.transId,
|
||||
}),
|
||||
{ headers: {'Cache-Control' : 'no-cache'} }
|
||||
).then(function (res) {
|
||||
let response = res.data.data.result;
|
||||
|
||||
$.ajax({
|
||||
url: this.geturl(handler.transId, reconnect),
|
||||
headers: {
|
||||
'Cache-Control' : 'no-cache',
|
||||
},
|
||||
})
|
||||
.done(function (res) {
|
||||
let response = res.data.result;
|
||||
|
||||
// Check the alertify dialog already loaded then delete it to clear
|
||||
// the cache
|
||||
@@ -234,6 +249,9 @@ let FilterDialog = {
|
||||
});
|
||||
|
||||
Alertify.filterDialog(title).resizeTo('65%', '60%');
|
||||
})
|
||||
.fail(function(e) {
|
||||
handleQueryToolAjaxError(pgAdmin, handler, e, '_show_filter', [], true);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user