From 4e9d60b446c6fa52459de257ee9f0fb4b4d37fdb Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 1 Dec 2021 17:55:57 +0000 Subject: [PATCH] First major part of the REST query resdesign. --- packages/bbui/src/Banner/Banner.svelte | 59 ++++++ packages/bbui/src/Tabs/Tab.svelte | 6 +- packages/bbui/src/index.js | 1 + .../common/inputs/EditableLabel.svelte | 63 +++++++ .../integration/KeyValueBuilder.svelte | 1 + .../[query]/_layout.svelte | 10 +- .../[selectedDatasource]/rest/_layout.svelte | 4 + .../[selectedDatasource]/rest/index.svelte | 173 ++++++++++++++++++ .../data/datasource/rest/_layout.svelte | 0 .../data/datasource/rest/index.svelte | 0 10 files changed, 313 insertions(+), 4 deletions(-) create mode 100644 packages/bbui/src/Banner/Banner.svelte create mode 100644 packages/builder/src/components/common/inputs/EditableLabel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/rest/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/rest/index.svelte diff --git a/packages/bbui/src/Banner/Banner.svelte b/packages/bbui/src/Banner/Banner.svelte new file mode 100644 index 0000000000..f28ee09d9c --- /dev/null +++ b/packages/bbui/src/Banner/Banner.svelte @@ -0,0 +1,59 @@ + + +{#if show} +
+ +
+
+ +
+ {#if extraButtonText && extraButtonAction} + + {/if} +
+
+ +
+
+{/if} diff --git a/packages/bbui/src/Tabs/Tab.svelte b/packages/bbui/src/Tabs/Tab.svelte index 86f2c0ee52..0aa59f7f8a 100644 --- a/packages/bbui/src/Tabs/Tab.svelte +++ b/packages/bbui/src/Tabs/Tab.svelte @@ -5,7 +5,7 @@ export let icon = "" const dispatch = createEventDispatcher() - const selected = getContext("tab") + let selected = getContext("tab") let tab let tabInfo @@ -16,8 +16,8 @@ // We just need to get this off the main thread to fix this, by using // a 0ms timeout. setTimeout(() => { - tabInfo = tab.getBoundingClientRect() - if ($selected.title === title) { + tabInfo = tab?.getBoundingClientRect() + if (tabInfo && $selected.title === title) { $selected.info = tabInfo } }, 0) diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index 377d451604..c30047f73f 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -59,6 +59,7 @@ export { default as Badge } from "./Badge/Badge.svelte" export { default as StatusLight } from "./StatusLight/StatusLight.svelte" export { default as ColorPicker } from "./ColorPicker/ColorPicker.svelte" export { default as InlineAlert } from "./InlineAlert/InlineAlert.svelte" +export { default as Banner } from "./Banner/Banner.svelte" // Typography export { default as Body } from "./Typography/Body.svelte" diff --git a/packages/builder/src/components/common/inputs/EditableLabel.svelte b/packages/builder/src/components/common/inputs/EditableLabel.svelte new file mode 100644 index 0000000000..ffe3c0968e --- /dev/null +++ b/packages/builder/src/components/common/inputs/EditableLabel.svelte @@ -0,0 +1,63 @@ + + +
+ {#if !editing} + {#if type === "heading"} + {value || defaultValue} + {:else if type === "body"} + {value || defaultValue} + {:else} + + {/if} +
+ setEditing(true)} /> +
+ {:else} +
+ +
+ setEditing(false)} + /> + {/if} +
+ + diff --git a/packages/builder/src/components/integration/KeyValueBuilder.svelte b/packages/builder/src/components/integration/KeyValueBuilder.svelte index 3261ef3559..e10bc59a5e 100644 --- a/packages/builder/src/components/integration/KeyValueBuilder.svelte +++ b/packages/builder/src/components/integration/KeyValueBuilder.svelte @@ -19,6 +19,7 @@ ) export function addEntry() { + console.log(fields) fields = [...fields, {}] changed() } diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte index 6d802df2e9..3fb52d86f9 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte @@ -1,6 +1,8 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/_layout.svelte new file mode 100644 index 0000000000..9cc1fe5817 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/_layout.svelte @@ -0,0 +1,4 @@ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/index.svelte new file mode 100644 index 0000000000..1900340304 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/index.svelte @@ -0,0 +1,173 @@ + + +{#if query} +
+
+ + (query.flags.urlName = false)} + /> +
+
+ checkQueryName(query, detail)} + /> +
+ +
+ + + + + + + + + {#if !query.flags.bannerCleared} + (query.flags.bannerCleared = true)} + > + Add a JavaScript function to transform the query result. + + {/if} + (query.transformer = e.detail)} + /> + + + +
+
+ + + Response + +
+{/if} + + diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/rest/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/rest/_layout.svelte deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/rest/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/rest/index.svelte deleted file mode 100644 index e69de29bb2..0000000000