diff --git a/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte b/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte index cf1ea57d27..f39eff5787 100644 --- a/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte @@ -8,7 +8,7 @@ import LinkedRecord from "./LinkedRecord.svelte" import AttachmentList from "./AttachmentList.svelte" import TablePagination from "./TablePagination.svelte" - import { CreateEditRecordModal } from "./modals" + import CreateEditRecordModal from "./popovers/CreateEditRecord.svelte" import RowPopover from "./popovers/Row.svelte" import ColumnPopover from "./popovers/Column.svelte" import ViewPopover from "./popovers/View.svelte" @@ -136,7 +136,6 @@ } thead th { color: var(--ink); - text-transform: capitalize; font-weight: 500; font-size: 14px; text-rendering: optimizeLegibility; diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index db69120a76..c58ea66ac8 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -8,7 +8,7 @@ import ActionButton from "components/common/ActionButton.svelte" import AttachmentList from "./AttachmentList.svelte" import TablePagination from "./TablePagination.svelte" - import { CreateEditRecordModal } from "./modals" + import CreateEditRecordModal from "./popovers/CreateEditRecord.svelte" 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/backend/DataTable/ViewDataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte index 9b73b7198b..2710fdfc66 100644 --- a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte @@ -9,7 +9,7 @@ import ActionButton from "components/common/ActionButton.svelte" import LinkedRecord from "./LinkedRecord.svelte" import TablePagination from "./TablePagination.svelte" - import { CreateEditRecordModal } from "./modals" + import CreateEditRecordModal from "./popovers/CreateEditRecord.svelte" 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/backend/DataTable/popovers/Calculate.svelte b/packages/builder/src/components/backend/DataTable/popovers/Calculate.svelte index 5497c4d455..08e3ece75c 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/Calculate.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/Calculate.svelte @@ -9,7 +9,7 @@ } from "@budibase/bbui" import { backendUiStore } from "builderStore" import { notifier } from "builderStore/store/notifications" - import CreateEditRecord from "../modals/CreateEditRecord.svelte" + import CreateEditRecord from "./CreateEditRecord.svelte" const CALCULATIONS = [ { @@ -90,7 +90,7 @@ .input-group-row { display: grid; - grid-template-columns: 50px 1fr 20px 1fr; + grid-template-columns: 30px 1fr 20px 1fr; gap: var(--spacing-s); align-items: center; } diff --git a/packages/builder/src/components/backend/DataTable/popovers/Column.svelte b/packages/builder/src/components/backend/DataTable/popovers/Column.svelte index 2047a9a31b..61d03a2fbb 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/Column.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/Column.svelte @@ -8,7 +8,7 @@ Select, } from "@budibase/bbui" import { FIELDS } from "constants/backend" - import CreateEditColumn from "../modals/CreateEditColumn.svelte" + import CreateEditColumn from "./CreateEditColumn.svelte" let anchor let dropdown diff --git a/packages/builder/src/components/backend/DataTable/popovers/ColumnHeader.svelte b/packages/builder/src/components/backend/DataTable/popovers/ColumnHeader.svelte index be0f40f6b2..fbe702b277 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/ColumnHeader.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/ColumnHeader.svelte @@ -2,14 +2,16 @@ import { backendUiStore } from "builderStore" import { DropdownMenu, Button, Icon, Input, Select } from "@budibase/bbui" import { FIELDS } from "constants/backend" - import { CreateEditColumnModal } from "../modals" + import CreateEditColumnModal from "./CreateEditColumn.svelte" + import ConfirmDialog from "components/common/ConfirmDialog.svelte" + import { notifier } from "../../../../builderStore/store/notifications" export let field let anchor let dropdown - let editing + let confirmDeleteDialog $: sortColumn = $backendUiStore.sort && $backendUiStore.sort.column $: sortDirection = $backendUiStore.sort && $backendUiStore.sort.direction @@ -23,8 +25,13 @@ editing = false } - function deleteField() { - backendUiStore.actions.models.deleteField(field) + function deleteColumn() { + if (field.name === $backendUiStore.selectedModel.primaryDisplay) { + notifier.danger("You cannot delete the primary display column") + } else { + backendUiStore.actions.models.deleteField(field) + notifier.success("Column deleted") + } hideEditor() } @@ -38,7 +45,7 @@
- {field.name} + {field.name}
@@ -51,7 +58,9 @@ Edit -
  • +
  • confirmDeleteDialog.show()}> Delete
  • @@ -70,6 +79,12 @@ {/if}
    + diff --git a/packages/builder/src/components/backend/DataTable/popovers/EditRow.svelte b/packages/builder/src/components/backend/DataTable/popovers/EditRow.svelte index 6c1472c23c..8b50bf6b61 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/EditRow.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/EditRow.svelte @@ -10,7 +10,7 @@ Heading, } from "@budibase/bbui" import { FIELDS } from "constants/backend" - import { CreateEditRecordModal } from "../modals" + import CreateEditRecordModal from "./CreateEditRecord.svelte" import * as api from "../api" import { notifier } from "builderStore/store/notifications" import ConfirmDialog from "components/common/ConfirmDialog.svelte" @@ -29,7 +29,6 @@ function hideEditor() { dropdown.hide() editing = false - close() } async function deleteRow() { diff --git a/packages/builder/src/components/backend/DataTable/popovers/Filter.svelte b/packages/builder/src/components/backend/DataTable/popovers/Filter.svelte index ed064926e8..379ccc4bd0 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/Filter.svelte @@ -9,7 +9,7 @@ } from "@budibase/bbui" import { backendUiStore } from "builderStore" import { notifier } from "builderStore/store/notifications" - import CreateEditRecord from "../modals/CreateEditRecord.svelte" + import CreateEditRecord from "./CreateEditRecord.svelte" const CONDITIONS = [ { @@ -130,10 +130,7 @@ {/each} {:else} - + {/if} removeFilter(idx)} /> {/each} diff --git a/packages/builder/src/components/backend/DataTable/popovers/GroupBy.svelte b/packages/builder/src/components/backend/DataTable/popovers/GroupBy.svelte index 152d59a1a5..7f42660357 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/GroupBy.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/GroupBy.svelte @@ -9,7 +9,7 @@ } from "@budibase/bbui" import { backendUiStore } from "builderStore" import { notifier } from "builderStore/store/notifications" - import CreateEditRecord from "../modals/CreateEditRecord.svelte" + import CreateEditRecord from "./CreateEditRecord.svelte" const CALCULATIONS = [ { @@ -38,14 +38,14 @@
    - Group By + Group
    -
    Group By
    +
    Group
    -

    Group By

    +

    By

    + {:else if type === 'date'} - - + {:else if type === 'file'} - - -{:else if type === 'checkbox'} -
    - - +
    + +
    +{:else if type === 'checkbox'} + {:else} - + {/if} diff --git a/packages/builder/src/pages/[application]/backend/model/[selectedModel]/index.svelte b/packages/builder/src/pages/[application]/backend/model/[selectedModel]/index.svelte index 30f252b78d..f3a7840958 100644 --- a/packages/builder/src/pages/[application]/backend/model/[selectedModel]/index.svelte +++ b/packages/builder/src/pages/[application]/backend/model/[selectedModel]/index.svelte @@ -5,7 +5,7 @@ import { backendUiStore } from "builderStore" import ActionButton from "components/common/ActionButton.svelte" import * as api from "components/backend/DataTable/api" - import { CreateEditRecordModal } from "components/backend/DataTable/modals" + import CreateEditRecordModal from "components/backend/DataTable/popovers/CreateEditRecord.svelte" const { open, close } = getContext("simple-modal") diff --git a/packages/builder/src/pages/[application]/backend/view/[selectedView]/index.svelte b/packages/builder/src/pages/[application]/backend/view/[selectedView]/index.svelte index 2aedd4fe3b..959d36f9d6 100644 --- a/packages/builder/src/pages/[application]/backend/view/[selectedView]/index.svelte +++ b/packages/builder/src/pages/[application]/backend/view/[selectedView]/index.svelte @@ -5,7 +5,7 @@ import { backendUiStore } from "builderStore" import ActionButton from "components/common/ActionButton.svelte" import * as api from "components/backend/DataTable/api" - import { CreateEditRecordModal } from "components/backend/DataTable/modals" + import CreateEditRecord from "components/backend/DataTable/popovers/CreateEditRecord.svelte" const { open, close } = getContext("simple-modal")