From 315702cec7ffd8fc5f4fa25c9d0bc4b88c43c8cc Mon Sep 17 00:00:00 2001 From: Bryn Ryans Date: Fri, 27 Oct 2023 06:58:16 -0700 Subject: [PATCH] feat: Tweak tile extension error messages (#116) Only demos single message in preparation for change to extension SDK. Reason is that Looker dashboards can only display one message. --- .../components/EventTester/EventTester.js | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/react/javascript/tile-sdk/src/components/Inspector/components/EventTester/EventTester.js b/react/javascript/tile-sdk/src/components/Inspector/components/EventTester/EventTester.js index 76207a9..5c99e34 100644 --- a/react/javascript/tile-sdk/src/components/Inspector/components/EventTester/EventTester.js +++ b/react/javascript/tile-sdk/src/components/Inspector/components/EventTester/EventTester.js @@ -44,25 +44,13 @@ export const EventTester = () => { const [runDashboard, setRunDashboard] = useState(false) const addErrorsClick = useCallback(() => { - tileSDK.addErrors( - { - title: 'Oh no', - message: "I've fallen and I can't get up!", - group: 'error_group_1', - }, - { - title: 'Oh no', - message: 'I pressed the wrong button!', - group: 'error_group_2', - } - ) - }, [tileSDK]) - - const partiallyClearErrorsClick = useCallback(() => { - tileSDK.clearErrors('error_group_1') + tileSDK.addErrors({ + title: 'Oh no', + message: "I've fallen and I can't get up!", + }) }, [tileSDK]) - const clearAllErrorsClick = useCallback(() => { + const clearErrorsClick = useCallback(() => { tileSDK.clearErrors() }, [tileSDK]) @@ -148,11 +136,8 @@ export const EventTester = () => { Test add errors - - Test partially clear errors - - - Test clear all errors + + Test clear errors Test trigger