From 97ee31fb63134659dff06f14da177055b88dbb0d Mon Sep 17 00:00:00 2001
From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com>
Date: Fri, 16 Aug 2024 15:41:39 +0000
Subject: [PATCH] feat(nc-gui): enable sqlite integration in oss
---
.../workspace/integrations/EditOrAdd.vue | 2 ++
.../integrations/IntegrationsTab.vue | 3 ++-
.../integrations/forms/EditOrAddDatabase.vue | 22 ++++++++++++++-----
.../composables/useIntegrationsStore.ts | 15 ++++++++++++-
packages/nc-gui/utils/syncDataUtils.ts | 18 +++++++++++++++
5 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/packages/nc-gui/components/workspace/integrations/EditOrAdd.vue b/packages/nc-gui/components/workspace/integrations/EditOrAdd.vue
index 68c1e43695..6aca0bc059 100644
--- a/packages/nc-gui/components/workspace/integrations/EditOrAdd.vue
+++ b/packages/nc-gui/components/workspace/integrations/EditOrAdd.vue
@@ -26,6 +26,8 @@ const connectionType = computed(() => {
return ClientType.PG
case integrationType.MySQL:
return ClientType.MYSQL
+ case integrationType.SQLITE:
+ return ClientType.SQLITE
default: {
return undefined
}
diff --git a/packages/nc-gui/components/workspace/integrations/IntegrationsTab.vue b/packages/nc-gui/components/workspace/integrations/IntegrationsTab.vue
index c070dfe13e..52d624ae23 100644
--- a/packages/nc-gui/components/workspace/integrations/IntegrationsTab.vue
+++ b/packages/nc-gui/components/workspace/integrations/IntegrationsTab.vue
@@ -59,8 +59,9 @@ const upvotesData = computed(() => {
const getIntegrationsByCategory = (category: IntegrationCategoryType, query: string) => {
return allIntegrations.filter((i) => {
+ const isOssOnly = isEeUI ? !i?.isOssOnly : true
return (
- filterIntegration(i) && i.categories.includes(category) && t(i.title).toLowerCase().includes(query.trim().toLowerCase())
+ isOssOnly && filterIntegration(i) && i.categories.includes(category) && t(i.title).toLowerCase().includes(query.trim().toLowerCase())
)
})
}
diff --git a/packages/nc-gui/components/workspace/integrations/forms/EditOrAddDatabase.vue b/packages/nc-gui/components/workspace/integrations/forms/EditOrAddDatabase.vue
index e40702a0a6..bc5cd6cf43 100644
--- a/packages/nc-gui/components/workspace/integrations/forms/EditOrAddDatabase.vue
+++ b/packages/nc-gui/components/workspace/integrations/forms/EditOrAddDatabase.vue
@@ -428,6 +428,14 @@ function handleAutoScroll(scroll: boolean, className: string) {
}
}
+const activeIntegrationIcon = computed(() => {
+ const activeIntegrationType = isEditMode.value
+ ? activeIntegration.value?.sub_type || activeIntegration.value?.config?.client
+ : activeIntegration.value?.type
+
+ return allIntegrationsMapByValue[activeIntegrationType]?.icon
+})
+
// reset test status on config change
watch(
formState,
@@ -504,12 +512,14 @@ watch(
>