From e06d2bccfe77d62ee92a7bea752f37fb7c95a548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Fri, 12 Apr 2024 15:40:41 +0200 Subject: [PATCH] style(webui): add icons to Inspect sections --- webui/src/lib/components/EntitySetEditor.svelte | 7 ++++++- webui/src/lib/components/EntryView.svelte | 4 ++-- webui/src/lib/components/Inspect.svelte | 12 +++++++++++- webui/src/lib/components/InspectGroups.svelte | 1 + webui/src/lib/components/InspectTypeEditor.svelte | 2 +- webui/src/lib/components/utils/NotesEditor.svelte | 3 ++- 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/webui/src/lib/components/EntitySetEditor.svelte b/webui/src/lib/components/EntitySetEditor.svelte index 5d183ec..0016bbd 100644 --- a/webui/src/lib/components/EntitySetEditor.svelte +++ b/webui/src/lib/components/EntitySetEditor.svelte @@ -6,6 +6,7 @@ import LabelBorder from './utils/LabelBorder.svelte'; import { createEventDispatcher } from 'svelte'; import { type Address } from '@upnd/upend/types'; + import Icon from '$lib/components/utils/Icon.svelte'; const dispatch = createEventDispatcher<{ highlighted: string | undefined; add: Address; @@ -16,6 +17,7 @@ export let hide = false; export let header = ''; + export let icon: string | null = null; export let confirmRemoveMessage: string | null = $i18n.t('Are you sure you want to remove this?'); export let emptyMessage = $i18n.t('Nothing to show.'); @@ -39,7 +41,10 @@ - {header} + {#if icon} + {/if}{header} {#if adding}
diff --git a/webui/src/lib/components/EntryView.svelte b/webui/src/lib/components/EntryView.svelte index 523a578..35f4843 100644 --- a/webui/src/lib/components/EntryView.svelte +++ b/webui/src/lib/components/EntryView.svelte @@ -90,14 +90,14 @@ {#if group} {#if icon}
- +
{/if} {:else} {#if icon}
- +
{/if} {title || ''} diff --git a/webui/src/lib/components/Inspect.svelte b/webui/src/lib/components/Inspect.svelte index 99069b8..a54b1cb 100644 --- a/webui/src/lib/components/Inspect.svelte +++ b/webui/src/lib/components/Inspect.svelte @@ -22,6 +22,7 @@ import { debug } from 'debug'; import { Any } from '@upnd/upend/query'; import { isDefined } from '$lib/util/werk'; + import Icon from '$lib/components/utils/Icon.svelte'; const dbg = debug('kestrel:Inspect'); const dispatch = createEventDispatcher<{ @@ -443,6 +444,7 @@ {#if currentUntypedProperties.length > 0} 0} correctlyTagged?.includes(e.entity))} on:change={onChange} @@ -478,6 +483,7 @@ /> incorrectlyTagged?.includes(e.entity))} on:change={onChange} @@ -488,6 +494,7 @@ {#if currentBacklinks.length > 0} - {$i18n.t('Used')} ({attributesUsed.length}) + + + {$i18n.t('Used')} ({attributesUsed.length}) + {/if} diff --git a/webui/src/lib/components/InspectGroups.svelte b/webui/src/lib/components/InspectGroups.svelte index 8d6b11b..cdb2830 100644 --- a/webui/src/lib/components/InspectGroups.svelte +++ b/webui/src/lib/components/InspectGroups.svelte @@ -39,6 +39,7 @@ addGroup(e.detail)} on:remove={(e) => removeGroup(e.detail)} diff --git a/webui/src/lib/components/InspectTypeEditor.svelte b/webui/src/lib/components/InspectTypeEditor.svelte index b6b116f..9faa3d5 100644 --- a/webui/src/lib/components/InspectTypeEditor.svelte +++ b/webui/src/lib/components/InspectTypeEditor.svelte @@ -101,7 +101,7 @@ {#if types.length || $entity?.attr['~IN']?.length} - {$i18n.t('Type Attributes')} + {$i18n.t('Type Attributes')} {#if adding}
(); export let address: string; @@ -34,7 +35,7 @@ - Notes + {$i18n.t('Notes')}
{#each (notes || '\n').split('\n') as line, idx} {#if idx > 0}
{/if}