Show counter
This commit is contained in:
parent
4d732dd142
commit
4bd98ff240
|
@ -1,9 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import { screenComponentErrorList, screenComponents } from "@/stores/builder"
|
||||||
componentStore,
|
|
||||||
screenComponentErrorList,
|
|
||||||
screenComponents,
|
|
||||||
} from "@/stores/builder"
|
|
||||||
import { ActionButton, Icon, Popover } from "@budibase/bbui"
|
import { ActionButton, Icon, Popover } from "@budibase/bbui"
|
||||||
|
|
||||||
let button: any
|
let button: any
|
||||||
|
@ -11,11 +7,18 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div bind:this={button}>
|
<div bind:this={button}>
|
||||||
<ActionButton selected quiet on:click={() => popover.show()}
|
<ActionButton selected quiet on:click={() => popover.show()}>
|
||||||
>Errors ({$screenComponentErrorList.length})</ActionButton
|
<div class="error-button">
|
||||||
>
|
Errors
|
||||||
|
{#if $screenComponentErrorList.length}
|
||||||
|
<div class="error-button-badge">
|
||||||
|
{$screenComponentErrorList.length}
|
||||||
</div>
|
</div>
|
||||||
<Popover bind:this={popover} open anchor={button} align={"right"}>
|
{/if}
|
||||||
|
</div>
|
||||||
|
</ActionButton>
|
||||||
|
</div>
|
||||||
|
<Popover bind:this={popover} anchor={button} align={"right"} maxWidth={400}>
|
||||||
<div class="errors">
|
<div class="errors">
|
||||||
{#each $screenComponentErrorList as error}
|
{#each $screenComponentErrorList as error}
|
||||||
<div class="error">
|
<div class="error">
|
||||||
|
@ -24,8 +27,11 @@
|
||||||
color="var(--spectrum-global-color-static-red-600)"
|
color="var(--spectrum-global-color-static-red-600)"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
|
<span class="error-title">
|
||||||
{$screenComponents[error.componentId]._instanceName}:
|
{$screenComponents[error.componentId]._instanceName}:
|
||||||
{error.message}
|
</span>
|
||||||
|
<!-- eslint-disable-next-line svelte/no-at-html-tags-->
|
||||||
|
{@html error.message}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
|
@ -33,6 +39,21 @@
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.error-button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--spacing-xs);
|
||||||
|
}
|
||||||
|
.error-button-badge {
|
||||||
|
background-color: var(--spectrum-global-color-static-red-700);
|
||||||
|
height: 18px;
|
||||||
|
width: 18px;
|
||||||
|
border-radius: 50%;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
.errors {
|
.errors {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -46,4 +67,14 @@
|
||||||
.error:not(:last-child) {
|
.error:not(:last-child) {
|
||||||
border-bottom: 1px solid var(--spectrum-global-color-gray-300);
|
border-bottom: 1px solid var(--spectrum-global-color-gray-300);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.error-title {
|
||||||
|
font-weight: 700;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error :global(mark) {
|
||||||
|
background: unset;
|
||||||
|
color: unset;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue