Browse Source

feat(nc-gui): all integration icon support

pull/9265/head
Ramesh Mane 3 months ago
parent
commit
560694fdac
  1. 6
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  2. 6
      packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue
  3. 27
      packages/nc-gui/components/general/IntegrationIcon.vue
  4. 15
      packages/nc-gui/components/workspace/integrations/ConnectionsTab.vue

6
packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue

@ -518,11 +518,7 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati
>
<a-select-option v-for="integration in integrations" :key="integration.id" :value="integration.id">
<div class="w-full flex gap-2 items-center" :data-testid="integration.title">
<GeneralBaseLogo
v-if="integration?.sub_type"
:source-type="integration.sub_type"
class="flex-none h-4 w-4"
/>
<GeneralIntegrationIcon v-if="integration?.sub_type" :type="integration.sub_type" />
<NcTooltip class="flex-1 truncate" show-on-truncate-only>
<template #title>
{{ integration.title }}

6
packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue

@ -413,11 +413,7 @@ function handleAutoScroll(scroll: boolean, className: string) {
>
<a-select-option v-for="integration in integrations" :key="integration.id" :value="integration.id">
<div class="w-full flex gap-2 items-center" :data-testid="integration.title">
<GeneralBaseLogo
v-if="integration.type"
:source-type="integration.sub_type"
class="flex-none h-4 w-4"
/>
<GeneralIntegrationIcon v-if="integration?.sub_type" :type="integration.sub_type" />
<NcTooltip class="flex-1 truncate" show-on-truncate-only>
<template #title>
{{ integration.title }}

27
packages/nc-gui/components/general/IntegrationIcon.vue

@ -0,0 +1,27 @@
<script lang="ts" setup>
const props = withDefaults(
defineProps<{
type: keyof typeof allIntegrationsMapByValue
size: 'sx' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'
}>(),
{
size: 'sm',
},
)
</script>
<template>
<component
v-if="allIntegrationsMapByValue[props.type]?.icon"
:is="allIntegrationsMapByValue[props.type]?.icon"
class="stroke-transparent flex-none"
:class="{
'w-3.5 h-3.5': size === 'sx',
'w-4 h-4': size === 'sm',
'w-5 h-5': size === 'md',
'w-6 h-6': size === 'lg',
'w-7 h-7': size === 'xl',
'w-8 h-8': size === 'xxl',
}"
/>
</template>

15
packages/nc-gui/components/workspace/integrations/ConnectionsTab.vue

@ -398,14 +398,9 @@ onKeyStroke('ArrowDown', onDown)
</div>
</td>
<td class="cell-type">
<div>
<div :title="integration.sub_type">
<NcBadge rounded="lg" class="flex items-center gap-2 px-0 py-1 !h-7 truncate !border-transparent">
<WorkspaceIntegrationsIcon
v-if="integration.sub_type"
:integration-type="integration.sub_type"
size="xs"
class="!p-0 !bg-transparent"
/>
<GeneralIntegrationIcon :type="integration.sub_type" />
<NcTooltip placement="bottom" show-on-truncate-only class="text-sm truncate">
<template #title> {{ clientTypesMap[integration?.sub_type]?.text || integration?.sub_type }}</template>
@ -604,11 +599,7 @@ onKeyStroke('ArrowDown', onDown)
</template>
<div v-else-if="toBeDeletedIntegration" class="w-full flex flex-col text-gray-800">
<div class="flex flex-row items-center py-2 px-3.25 bg-gray-50 rounded-lg text-gray-700 mb-4">
<WorkspaceIntegrationsIcon
:integration-type="toBeDeletedIntegration.sub_type"
size="xs"
class="!p-0 !bg-transparent"
/>
<GeneralIntegrationIcon :type="toBeDeletedIntegration.sub_type" />
<div
class="text-ellipsis overflow-hidden select-none w-full pl-3"
:style="{ wordBreak: 'keep-all', whiteSpace: 'nowrap', display: 'inline' }"

Loading…
Cancel
Save