wip: add labels to address types
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
parent
d2a81173ee
commit
d077726894
|
@ -9,7 +9,7 @@
|
|||
import NotesEditor from "./utils/NotesEditor.svelte";
|
||||
import type { AttributeChange } from "../types/base";
|
||||
import Selector from "./utils/Selector.svelte";
|
||||
import type { EntityInfo, IValue } from "upend/types";
|
||||
import type { ADDRESS_TYPE, EntityInfo, IValue } from "upend/types";
|
||||
import IconButton from "./utils/IconButton.svelte";
|
||||
import type { BrowseContext } from "../util/browse";
|
||||
import { Link, useParams } from "svelte-navigator";
|
||||
|
@ -76,16 +76,34 @@
|
|||
const labelsQuery = await api.query(
|
||||
`(matches (in ${typeAddressesIn}) "${ATTR_LABEL}" ?)`
|
||||
);
|
||||
typeAddresses.forEach((address) => {
|
||||
let labels = labelsQuery.getObject(address).identify();
|
||||
if (!labels.length) {
|
||||
labels.push(address);
|
||||
}
|
||||
allTypes[address] = {
|
||||
labels,
|
||||
attributes: [],
|
||||
};
|
||||
});
|
||||
await Promise.all(
|
||||
typeAddresses.map(async (address) => {
|
||||
let labels = labelsQuery.getObject(address).identify();
|
||||
|
||||
let typeLabel: string | undefined;
|
||||
await Promise.all(
|
||||
(["Hash", "Uuid", "Attribute", "Url"] as ADDRESS_TYPE[]).map(
|
||||
async (t) => {
|
||||
if ((await api.getAddress(t)) == address) {
|
||||
labels.push(`[${t}]`);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
if (typeLabel) {
|
||||
labels.unshift(typeLabel);
|
||||
}
|
||||
|
||||
if (!labels.length) {
|
||||
labels.push(address);
|
||||
}
|
||||
|
||||
allTypes[address] = {
|
||||
labels,
|
||||
attributes: [],
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
const attributes = await api.query(
|
||||
`(matches ? "${ATTR_OF}" (in ${typeAddressesIn}))`
|
||||
|
|
Loading…
Reference in New Issue