diff --git a/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte b/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte index 6587451462..6565bf1766 100644 --- a/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte @@ -1,8 +1,8 @@ - + {#if Object.keys(schema).length > 0} - - + + {/if}
diff --git a/packages/builder/src/components/backend/DataTable/popovers/RecordFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte similarity index 96% rename from packages/builder/src/components/backend/DataTable/popovers/RecordFieldControl.svelte rename to packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte index 10aeb56ae8..55129b47e3 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/RecordFieldControl.svelte +++ b/packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte @@ -1,7 +1,7 @@ @@ -50,68 +52,68 @@

{title}

- +
- - {#if allowEditing} - - {/if} - {#each columns as header} - - {/each} - - - - {#if paginatedData.length === 0} - {#if allowEditing} - - {/if} - {#each columns as header, idx} - - {/each} - {/if} - {#each paginatedData as row} {#if allowEditing} - + {/if} {#each columns as header} - + {/each} - {/each} + + + {#if paginatedData.length === 0} + {#if allowEditing} + + {/if} + {#each columns as header, idx} + + {/each} + {/if} + {#each paginatedData as row} + + {#if allowEditing} + + {/if} + {#each columns as header} + + {/each} + + {/each}
-
Edit
-
- {#if allowEditing} - - {:else} -
{header}
- {/if} -
No data. - {#if idx === 0}No data.{/if} -
- - +
Edit
+
- {#if schema[header].type === 'link'} -
selectRelationship(row, header)}> - {row[header] ? row[header].length : 0} linked row(s) -
- {:else if schema[header].type === 'attachment'} - - {:else}{getOr('', header, row)}{/if} -
+ {#if allowEditing} + + {:else} +
{header}
+ {/if} +
No data. + {#if idx === 0}No data.{/if} +
+ + + {#if schema[header].type === 'link'} +
selectRelationship(row, header)}> + {row[header] ? row[header].length : 0} linked row(s) +
+ {:else if schema[header].type === 'attachment'} + + {:else}{getOr('', header, row)}{/if} +
+ {data} + bind:currentPage + pageItemCount={paginatedData.length} + {ITEMS_PER_PAGE} /> diff --git a/packages/builder/src/components/backend/DataTable/popovers/CalculatePopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/CalculatePopover.svelte new file mode 100644 index 0000000000..ef97598af5 --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/popovers/CalculatePopover.svelte @@ -0,0 +1,84 @@ + + +
+
Calculate
+
+

The

+ +

of

+ +
+ +
+ + diff --git a/packages/builder/src/components/backend/DataTable/popovers/ColumnHeader.svelte b/packages/builder/src/components/backend/DataTable/popovers/ColumnPopover.svelte similarity index 91% rename from packages/builder/src/components/backend/DataTable/popovers/ColumnHeader.svelte rename to packages/builder/src/components/backend/DataTable/popovers/ColumnPopover.svelte index e1429edb34..de431035da 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/ColumnHeader.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/ColumnPopover.svelte @@ -2,7 +2,7 @@ import { backendUiStore } from "builderStore" import { DropdownMenu, Button, Icon, Input, Select } from "@budibase/bbui" import { FIELDS } from "constants/backend" - import CreateEditColumnModal from "./CreateEditColumn.svelte" + import CreateEditColumnPopover from "./CreateEditColumnPopover.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte" import { notifier } from "../../../../builderStore/store/notifications" @@ -26,6 +26,11 @@ editing = false } + function showDelete() { + dropdown.hide() + confirmDeleteDialog.show() + } + function deleteColumn() { if (field.name === $backendUiStore.selectedModel.primaryDisplay) { notifier.danger("You cannot delete the primary display column") @@ -52,7 +57,7 @@ {#if editing}
Edit Column
- + {:else}
    {#if type !== 'link'} @@ -61,9 +66,7 @@ Edit {/if} -
  • confirmDeleteDialog.show()}> +
  • Delete
  • diff --git a/packages/builder/src/components/backend/DataTable/popovers/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/popovers/CreateEditColumnPopover.svelte similarity index 100% rename from packages/builder/src/components/backend/DataTable/popovers/CreateEditColumn.svelte rename to packages/builder/src/components/backend/DataTable/popovers/CreateEditColumnPopover.svelte diff --git a/packages/builder/src/components/backend/DataTable/popovers/CreateEditRecord.svelte b/packages/builder/src/components/backend/DataTable/popovers/CreateEditRecord.svelte deleted file mode 100644 index dda74a6ab3..0000000000 --- a/packages/builder/src/components/backend/DataTable/popovers/CreateEditRecord.svelte +++ /dev/null @@ -1,81 +0,0 @@ - - -
    - -
    - {#each modelSchema as [key, meta]} -
    - {#if meta.type === 'link'} - - {:else} - - {/if} -
    - {/each} -
    -
    - - -
    -
    - - diff --git a/packages/builder/src/components/backend/DataTable/popovers/View.svelte b/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte similarity index 60% rename from packages/builder/src/components/backend/DataTable/popovers/View.svelte rename to packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte index f8f6ce948b..1c732c7edc 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/View.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte @@ -1,19 +1,10 @@ -
    - - - Create New View - -
    - -
    -
    Create View
    - - +
    +
    Create View
    + + - +
    diff --git a/packages/builder/src/components/backend/DataTable/popovers/GroupByPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/GroupByPopover.svelte new file mode 100644 index 0000000000..da5cf7b8ec --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/popovers/GroupByPopover.svelte @@ -0,0 +1,66 @@ + + +
    +
    Group
    +
    +

    By

    + +
    + +
    + + diff --git a/packages/builder/src/components/backend/DataTable/popovers/Row.svelte b/packages/builder/src/components/backend/DataTable/popovers/Row.svelte deleted file mode 100644 index 38b56e83fd..0000000000 --- a/packages/builder/src/components/backend/DataTable/popovers/Row.svelte +++ /dev/null @@ -1,27 +0,0 @@ - - -
    - -
    - -
    Add New Row
    - -
    - - diff --git a/packages/builder/src/components/backend/DataTable/popovers/EditRow.svelte b/packages/builder/src/components/backend/DataTable/popovers/RowPopover.svelte similarity index 65% rename from packages/builder/src/components/backend/DataTable/popovers/EditRow.svelte rename to packages/builder/src/components/backend/DataTable/popovers/RowPopover.svelte index 8b50bf6b61..ca8488e134 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/EditRow.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/RowPopover.svelte @@ -1,41 +1,33 @@ @@ -43,21 +35,16 @@
    - {#if editing} -
    Edit Row
    - - {:else} -
      -
    • - - Edit -
    • -
    • confirmDeleteDialog.show()}> - - Delete -
    • -
    - {/if} +
      +
    • + + Edit +
    • +
    • + + Delete +
    • +
    + + + diff --git a/packages/builder/src/components/common/LinkedRecordSelector.svelte b/packages/builder/src/components/common/LinkedRecordSelector.svelte index c263332ca5..f4df3a7d1f 100644 --- a/packages/builder/src/components/common/LinkedRecordSelector.svelte +++ b/packages/builder/src/components/common/LinkedRecordSelector.svelte @@ -20,7 +20,6 @@ const FETCH_RECORDS_URL = `/api/${linkedModelId}/records` const response = await api.get(FETCH_RECORDS_URL) const result = await response.json() - console.log(result) return result } diff --git a/packages/builder/src/components/common/Modal/Modal.svelte b/packages/builder/src/components/common/Modal/Modal.svelte index 0077567100..dd6c6615fd 100644 --- a/packages/builder/src/components/common/Modal/Modal.svelte +++ b/packages/builder/src/components/common/Modal/Modal.svelte @@ -1,17 +1,23 @@ {#if visible} @@ -66,7 +74,6 @@ justify-content: center; align-items: center; background-color: rgba(0, 0, 0, 0.25); - z-index: 999; } .scroll-wrapper { @@ -98,5 +105,7 @@ flex: 0 0 400px; margin: 2rem 0; border-radius: var(--border-radius-m); + gap: var(--spacing-xl); + padding: var(--spacing-xl); } diff --git a/packages/builder/src/components/common/Modal/ModalContainer.svelte b/packages/builder/src/components/common/Modal/ModalContainer.svelte index 891df8630b..ed6d9e15ad 100644 --- a/packages/builder/src/components/common/Modal/ModalContainer.svelte +++ b/packages/builder/src/components/common/Modal/ModalContainer.svelte @@ -5,5 +5,6 @@ position: fixed; top: 0; left: 0; + z-index: 999; } diff --git a/packages/builder/src/components/common/Modal/ModalFooter.svelte b/packages/builder/src/components/common/Modal/ModalFooter.svelte new file mode 100644 index 0000000000..39c2652ead --- /dev/null +++ b/packages/builder/src/components/common/Modal/ModalFooter.svelte @@ -0,0 +1,44 @@ + + +{#if showCancelButton || showConfirmButton} +
    + {#if showCancelButton} + + {/if} + {#if showConfirmButton} + + {/if} +
    +{/if} + + diff --git a/packages/builder/src/components/common/Modal/ModalTitle.svelte b/packages/builder/src/components/common/Modal/ModalTitle.svelte new file mode 100644 index 0000000000..0f6a4f5207 --- /dev/null +++ b/packages/builder/src/components/common/Modal/ModalTitle.svelte @@ -0,0 +1,10 @@ +
    + +
    + + diff --git a/packages/builder/src/components/common/Modal/context.js b/packages/builder/src/components/common/Modal/context.js new file mode 100644 index 0000000000..81ea1cdcf5 --- /dev/null +++ b/packages/builder/src/components/common/Modal/context.js @@ -0,0 +1 @@ +export const ContextKey = "budibase-modal" diff --git a/packages/builder/src/components/common/Modal/index.js b/packages/builder/src/components/common/Modal/index.js index bd53a1373b..8420f8416a 100644 --- a/packages/builder/src/components/common/Modal/index.js +++ b/packages/builder/src/components/common/Modal/index.js @@ -1,2 +1,5 @@ export { default as Modal } from "./Modal.svelte" export { default as ModalContainer } from "./ModalContainer.svelte" +export { default as ModalTitle } from "./ModalTitle.svelte" +export { default as ModalFooter } from "./ModalFooter.svelte" +export { ContextKey } from "./context" 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 176bfc4c30..c2cf7f6ff9 100644 --- a/packages/builder/src/pages/[application]/backend/model/[selectedModel]/index.svelte +++ b/packages/builder/src/pages/[application]/backend/model/[selectedModel]/index.svelte @@ -1,13 +1,6 @@ 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 168461699b..8a0c87b98b 100644 --- a/packages/builder/src/pages/[application]/backend/view/[selectedView]/index.svelte +++ b/packages/builder/src/pages/[application]/backend/view/[selectedView]/index.svelte @@ -1,13 +1,6 @@