Skip to content

Commit

Permalink
Keep line breaks in ModelTable
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Feb 13, 2024
1 parent d227697 commit 093e193
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/lib/components/ModelTable/ModelTable.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import TableRowActions from '$lib/components/TableRowActions/TableRowActions.svelte';
import { page } from '$app/stores';
import TableRowActions from '$lib/components/TableRowActions/TableRowActions.svelte';
import { FIELD_COLORED_TAG_MAP, FIELD_COMPONENT_MAP } from '$lib/utils/crud';
import { createEventDispatcher } from 'svelte';
Expand Down Expand Up @@ -198,8 +198,9 @@
{#if component}
<svelte:component this={component} meta={row.meta ?? {}} cell={value}/>
{:else}
<pre class="font-token whitespace-pre-line break-words">
{#if Array.isArray(value)}
<ul class="list-disc pl-4">
<ul class="list-disc pl-4 whitespace-normal">
{#each value as val}
<li>
{#if val.str && val.id}
Expand All @@ -224,11 +225,12 @@
{:else}
{value.str ?? '-'}
{/if}
{:else if value && value.hexcolor}
<p class="flex w-1/2 justify-center p-1 rounded-md ml-2" style="background-color: {value.hexcolor}">{value.name ?? value.str ?? '-'}</p>
{:else if value && value.hexcolor}
<p class="flex w-1/2 justify-center p-1 rounded-md ml-2" style="background-color: {value.hexcolor}">{value.name ?? value.str ?? '-'}</p>
{:else}
{value ?? '-'}
{/if}
</pre>
{/if}
</td>
{/if}
Expand Down

0 comments on commit 093e193

Please sign in to comment.