Merge pull request #1586 from Budibase/fix/data-connectors

Fix/data connectors
This commit is contained in:
Martin McKeaveney 2021-05-28 14:10:40 +01:00 committed by GitHub
commit 8ee87fcf62
4 changed files with 25 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<script>
import { Label, Input, Layout } from "@budibase/bbui"
import { Label, Input, Layout, Toggle } from "@budibase/bbui"
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import { capitalise } from "helpers"
@ -16,6 +16,11 @@
defaults={schema[configKey].default}
bind:object={integration[configKey]}
/>
{:else if schema[configKey].type === "boolean"}
<div class="form-row">
<Label>{capitalise(configKey)}</Label>
<Toggle text="" bind:value={integration[configKey]} />
</div>
{:else}
<div class="form-row">
<Label>{capitalise(configKey)}</Label>

View File

@ -13,7 +13,7 @@
} from "@budibase/bbui"
import { onMount } from "svelte"
import { apps, organisation, auth } from "stores/portal"
import { goto } from "@roxi/routify"
import { goto, redirect } from "@roxi/routify"
import { AppStatus } from "constants"
import { gradient } from "actions"
import UpdateUserInfoModal from "components/settings/UpdateUserInfoModal.svelte"
@ -28,10 +28,17 @@
onMount(async () => {
await organisation.init()
await apps.load()
loaded = true
// Skip the portal if you only have one app
if (!$auth.isBuilder && $apps.filter(publishedAppsOnly).length === 1) {
window.location = `/${publishedApps[0].prodId}`
} else {
loaded = true
}
})
$: publishedApps = $apps.filter(app => app.status === AppStatus.DEPLOYED)
const publishedAppsOnly = app => app.status === AppStatus.DEPLOYED
$: publishedApps = $apps.filter(publishedAppsOnly)
</script>
{#if $auth.user && loaded}

View File

@ -6,6 +6,7 @@ exports.QUERY_TYPES = {
exports.FIELD_TYPES = {
STRING: "string",
BOOLEAN: "boolean",
NUMBER: "number",
PASSWORD: "password",
LIST: "list",

View File

@ -31,6 +31,10 @@ const SCHEMA = {
type: FIELD_TYPES.STRING,
default: "root",
},
encrypt: {
type: FIELD_TYPES.BOOLEAN,
default: true,
},
},
query: {
create: {
@ -51,6 +55,10 @@ const SCHEMA = {
class SqlServerIntegration {
constructor(config) {
this.config = config
this.config.options = {
encrypt: this.config.encrypt,
}
delete this.config.encrypt
if (!pool) {
pool = new sqlServer.ConnectionPool(this.config)
}