Browse Source

fix(nc-gui): show empty state if integration search list is empty (#9178)

pull/9190/head
Ramesh Mane 4 months ago committed by GitHub
parent
commit
353241123b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 26
      packages/nc-gui/components/workspace/integrations/IntegrationsTab.vue

26
packages/nc-gui/components/workspace/integrations/IntegrationsTab.vue

@ -90,6 +90,18 @@ const integrationsMapByCategory = computed(() => {
) )
}) })
const isEmptyList = computed(() => {
const categories = Object.keys(integrationsMapByCategory.value);
if (!categories.length) {
return true;
}
console.log('cate', categories, integrationsMapByCategory.value)
return !categories.some(category => integrationsMapByCategory.value[category].list.length > 0);
});
const isAddNewIntegrationModalOpen = computed({ const isAddNewIntegrationModalOpen = computed({
get: () => { get: () => {
return pageMode.value === IntegrationsPageMode.LIST return pageMode.value === IntegrationsPageMode.LIST
@ -197,7 +209,9 @@ const handleAddIntegration = (category: IntegrationCategoryType, integration: In
ref="integrationListRef" ref="integrationListRef"
class="flex-1 px-6 pb-6 flex flex-col nc-workspace-settings-integrations-list overflow-y-auto nc-scrollbar-thin" class="flex-1 px-6 pb-6 flex flex-col nc-workspace-settings-integrations-list overflow-y-auto nc-scrollbar-thin"
> >
<div class="w-full flex justify-center"> <div class="w-full flex justify-center" :class="{
'flex-1': isEmptyList
}">
<div <div
class="flex flex-col space-y-6 w-full" class="flex flex-col space-y-6 w-full"
:style="{ :style="{
@ -205,11 +219,7 @@ const handleAddIntegration = (category: IntegrationCategoryType, integration: In
}" }"
> >
<template v-for="(category, key) in integrationsMapByCategory"> <template v-for="(category, key) in integrationsMapByCategory">
<div <div v-if="category.list.length" :key="key" class="integration-type-wrapper">
v-if="category.list.length || key === IntegrationCategoryType.OTHERS"
:key="key"
class="integration-type-wrapper"
>
<div class="category-type-title flex gap-2"> <div class="category-type-title flex gap-2">
{{ $t(category.title) }} {{ $t(category.title) }}
<NcBadge <NcBadge
@ -259,6 +269,10 @@ const handleAddIntegration = (category: IntegrationCategoryType, integration: In
</div> </div>
</div> </div>
</template> </template>
<div v-if="isEmptyList" class="h-full text-center flex items-center justify-center gap-3">
<a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" :description="$t('labels.noData')" class="!my-0" />
</div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save