Highlight setting on click

This commit is contained in:
Adria Navarro 2025-02-03 17:59:09 +01:00
parent 20c17f1065
commit f3e617635e
1 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { UIComponentError } from "@budibase/types" import type { UIComponentError } from "@budibase/types"
import { import {
builderStore,
componentStore, componentStore,
screenComponentErrorList, screenComponentErrorList,
screenComponents, screenComponents,
@ -17,6 +18,13 @@
} }
return titleParts.join(" - ") return titleParts.join(" - ")
} }
function onErrorClick(error: UIComponentError) {
componentStore.select(error.componentId)
if (error.errorType === "setting") {
builderStore.highlightSetting(error.key, "error")
}
}
</script> </script>
<div bind:this={button} class="error-button"> <div bind:this={button} class="error-button">
@ -40,10 +48,7 @@
color="var(--spectrum-global-color-static-red-600)" color="var(--spectrum-global-color-static-red-600)"
/> />
<div> <div>
<Link <Link overBackground on:click={() => onErrorClick(error)}>
overBackground
on:click={() => componentStore.select(error.componentId)}
>
{getErrorTitle(error)}:</Link {getErrorTitle(error)}:</Link
> >
<!-- eslint-disable-next-line svelte/no-at-html-tags--> <!-- eslint-disable-next-line svelte/no-at-html-tags-->