[ui, lib] remove identifying by ALIASes
parent
6b9e534270
commit
1ee86a9da6
|
@ -82,14 +82,8 @@ export class UpObject {
|
|||
}
|
||||
|
||||
public identify(): string[] {
|
||||
const hasAliases = this.backlinks
|
||||
.filter((entry) => entry.attribute === "HAS")
|
||||
.map((entry) => entry.get("ALIAS"))
|
||||
.filter(Boolean) as string[];
|
||||
|
||||
const lblValues = (this.attr["LBL"] || []).map((e) => String(e.value.c));
|
||||
|
||||
return lblValues.concat(hasAliases);
|
||||
return lblValues;
|
||||
}
|
||||
|
||||
public asDict() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { UpEntry } from "upend";
|
||||
import type { ListingResult } from "upend/types";
|
||||
import { fetchEntry, query as queryFn, queryOnce } from "../lib/entity";
|
||||
import { query as queryFn, queryOnce } from "../lib/entity";
|
||||
|
||||
export function baseSearch(query: string) {
|
||||
return queryFn(
|
||||
|
@ -19,21 +19,10 @@ export async function getObjects(
|
|||
entries: UpEntry[],
|
||||
limit = 50
|
||||
): Promise<[string, string][]> {
|
||||
const labelled = entries
|
||||
return entries
|
||||
.slice(0, limit)
|
||||
.filter((e) => e.attribute == "LBL")
|
||||
.map((e) => [e.entity, String(e.value.c)] as [string, string]);
|
||||
const aliased = entries
|
||||
.slice(0, limit)
|
||||
.filter((e) => e.attribute === "ALIAS")
|
||||
.map(async (aliasEntry) => {
|
||||
const entry = await fetchEntry(aliasEntry.entity);
|
||||
return [String(entry.value.c), String(aliasEntry.value.c)] as [
|
||||
string,
|
||||
string
|
||||
];
|
||||
});
|
||||
return labelled.concat(await Promise.all(aliased));
|
||||
}
|
||||
|
||||
export async function createLabelled(label: string) {
|
||||
|
|
|
@ -4008,8 +4008,8 @@ __metadata:
|
|||
|
||||
"upend@file:../tools/upend_js::locator=svelte-app%40workspace%3A.":
|
||||
version: 0.0.1
|
||||
resolution: "upend@file:../tools/upend_js#../tools/upend_js::hash=065315&locator=svelte-app%40workspace%3A."
|
||||
checksum: d60e8503f734a109f51f817dcefa33d9650e282358e411c69b2457ee93fe8173e596277feb02b805a4489975a2fca2dc9892d343343cb1368152ab6deb3f93ff
|
||||
resolution: "upend@file:../tools/upend_js#../tools/upend_js::hash=a864e4&locator=svelte-app%40workspace%3A."
|
||||
checksum: 7fdd22d2098068c8c5467d0cada87425491223a5bc7d79a9cdfb03497365a969ea055d71817f18723b783869cb44cd3a4928ae8f765f37611f65eb900ead74e5
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
|
Loading…
Reference in New Issue