From ae1ca5e7ad21f2459fc922889993df1fb3dd1441 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Mar 2024 11:26:29 -0400 Subject: [PATCH] [ALS-6161 + ALS-6162] Search, Filters, Exports --- .github/dependabot.yml | 16 +- src/app.postcss | 13 +- src/lib/components/ModalWrapper.svelte | 17 + .../components/OptionsSelectionList.svelte | 183 +++ src/lib/components/Searchbox.svelte | 44 + src/lib/components/UserToken.svelte | 6 +- src/lib/components/datatable/Row.svelte | 48 + src/lib/components/datatable/Table.svelte | 43 +- .../datatable/accessories/Rows.svelte | 25 +- src/lib/components/explorer/AddFilter.svelte | 145 +++ .../explorer/HierarchyComponent.svelte | 10 + .../explorer/ResultInfoComponent.svelte | 22 + .../components/explorer/cell/Actions.svelte | 62 +- .../explorer/results/AddedFilter.svelte | 125 ++ .../explorer/results/ExportedVariable.svelte | 7 +- .../explorer/results/FilterComponent.svelte | 82 -- .../explorer/results/ResultsPanel.svelte | 116 +- .../explorer/results/SidePanel.svelte | 21 +- src/lib/components/user/cell/Status.svelte | 3 +- src/lib/configuration.ts | 10 +- src/lib/models/Filter.ts | 54 +- src/lib/models/Search.ts | 8 + src/lib/models/Tables.ts | 7 + src/lib/models/query/Query.ts | 21 +- src/lib/stores/Export.ts | 3 + src/lib/stores/Filter.ts | 5 + src/lib/stores/Query.ts | 14 + src/lib/stores/Search.ts | 7 + src/routes/+layout.svelte | 9 +- src/routes/+page.svelte | 28 +- src/routes/admin/+page.svelte | 5 + src/routes/admin/super/+page.svelte | 5 + src/routes/api/+page.svelte | 3 + src/routes/dataset/+page.svelte | 5 + src/routes/dataset/[uuid]/+page.svelte | 5 + src/routes/explorer/+page.svelte | 62 +- src/routes/help/+page.svelte | 3 + tests/lib/component/navigation/test.ts | 2 +- tests/mock-data.ts | 79 ++ tests/routes/explorer/test.ts | 1078 ++++++++++++++--- 40 files changed, 2014 insertions(+), 387 deletions(-) create mode 100644 src/lib/components/ModalWrapper.svelte create mode 100644 src/lib/components/OptionsSelectionList.svelte create mode 100644 src/lib/components/Searchbox.svelte create mode 100644 src/lib/components/datatable/Row.svelte create mode 100644 src/lib/components/explorer/AddFilter.svelte create mode 100644 src/lib/components/explorer/HierarchyComponent.svelte create mode 100644 src/lib/components/explorer/ResultInfoComponent.svelte create mode 100644 src/lib/components/explorer/results/AddedFilter.svelte delete mode 100644 src/lib/components/explorer/results/FilterComponent.svelte create mode 100644 src/lib/models/Tables.ts create mode 100644 src/lib/stores/Query.ts diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ede2a14a..fcc6ad64 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,15 +1,15 @@ version: 2 updates: - - package-ecosystem: "npm" - directory: "/" + - package-ecosystem: 'npm' + directory: '/' schedule: - interval: "weekly" + interval: 'weekly' commit-message: - prefix: "[npm] " + prefix: '[npm] ' - - package-ecosystem: "docker" - directory: "/" + - package-ecosystem: 'docker' + directory: '/' schedule: - interval: "weekly" + interval: 'weekly' commit-message: - prefix: "[docker] " + prefix: '[docker] ' diff --git a/src/app.postcss b/src/app.postcss index 69308385..2a20bfff 100644 --- a/src/app.postcss +++ b/src/app.postcss @@ -8,7 +8,6 @@ body { @apply h-full overflow-hidden; } -#shell-header, section.main-content { padding: 0 1em; } @@ -31,6 +30,10 @@ section.main-content.w-full { } } +input[type='checkbox'] { + @apply checkbox; +} + @media print { .app-bar #page-navigation { display: none; @@ -203,17 +206,17 @@ nav#page-navigation li a { @apply rounded-container-token; } nav#page-navigation a[aria-current='page'] { - @apply variant-filled-secondary; + background-color: rgba(var(--color-primary-50-900)); + color: rgb(var(--theme-font-color-base)); } nav#page-navigation a:hover, nav#page-navigation a:active { @apply variant-filled-primary; } -#landing input[type='search'] { +input[type='search'] { width: 100%; box-sizing: border-box; - margin-right: 0.5rem; @apply input; } @@ -269,4 +272,4 @@ nav#page-navigation a:active { height: 6rem; margin-bottom: 1rem; @apply rounded-container-token; -} \ No newline at end of file +} diff --git a/src/lib/components/ModalWrapper.svelte b/src/lib/components/ModalWrapper.svelte new file mode 100644 index 00000000..3584cd3b --- /dev/null +++ b/src/lib/components/ModalWrapper.svelte @@ -0,0 +1,17 @@ + + +{#if $modalStore[0]} +
+
+ {$modalStore[0].title ?? '(title missing)'} + +
+ +
+{/if} diff --git a/src/lib/components/OptionsSelectionList.svelte b/src/lib/components/OptionsSelectionList.svelte new file mode 100644 index 00000000..18847edc --- /dev/null +++ b/src/lib/components/OptionsSelectionList.svelte @@ -0,0 +1,183 @@ + + +
+
+
+ + {#if showSelectAll} + + {/if} +
+
+
handleScroll()} + > + {#each filteredOptions as option (option)} + + {/each} +
+
+
+
+
+
Selected:
+ +
+
+ +
loadMoreSelectedOptions()} + > + {#each displayedSelectedOptions as option (option)} + + {/each} +
+
+
+
+ + diff --git a/src/lib/components/Searchbox.svelte b/src/lib/components/Searchbox.svelte new file mode 100644 index 00000000..1581d8bc --- /dev/null +++ b/src/lib/components/Searchbox.svelte @@ -0,0 +1,44 @@ + + +
+ e.key === 'Enter' && search()} + required + /> + +
+ + diff --git a/src/lib/components/UserToken.svelte b/src/lib/components/UserToken.svelte index 17f444ac..52f2e0bd 100644 --- a/src/lib/components/UserToken.svelte +++ b/src/lib/components/UserToken.svelte @@ -53,6 +53,7 @@ message: 'An error occured while parsing your token. Please try again later. If this problem persists, please contact an administrator.', background: 'variant-filled-error', + hoverable: true, }); return 0; //TODO: Handle errors } @@ -101,10 +102,7 @@ + + diff --git a/src/lib/components/datatable/accessories/Rows.svelte b/src/lib/components/datatable/accessories/Rows.svelte index c18fb38b..57bcdc35 100644 --- a/src/lib/components/datatable/accessories/Rows.svelte +++ b/src/lib/components/datatable/accessories/Rows.svelte @@ -5,13 +5,20 @@ const options = [5, 10, 20, 50, 100]; -