From 7dfe049ae679e8be98f6717d17d4d396aca0e1d0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 17 Aug 2022 23:13:51 +0100 Subject: [PATCH] Adding full builder integration of custom components - splitting into own section properly - fixing some issues with SVG class overlap. --- .../builder/src/builderStore/datasource.js | 2 +- .../DatasourceNavigator.svelte | 4 ++-- .../_components/DatasourceCard.svelte | 10 +--------- .../DatasourceNavigator/icons/Custom.svelte | 18 ++++++++++++------ .../backend/DatasourceNavigator/icons/index.js | 12 +++++++++++- .../app/[application]/data/_layout.svelte | 4 +++- .../server/src/utilities/fileSystem/index.js | 5 ++++- 7 files changed, 34 insertions(+), 21 deletions(-) diff --git a/packages/builder/src/builderStore/datasource.js b/packages/builder/src/builderStore/datasource.js index 804d88bad6..84edcdd6ad 100644 --- a/packages/builder/src/builderStore/datasource.js +++ b/packages/builder/src/builderStore/datasource.js @@ -9,7 +9,7 @@ function prepareData(config) { ds => ds.source === config.type ).length - let baseName = IntegrationNames[config.type] + let baseName = IntegrationNames[config.type] || config.name let name = existingTypeCount === 0 ? baseName : `${baseName}-${existingTypeCount + 1}` diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index 9faf00a199..6235e52916 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -13,7 +13,7 @@ customQueryIconColor, customQueryText, } from "helpers/data/utils" - import ICONS from "./icons" + import { getIcon } from "./icons" import { notifications } from "@budibase/bbui" let openDataSources = [] @@ -124,7 +124,7 @@ >
diff --git a/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte b/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte index 2dac2fec79..6dffc70a63 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte @@ -1,21 +1,13 @@
- + - + {#if modal} + + {/if}
diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index d65ee48f05..f937f172b5 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -359,7 +359,10 @@ exports.getDatasourcePlugin = async (name, url) => { if (fs.existsSync(filename)) { return require(filename) } - const response = await fetch(checkSlashesInUrl(`${env.MINIO_URL}/${url}`)) + const fullUrl = checkSlashesInUrl( + `${env.MINIO_URL}/${ObjectStoreBuckets.PLUGINS}/${url}` + ) + const response = await fetch(fullUrl) if (response.status === 200) { const content = await response.text() fs.writeFileSync(filename, content)