diff --git a/lerna.json b/lerna.json index ee7d734841..ac0de2382e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.180-alpha.1", + "version": "0.9.184", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index a1ac04abb6..f5493d8291 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.180-alpha.1", + "version": "0.9.184", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 2df5df2588..d23a9672a8 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.180-alpha.1", + "version": "0.9.184", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/bbui/src/Form/Combobox.svelte b/packages/bbui/src/Form/Combobox.svelte index b718921325..368e8bec4b 100644 --- a/packages/bbui/src/Form/Combobox.svelte +++ b/packages/bbui/src/Form/Combobox.svelte @@ -36,5 +36,7 @@ {getOptionLabel} {getOptionValue} on:change={onChange} + on:pick + on:type /> diff --git a/packages/bbui/src/Form/Core/Combobox.svelte b/packages/bbui/src/Form/Core/Combobox.svelte index 2f832ad91e..6a1390eeea 100644 --- a/packages/bbui/src/Form/Core/Combobox.svelte +++ b/packages/bbui/src/Form/Core/Combobox.svelte @@ -40,8 +40,15 @@ open = false } - const onChange = e => { - selectOption(e.target.value) + const onType = e => { + const value = e.target.value + dispatch("type", value) + selectOption(value) + } + + const onPick = value => { + dispatch("pick", value) + selectOption(value) } @@ -62,7 +69,7 @@ type="text" on:focus={() => (focus = true)} on:blur={() => (focus = false)} - on:change={onChange} + on:change={onType} value={value || ""} placeholder={placeholder || ""} {disabled} @@ -99,7 +106,7 @@ role="option" aria-selected="true" tabindex="0" - on:click={() => selectOption(getOptionValue(option))} + on:click={() => onPick(getOptionValue(option))} > {getOptionLabel(option)} { renameApp(appRename) cy.searchForApplication(appRename) cy.get(".appGrid").find(".wrapper").should("have.length", 1) - }) + cy.deleteApp(appRename) +}) xit("Should rename a published application", () => { // It is not possible to rename a published application diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 82e3c45a1f..ca758e46d0 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -43,24 +43,26 @@ Cypress.Commands.add("createApp", name => { }) }) -Cypress.Commands.add("deleteApp", () => { +Cypress.Commands.add("deleteApp", appName => { cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.wait(1000) cy.request(`localhost:${Cypress.env("PORT")}/api/applications?status=all`) .its("body") .then(val => { - console.log(val) if (val.length > 0) { cy.get(".title > :nth-child(3) > .spectrum-Icon").click() cy.contains("Delete").click() - cy.get(".spectrum-Button--warning").click() + cy.get(".spectrum-Modal").within(() => { + cy.get("input").type(appName) + cy.get(".spectrum-Button--warning").click() + }) } }) }) Cypress.Commands.add("createTestApp", () => { const appName = "Cypress Tests" - cy.deleteApp() + cy.deleteApp(appName) cy.createApp(appName, "This app is used for Cypress testing.") }) diff --git a/packages/builder/package.json b/packages/builder/package.json index 41594d0909..7c087b5730 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.180-alpha.1", + "version": "0.9.184", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.180-alpha.1", - "@budibase/client": "^0.9.180-alpha.1", + "@budibase/bbui": "^0.9.184", + "@budibase/client": "^0.9.184", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.180-alpha.1", + "@budibase/string-templates": "^0.9.184", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/analytics/PosthogClient.js b/packages/builder/src/analytics/PosthogClient.js index 0a1fde42ea..ab06fa6413 100644 --- a/packages/builder/src/analytics/PosthogClient.js +++ b/packages/builder/src/analytics/PosthogClient.js @@ -12,7 +12,7 @@ export default class PosthogClient { posthog.init(this.token, { autocapture: false, - capture_pageview: false, + capture_pageview: true, api_host: this.url, }) posthog.set_config({ persistence: "cookie" }) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 165ed37fbb..9cf00be3d4 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -31,11 +31,11 @@ export const getBindableProperties = (asset, componentId) => { const deviceBindings = getDeviceBindings() const stateBindings = getStateBindings() return [ - ...stateBindings, - ...deviceBindings, - ...urlBindings, ...contextBindings, + ...urlBindings, + ...stateBindings, ...userBindings, + ...deviceBindings, ] } @@ -217,18 +217,8 @@ const getProviderContextBindings = (asset, dataProviders) => { keys.forEach(key => { const fieldSchema = schema[key] - // Make safe runtime binding and replace certain bindings with a - // new property to help display components - let runtimeBoundKey = key - if (fieldSchema.type === "link") { - runtimeBoundKey = `${key}_text` - } else if (fieldSchema.type === "attachment") { - runtimeBoundKey = `${key}_first` - } - - const runtimeBinding = `${safeComponentId}.${makePropSafe( - runtimeBoundKey - )}` + // Make safe runtime binding + const runtimeBinding = `${safeComponentId}.${makePropSafe(key)}` // Optionally use a prefix with readable bindings let readableBinding = component._instanceName @@ -267,17 +257,9 @@ const getUserBindings = () => { const safeUser = makePropSafe("user") keys.forEach(key => { const fieldSchema = schema[key] - // Replace certain bindings with a new property to help display components - let runtimeBoundKey = key - if (fieldSchema.type === "link") { - runtimeBoundKey = `${key}_text` - } else if (fieldSchema.type === "attachment") { - runtimeBoundKey = `${key}_first` - } - bindings.push({ type: "context", - runtimeBinding: `${safeUser}.${makePropSafe(runtimeBoundKey)}`, + runtimeBinding: `${safeUser}.${makePropSafe(key)}`, readableBinding: `Current User.${key}`, // Field schema and provider are required to construct relationship // datasource options, based on bindable properties diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 1a5c4523e3..7bbd474a92 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -45,6 +45,7 @@ const INITIAL_FRONTEND_STATE = { state: false, customThemes: false, devicePreview: false, + messagePassing: false, }, currentFrontEndType: "none", selectedScreenId: "", diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 74e82a2da7..7ddc5c3e48 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -202,7 +202,7 @@ display: inline-block; } .block { - width: 360px; + width: 480px; font-size: 16px; background-color: var(--background); border: 1px solid var(--spectrum-global-color-gray-300); diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index a3a2870a5e..874a0e68eb 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -234,7 +234,8 @@ { - onChange(e, key) + // need to pass without the value inside + onChange({ detail: e.detail.value }, key) inputData[key] = e.detail.value }} value={inputData[key]} diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index aa21799ca2..83ed741b75 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -18,6 +18,11 @@ FIELDS, AUTO_COLUMN_SUB_TYPES, RelationshipTypes, + ALLOWABLE_STRING_OPTIONS, + ALLOWABLE_NUMBER_OPTIONS, + ALLOWABLE_STRING_TYPES, + ALLOWABLE_NUMBER_TYPES, + SWITCHABLE_TYPES, } from "constants/backend" import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils" import { notifications } from "@budibase/bbui" @@ -92,6 +97,9 @@ opt.type === table.type && table.sourceId === opt.sourceId ) + $: typeEnabled = + !originalName || + (originalName && SWITCHABLE_TYPES.indexOf(field.type) !== -1) async function saveColumn() { if (field.type === AUTO_TYPE) { @@ -204,7 +212,14 @@ } function getAllowedTypes() { - if (!external) { + if (originalName && ALLOWABLE_STRING_TYPES.indexOf(field.type) !== -1) { + return ALLOWABLE_STRING_OPTIONS + } else if ( + originalName && + ALLOWABLE_NUMBER_TYPES.indexOf(field.type) !== -1 + ) { + return ALLOWABLE_NUMBER_OPTIONS + } else if (!external) { return [ ...Object.values(fieldDefinitions), { name: "Auto Column", type: AUTO_TYPE }, @@ -259,7 +274,7 @@ /> + diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte index 73385b73f5..72b54f3b96 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte @@ -1,11 +1,9 @@ -
+
{#if type !== "boolean" && label}
@@ -94,31 +83,6 @@ {type} {...props} /> - {#if bindable && !key.startsWith("_") && type === "text"} -
- -
- - - Add the objects on the left to enrich your text. - - - (tempValue = e.detail)} - bindableProperties={allBindings} - allowJS - /> - - {/if}
@@ -130,40 +94,10 @@ justify-content: flex-start; align-items: stretch; } - .label { padding-bottom: var(--spectrum-global-dimension-size-65); } - .control { position: relative; } - - .icon { - right: 1px; - top: 1px; - bottom: 1px; - position: absolute; - justify-content: center; - align-items: center; - display: flex; - flex-direction: row; - box-sizing: border-box; - border-left: 1px solid var(--spectrum-alias-border-color); - border-top-right-radius: var(--spectrum-alias-border-radius-regular); - border-bottom-right-radius: var(--spectrum-alias-border-radius-regular); - width: 31px; - color: var(--spectrum-alias-text-color); - background-color: var(--spectrum-global-color-gray-75); - transition: background-color - var(--spectrum-global-animation-duration-100, 130ms), - box-shadow var(--spectrum-global-animation-duration-100, 130ms), - border-color var(--spectrum-global-animation-duration-100, 130ms); - } - .icon:hover { - cursor: pointer; - color: var(--spectrum-alias-text-color-hover); - background-color: var(--spectrum-global-color-gray-50); - border-color: var(--spectrum-alias-border-color-hover); - } diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/URLSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/URLSelect.svelte index fb8b48b9ed..dc2fa7ad89 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/URLSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/URLSelect.svelte @@ -10,4 +10,10 @@ .filter(x => x != null) - + diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/componentSettings.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/componentSettings.js index 69bb3f8b47..b9b227bef0 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/componentSettings.js +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/componentSettings.js @@ -15,10 +15,10 @@ import URLSelect from "./URLSelect.svelte" import OptionsEditor from "./OptionsEditor/OptionsEditor.svelte" import FormFieldSelect from "./FormFieldSelect.svelte" import ValidationEditor from "./ValidationEditor/ValidationEditor.svelte" -import Input from "./Input.svelte" +import DrawerBindableCombobox from "components/common/bindings/DrawerBindableCombobox.svelte" const componentMap = { - text: Input, + text: DrawerBindableCombobox, select: Select, dataSource: DataSourceSelect, dataProvider: DataProviderSelect, diff --git a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte index efe51ebdac..4a7c77746e 100644 --- a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte @@ -54,7 +54,6 @@ {#each screenSettings as def (`${componentInstance._id}-${def.key}`)} {#if showTemplateSelection} @@ -186,7 +191,7 @@ title={getModalTitle()} confirmText={template?.fromFile ? "Import app" : "Create app"} onConfirm={createNewApp} - onCancel={inline ? () => (template = null) : null} + onCancel={inline ? onCancel : null} cancelText={inline ? "Back" : undefined} showCloseIcon={!inline} disabled={!valid} diff --git a/packages/builder/src/components/start/TemplateList.svelte b/packages/builder/src/components/start/TemplateList.svelte index 7c7eb1f8f9..12f8725bd3 100644 --- a/packages/builder/src/components/start/TemplateList.svelte +++ b/packages/builder/src/components/start/TemplateList.svelte @@ -37,33 +37,33 @@

{template?.category?.toUpperCase()}

{/each} -
onSelect(null)}> -
- -
- Start from scratch -

BLANK

-
-
onSelect(null, { useImport: true })} - > -
- -
- Import an app -

BLANK

-
{:catch err}

{err}

{/await} +
onSelect(null)}> +
+ +
+ Start from scratch +

BLANK

+
+
onSelect(null, { useImport: true })} + > +
+ +
+ Import an app +

BLANK

+