From 67f5225e189f70d7d0344a02f691c180e174c358 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Mon, 5 Dec 2022 16:31:43 +0000 Subject: [PATCH 01/21] feat: notification transitions --- src/lib/layout/notification.svelte | 5 ++++- src/lib/layout/notifications.svelte | 17 ++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/lib/layout/notification.svelte b/src/lib/layout/notification.svelte index 877283cc1..8d386c59e 100644 --- a/src/lib/layout/notification.svelte +++ b/src/lib/layout/notification.svelte @@ -1,5 +1,7 @@ {#if $notifications}
From d3f4cb2deaf0cfd7d736c926b69ae8adf1a1835e Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:07:06 +0000 Subject: [PATCH 02/21] refactor: edit html structure --- src/lib/layout/notification.svelte | 4 ++-- src/lib/layout/notifications.svelte | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/layout/notification.svelte b/src/lib/layout/notification.svelte index baae131a8..71c3b8edc 100644 --- a/src/lib/layout/notification.svelte +++ b/src/lib/layout/notification.svelte @@ -10,7 +10,7 @@ const dispatch = createEventDispatcher(); -
  • {/if} -
  • + diff --git a/src/lib/layout/notifications.svelte b/src/lib/layout/notifications.svelte index 9357a4a4e..da64f62d1 100644 --- a/src/lib/layout/notifications.svelte +++ b/src/lib/layout/notifications.svelte @@ -8,7 +8,7 @@
    From 5c0cec6ed7494f3347fa8e8a1a46122872b2f6bc Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Fri, 17 Mar 2023 19:28:05 +0000 Subject: [PATCH 03/21] feat: input count dynamic color --- src/lib/elements/forms/inputTextarea.svelte | 29 ++++++++++++++++- .../attributes/string.svelte | 31 +++++++++++++------ 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/src/lib/elements/forms/inputTextarea.svelte b/src/lib/elements/forms/inputTextarea.svelte index 7285b6f24..51feff2e2 100644 --- a/src/lib/elements/forms/inputTextarea.svelte +++ b/src/lib/elements/forms/inputTextarea.svelte @@ -12,6 +12,8 @@ export let readonly = false; export let autofocus = false; export let maxlength: number = null; + export let optionalText: string | undefined = undefined; + export let tooltip: string = null; let element: HTMLTextAreaElement; let error: string; @@ -37,7 +39,7 @@ - + + diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte index e6655f95e..49750c8ea 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte @@ -1,5 +1,6 @@ - +{#if attribute.size > 64} + +{:else} + +{/if} From 25d5ab173fb1276ba3ba199a04e181dacc13c050 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Mon, 20 Mar 2023 19:09:57 +0000 Subject: [PATCH 04/21] refactor: paddinginline end on input text --- src/lib/elements/forms/inputText.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elements/forms/inputText.svelte b/src/lib/elements/forms/inputText.svelte index 333f17369..dfc83a7da 100644 --- a/src/lib/elements/forms/inputText.svelte +++ b/src/lib/elements/forms/inputText.svelte @@ -58,6 +58,7 @@ type="text" class="input-text" bind:value + class:u-padding-inline-end-56={typeof maxlength === 'number'} bind:this={element} on:invalid={handleInvalid} /> {#if maxlength} From a160506a7400b34feb33d03cb77f3bdf98e22bc8 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Mon, 20 Mar 2023 19:22:55 +0000 Subject: [PATCH 05/21] fix: input text missing text counter --- src/lib/elements/forms/inputText.svelte | 7 ++---- src/lib/elements/forms/inputTextarea.svelte | 25 ++---------------- src/lib/elements/forms/textCounter.svelte | 28 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 src/lib/elements/forms/textCounter.svelte diff --git a/src/lib/elements/forms/inputText.svelte b/src/lib/elements/forms/inputText.svelte index dfc83a7da..f56963788 100644 --- a/src/lib/elements/forms/inputText.svelte +++ b/src/lib/elements/forms/inputText.svelte @@ -1,6 +1,7 @@ + + 0}> + {count} + + {max} + + + From 505cfe2cb4856dfa679a3d189088a5f1f8645998 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Mon, 20 Mar 2023 19:24:21 +0000 Subject: [PATCH 06/21] refactor: modularize text counter --- src/lib/elements/forms/inputId.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/elements/forms/inputId.svelte b/src/lib/elements/forms/inputId.svelte index b11c7b7a3..93aaecc55 100644 --- a/src/lib/elements/forms/inputId.svelte +++ b/src/lib/elements/forms/inputId.svelte @@ -1,6 +1,7 @@ - + Upload Variables

    Upload multiple variables via a .env file that will be passed to your function at runtime.

    - + - +
    From b16b8e0a718904d6c15d3dea3e4e39a98dc558d0 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 21 Mar 2023 14:58:21 +0100 Subject: [PATCH 09/21] fix: variables upload with more than 8192 chars --- .../settings/uploadVariables.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte index d5caa07e7..acec944d7 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte @@ -28,8 +28,16 @@ throw new Error('No variables found'); } + const entries = Object.entries(uploaded); + + for (const [key, value] of entries) { + if (value.length > 8192) { + throw new Error(`Variable ${key} is longer than 8192 allowed characters`); + } + } + await Promise.all( - Object.entries(uploaded) + entries .filter(([, value]) => !!value) .map(([key, value]) => { const found = $variables.find((variable) => variable.key === key); From dffe268dbf95d0e5256f6fda979701ecc0b7ff9c Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 21 Mar 2023 15:17:12 +0100 Subject: [PATCH 10/21] remove max-size --- .../function-[function]/settings/uploadVariables.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte index acec944d7..3da9fbf52 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte @@ -70,7 +70,7 @@ Upload multiple variables via a .env file that will be passed to your function at runtime.

    - + From 9a9e8747e32565d044de4fb0eca94bb2bc9c850c Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 21 Mar 2023 15:29:04 +0100 Subject: [PATCH 11/21] fix: force pointer cursor on copy --- src/lib/components/copy.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/components/copy.svelte b/src/lib/components/copy.svelte index c6cc8fe7d..33050e82e 100644 --- a/src/lib/components/copy.svelte +++ b/src/lib/components/copy.svelte @@ -33,6 +33,8 @@ setTimeout(() => (content = 'Click to copy'))} From b0cc129834d418f4c2898276f79b3d8f12e60ff7 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Tue, 21 Mar 2023 19:21:15 +0000 Subject: [PATCH 12/21] refactor: change notification limit --- src/lib/stores/notifications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/notifications.ts b/src/lib/stores/notifications.ts index 26fa69a28..25ba01968 100644 --- a/src/lib/stores/notifications.ts +++ b/src/lib/stores/notifications.ts @@ -33,7 +33,7 @@ export const addNotification = (notification: Omit) => { const n = { ...defaults, ...notification }; notifications.update((all) => { - return [n, ...all.slice(0, 2)]; + return [n, ...all.slice(0, 4)]; }); if (n.timeout) setTimeout(() => dismissNotification(n.id), n.timeout); From a0b617284424a31021a7bb5a47e79d67173093e0 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 22 Mar 2023 12:30:12 +0100 Subject: [PATCH 13/21] feat: pagination for func vars --- src/lib/components/output.svelte | 16 +++++---- .../function-[function]/settings/+page.svelte | 33 ++++++++++++------- .../settings/uploadVariables.svelte | 2 +- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/lib/components/output.svelte b/src/lib/components/output.svelte index e8830076c..ff658d7d5 100644 --- a/src/lib/components/output.svelte +++ b/src/lib/components/output.svelte @@ -2,16 +2,18 @@ import Copy from './copy.svelte'; export let value: string; + export let hideCopyIcon = false; -
    +
    - -
    - -
    + {#if !hideCopyIcon} +
    + +
    + {/if}
    diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte index 09a4ea17d..dc2f755b2 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte @@ -3,7 +3,16 @@ import { base } from '$app/paths'; import { page } from '$app/stores'; import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; - import { Box, CardGrid, DropList, DropListItem, Empty, Output, Secret } from '$lib/components'; + import { + Box, + CardGrid, + DropList, + DropListItem, + Empty, + Output, + PaginationInline, + Secret + } from '$lib/components'; import Heading from '$lib/components/heading.svelte'; import { Roles } from '$lib/components/permissions'; import { Dependencies } from '$lib/constants'; @@ -44,6 +53,7 @@ let functionSchedule: string = null; let permissions: string[] = []; let arePermsDisabled = true; + let offset = 0; onMount(async () => { timeout ??= $func.timeout; @@ -374,19 +384,21 @@ Import .env file
    - {#if data.variables.total} + {@const limit = 10} + {@const sum = data.variables.total} + {#if sum}
    Key - Value + Value - {#each data.variables.variables as variable, i} + {#each data.variables.variables.slice(offset, offset + limit) as variable, i} - + {variable.key} @@ -435,15 +447,14 @@ {/each}
    - +
    +

    Total variables: {sum}

    + +
    {:else} (showVariablesModal = !showVariablesModal)}> diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte index 3da9fbf52..974932a16 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte @@ -70,7 +70,7 @@ Upload multiple variables via a .env file that will be passed to your function at runtime.

    - + From e098db6f9dc65d11e364604e2f3f97afb197ddd2 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Wed, 22 Mar 2023 13:11:04 +0000 Subject: [PATCH 14/21] refactor: improve notifications mobile styling --- src/lib/layout/notifications.svelte | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/layout/notifications.svelte b/src/lib/layout/notifications.svelte index da64f62d1..3200a1280 100644 --- a/src/lib/layout/notifications.svelte +++ b/src/lib/layout/notifications.svelte @@ -25,8 +25,15 @@ From 01fad2db341e9547e63e227aba27519d08dd4a9b Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Wed, 22 Mar 2023 15:46:11 +0000 Subject: [PATCH 15/21] feat: input text area on big string attributes --- .../attributes/string.svelte | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte index 9ecc9c513..747e2d10a 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte @@ -22,6 +22,7 @@