diff --git a/packages/backend-core/src/db/Replication.ts b/packages/backend-core/src/db/Replication.ts
index b46f6072be..e0bd3c7a43 100644
--- a/packages/backend-core/src/db/Replication.ts
+++ b/packages/backend-core/src/db/Replication.ts
@@ -1,4 +1,5 @@
import { dangerousGetDB, closeDB } from "."
+import { DocumentType } from "./constants"
class Replication {
source: any
@@ -53,6 +54,14 @@ class Replication {
return this.replication
}
+ appReplicateOpts() {
+ return {
+ filter: (doc: any) => {
+ return doc._id !== DocumentType.APP_METADATA
+ },
+ }
+ }
+
/**
* Rollback the target DB back to the state of the source DB
*/
@@ -60,6 +69,7 @@ class Replication {
await this.target.destroy()
// Recreate the DB again
this.target = dangerousGetDB(this.target.name)
+ // take the opportunity to remove deleted tombstones
await this.replicate()
}
diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts
index 321ebd7f58..4926a60150 100644
--- a/packages/backend-core/src/db/utils.ts
+++ b/packages/backend-core/src/db/utils.ts
@@ -254,7 +254,16 @@ export async function getAllApps({ dev, all, idsOnly, efficient }: any = {}) {
return false
})
if (idsOnly) {
- return appDbNames
+ const devAppIds = appDbNames.filter(appId => isDevAppID(appId))
+ const prodAppIds = appDbNames.filter(appId => !isDevAppID(appId))
+ switch (dev) {
+ case true:
+ return devAppIds
+ case false:
+ return prodAppIds
+ default:
+ return appDbNames
+ }
}
const appPromises = appDbNames.map((app: any) =>
// skip setup otherwise databases could be re-created
diff --git a/packages/bbui/src/Tabs/Tabs.svelte b/packages/bbui/src/Tabs/Tabs.svelte
index 74edc9cd02..7184aedbaf 100644
--- a/packages/bbui/src/Tabs/Tabs.svelte
+++ b/packages/bbui/src/Tabs/Tabs.svelte
@@ -10,6 +10,7 @@
export let noHorizPadding = false
export let quiet = false
export let emphasized = false
+ export let onTop = false
export let size = "M"
let thisSelected = undefined
@@ -75,6 +76,7 @@
bind:this={container}
class:spectrum-Tabs--quiet={quiet}
class:noHorizPadding
+ class:onTop
class:spectrum-Tabs--vertical={vertical}
class:spectrum-Tabs--horizontal={!vertical}
class="spectrum-Tabs spectrum-Tabs--size{size}"
@@ -122,4 +124,7 @@
.noPadding {
margin: 0;
}
+ .onTop {
+ z-index: 100;
+ }
diff --git a/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte b/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte
index 93b8394b49..f2da863424 100644
--- a/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte
+++ b/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte
@@ -1,6 +1,7 @@
diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte
index b8d418c62b..22d322985d 100644
--- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte
+++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte
@@ -23,6 +23,7 @@
const dispatch = createEventDispatcher()
let bindingDrawer
let valid = true
+ let currentVal = value
$: readableValue = runtimeToReadableBinding(bindings, value)
$: tempValue = readableValue
@@ -30,11 +31,17 @@
const saveBinding = () => {
onChange(tempValue)
+ onBlur()
bindingDrawer.hide()
}
const onChange = value => {
- dispatch("change", readableToRuntimeBinding(bindings, value))
+ currentVal = readableToRuntimeBinding(bindings, value)
+ dispatch("change", currentVal)
+ }
+
+ const onBlur = () => {
+ dispatch("blur", currentVal)
}
@@ -45,6 +52,7 @@
readonly={isJS}
value={isJS ? "(JavaScript function)" : readableValue}
on:change={event => onChange(event.detail)}
+ on:blur={onBlur}
{placeholder}
{updateOnChange}
/>
diff --git a/packages/builder/src/components/integration/KeyValueBuilder.svelte b/packages/builder/src/components/integration/KeyValueBuilder.svelte
index 4ffb380aa4..28db6b61c6 100644
--- a/packages/builder/src/components/integration/KeyValueBuilder.svelte
+++ b/packages/builder/src/components/integration/KeyValueBuilder.svelte
@@ -107,7 +107,7 @@
placeholder={keyPlaceholder}
readonly={readOnly}
bind:value={field.name}
- on:change={changed}
+ on:blur={changed}
/>
{#if options}
@@ -115,7 +115,10 @@
(field.value = e.detail)}
+ on:blur={e => {
+ field.value = e.detail
+ changed()
+ }}
disabled={readOnly}
value={field.value}
allowJS={false}
@@ -127,7 +130,7 @@
placeholder={valuePlaceholder}
readonly={readOnly}
bind:value={field.value}
- on:change={changed}
+ on:blur={changed}
/>
{/if}
{#if toggle}
diff --git a/packages/builder/src/components/start/ExportAppModal.svelte b/packages/builder/src/components/start/ExportAppModal.svelte
index 05a42dfa4a..25c0606c14 100644
--- a/packages/builder/src/components/start/ExportAppModal.svelte
+++ b/packages/builder/src/components/start/ExportAppModal.svelte
@@ -1,16 +1,24 @@
-
+
+ Apps can be exported with or without data that is within internal tables -
+ select this below.
diff --git a/packages/builder/src/helpers/data/utils.js b/packages/builder/src/helpers/data/utils.js
index 647c2be33e..cd6a8cf481 100644
--- a/packages/builder/src/helpers/data/utils.js
+++ b/packages/builder/src/helpers/data/utils.js
@@ -46,7 +46,7 @@ export function buildQueryString(obj) {
if (str !== "") {
str += "&"
}
- str += `${key}=${value || ""}`
+ str += `${key}=${encodeURIComponent(value || "")}`
}
}
return str
diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte
index b0a93f8eec..d2c1630416 100644
--- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte
@@ -28,25 +28,25 @@
import { onMount } from "svelte"
import restUtils from "helpers/data/utils"
import {
- RestBodyTypes as bodyTypes,
- SchemaTypeOptions,
PaginationLocations,
PaginationTypes,
+ RawRestBodyTypes,
+ RestBodyTypes as bodyTypes,
+ SchemaTypeOptions,
} from "constants/backend"
import JSONPreview from "components/integration/JSONPreview.svelte"
import AccessLevelSelect from "components/integration/AccessLevelSelect.svelte"
import DynamicVariableModal from "../../_components/DynamicVariableModal.svelte"
import Placeholder from "assets/bb-spaceship.svg"
import { cloneDeep } from "lodash/fp"
- import { RawRestBodyTypes } from "constants/backend"
import {
getRestBindings,
- toBindingsArray,
- runtimeToReadableBinding,
readableToRuntimeBinding,
- runtimeToReadableMap,
readableToRuntimeMap,
+ runtimeToReadableBinding,
+ runtimeToReadableMap,
+ toBindingsArray,
} from "builderStore/dataBinding"
let query, datasource
@@ -95,7 +95,7 @@
$: runtimeUrlQueries = readableToRuntimeMap(mergedBindings, breakQs)
function getSelectedQuery() {
- const cloneQuery = cloneDeep(
+ return cloneDeep(
$queries.list.find(q => q._id === $queries.selected) || {
datasourceId: $params.selectedDatasource,
parameters: [],
@@ -107,7 +107,6 @@
queryVerb: "read",
}
)
- return cloneQuery
}
function checkQueryName(inputUrl = null) {
@@ -121,14 +120,15 @@
if (!base) {
return base
}
- const qs = restUtils.buildQueryString(
+ let qs = restUtils.buildQueryString(
runtimeToReadableMap(mergedBindings, qsObj)
)
let newUrl = base
if (base.includes("?")) {
- newUrl = base.split("?")[0]
+ const split = base.split("?")
+ newUrl = split[0]
}
- return qs.length > 0 ? `${newUrl}?${qs}` : newUrl
+ return qs.length === 0 ? newUrl : `${newUrl}?${qs}`
}
function buildQuery() {
@@ -314,6 +314,25 @@
}
}
+ const paramsChanged = evt => {
+ breakQs = {}
+ for (let param of evt.detail) {
+ breakQs[param.name] = param.value
+ }
+ }
+
+ const urlChanged = evt => {
+ breakQs = {}
+ const qs = evt.target.value.split("?")[1]
+ if (qs && qs.length > 0) {
+ const parts = qs.split("&")
+ for (let part of parts) {
+ const [key, value] = part.split("=")
+ breakQs[key] = value
+ }
+ }
+ }
+
onMount(async () => {
query = getSelectedQuery()
@@ -426,7 +445,11 @@
/>
-
+
-
+ {#key breakQs}
+
+ {/key}
-
-
-
-