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 ae86fd7d1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 4 deletions

View File

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

View File

@ -13,7 +13,7 @@
} from "@budibase/bbui" } from "@budibase/bbui"
import { onMount } from "svelte" import { onMount } from "svelte"
import { apps, organisation, auth } from "stores/portal" import { apps, organisation, auth } from "stores/portal"
import { goto } from "@roxi/routify" import { goto, redirect } from "@roxi/routify"
import { AppStatus } from "constants" import { AppStatus } from "constants"
import { gradient } from "actions" import { gradient } from "actions"
import UpdateUserInfoModal from "components/settings/UpdateUserInfoModal.svelte" import UpdateUserInfoModal from "components/settings/UpdateUserInfoModal.svelte"
@ -28,10 +28,17 @@
onMount(async () => { onMount(async () => {
await organisation.init() await organisation.init()
await apps.load() await apps.load()
// 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 loaded = true
}
}) })
$: publishedApps = $apps.filter(app => app.status === AppStatus.DEPLOYED) const publishedAppsOnly = app => app.status === AppStatus.DEPLOYED
$: publishedApps = $apps.filter(publishedAppsOnly)
</script> </script>
{#if $auth.user && loaded} {#if $auth.user && loaded}

View File

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

View File

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