sort exported collections by type and name

This commit is contained in:
Gani Georgiev
2024-02-25 21:06:14 +02:00
parent 88c56cd539
commit 1014c92d86
33 changed files with 118 additions and 113 deletions
@@ -28,11 +28,13 @@
isLoadingCollections = true;
try {
collections = await ApiClient.collections.getFullList(100, {
collections = await ApiClient.collections.getFullList({
batch: 100,
$cancelKey: uniqueId,
sort: "updated",
});
collections = CommonHelper.sortCollections(collections);
// delete timestamps
for (let collection of collections) {
delete collection.created;
@@ -341,10 +341,12 @@
{#each collectionsToDelete as collection (collection.id)}
<div class="list-item">
<span class="label label-danger list-label">Deleted</span>
<strong>{collection.name}</strong>
{#if collection.id}
<small class="txt-hint">({collection.id})</small>
{/if}
<div class="inline-flex flex-gap-5">
<strong>{collection.name}</strong>
{#if collection.id}
<small class="txt-hint">{collection.id}</small>
{/if}
</div>
</div>
{/each}
{/if}
@@ -355,15 +357,14 @@
<span class="label label-warning list-label">Changed</span>
<div class="inline-flex flex-gap-5">
{#if pair.old.name !== pair.new.name}
<strong class="txt-strikethrough txt-hint">{pair.old.name}</strong
>
<strong class="txt-strikethrough txt-hint">
{pair.old.name}
</strong>
<i class="ri-arrow-right-line txt-sm" />
{/if}
<strong>
{pair.new.name}
</strong>
<strong>{pair.new.name}</strong>
{#if pair.new.id}
<small class="txt-hint">({pair.new.id})</small>
<small class="txt-hint">{pair.new.id}</small>
{/if}
</div>
</div>
@@ -374,10 +375,12 @@
{#each collectionsToAdd as collection (collection.id)}
<div class="list-item">
<span class="label label-success list-label">Added</span>
<strong>{collection.name}</strong>
{#if collection.id}
<small class="txt-hint">({collection.id})</small>
{/if}
<div class="inline-flex flex-gap-5">
<strong>{collection.name}</strong>
{#if collection.id}
<small class="txt-hint">{collection.id}</small>
{/if}
</div>
</div>
{/each}
{/if}