From 14b13c7c52caf00ba89e13810a9bc9f3ea9e8a22 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 23 Oct 2020 12:25:22 +0100 Subject: [PATCH] Update data page to use new styles --- .../components/backend/DataTable/Table.svelte | 73 +++++++------ .../TableNavigator/TableNavigator.svelte | 103 ++++++++++-------- .../modals/CreateTableModal.svelte | 54 ++++----- .../pages/[application]/data/_layout.svelte | 9 +- 4 files changed, 124 insertions(+), 115 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 7bb5ac6a18..e26b68d537 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -51,19 +51,17 @@ } -
-
-

- {title} - {#if loading} -
- -
- {/if} -

-
- -
+
+
+

{title}

+ {#if loading} +
+ +
+ {/if} +
+
+
@@ -125,20 +123,44 @@ bind:currentPage pageItemCount={paginatedData.length} {ITEMS_PER_PAGE} /> - + diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index dd691e9e80..e77fec709f 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -2,8 +2,7 @@ import { goto } from "@sveltech/routify" import { backendUiStore, store } from "builderStore" import { notifier } from "builderStore/store/notifications" - import { Button, Input, Label, ModalContent, Modal } from "@budibase/bbui" - import Spinner from "components/common/Spinner.svelte" + import { Input, Label, ModalContent } from "@budibase/bbui" import TableDataImport from "../TableDataImport.svelte" import analytics from "analytics" import screenTemplates from "builderStore/store/screenTemplates" @@ -22,15 +21,9 @@ let dataImport let error = "" - function resetState() { - name = "" - dataImport = undefined - error = "" - } - function checkValid(evt) { const tableName = evt.target.value - if ($backendUiStore.models?.some(model => model.name === tableName)) { + if ($backendUiStore.models?.some((model) => model.name === tableName)) { error = `Table with name ${tableName} already exists. Please choose another name.` return } @@ -56,8 +49,8 @@ // Create auto screens const screens = screenTemplates($store, [table]) - .filter(template => defaultScreens.includes(template.id)) - .map(template => template.create()) + .filter((template) => defaultScreens.includes(template.id)) + .map((template) => template.create()) for (let screen of screens) { // Record the table that created this screen so we can link it later screen.autoTableId = table._id @@ -74,7 +67,7 @@ } // Create autolink to newly created list page - const listPage = screens.find(screen => + const listPage = screens.find((screen) => screen.props._instanceName.endsWith("List") ) await store.createLink(listPage.route, table.name) @@ -84,23 +77,20 @@ } - - - - -
- - -
-
-
+ + +
+ + +
+
diff --git a/packages/builder/src/pages/[application]/data/_layout.svelte b/packages/builder/src/pages/[application]/data/_layout.svelte index 1ac92b84c9..d52fdffade 100644 --- a/packages/builder/src/pages/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/[application]/data/_layout.svelte @@ -18,18 +18,17 @@ .root { height: calc(100vh - 60px); display: grid; - grid-template-columns: 300px minmax(0, 1fr); - background: var(--grey-1); - line-height: 1; + grid-template-columns: 260px minmax(0, 1fr); + background: var(--grey-2); } .content { flex: 1 1 auto; - padding: var(--spacing-xl) 40px; + padding: var(--spacing-l) 40px; overflow-y: auto; } .nav { overflow-y: auto; background: var(--white); - padding: var(--spacing-xl); + padding: var(--spacing-l) var(--spacing-xl); }