diff --git a/README.md b/README.md index 75b48a6107..04bb71fb50 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Code of conduct - +

diff --git a/packages/builder/src/builderStore/api.js b/packages/builder/src/builderStore/api.js index 46304e1486..0202c5e8ab 100644 --- a/packages/builder/src/builderStore/api.js +++ b/packages/builder/src/builderStore/api.js @@ -7,9 +7,10 @@ const apiCall = method => async ( headers = { "Content-Type": "application/json" } ) => { headers["x-budibase-app-id"] = svelteGet(store).appId + const json = headers["Content-Type"] === "application/json" return await fetch(url, { method: method, - body: body && JSON.stringify(body), + body: json ? JSON.stringify(body) : body, headers, }) } diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index 0a5b9f0461..5d0e722650 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -105,7 +105,9 @@ export const getBackendUiStore = () => { state.datasources = state.datasources.filter( existing => existing._id !== datasource._id ) - state.selectedDatasourceId = null + if (datasource._id === state.selectedDatasourceId) { + state.selectedDatasourceId = null + } return state }) }, @@ -233,7 +235,9 @@ export const getBackendUiStore = () => { state.tables = state.tables.filter( existing => existing._id !== table._id ) - state.selectedTable = {} + if (table._id === state.selectedTable._id) { + state.selectedTable = {} + } return state }) }, diff --git a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte index f8a3699f4d..62faff3caa 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte @@ -1,12 +1,9 @@
@@ -18,7 +23,7 @@ icon="ri-stackshare-line" text={automation.name} selected={automation._id === selectedAutomationId} - on:click={() => automationStore.actions.select(automation)}> + on:click={() => selectAutomation(automation)}> {/each} diff --git a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte index 804dceec87..abc7bd9f96 100644 --- a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte @@ -1,5 +1,6 @@ diff --git a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte index eb983dc948..81c38e553b 100644 --- a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte @@ -1,4 +1,5 @@ diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index ad2371f3ea..d269124219 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -53,7 +53,11 @@ $: uneditable = $backendUiStore.selectedTable?._id === TableNames.USERS && UNEDITABLE_USER_FIELDS.includes(field.name) - $: invalid = field.type === LINK_TYPE && !field.tableId + $: invalid = + (field.type === LINK_TYPE && !field.tableId) || + Object.keys($backendUiStore.draftTable.schema).some( + key => key === field.name + ) // used to select what different options can be displayed for column type $: canBeSearched = diff --git a/packages/builder/src/components/backend/DatasourceNavigator/popovers/EditDatasourcePopover.svelte b/packages/builder/src/components/backend/DatasourceNavigator/popovers/EditDatasourcePopover.svelte index c2b0e5d346..7570cd6c5e 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/popovers/EditDatasourcePopover.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/popovers/EditDatasourcePopover.svelte @@ -1,7 +1,8 @@ diff --git a/packages/builder/src/components/backend/TableNavigator/TableNavigator.svelte b/packages/builder/src/components/backend/TableNavigator/TableNavigator.svelte index 3719d62c62..55e62a8a36 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableNavigator.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableNavigator.svelte @@ -4,7 +4,6 @@ import { TableNames } from "constants" import EditTablePopover from "./popovers/EditTablePopover.svelte" import EditViewPopover from "./popovers/EditViewPopover.svelte" - import { Switcher } from "@budibase/bbui" import NavItem from "components/common/NavItem.svelte" $: selectedView = diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 900afe6f86..60886b5be1 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -1,4 +1,5 @@ diff --git a/packages/builder/src/components/deploy/DeploymentHistory.svelte b/packages/builder/src/components/deploy/DeploymentHistory.svelte index 375a02195d..0933b1a676 100644 --- a/packages/builder/src/components/deploy/DeploymentHistory.svelte +++ b/packages/builder/src/components/deploy/DeploymentHistory.svelte @@ -80,6 +80,7 @@ } function showErrorReasonModal(err) { + if (!err) return errorReason = err errorReasonModal.show() } @@ -118,13 +119,13 @@ {#if deployment.status.toLowerCase() === 'pending'} {/if} -
+
showErrorReasonModal(deployment.err)} + class={`deployment-status ${deployment.status}`}> {deployment.status} {#if deployment.status === DeploymentStatus.FAILURE} - showErrorReasonModal(deployment.err)} /> + {/if}
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte index 6235e744f8..c777f79666 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte @@ -1,38 +1,42 @@ diff --git a/packages/builder/src/components/settings/tabs/APIKeys.svelte b/packages/builder/src/components/settings/tabs/APIKeys.svelte index 82e66a12fd..18dab9243c 100644 --- a/packages/builder/src/components/settings/tabs/APIKeys.svelte +++ b/packages/builder/src/components/settings/tabs/APIKeys.svelte @@ -19,6 +19,7 @@ const response = await api.put(`/api/keys/${key}`, { value }) const res = await response.json() keys = { ...keys, ...res } + notifier.success("API Key saved.") } // Get Keys diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index 7f1d73f744..5102179cde 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -123,13 +123,19 @@ async function createNewApp() { submitting = true try { - // Create App - const appResp = await post("/api/applications", { - name: $createAppStore.values.applicationName, - template, - }) - const appJson = await appResp.json() + // Create form data to create app + let data = new FormData() + data.append("name", $createAppStore.values.applicationName) + data.append("useTemplate", template != null) + if (template) { + data.append("templateName", template.name) + data.append("templateKey", template.key) + data.append("templateFile", template.file) + } + // Create App + const appResp = await post("/api/applications", data, {}) + const appJson = await appResp.json() if (!appResp.ok) { throw new Error(appJson.message) } diff --git a/packages/builder/src/components/start/Steps/Info.svelte b/packages/builder/src/components/start/Steps/Info.svelte index e14e327bce..fa74e8b3a0 100644 --- a/packages/builder/src/components/start/Steps/Info.svelte +++ b/packages/builder/src/components/start/Steps/Info.svelte @@ -1,6 +1,5 @@ diff --git a/packages/builder/src/pages/[application]/automate/[automation]/_layout.svelte b/packages/builder/src/pages/[application]/automate/[automation]/_layout.svelte index 28234decc3..ce6917df6b 100644 --- a/packages/builder/src/pages/[application]/automate/[automation]/_layout.svelte +++ b/packages/builder/src/pages/[application]/automate/[automation]/_layout.svelte @@ -1,6 +1,15 @@ + + diff --git a/packages/builder/src/pages/[application]/automate/[automation]/index.svelte b/packages/builder/src/pages/[application]/automate/[automation]/index.svelte new file mode 100644 index 0000000000..1a15ed48c6 --- /dev/null +++ b/packages/builder/src/pages/[application]/automate/[automation]/index.svelte @@ -0,0 +1,5 @@ + + + diff --git a/packages/builder/src/pages/[application]/automate/index.svelte b/packages/builder/src/pages/[application]/automate/index.svelte index 1a15ed48c6..f6568417a8 100644 --- a/packages/builder/src/pages/[application]/automate/index.svelte +++ b/packages/builder/src/pages/[application]/automate/index.svelte @@ -1,5 +1,27 @@ - +Create your first automation to get started + + diff --git a/packages/builder/src/pages/[application]/data/_layout.svelte b/packages/builder/src/pages/[application]/data/_layout.svelte index 6a4033d468..5a31d7db92 100644 --- a/packages/builder/src/pages/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/[application]/data/_layout.svelte @@ -1,6 +1,6 @@ @@ -25,7 +34,10 @@