diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index 3ccf4d5cfd..81af40c7f7 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -47,8 +47,9 @@ context('Create a View', () => { it('creates a stats calculation view based on age', () => { cy.contains("Calculate").click() - cy.get(".menu-container").find("select").first().select("Statistics") - cy.get(".menu-container").find("select").eq(1).select("age") + // we may reinstate this - have commented this dropdown for now as there is only one option + //cy.get(".menu-container").find("select").first().select("Statistics") + cy.get(".menu-container").find("select").eq(0).select("age") cy.contains("Save").click() cy.get("thead th").should(($headers) => { expect($headers).to.have.length(7) diff --git a/packages/builder/src/components/database/DataTable/ModelDataTable.svelte b/packages/builder/src/components/database/DataTable/ModelDataTable.svelte index b06e31a344..fbef976bd5 100644 --- a/packages/builder/src/components/database/DataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/database/DataTable/ModelDataTable.svelte @@ -10,7 +10,6 @@ import AttachmentList from "./AttachmentList.svelte" import TablePagination from "./TablePagination.svelte" import Spinner from "components/common/Spinner.svelte" - import { DeleteRecordModal, CreateEditRecordModal } from "./modals" import RowPopover from "./popovers/Row.svelte" import ColumnPopover from "./popovers/Column.svelte" import ViewPopover from "./popovers/View.svelte" diff --git a/packages/builder/src/components/database/DataTable/Table.svelte b/packages/builder/src/components/database/DataTable/Table.svelte index 4d6563d8bd..5b167c71f7 100644 --- a/packages/builder/src/components/database/DataTable/Table.svelte +++ b/packages/builder/src/components/database/DataTable/Table.svelte @@ -8,7 +8,6 @@ import ActionButton from "components/common/ActionButton.svelte" import AttachmentList from "./AttachmentList.svelte" import TablePagination from "./TablePagination.svelte" - import { DeleteRecordModal, CreateEditRecordModal } from "./modals" import RowPopover from "./popovers/Row.svelte" import ColumnPopover from "./popovers/Column.svelte" import ViewPopover from "./popovers/View.svelte" diff --git a/packages/builder/src/components/database/DataTable/ViewDataTable.svelte b/packages/builder/src/components/database/DataTable/ViewDataTable.svelte index 0958737b59..164683ef5f 100644 --- a/packages/builder/src/components/database/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/database/DataTable/ViewDataTable.svelte @@ -9,7 +9,6 @@ import ActionButton from "components/common/ActionButton.svelte" import LinkedRecord from "./LinkedRecord.svelte" import TablePagination from "./TablePagination.svelte" - import { DeleteRecordModal, CreateEditRecordModal } from "./modals" import RowPopover from "./popovers/Row.svelte" import ColumnPopover from "./popovers/Column.svelte" import ViewPopover from "./popovers/View.svelte" diff --git a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte index 270e4b6e25..1e5e23823c 100644 --- a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte @@ -24,11 +24,7 @@ } let originalName = field.name - - $: required = - field.constraints && - field.constraints.presence && - !field.constraints.presence.allowEmpty + $: required = field && field.constraints && field.constraints.presence async function saveColumn() { backendUiStore.update(state => { @@ -50,6 +46,14 @@ field.type = type field.constraints = constraints } + + const getPresence = required => (required ? { allowEmpty: false } : false) + + const requiredChanged = ev => { + const req = ev.target.checked + field.constraints.presence = req ? { allowEmpty: false } : false + required = req + }
@@ -68,10 +72,7 @@
- (field.constraints.presence.allowEmpty = required)} /> +
{#if field.type === 'string' && field.constraints} diff --git a/packages/builder/src/components/database/DataTable/popovers/Calculate.svelte b/packages/builder/src/components/database/DataTable/popovers/Calculate.svelte index a736ff61e8..f994fe655b 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Calculate.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Calculate.svelte @@ -9,7 +9,6 @@ } from "@budibase/bbui" import { backendUiStore } from "builderStore" import { notifier } from "builderStore/store/notifications" - import CreateEditRecord from "../modals/CreateEditRecord.svelte" import analytics from "analytics" const CALCULATIONS = [ @@ -34,6 +33,7 @@ ) function saveView() { + if (!view.calculation) view.calculation = "stats" backendUiStore.actions.views.save(view) notifier.success(`View ${view.name} saved.`) analytics.captureEvent("Added View Calculate", { field: view.field }) @@ -50,14 +50,15 @@
Calculate
-

The

+ +

The statistics of

{/if} - {#each fields as field} @@ -126,10 +157,21 @@ {#if filter.key && isMultipleChoice(filter.key)} + {:else if filter.key && isDate(filter.key)} + + {:else if filter.key && isNumber(filter.key)} + {:else} (blurred.api = true)} label="API Key" name="apiKey" - placeholder="Enter your API Key" + placeholder="Use command-V to paste your API Key" type="password" error={blurred.api && validationErrors.apiKey} /> Get API Key diff --git a/packages/builder/src/components/start/Steps/User.svelte b/packages/builder/src/components/start/Steps/User.svelte index 90f4045cb4..71fa979d2d 100644 --- a/packages/builder/src/components/start/Steps/User.svelte +++ b/packages/builder/src/components/start/Steps/User.svelte @@ -19,7 +19,7 @@ label="Password" name="password" placeholder="Password" - type="pasword" + type="password" error={blurred.password && validationErrors.password} />