Skip to content

Commit

Permalink
feat: Tweak tile extension error messages (#116)
Browse files Browse the repository at this point in the history
Only demos single message in preparation for change to extension
SDK. Reason is that Looker dashboards can only display one
message.
  • Loading branch information
bryans99 authored Oct 27, 2023
1 parent bef11b9 commit 315702c
Showing 1 changed file with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down Expand Up @@ -148,11 +136,8 @@ export const EventTester = () => {
<ButtonOutline onClick={addErrorsClick} width="100%">
Test add errors
</ButtonOutline>
<ButtonOutline onClick={partiallyClearErrorsClick} width="100%">
Test partially clear errors
</ButtonOutline>
<ButtonOutline onClick={clearAllErrorsClick} width="100%">
Test clear all errors
<ButtonOutline onClick={clearErrorsClick} width="100%">
Test clear errors
</ButtonOutline>
<ButtonOutline onClick={triggerClick} width="100%">
Test trigger
Expand Down

0 comments on commit 315702c

Please sign in to comment.