[Manager] Show progress spinner on initial load (#2936)

This commit is contained in:
Christian Byrne
2025-03-09 10:47:14 -07:00
committed by GitHub
parent ba8c1ee823
commit 83f9240587

View File

@@ -36,8 +36,14 @@
@update:filterBy="handleFilterChange" @update:filterBy="handleFilterChange"
/> />
<div class="flex-1 overflow-auto"> <div class="flex-1 overflow-auto">
<div
v-if="isLoading || isInitialLoad"
class="flex justify-center items-center h-full"
>
<ProgressSpinner />
</div>
<NoResultsPlaceholder <NoResultsPlaceholder
v-if="error || searchResults.length === 0" v-else-if="error || searchResults.length === 0"
:title=" :title="
error error
? $t('manager.errorConnecting') ? $t('manager.errorConnecting')
@@ -49,12 +55,6 @@
: $t('manager.tryDifferentSearch') : $t('manager.tryDifferentSearch')
" "
/> />
<div
v-else-if="isLoading"
class="flex justify-center items-center h-full"
>
<ProgressSpinner />
</div>
<div v-else class="h-full" @click="handleGridContainerClick"> <div v-else class="h-full" @click="handleGridContainerClick">
<VirtualGrid <VirtualGrid
:items="resultsWithKeys" :items="resultsWithKeys"
@@ -144,6 +144,11 @@ const handleTabSelection = (tab: TabItem) => {
const { searchQuery, pageNumber, sortField, isLoading, error, searchResults } = const { searchQuery, pageNumber, sortField, isLoading, error, searchResults } =
useRegistrySearch() useRegistrySearch()
pageNumber.value = 1 pageNumber.value = 1
const isInitialLoad = computed(
() => searchResults.value.length === 0 && searchQuery.value === ''
)
const resultsWithKeys = computed(() => const resultsWithKeys = computed(() =>
searchResults.value.map((item) => ({ searchResults.value.map((item) => ({
...item, ...item,