From 1dc406e1d7b73456626da2108809632066f5c12f Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Thu, 2 Jul 2020 21:22:21 +0100 Subject: [PATCH 1/3] DataTable should not display type & modelId --- packages/standard-components/src/DataTable.svelte | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/standard-components/src/DataTable.svelte b/packages/standard-components/src/DataTable.svelte index e6f097314c..6782a9925c 100644 --- a/packages/standard-components/src/DataTable.svelte +++ b/packages/standard-components/src/DataTable.svelte @@ -8,6 +8,16 @@ let headers = [] let store = _bb.store + const shouldDisplayField = name => { + if (name.startsWith("_")) return false + // always 'record' + if (name === "type") return false + // tables are always tied to a single modelId, this is irrelevant + if (name === "modelId") return false + + return true + } + async function fetchData() { const FETCH_RECORDS_URL = `/api/views/all_${model}` @@ -20,7 +30,7 @@ return state }) - headers = Object.keys(json[0]).filter(key => !key.startsWith("_")) + headers = Object.keys(json[0]).filter(shouldDisplayField) } else { throw new Error("Failed to fetch records.", response) } From 60ff21b159a0606104ecf8d6add486567a23b3fc Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Fri, 3 Jul 2020 14:44:25 +0100 Subject: [PATCH 2/3] hiding the `` for now --- .../[application]/backend/model/[selectedModel]/index.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 3b2c43a178..6da373bcca 100644 --- a/packages/builder/src/pages/[application]/backend/model/[selectedModel]/index.svelte +++ b/packages/builder/src/pages/[application]/backend/model/[selectedModel]/index.svelte @@ -23,9 +23,7 @@ } -{#if selectedModel.schema && Object.keys(selectedModel.schema).length === 0} - -{:else if $backendUiStore.selectedDatabase._id && selectedModel.name} +{#if $backendUiStore.selectedDatabase._id && selectedModel.name} {:else} create your first table to start building From c57b30efdf8d5e3611c5f0b428cae6ffdb765cd0 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Fri, 3 Jul 2020 21:48:34 +0100 Subject: [PATCH 3/3] more understandable screenslot & default header on master screen --- .../AppPreview/CurrentItemPreview.svelte | 128 +++++++++++------- .../AppPreview/iframeTemplate.js | 10 ++ .../appDirectoryTemplate/pages/main/page.json | 75 ++++++++-- 3 files changed, 155 insertions(+), 58 deletions(-) diff --git a/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte index abf226048b..239cebdd0a 100644 --- a/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte @@ -25,16 +25,10 @@ name: "Screen Placeholder", route: "*", props: { - "_id": "49c3d0a2-7028-46f0-b004-7eddf62ad01c", + "_id": "screenslot-placeholder", "_component": "@budibase/standard-components/container", "_styles": { - "normal": { - "padding": "0px", - "font-family": "Roboto", - "border-width": "0", - "border-style": "None", - "text-align": "center" - }, + "normal": {}, "hover": {}, "active": {}, "selected": {} @@ -45,47 +39,87 @@ "type": "div", "_children": [ { - "_id": "335428f7-f9ca-4acd-9e76-71bc8ad27324", - "_component": "@budibase/standard-components/container", - "_styles": { - "normal": { - "padding": "16px", - "border-style": "Dashed", - "border-width": "2px", - "border-color": "#8a8989fa" - }, - "hover": {}, - "active": {}, - "selected": {} + "_id": "51a1b494-0fa4-49c3-90cc-c2a6c7a3f888", + "_component": "@budibase/standard-components/container", + "_styles": { + "normal": { + "display": "flex", + "flex-direction": "column", + "align-items": "center" }, - "_code": "", - "className": "", - "onLoad": [], - "type": "div", - "_instanceId": "inst_b3b4e95_ab0df02dda3f4d8eb4b35eea2968bad3", - "_instanceName": "Container", - "_children": [ - { - "_id": "ddb6a225-33ba-4ba8-91da-bc6a2697ebf9", - "_component": "@budibase/standard-components/heading", - "_styles": { - "normal": { - "font-family": "Roboto" - }, - "hover": {}, - "active": {}, - "selected": {} + "hover": {}, + "active": {}, + "selected": {} + }, + "_code": "", + "className": "", + "onLoad": [], + "type": "div", + "_instanceId": "inst_40d9036_4c81114e2bf145ab8721978c66e09a10", + "_instanceName": "Container", + "_children": [ + { + "_id": "90a52cd0-f215-46c1-b29b-e28f9e7edf72", + "_component": "@budibase/standard-components/heading", + "_styles": { + "normal": { + "width": "500px", + "padding": "8px" }, - "_code": "", - "className": "", - "text": "Your screens go here", - "type": "h1", - "_instanceId": "inst_b3b4e95_ab0df02dda3f4d8eb4b35eea2968bad3", - "_instanceName": "Heading", - "_children": [] - } - ] - } + "hover": {}, + "active": {}, + "selected": {} + }, + "_code": "", + "className": "", + "text": "Screenslot", + "type": "h1", + "_instanceId": "inst_40d9036_4c81114e2bf145ab8721978c66e09a10", + "_instanceName": "Heading", + "_children": [] + }, + { + "_id": "71a3da65-72c6-4c43-8c6a-49871c07b77d", + "_component": "@budibase/standard-components/text", + "_styles": { + "normal": { + "max-width": "", + "text-align": "left", + "width": "500px", + "padding": "8px" + }, + "hover": {}, + "active": {}, + "selected": {} + }, + "_code": "", + "text": "The screens that you create will be displayed inside this box.", + "type": "none", + "_instanceId": "inst_40d9036_4c81114e2bf145ab8721978c66e09a10", + "_instanceName": "Text" + }, + { + "_id": "8af80374-460d-497b-a5d8-7dd2ec4a7bbc", + "_component": "@budibase/standard-components/text", + "_styles": { + "normal": { + "max-width": "", + "text-align": "left", + "width": "500px", + "padding": "8px" + }, + "hover": {}, + "active": {}, + "selected": {} + }, + "_code": "", + "text": "This box is just a placeholder, to show you the position of screens.", + "type": "none", + "_instanceId": "inst_40d9036_4c81114e2bf145ab8721978c66e09a10", + "_instanceName": "Text" + } + ] + } ], "_instanceName": "Content Placeholder" }, diff --git a/packages/builder/src/components/userInterface/AppPreview/iframeTemplate.js b/packages/builder/src/components/userInterface/AppPreview/iframeTemplate.js index b78f882fe1..e269e3166e 100644 --- a/packages/builder/src/components/userInterface/AppPreview/iframeTemplate.js +++ b/packages/builder/src/components/userInterface/AppPreview/iframeTemplate.js @@ -24,6 +24,16 @@ export default ` text-transform: uppercase; font-weight: bold; } + + .container-screenslot-placeholder { + padding: 20px; + text-align: center; + border-style: dashed !important; + border-width: 1px; + color: #806fde; + background: #e9e6ff44; + height: 100%; + }