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 + }
The
+ +The statistics of