fix: search on collections > empty state ui (#2912)

fix: collection search filter ui
This commit is contained in:
Nivedin
2023-01-31 22:33:10 +05:30
committed by GitHub
parent 2910164d5a
commit 59a8a22e8a
2 changed files with 11 additions and 14 deletions

View File

@@ -188,7 +188,16 @@
/>
</template>
<template #emptyNode="{ node }">
<div v-if="node === null">
<div
v-if="filterText.length !== 0 && filteredCollections.length === 0"
class="flex flex-col items-center justify-center p-4 text-secondaryLight"
>
<icon-lucide-search class="pb-2 opacity-75 svg-icons" />
<span class="my-2 text-center">
{{ t("state.nothing_found") }} "{{ filterText }}"
</span>
</div>
<div v-else-if="node === null">
<div
class="flex flex-col items-center justify-center p-4 text-secondaryLight"
>
@@ -251,19 +260,6 @@
{{ t("empty.folder") }}
</span>
</div>
<div
v-if="
filterText.length !== 0 &&
filteredCollections.length === 0 &&
node === null
"
class="flex flex-col items-center justify-center p-4 text-secondaryLight"
>
<icon-lucide-search class="pb-2 opacity-75 svg-icons" />
<span class="my-2 text-center">
{{ t("state.nothing_found") }} "{{ filterText }}"
</span>
</div>
</template>
</SmartTree>
</div>

View File

@@ -437,6 +437,7 @@ const filteredCollections = computed(() => {
if (isMatch(request.name)) filteredRequests.push(request)
}
for (const folder of collection.folders) {
if (isMatch(folder.name)) filteredFolders.push(folder)
const filteredFolderRequests = []
for (const request of folder.requests) {
if (isMatch(request.name)) filteredFolderRequests.push(request)