mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-21 16:27:39 -06:00
Fixed an issue where query tool should show results and messages only from the last executed query. #8010
Fixed an issue where query tool should not prompt for unsaved changes when there are no changes. #8127
This commit is contained in:
parent
6d5b1673e6
commit
321366489d
@ -10,7 +10,7 @@ import React, {useContext, useCallback, useEffect, useMemo } from 'react';
|
|||||||
import { format } from 'sql-formatter';
|
import { format } from 'sql-formatter';
|
||||||
import { QueryToolContext, QueryToolEventsContext } from '../QueryToolComponent';
|
import { QueryToolContext, QueryToolEventsContext } from '../QueryToolComponent';
|
||||||
import CodeMirror from '../../../../../../static/js/components/ReactCodeMirror';
|
import CodeMirror from '../../../../../../static/js/components/ReactCodeMirror';
|
||||||
import {PANELS, QUERY_TOOL_EVENTS} from '../QueryToolConstants';
|
import {OS_EOL, PANELS, QUERY_TOOL_EVENTS} from '../QueryToolConstants';
|
||||||
import url_for from 'sources/url_for';
|
import url_for from 'sources/url_for';
|
||||||
import { LayoutDockerContext, LAYOUT_EVENTS } from '../../../../../../static/js/helpers/Layout';
|
import { LayoutDockerContext, LAYOUT_EVENTS } from '../../../../../../static/js/helpers/Layout';
|
||||||
import ConfirmSaveContent from '../../../../../../static/js/Dialogs/ConfirmSaveContent';
|
import ConfirmSaveContent from '../../../../../../static/js/Dialogs/ConfirmSaveContent';
|
||||||
@ -190,7 +190,9 @@ export default function Query({onTextSelect, handleEndOfLineChange}) {
|
|||||||
editor.current.markClean();
|
editor.current.markClean();
|
||||||
eventBus.fireEvent(QUERY_TOOL_EVENTS.LOAD_FILE_DONE, fileName, true);
|
eventBus.fireEvent(QUERY_TOOL_EVENTS.LOAD_FILE_DONE, fileName, true);
|
||||||
const lineSep = res.data.includes('\r\n') ? 'crlf' : 'lf';
|
const lineSep = res.data.includes('\r\n') ? 'crlf' : 'lf';
|
||||||
|
if (lineSep !== OS_EOL){
|
||||||
handleEndOfLineChange(lineSep);
|
handleEndOfLineChange(lineSep);
|
||||||
|
}
|
||||||
}).catch((err)=>{
|
}).catch((err)=>{
|
||||||
eventBus.fireEvent(QUERY_TOOL_EVENTS.LOAD_FILE_DONE, null, false);
|
eventBus.fireEvent(QUERY_TOOL_EVENTS.LOAD_FILE_DONE, null, false);
|
||||||
pgAdmin.Browser.notifier.error(parseApiError(err));
|
pgAdmin.Browser.notifier.error(parseApiError(err));
|
||||||
|
@ -753,6 +753,8 @@ export class ResultSetUtils {
|
|||||||
}
|
}
|
||||||
this.eventBus.fireEvent(QUERY_TOOL_EVENTS.SET_MESSAGE, tabMsg, true);
|
this.eventBus.fireEvent(QUERY_TOOL_EVENTS.SET_MESSAGE, tabMsg, true);
|
||||||
this.eventBus.fireEvent(QUERY_TOOL_EVENTS.FOCUS_PANEL, PANELS.MESSAGES);
|
this.eventBus.fireEvent(QUERY_TOOL_EVENTS.FOCUS_PANEL, PANELS.MESSAGES);
|
||||||
|
/* Clear the query data if the query has no result to display.*/
|
||||||
|
onResultsAvailable(null, [], []);
|
||||||
}
|
}
|
||||||
return retMsg;
|
return retMsg;
|
||||||
}
|
}
|
||||||
|
@ -1510,7 +1510,8 @@ Failed to reset the connection to the server due to following error:
|
|||||||
for col in self.column_info:
|
for col in self.column_info:
|
||||||
col['pos'] = pos
|
col['pos'] = pos
|
||||||
pos += 1
|
pos += 1
|
||||||
|
else:
|
||||||
|
self.column_info = None
|
||||||
self.row_count = cur.get_rowcount()
|
self.row_count = cur.get_rowcount()
|
||||||
if not no_result and cur.get_rowcount() > 0:
|
if not no_result and cur.get_rowcount() > 0:
|
||||||
result = []
|
result = []
|
||||||
|
Loading…
Reference in New Issue
Block a user