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 {
color: $warning-color;
padding-left: $input-padding;
padding: 0 $input-padding;
}

View File

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