From eb27ac368acf23e688409b455d50544076e9a950 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 21:26:08 +0000 Subject: [PATCH 1/2] Fix incorrect syntax for showing a notification while executing custom queries --- packages/client/src/utils/buttonActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 72c8f9c083..ca7be60151 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -127,7 +127,7 @@ const queryExecutionHandler = async action => { // Trigger a notification and invalidate the datasource as long as this // was not a readable query if (!query.readable) { - API.notifications.error.success("Query executed successfully") + notificationStore.actions.success("Query executed successfully") await dataSourceStore.actions.invalidateDataSource(query.datasourceId) } From 3ba195960be7097642895a463513709e70e6b3e3 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 21:29:02 +0000 Subject: [PATCH 2/2] Add error notification if executing a query in a button action fails --- packages/client/src/utils/buttonActions.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index ca7be60151..fec966725b 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -133,6 +133,10 @@ const queryExecutionHandler = async action => { return { result } } catch (error) { + notificationStore.actions.error( + "An error occurred while executing the query" + ) + // Abort next actions return false }