mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where there is no setting to turn off notifications in the Query Tool. Fixes #7423
This commit is contained in:
committed by
Akshay Joshi
parent
725726f083
commit
5c1493bd7e
@@ -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));
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user