feat(webui): stable type sort in Inspect: by amount of attributes, address
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
parent
06f7d1a4a6
commit
b99f9bc15c
|
@ -53,6 +53,9 @@
|
||||||
attributes: string[];
|
attributes: string[];
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
|
$: sortedTypes = Object.entries($allTypes)
|
||||||
|
.sort(([a, _], [b, __]) => a.localeCompare(b))
|
||||||
|
.sort(([_, a], [__, b]) => a.attributes.length - b.attributes.length);
|
||||||
|
|
||||||
async function getAllTypes(entityInfo: EntityInfo) {
|
async function getAllTypes(entityInfo: EntityInfo) {
|
||||||
const allTypes = {};
|
const allTypes = {};
|
||||||
|
@ -422,7 +425,7 @@
|
||||||
<div class="properties">
|
<div class="properties">
|
||||||
<NotesEditor {address} on:change={onChange} />
|
<NotesEditor {address} on:change={onChange} />
|
||||||
<InspectTypeEditor {entity} on:change={() => revalidate()} />
|
<InspectTypeEditor {entity} on:change={() => revalidate()} />
|
||||||
{#each Object.entries($allTypes) as [typeAddr, { labels, attributes }]}
|
{#each sortedTypes as [typeAddr, { labels, attributes }]}
|
||||||
<EntryView
|
<EntryView
|
||||||
entries={($entity?.attributes || []).filter((e) =>
|
entries={($entity?.attributes || []).filter((e) =>
|
||||||
attributes.includes(e.attribute),
|
attributes.includes(e.attribute),
|
||||||
|
|
Loading…
Reference in New Issue