Skip to content

Commit

Permalink
add aliases to other tables
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenClontz committed Nov 2, 2024
1 parent 1b1233f commit 1842b6b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
18 changes: 18 additions & 0 deletions packages/viewer/src/components/Properties/Cell.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script lang="ts">
import type { Property } from '@/models'
import { Link } from '../Shared'
import Typeset from '../Shared/Typeset.svelte'
export let property: Property
</script>

<div><Link.Property {property} /></div>
{#if property.aliases.length > 0}
<div>
<small class="text-muted">
{#each property.aliases as alias, i}
{#if i > 0}, {/if}
<Typeset body={alias} />
{/each}
</small>
</div>
{/if}
3 changes: 2 additions & 1 deletion packages/viewer/src/components/Properties/List.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Filter, Link, Typeset } from '@/components/Shared'
import type { Property } from '@/models'
import type { Store } from '@/stores/list'
import Cell from './Cell.svelte'
export let properties: Store<Property>
</script>
Expand All @@ -22,7 +23,7 @@
<Link.Property {property} content="id" />
</td>
<td>
<Typeset body={property.name} />
<Cell {property} />
</td>
<td>
<Typeset body={property.description} truncated={true} />
Expand Down
18 changes: 18 additions & 0 deletions packages/viewer/src/components/Spaces/Cell.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script lang="ts">
import type { Space } from '@/models'
import { Link } from '../Shared'
import Typeset from '../Shared/Typeset.svelte'
export let space: Space
</script>

<div><Link.Space {space} /></div>
{#if space.aliases.length > 0}
<div>
<small class="text-muted">
{#each space.aliases as alias, i}
{#if i > 0}, {/if}
<Typeset body={alias} />
{/each}
</small>
</div>
{/if}
3 changes: 2 additions & 1 deletion packages/viewer/src/components/Spaces/List.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Filter, Link, Typeset } from '@/components/Shared'
import type { Space } from '@/models'
import type { Store } from '@/stores/list'
import Cell from './Cell.svelte'
export let spaces: Store<Space>
</script>
Expand All @@ -22,7 +23,7 @@
<Link.Space {space} content="id" />
</td>
<td>
<Typeset body={space.name} />
<Cell {space}/>
</td>
<td>
<Typeset body={space.description} truncated={true} />
Expand Down
13 changes: 2 additions & 11 deletions packages/viewer/src/components/Traits/Table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { Link } from '../Shared'
import Value from './Value.svelte'
import Typeset from '../Shared/Typeset.svelte'
import Cell from '../Spaces/Cell.svelte'
export let properties: Property[]
export let spaces: Space[]
Expand All @@ -31,17 +32,7 @@
<Link.Space {space}>S{space.id}</Link.Space>
</td>
<td>
<div><Link.Space {space} /></div>
{#if space.aliases.length > 0}
<div>
<small class="text-muted">
{#each space.aliases as alias, i}
{#if i > 0}, {/if}
<Typeset body={alias} />
{/each}
</small>
</div>
{/if}
<Cell {space}/>
</td>
{#each properties as property (property.id)}
<td>
Expand Down

0 comments on commit 1842b6b

Please sign in to comment.