Only show validation error on parent when collapsed

This commit is contained in:
Jos de Jong 2020-07-30 14:55:49 +02:00
parent bb2dcf0039
commit a29c196733
2 changed files with 21 additions and 19 deletions

View File

@ -238,5 +238,5 @@ div.empty {
.validation-error { .validation-error {
color: $warning-color; color: $warning-color;
padding-left: $input-padding; padding: 0 $input-padding;
} }

View File

@ -378,15 +378,16 @@
<div class="delimiter">[</div> <div class="delimiter">[</div>
<button class="tag" on:click={handleExpand}>{value.length} items</button> <button class="tag" on:click={handleExpand}>{value.length} items</button>
<div class="delimiter">]</div> <div class="delimiter">]</div>
{/if}
{#if validationError} {#if validationError}
<!-- FIXME: implement proper tooltip --> <!-- FIXME: implement proper tooltip -->
<div <button
class='validation-error' class='validation-error'
title={validationError.isChildError ? 'Contains invalid items' : validationError.message} title={validationError.isChildError ? 'Contains invalid items' : validationError.message}
on:click={handleExpand}
> >
<Icon data={faExclamationTriangle} /> <Icon data={faExclamationTriangle} />
</div> </button>
{/if}
{/if} {/if}
</div> </div>
{#if expanded} {#if expanded}
@ -456,15 +457,16 @@
<span class="delimiter"> &#123;</span> <span class="delimiter"> &#123;</span>
<button class="tag" on:click={handleExpand}>{Object.keys(value).length} props</button> <button class="tag" on:click={handleExpand}>{Object.keys(value).length} props</button>
<span class="delimiter">&rbrace;</span> <span class="delimiter">&rbrace;</span>
{/if}
{#if validationError} {#if validationError}
<!-- FIXME: implement proper tooltip --> <!-- FIXME: implement proper tooltip -->
<div <button
class='validation-error' class='validation-error'
title={validationError.isChildError ? 'Contains invalid properties' : validationError.message} title={validationError.isChildError ? 'Contains invalid properties' : validationError.message}
on:click={handleExpand}
> >
<Icon data={faExclamationTriangle} /> <Icon data={faExclamationTriangle} />
</div> </button>
{/if}
{/if} {/if}
</div> </div>
{#if expanded} {#if expanded}