From ebe6a6c325bd79754f7a13804d4aef2608008d08 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 19 Jun 2023 02:28:09 +0200 Subject: [PATCH] make download button configurable for table --- .../components/display/table/AppTable.svelte | 1 + .../display/table/AppTableFooter.svelte | 91 ++++++++++--------- .../apps/editor/component/components.ts | 9 +- 3 files changed, 57 insertions(+), 44 deletions(-) diff --git a/frontend/src/lib/components/apps/components/display/table/AppTable.svelte b/frontend/src/lib/components/apps/components/display/table/AppTable.svelte index e0e6178f1c..2f787af8fe 100644 --- a/frontend/src/lib/components/apps/components/display/table/AppTable.svelte +++ b/frontend/src/lib/components/apps/components/display/table/AppTable.svelte @@ -465,6 +465,7 @@ -
- {#if result.length > pageSize || manualPagination} +{#if result.length > pageSize || manualPagination || download} +
+ {#if result.length > pageSize || manualPagination} +
+ + + {$table.getState().pagination.pageIndex + 1} of {$table.getPageCount()} +
+ {:else} +
+ {/if}
- - - {$table.getState().pagination.pageIndex + 1} of {$table.getPageCount()} + {#if download} + + {/if}
- {:else} -
- {/if} -
-
-
+{/if} diff --git a/frontend/src/lib/components/apps/editor/component/components.ts b/frontend/src/lib/components/apps/editor/component/components.ts index 162fe66024..9ce6e812f7 100644 --- a/frontend/src/lib/components/apps/editor/component/components.ts +++ b/frontend/src/lib/components/apps/editor/component/components.ts @@ -1078,7 +1078,14 @@ Hello \${ctx.username} tooltip: 'Search can be configured in the following ways: Disabled: The search is disabled,By Runnable: The search is done in the backend, or by component: The search is done in the frontend.' }, - pagination: paginationOneOf + pagination: paginationOneOf, + downloadButton: { + type: 'static', + fieldType: 'boolean', + value: true, + onlyStatic: true, + tooltip: 'display a button to download the table as a csv file' + } }, componentInput: { type: 'static',