Fixed an issue where there is no setting to turn off notifications in the Query Tool. Fixes #7423

This commit is contained in:
Aditya Toshniwal 2022-06-13 14:32:07 +05:30 committed by Akshay Joshi
parent 725726f083
commit 5c1493bd7e
3 changed files with 18 additions and 1 deletions

View File

@ -20,6 +20,7 @@ Bug fixes
*********
| `Issue #7411 <https://redmine.postgresql.org/issues/7411>`_ - Fixed an issue where the Database restriction is not working.
| `Issue #7423 <https://redmine.postgresql.org/issues/7423>`_ - Fixed an issue where there is no setting to turn off notifications in the Query Tool.
| `Issue #7441 <https://redmine.postgresql.org/issues/7441>`_ - Ensure that the Query Editor should be focused when switching between query tool tabs.
| `Issue #7443 <https://redmine.postgresql.org/issues/7443>`_ - Fixed and issue where 'Use spaces' not working in the query tool.
| `Issue #7468 <https://redmine.postgresql.org/issues/7468>`_ - Skip the history records if the JSON info can't be parsed instead of showing 'No history'.

View File

@ -139,6 +139,10 @@ export class ResultSetUtils {
this.eventBus = eventBus;
}
setQtPref(pref) {
this.qtPref = pref;
}
setStartData(data) {
this.startData = data;
}
@ -314,7 +318,9 @@ export class ResultSetUtils {
this.eventBus.fireEvent(QUERY_TOOL_EVENTS.SET_MESSAGE, httpMessage.data.data.result || 'Execution Cancelled!', true);
this.eventBus.fireEvent(QUERY_TOOL_EVENTS.EXECUTION_END);
}
Notifier.success(msg);
if(this.qtPref?.query_success_notification) {
Notifier.success(msg);
}
if(!ResultSetUtils.isQueryStillRunning(httpMessage)) {
this.eventBus.fireEvent(QUERY_TOOL_EVENTS.PUSH_HISTORY, {
status: true,
@ -750,6 +756,7 @@ export function ResultSet() {
const [rowsResetKey, setRowsResetKey] = useState(0);
rsu.current.setEventBus(eventBus);
rsu.current.setQtPref(queryToolCtx.preferences?.sqleditor);
const isDataChanged = ()=>{
return Boolean(_.size(dataChangeStore.updated) || _.size(dataChangeStore.added) || _.size(dataChangeStore.deleted));

View File

@ -323,6 +323,15 @@ def register_query_tool_preferences(self):
)
)
self.query_success_notification = self.preference.register(
'display', 'query_success_notification',
gettext("Show query success notification?"), 'boolean', True,
category_label=PREF_LABEL_DISPLAY,
help_str=gettext('If set to True, the Query Tool '
'will show notifications on successful query '
'execution.')
)
self.preference.register(
'keyboard_shortcuts',
'execute_query',