[ui] fix identification in Table...
parent
d61bca6ac3
commit
3f5edc3443
|
@ -11,6 +11,7 @@
|
|||
import type { IValue } from "upend/types";
|
||||
import Editable from "../utils/Editable.svelte";
|
||||
import { query } from "../../lib/entity";
|
||||
import { readable } from "svelte/store";
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let columns: string;
|
||||
|
@ -57,12 +58,25 @@
|
|||
}
|
||||
|
||||
// Labelling
|
||||
$: labelListing = query(
|
||||
() =>
|
||||
`(matches (in ${entries
|
||||
.map((e) => '"' + e.entity + '"')
|
||||
.join(" ")}) "LBL" ? )`
|
||||
).result;
|
||||
let labelListing = readable(undefined);
|
||||
$: {
|
||||
const addresses = [];
|
||||
entries
|
||||
.flatMap((e) =>
|
||||
e.value.t === "Address" ? [e.entity, e.value.c] : [e.entity]
|
||||
)
|
||||
.forEach((addr) => {
|
||||
if (!addresses.includes(addr)) {
|
||||
addresses.push(addr);
|
||||
}
|
||||
});
|
||||
|
||||
const addressesString = addresses.map((addr) => `"${addr}"`).join(" ");
|
||||
|
||||
labelListing = query(
|
||||
() => `(matches (in ${addressesString}) "LBL" ? )`
|
||||
).result;
|
||||
}
|
||||
|
||||
// Sorting
|
||||
let sortedAttributes = entries;
|
||||
|
@ -238,7 +252,9 @@
|
|||
<td class="entity">
|
||||
<UpObject
|
||||
link
|
||||
labels={entry.listing.getObject(String(entry.entity)).identify()}
|
||||
labels={$labelListing
|
||||
?.getObject(String(entry.entity))
|
||||
?.identify() || []}
|
||||
address={entry.entity}
|
||||
on:resolved={(event) => {
|
||||
addSortKeys(entry.entity, event.detail);
|
||||
|
@ -269,7 +285,7 @@
|
|||
address={String(entry.value.c)}
|
||||
labels={$labelListing
|
||||
?.getObject(String(entry.value.c))
|
||||
?.identify()}
|
||||
?.identify() || []}
|
||||
on:resolved={(event) => {
|
||||
addSortKeys(String(entry.value.c), event.detail);
|
||||
}}
|
||||
|
|
Loading…
Reference in New Issue