From ab350057b62cc6d0d7e12a6f3bab72ea00b10f58 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 9 Nov 2023 12:23:41 +0100 Subject: [PATCH 01/45] Add seachbox to sources (not functional) --- .../src/components/common/SearchBox.svelte | 162 ++++++++++++++++++ .../app/[application]/data/_layout.svelte | 10 +- 2 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 packages/builder/src/components/common/SearchBox.svelte diff --git a/packages/builder/src/components/common/SearchBox.svelte b/packages/builder/src/components/common/SearchBox.svelte new file mode 100644 index 0000000000..d37bcab2a0 --- /dev/null +++ b/packages/builder/src/components/common/SearchBox.svelte @@ -0,0 +1,162 @@ + + + + +
+ +
+ {title} +
+
+ +
+
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte index d89f09fc08..80f3f22497 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte @@ -4,6 +4,7 @@ import Panel from "components/design/Panel.svelte" import { isActive, redirect, goto, params } from "@roxi/routify" import { datasources } from "stores/backend" + import SearchBox from "components/common/SearchBox.svelte" $: { // If we ever don't have any data other than the users table, prompt the @@ -18,7 +19,10 @@
{#if !$isActive("./new")} - + + + + @@ -51,4 +55,8 @@ flex: 1 1 auto; z-index: 1; } + + .panel-title-content { + display: contents; + } From 04f67f3199a3511fac67b291fa63218bdd008dab Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 9 Nov 2023 12:53:47 +0100 Subject: [PATCH 02/45] Add close functionallity --- .../src/components/common/SearchBox.svelte | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/common/SearchBox.svelte b/packages/builder/src/components/common/SearchBox.svelte index d37bcab2a0..079ac7e37b 100644 --- a/packages/builder/src/components/common/SearchBox.svelte +++ b/packages/builder/src/components/common/SearchBox.svelte @@ -1,7 +1,6 @@ @@ -39,15 +47,16 @@ {placeholder} /> -
- -
{title}
+ +
+ +
From 24bef1ee9df868ed21bdc5c04ef295646281e7e3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 9 Nov 2023 15:38:08 +0100 Subject: [PATCH 09/45] Rename --- .../components/common/{SearchBox.svelte => NavHeader.svelte} | 0 .../src/pages/builder/app/[application]/data/_layout.svelte | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename packages/builder/src/components/common/{SearchBox.svelte => NavHeader.svelte} (100%) diff --git a/packages/builder/src/components/common/SearchBox.svelte b/packages/builder/src/components/common/NavHeader.svelte similarity index 100% rename from packages/builder/src/components/common/SearchBox.svelte rename to packages/builder/src/components/common/NavHeader.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte index 7d05b68ec8..268cce2930 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte @@ -4,7 +4,7 @@ import Panel from "components/design/Panel.svelte" import { isActive, redirect, goto, params } from "@roxi/routify" import { datasources } from "stores/backend" - import SearchBox from "components/common/SearchBox.svelte" + import NavHeader from "components/common/NavHeader.svelte" let searchValue @@ -23,7 +23,7 @@ {#if !$isActive("./new")} - Date: Thu, 9 Nov 2023 15:44:34 +0100 Subject: [PATCH 10/45] Handle enters --- .../src/components/common/NavHeader.svelte | 15 +++++++++++++-- packages/builder/src/helpers/keyUtils.js | 7 +++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 packages/builder/src/helpers/keyUtils.js diff --git a/packages/builder/src/components/common/NavHeader.svelte b/packages/builder/src/components/common/NavHeader.svelte index 3131f06ea6..5e401cf3c8 100644 --- a/packages/builder/src/components/common/NavHeader.svelte +++ b/packages/builder/src/components/common/NavHeader.svelte @@ -1,6 +1,7 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte index 268cce2930..90f9fb6be2 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte @@ -27,10 +27,10 @@ title="Sources" placeholder="Search for sources" bind:value={searchValue} + onAdd={() => $goto("./new")} /> - From b908287223d150d0e93f9cf0ea35678078a99da9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 9 Nov 2023 16:09:45 +0100 Subject: [PATCH 14/45] Animate chevron --- packages/builder/src/components/common/NavItem.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/components/common/NavItem.svelte b/packages/builder/src/components/common/NavItem.svelte index 2c8a862535..1c9267ca18 100644 --- a/packages/builder/src/components/common/NavItem.svelte +++ b/packages/builder/src/components/common/NavItem.svelte @@ -189,6 +189,7 @@ flex: 0 0 20px; pointer-events: all; order: 0; + transition: transform 100ms linear; } .icon.arrow.absolute { position: absolute; From 72c415e72c61c18e01e76cbc53b92fbbf1e92a16 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 9 Nov 2023 16:31:10 +0100 Subject: [PATCH 15/45] Filter tables --- .../backend/DatasourceNavigator/DatasourceNavigator.svelte | 2 +- .../components/backend/TableNavigator/TableNavigator.svelte | 6 ++++++ .../src/pages/builder/app/[application]/data/_layout.svelte | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index 5f914f545a..86cea3b3b9 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -206,7 +206,7 @@ {#if datasource.open} - + {#each $queries.list.filter(query => query.datasourceId === datasource._id && (!searchTerm || query.name ?.toLowerCase() ?.indexOf(searchTerm.toLowerCase()) > -1)) as query} diff --git a/packages/builder/src/components/backend/TableNavigator/TableNavigator.svelte b/packages/builder/src/components/backend/TableNavigator/TableNavigator.svelte index 712d74889c..3f0538ceb3 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableNavigator.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableNavigator.svelte @@ -7,6 +7,7 @@ import { goto, isActive } from "@roxi/routify" import { userSelectedResourceMap } from "builderStore" + export let searchTerm export let sourceId export let selectTable @@ -14,6 +15,11 @@ .filter( table => table.sourceId === sourceId && table._id !== TableNames.USERS ) + .filter( + table => + !searchTerm || + table.name.toLowerCase()?.indexOf(searchTerm.toLowerCase()) > -1 + ) .sort(alphabetical) const alphabetical = (a, b) => { diff --git a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte index 90f9fb6be2..3fbf18eac5 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte @@ -1,5 +1,5 @@