Fix: fix inspector

This commit is contained in:
Pieter Vander Vennet 2024-12-19 13:59:40 +01:00
parent 387750a0b6
commit e0931dceba
8 changed files with 211 additions and 24 deletions

View file

@ -5,7 +5,8 @@
import { createEventDispatcher } from "svelte"
import { XCircleIcon } from "@babeard/svelte-heroicons/solid"
import AccordionSingle from "../Flowbite/AccordionSingle.svelte"
import Dropdown from "../Base/Dropdown.svelte"
import Translations from "../i18n/Translations"
import Tr from "../Base/Tr.svelte"
export let osmConnection: OsmConnection
export let inspectedContributors: UIEventSource<
@ -41,23 +42,32 @@
inspectedContributors.data.sort((a, b) => (a[key] ?? "").localeCompare(b[key] ?? ""))
inspectedContributors.ping()
}
const t = Translations.t.inspector.previouslySpied
</script>
<LoginToggle ignoreLoading state={{ osmConnection }}>
<table class="w-full">
<tr>
<td>
<button class="as-link cursor-pointer" on:click={() => sort("name")}>Contributor</button>
</td>
<td>
<button class="as-link cursor-pointer" on:click={() => sort("visitedTime")}>
Visited time
<button class="as-link cursor-pointer" on:click={() => sort("name")}>
<Tr t={t.username} />
</button>
</td>
<td>
<button class="as-link cursor-pointer" on:click={() => sort("label")}>Label</button>
<button class="as-link cursor-pointer" on:click={() => sort("visitedTime")}>
<Tr t={t.time} />
</button>
</td>
<td>
<button class="as-link cursor-pointer" on:click={() => sort("label")}>
<Tr t={t.label} />
</button>
</td>
<td>
<Tr t={t.remove} />
</td>
<td>Remove</td>
</tr>
{#each $inspectedContributors as c}
<tr>
@ -85,7 +95,8 @@
<AccordionSingle>
<div slot="header">Labels</div>
{#if $labels.length === 0}
No labels
<Tr t={t.noLabels} />
{:else}
{#each $labels as label}
<div class="mx-2">
@ -102,7 +113,8 @@
)
}}
>
See all changes for these users
<Tr t={t.allChanges} />
</button>
</div>
{/each}
@ -115,7 +127,7 @@
class:disabled={!(labelField?.length > 0)}
class="disabled shrink-0"
>
Add label
<Tr t={t.addLabel} />
</button>
</div>
</AccordionSingle>