From 1751928d1883d21b6024c72aa690a40d74d57411 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:41:38 +0000 Subject: [PATCH 01/35] refactor: improve table overflow detection --- src/lib/elements/table/tableScroll.svelte | 25 ++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/lib/elements/table/tableScroll.svelte b/src/lib/elements/table/tableScroll.svelte index 814fe00e5..6d30f8aff 100644 --- a/src/lib/elements/table/tableScroll.svelte +++ b/src/lib/elements/table/tableScroll.svelte @@ -2,11 +2,28 @@ import type { Action } from 'svelte/action'; export let isSticky = false; + let isOverflowing = false; - const hasOverflow: Action void> = (node, callback) => { + const hasOverflow: Action = (node) => { const observer = new ResizeObserver((entries) => { for (const entry of entries) { - callback(entry.contentRect.width < entry.target.scrollWidth); + let overflowing = false; + if (entry.contentRect.width < entry.target.scrollWidth) { + overflowing = true; + } + + const cols = entry.target.querySelectorAll('.table-thead-col'); + for (let i = 0; i < cols.length; i++) { + const col = cols[i]; + const cs = getComputedStyle(col); + const innerWidth = + col.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight); + if (innerWidth < 32) { + overflowing = true; + } + } + + isOverflowing = overflowing; } }); @@ -18,12 +35,10 @@ } }; }; - - let isOverflowing = false;
-
(isOverflowing = v)}> +
From f21646b3968f98b2ba20ec1298d6072ab490823a Mon Sep 17 00:00:00 2001 From: Tushar Dave Date: Sun, 26 Mar 2023 15:00:35 +0530 Subject: [PATCH 02/35] fix flutter install command : pub get -> pub add --- .../overview/platforms/wizard/flutter/step2.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/overview/platforms/wizard/flutter/step2.svelte b/src/routes/console/project-[project]/overview/platforms/wizard/flutter/step2.svelte index 7d7dc3551..a47e93a8d 100644 --- a/src/routes/console/project-[project]/overview/platforms/wizard/flutter/step2.svelte +++ b/src/routes/console/project-[project]/overview/platforms/wizard/flutter/step2.svelte @@ -5,7 +5,7 @@ const example1 = `dependencies: appwrite: ^${$versions['client-flutter']}`; - const example2 = `pub get appwrite`; + const example2 = `flutter pub add appwrite`; From 9fb6de180c3974652cb6010e42a8668e285d9fa1 Mon Sep 17 00:00:00 2001 From: Rohan kumar <51409281+rohan220217@users.noreply.github.com> Date: Fri, 31 Mar 2023 20:46:17 +0530 Subject: [PATCH 03/35] fix: session modal was not closed after successfull deletion --- .../project-[project]/auth/user-[user]/deleteSession.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/console/project-[project]/auth/user-[user]/deleteSession.svelte b/src/routes/console/project-[project]/auth/user-[user]/deleteSession.svelte index 306feb2d4..f934958b2 100644 --- a/src/routes/console/project-[project]/auth/user-[user]/deleteSession.svelte +++ b/src/routes/console/project-[project]/auth/user-[user]/deleteSession.svelte @@ -15,6 +15,7 @@ try { await sdk.forProject.users.deleteSession($page.params.user, selectedSessionId); await invalidate(Dependencies.SESSIONS); + showDelete = false; addNotification({ type: 'success', message: 'Session has been deleted' From de2439b2af1046bae80af8fdc9a58d04c041bfff Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 12 Apr 2023 11:27:06 +0200 Subject: [PATCH 04/35] fix: attribute defaults --- src/lib/elements/forms/inputNumber.svelte | 2 +- src/lib/elements/forms/inputURL.svelte | 34 ++++++++++++++---- .../attributes/boolean.svelte | 22 ++++++------ .../attributes/datetime.svelte | 2 +- .../attributes/edit.svelte | 27 +++++--------- .../attributes/email.svelte | 3 +- .../attributes/enum.svelte | 32 ++++++++++------- .../attributes/float.svelte | 6 ++-- .../attributes/integer.svelte | 4 +-- .../attributes/ip.svelte | 3 +- .../attributes/relationship.svelte | 2 -- .../attributes/string.svelte | 36 ++++++++++--------- .../attributes/url.svelte | 7 ++-- .../attributes/boolean.svelte | 4 +-- .../attributes/enum.svelte | 4 +-- .../attributes/integer.svelte | 4 +-- .../attributes/string.svelte | 7 ++-- 17 files changed, 105 insertions(+), 94 deletions(-) diff --git a/src/lib/elements/forms/inputNumber.svelte b/src/lib/elements/forms/inputNumber.svelte index 7c36615e0..5110e4eea 100644 --- a/src/lib/elements/forms/inputNumber.svelte +++ b/src/lib/elements/forms/inputNumber.svelte @@ -84,7 +84,7 @@ bind:value bind:this={element} on:invalid={handleInvalid} - style:--amount-of-buttons={required ? 0 : 1.75} /> + style:--amount-of-buttons={nullable && !required ? 1.75 : 0} />
    {#if nullable && !required} diff --git a/src/lib/elements/forms/inputURL.svelte b/src/lib/elements/forms/inputURL.svelte index 848bc5532..5c7a1178a 100644 --- a/src/lib/elements/forms/inputURL.svelte +++ b/src/lib/elements/forms/inputURL.svelte @@ -1,6 +1,8 @@ @@ -66,9 +74,21 @@ type="url" autocomplete={autocomplete ? 'on' : 'off'} bind:value - on:input={handleInput} bind:this={element} on:invalid={handleInvalid} /> +
      + {#if maxlength} +
    • + +
    • + {/if} + {#if nullable && !required} +
    • + +
    • + {/if} +
{#if error} {error} diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/boolean.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/boolean.svelte index 7dea3b464..ffa3e61f4 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/boolean.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/boolean.svelte @@ -34,8 +34,7 @@ - + placeholder="Select a value" + disabled={data.required || data.array} + options={[ + { label: 'NULL', value: null }, + { label: 'True', value: true }, + { label: 'False', value: false } + ]} + bind:value={data.default} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte index 4315f1319..21886dc1f 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte @@ -48,7 +48,7 @@ id="default" label="Default value" bind:value={data.default} - disabled={data.required} /> + disabled={data.required || data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte index 72bb2eaf7..6d38653c3 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte @@ -71,25 +71,14 @@ {#if selectedAttribute?.type !== 'relationship'} -
- - -
-
-
+ {/if} {#if option} + disabled={data.required || data.array} + nullable={!data.required && !data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte index a8e166a2a..5996689ea 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte @@ -36,8 +36,7 @@ - - Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte index 9e07b3e87..57e7ae51b 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte @@ -54,9 +54,8 @@ } - - - + + Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte index d68ef0976..d92032f82 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte @@ -56,7 +56,6 @@ - + disabled={data.required || data.array} + nullable={!data.required && !data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte index b59473958..3bba15ad6 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte @@ -48,7 +48,8 @@ label="Default value" placeholder="Enter value" bind:value={data.default} - disabled={data.required || data.array} /> + disabled={data.required || data.array} + nullable={!data.required && !data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte index f847e0ebd..501ee1dc5 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte @@ -98,7 +98,6 @@ }); // Reactive statements - $: getCollections(search).then((res) => (collectionList = res)); $: collections = collectionList?.collections?.filter((n) => n.$id !== $collection.$id) ?? []; @@ -219,7 +218,6 @@ placeholder="Select a relation" options={relationshipType} disabled={editing} /> -
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 bbf9175bd..d7acb0e6c 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 @@ -34,8 +34,7 @@ - + disabled={data.required || data.array} + nullable={!data.required && !data.array} /> Indicate whether this is a required attribute diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/boolean.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/boolean.svelte index 6e6e02e7a..fb18a51fc 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/boolean.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/boolean.svelte @@ -7,7 +7,6 @@ export let value: boolean; export let attribute: Models.AttributeBoolean; export let optionalText: string | undefined = undefined; - export let disabled = false; + bind:value /> diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/enum.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/enum.svelte index 7a5103da8..9f88aaa57 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/enum.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/enum.svelte @@ -7,7 +7,6 @@ export let value: string; export let attribute: Models.AttributeEnum; export let optionalText: string | undefined = undefined; - export let disabled = false; $: options = [ ...attribute.elements.map((element) => { @@ -31,5 +30,4 @@ {optionalText} required={attribute.required} placeholder="Select a value" - showLabel={!!label?.length} - {disabled} /> + showLabel={!!label?.length} /> diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte index d490f0e3d..22360ff6f 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte @@ -17,5 +17,5 @@ required={attribute.required} min={attribute.min} max={attribute.max} - bind:value - step={attribute.type === 'double' ? 'any' : 1} /> + step={attribute.type === 'double' ? 'any' : 1} + bind:value /> 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 ecb1c613e..d5c32fa59 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 @@ -7,30 +7,27 @@ export let value: string; export let attribute: Models.AttributeString; export let optionalText: string | undefined = undefined; - export let disabled = false; {#if attribute.size >= 50} {:else} {/if} From 7c820d129ccef2f40ff7d35cd35d63569b9b6108 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 12 Apr 2023 11:40:42 +0200 Subject: [PATCH 05/35] fix: editing attributes --- .../attributes/edit.svelte | 3 +-- .../attributes/float.svelte | 16 ++++++++++++++-- .../attributes/integer.svelte | 14 ++++++++++++-- .../attributes/string.svelte | 2 +- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte index 6d38653c3..e4ea11990 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte @@ -77,14 +77,13 @@ placeholder="Enter Key" bind:value={selectedAttribute.key} autofocus - required readonly /> {/if} {#if option} (option = null)} /> {/if} diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte index 57e7ae51b..b641880d0 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte @@ -54,8 +54,20 @@ } - - + + - - + + {#if data.size >= 50} Date: Wed, 12 Apr 2023 15:10:36 +0200 Subject: [PATCH 06/35] fix: url not bein nullable --- .../document-[document]/attributes/url.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte index cbff896fa..b745348d9 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte @@ -15,5 +15,6 @@ {optionalText} placeholder="Enter URL" showLabel={!!label?.length} + nullable={!attribute.required} required={attribute.required} bind:value /> From f7a7e6fc7f77576db14cfe8d7bbb877688c17dd8 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Thu, 13 Apr 2023 14:30:16 +0100 Subject: [PATCH 07/35] fix: copy scrolling to bottom --- src/lib/helpers/copy.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/helpers/copy.ts b/src/lib/helpers/copy.ts index 6399995ea..4c3779ffc 100644 --- a/src/lib/helpers/copy.ts +++ b/src/lib/helpers/copy.ts @@ -11,6 +11,12 @@ async function securedCopy(value: string) { function unsecuredCopy(value: string) { const textArea = document.createElement('textarea'); textArea.value = value; + + // Avoid scrolling to bottom + textArea.style.top = '0'; + textArea.style.left = '0'; + textArea.style.position = 'fixed'; + document.body.appendChild(textArea); textArea.focus(); textArea.select(); From e0bfc2da8e2eb0f5cb6f61452fe5c05336efeb8e Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Fri, 14 Apr 2023 18:21:20 +0100 Subject: [PATCH 08/35] fix: non-expiring api key disallowing name updates --- .../console/project-[project]/overview/keys/[key]/+page.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/console/project-[project]/overview/keys/[key]/+page.ts b/src/routes/console/project-[project]/overview/keys/[key]/+page.ts index 1c8f8a44d..e235ed2d6 100644 --- a/src/routes/console/project-[project]/overview/keys/[key]/+page.ts +++ b/src/routes/console/project-[project]/overview/keys/[key]/+page.ts @@ -10,6 +10,8 @@ export const load: PageLoad = async ({ params, depends }) => { const key = await sdk.forConsole.projects.getKey(params.project, params.key); if (key.expire) { key.expire = new Date(key.expire).toISOString().slice(0, 23); + } else { + key.expire = undefined; } return { From 89403ea1c9de895ea57991de3a94782b2f071b3b Mon Sep 17 00:00:00 2001 From: Akshay Rana Date: Sun, 16 Apr 2023 11:52:56 +0530 Subject: [PATCH 09/35] fixed: reset custom validity on re-render if required checkbox field unchecked in inputSelect form element --- src/lib/elements/forms/inputSelect.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index 0b3663529..ef5f70b72 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -35,6 +35,10 @@ element.setCustomValidity(''); } + $: if (element && !required){ + element.setCustomValidity(''); + } + $: if (value) { error = null; } From b933f88c2660fc1cb7b93195e5e289a9107aa4e0 Mon Sep 17 00:00:00 2001 From: Akshay Rana Date: Sun, 16 Apr 2023 12:41:08 +0530 Subject: [PATCH 10/35] fixed lint issue --- src/lib/elements/forms/inputSelect.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index ef5f70b72..f89ec26f0 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -35,10 +35,10 @@ element.setCustomValidity(''); } - $: if (element && !required){ + $: if (element && !required) { element.setCustomValidity(''); } - + $: if (value) { error = null; } From 8d855e53e3f6b4884877bd888ed82e55b7b8659e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 17 Apr 2023 11:46:32 +0400 Subject: [PATCH 11/35] feat: update select validation for boolean attributes --- src/lib/elements/forms/inputSelect.svelte | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index 0b3663529..85633d9f9 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -27,15 +27,28 @@ error = element.validationMessage; }; - $: if (element && required && !value) { + const isValid = (value: string | number | boolean) => { + if (typeof value === 'boolean') { + if (value === null || value === undefined) return false; + else return true; + } + + if (!value) { + return false; + } + + return true; + }; + + $: if (element && required && !isValid(value)) { element.setCustomValidity('This field is required'); } - $: if (element && required && value) { + $: if (element && required && isValid(value)) { element.setCustomValidity(''); } - $: if (value) { + $: if (isValid(value)) { error = null; } From 9a90fba3b00facc5ebf98521870fd782f495220a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 17 Apr 2023 12:00:36 +0400 Subject: [PATCH 12/35] feat: update select validation for boolean attributes --- src/lib/elements/forms/inputSelect.svelte | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index 85633d9f9..bbab9e44d 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -28,13 +28,14 @@ }; const isValid = (value: string | number | boolean) => { - if (typeof value === 'boolean') { - if (value === null || value === undefined) return false; - else return true; - } + if (value === null) return false; - if (!value) { - return false; + if (value === undefined) return false; + + if (typeof value !== 'boolean') { + if (!value) { + return false; + } } return true; From cb0ec96b36ef375762dd623cb39153f5139f89ed Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Mon, 17 Apr 2023 15:20:35 +0100 Subject: [PATCH 13/35] fix: remove empty button list from inputs --- src/lib/elements/forms/inputText.svelte | 31 +++++++++++-------- src/lib/elements/forms/inputTextarea.svelte | 33 ++++++++++++--------- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/src/lib/elements/forms/inputText.svelte b/src/lib/elements/forms/inputText.svelte index a7082a4b0..28123a30f 100644 --- a/src/lib/elements/forms/inputText.svelte +++ b/src/lib/elements/forms/inputText.svelte @@ -53,6 +53,9 @@ value = prevValue; } } + + $: showTextCounter = !!maxlength; + $: showNullCheckbox = nullable && !required; @@ -75,19 +78,21 @@ class:u-padding-inline-end-56={typeof maxlength === 'number'} bind:this={element} on:invalid={handleInvalid} /> -
    - {#if maxlength} -
  • - -
  • - {/if} - {#if nullable && !required} -
  • - -
  • - {/if} -
+ {#if showTextCounter || showNullCheckbox} +
    + {#if showTextCounter} +
  • + +
  • + {/if} + {#if showNullCheckbox} +
  • + +
  • + {/if} +
+ {/if}
{#if error} {error} diff --git a/src/lib/elements/forms/inputTextarea.svelte b/src/lib/elements/forms/inputTextarea.svelte index 7a9c121a6..a5a096b35 100644 --- a/src/lib/elements/forms/inputTextarea.svelte +++ b/src/lib/elements/forms/inputTextarea.svelte @@ -50,6 +50,9 @@ value = prevValue; } } + + $: showTextCounter = !!maxlength; + $: showNullCheckbox = nullable && !required; @@ -72,20 +75,22 @@ bind:this={element} on:invalid={handleInvalid} style:--amount-of-buttons={required ? undefined : 0.25} /> -
    - {#if maxlength} -
  • - -
  • - {/if} - {#if nullable && !required} -
  • - -
  • - {/if} -
+ {#if showTextCounter || showNullCheckbox} +
    + {#if showTextCounter} +
  • + +
  • + {/if} + {#if showNullCheckbox} +
  • + +
  • + {/if} +
+ {/if}
{#if error} From 404b75d557c2f933a348bb6a01786d065d5e0f19 Mon Sep 17 00:00:00 2001 From: Akshay Rana Date: Mon, 17 Apr 2023 23:20:49 +0530 Subject: [PATCH 14/35] updated if condition to check custom validity --- src/lib/elements/forms/inputSelect.svelte | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index f89ec26f0..f835c2364 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -27,18 +27,16 @@ error = element.validationMessage; }; - $: if (element && required && !value) { - element.setCustomValidity('This field is required'); + $: if (required && !value) { + element?.setCustomValidity('This field is required'); + } else { + element?.setCustomValidity(''); } $: if (element && required && value) { element.setCustomValidity(''); } - $: if (element && !required) { - element.setCustomValidity(''); - } - $: if (value) { error = null; } From 5b0f8dd755ae76cc0bc8b0bf837fea2dd0964d57 Mon Sep 17 00:00:00 2001 From: Akshay Rana Date: Tue, 18 Apr 2023 09:26:34 +0530 Subject: [PATCH 15/35] removed extra if condition --- src/lib/elements/forms/inputSelect.svelte | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index f835c2364..4db46cb13 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -33,10 +33,6 @@ element?.setCustomValidity(''); } - $: if (element && required && value) { - element.setCustomValidity(''); - } - $: if (value) { error = null; } From 1b9a9b64825a40d44d418a88ae158d26a6ea93b4 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 18 Apr 2023 14:20:33 +0400 Subject: [PATCH 16/35] feat: review comments --- src/lib/elements/forms/inputSelect.svelte | 30 +++++++---------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index bbab9e44d..ac2a83f78 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -27,29 +27,17 @@ error = element.validationMessage; }; - const isValid = (value: string | number | boolean) => { - if (value === null) return false; - - if (value === undefined) return false; - - if (typeof value !== 'boolean') { - if (!value) { - return false; - } - } - - return true; + const isNotEmpty = (value: string | number | boolean) => { + return typeof value === 'boolean' ? true : !!value; }; - $: if (element && required && !isValid(value)) { - element.setCustomValidity('This field is required'); - } - - $: if (element && required && isValid(value)) { - element.setCustomValidity(''); - } - - $: if (isValid(value)) { + $: if (element && required) { + if (!isNotEmpty(value)) { + element.setCustomValidity('This field is required'); + } else { + element.setCustomValidity(''); + } + } else if (isNotEmpty(value)) { error = null; } From fef2ede9e808f44bf94f03b184419616c7a5e3af Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 19 Apr 2023 19:43:11 +0400 Subject: [PATCH 17/35] feat: review comments --- src/lib/elements/forms/inputSelect.svelte | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index ac2a83f78..fd37a958c 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -31,13 +31,13 @@ return typeof value === 'boolean' ? true : !!value; }; - $: if (element && required) { - if (!isNotEmpty(value)) { - element.setCustomValidity('This field is required'); - } else { - element.setCustomValidity(''); - } - } else if (isNotEmpty(value)) { + $: if (required && !isNotEmpty(value)) { + element?.setCustomValidity('This field is required'); + } else { + element?.setCustomValidity(''); + } + + $: if (isNotEmpty(value)) { error = null; } From 532edeb3f69b1819c1d620364900c84f31a0568e Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 19 Apr 2023 22:23:26 +0000 Subject: [PATCH 18/35] Remove overly casual language from empty states --- src/lib/components/empty.svelte | 2 +- src/lib/components/permissions/team.svelte | 2 +- src/lib/components/permissions/user.svelte | 2 +- .../database-[database]/collection-[collection]/+page.svelte | 2 +- .../collection-[collection]/attributes/+page.svelte | 2 +- .../collection-[collection]/indexes/+page.svelte | 2 +- .../functions/function-[function]/executions/+page.svelte | 2 +- .../console/project-[project]/overview/platforms/+page.svelte | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/components/empty.svelte b/src/lib/components/empty.svelte index ab7d091a4..2c01f69fa 100644 --- a/src/lib/components/empty.svelte +++ b/src/lib/components/empty.svelte @@ -42,7 +42,7 @@
Create your first {target} to get started.

- Need a hand? Check out our documentation. + Need a hand? Learn more in our documentation.

diff --git a/src/lib/components/permissions/team.svelte b/src/lib/components/permissions/team.svelte index 7b214f534..fdd4c5e9c 100644 --- a/src/lib/components/permissions/team.svelte +++ b/src/lib/components/permissions/team.svelte @@ -134,7 +134,7 @@ You have no teams. Create a team to see them here.

- Need a hand? Check out our diff --git a/src/lib/components/permissions/user.svelte b/src/lib/components/permissions/user.svelte index 4488d8f01..5835023b6 100644 --- a/src/lib/components/permissions/user.svelte +++ b/src/lib/components/permissions/user.svelte @@ -153,7 +153,7 @@ You have no users. Create a user to see them here.

- Need a hand? Check out our diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/+page.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/+page.svelte index 232e0be6d..d99f0bbf7 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/+page.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/+page.svelte @@ -75,7 +75,7 @@

diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte index 68b72fb5c..10f82e672 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte @@ -180,7 +180,7 @@
Create your first attribute to get started.

- Need a hand? Check out our documentation. + Need a hand? Learn more in our documentation.

diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte index 605450998..81cc43c89 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte @@ -125,7 +125,7 @@
Create your first attribute to get started.

- Need a hand? Check out our documentation. + Need a hand? Learn more in our documentation.

diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index fb36561ff..1e783436d 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -110,7 +110,7 @@

You have no execution logs. Create and activate a deployment to see it here.

-

Need a hand? Check out our documentation

+

Need a hand? Learn more in our documentation

From 633965baae9115d75871e8a9806a71cfd07eadd8 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 25 Apr 2023 09:02:31 -0700 Subject: [PATCH 23/35] Ensure Update button is enabled when updating a many relationship The original array was being modified in the relationship component so when the data page checked if work was different than doc, it was always the same. Fixes #5379 --- .../document-[document]/attributes/relationship.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte index c12654564..f01e54ca5 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte @@ -3,12 +3,12 @@ import { PaginationInline } from '$lib/components'; import { SelectSearchItem } from '$lib/elements'; import { Button, InputSelectSearch, Label } from '$lib/elements/forms'; + import { preferences } from '$lib/stores/preferences'; import { sdk } from '$lib/stores/sdk'; import { Query, type Models } from '@appwrite.io/console'; import { onMount } from 'svelte'; import { doc } from '../store'; import { isRelationshipToMany } from './store'; - import { preferences } from '$lib/stores/preferences'; export let id: string; export let label: string; @@ -32,7 +32,7 @@ onMount(async () => { if (value) { if (isRelationshipToMany(attribute)) { - relatedList = value as string[]; + relatedList = (value as string[]).slice(); } else { singleRel = value as string; } From 834841018c522c82efce1304cadf8b651073f85c Mon Sep 17 00:00:00 2001 From: fliitor <117680686+fliitor@users.noreply.github.com> Date: Tue, 2 May 2023 15:11:15 +0300 Subject: [PATCH 24/35] fix inversed message on (un)verified user --- .../project-[project]/auth/user-[user]/updateStatus.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/auth/user-[user]/updateStatus.svelte b/src/routes/console/project-[project]/auth/user-[user]/updateStatus.svelte index 34f4c81b0..60a2189d1 100644 --- a/src/routes/console/project-[project]/auth/user-[user]/updateStatus.svelte +++ b/src/routes/console/project-[project]/auth/user-[user]/updateStatus.svelte @@ -19,7 +19,7 @@ await invalidate(Dependencies.USER); addNotification({ message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${ - $user.emailVerification ? 'unverified' : 'verified' + !$user.emailVerification ? 'unverified' : 'verified' }`, type: 'success' }); From 28c7293a2c70fbdd585a098d81539c8c6661f506 Mon Sep 17 00:00:00 2001 From: Suven-p Date: Fri, 5 May 2023 10:05:20 +0545 Subject: [PATCH 25/35] Remove trailing space in bash code snippet --- CONTRIBUTING.md | 3 +++ .../functions/function-[function]/create.svelte | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 607bb07f6..ad67fbd68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,12 +40,15 @@ git clone https://github.com/appwrite/console.git appwrite-console ``` ### 2. Install dependencies with npm + Navigate to the Appwrite Console repository and install dependencies. + ```bash cd appwrite-console && npm install ``` ### 3. Install and run Appwrite locally + When you run the Appwrite Console locally, it needs to point to a backend as well. The easiest way to do this is to run an Appwrite instance locally. Follow the [install instructions](https://appwrite.io/docs/installation) in the Appwrite docs. diff --git a/src/routes/console/project-[project]/functions/function-[function]/create.svelte b/src/routes/console/project-[project]/functions/function-[function]/create.svelte index 806ff23ca..4d65e044b 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/create.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/create.svelte @@ -62,10 +62,10 @@ function setCodeSnippets(lang: string) { return { Unix: { - code: `appwrite functions createDeployment \\ - --functionId=${functionId} \\ - --entrypoint='index.${lang}' \\ - --code="." \\ + code: `appwrite functions createDeployment \\ + --functionId=${functionId} \\ + --entrypoint='index.${lang}' \\ + --code="." \\ --activate=true`, language: 'bash' }, From 8ba4a196e40d085dc39690660b05b8869a77751d Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Sat, 6 May 2023 20:51:28 +0000 Subject: [PATCH 26/35] Update description of disabled services. --- CONTRIBUTING.md | 3 +++ src/routes/console/project-[project]/settings/+page.svelte | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 607bb07f6..ad67fbd68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,12 +40,15 @@ git clone https://github.com/appwrite/console.git appwrite-console ``` ### 2. Install dependencies with npm + Navigate to the Appwrite Console repository and install dependencies. + ```bash cd appwrite-console && npm install ``` ### 3. Install and run Appwrite locally + When you run the Appwrite Console locally, it needs to point to a backend as well. The easiest way to do this is to run an Appwrite instance locally. Follow the [install instructions](https://appwrite.io/docs/installation) in the Appwrite docs. diff --git a/src/routes/console/project-[project]/settings/+page.svelte b/src/routes/console/project-[project]/settings/+page.svelte index ccce2b50b..cf8659329 100644 --- a/src/routes/console/project-[project]/settings/+page.svelte +++ b/src/routes/console/project-[project]/settings/+page.svelte @@ -115,7 +115,10 @@ Services -

Choose services you wish to enable or disable.

+

+ Choose services you wish to enable or disable for the client API. When disabled, the + services are not accessible to client SDKs but remain accessible to server SDKs. +

From f8b3929762a252eb049abfb23169e2f44ebd4afb Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 9 May 2023 15:00:01 +0200 Subject: [PATCH 27/35] fix: id component copy on click --- CONTRIBUTING.md | 3 +++ src/lib/components/id.svelte | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 607bb07f6..ad67fbd68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,12 +40,15 @@ git clone https://github.com/appwrite/console.git appwrite-console ``` ### 2. Install dependencies with npm + Navigate to the Appwrite Console repository and install dependencies. + ```bash cd appwrite-console && npm install ``` ### 3. Install and run Appwrite locally + When you run the Appwrite Console locally, it needs to point to a backend as well. The easiest way to do this is to run an Appwrite instance locally. Follow the [install instructions](https://appwrite.io/docs/installation) in the Appwrite docs. diff --git a/src/lib/components/id.svelte b/src/lib/components/id.svelte index c64dcb1f2..1b618f3d2 100644 --- a/src/lib/components/id.svelte +++ b/src/lib/components/id.svelte @@ -46,22 +46,22 @@ } -
- - - -
- + +
+ + + +
- +
-
+ From bdfcadfee321a73bec45a60312cc6a5380bfc9f7 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 9 May 2023 10:20:07 -0700 Subject: [PATCH 28/35] Replace image-item with avatar class The image-item class had a bug where the width could be incorrect causing the iamge to look squished. The new avatar class fixes this problem. --- .../project-[project]/auth/settings/+page.svelte | 14 +++++++------- .../auth/user-[user]/sessions/+page.svelte | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/routes/console/project-[project]/auth/settings/+page.svelte b/src/routes/console/project-[project]/auth/settings/+page.svelte index eba59cea4..42f640d07 100644 --- a/src/routes/console/project-[project]/auth/settings/+page.svelte +++ b/src/routes/console/project-[project]/auth/settings/+page.svelte @@ -1,17 +1,17 @@ - -
-
- technology -
-
- {$func.name} - -

{$func.runtime}

-
-
- -
-
-

Function ID: {$func.$id}

-

Created at: {toLocaleDateTime($func.$createdAt)}

-

Updated at: {toLocaleDateTime($func.$updatedAt)}

-
-
-
- - - - -
- - - - Name - - -
    - -
-
- - - - -
- - -
- - Execute Access -

- Choose who can execute this function using the client API. For more information, - check out the - Permissions Guide - . -

- - - - - - - - -
- + + + - -
- - Schedule -

- Set a Cron schedule to trigger your function. Leave blank for no schedule. - More details on Cron syntax here. -

- - - - - - - - - -
-
- - - Variables -

Set the variables (or secret keys) that will be passed to your function at runtime.

- -
- - -
- {@const limit = 10} - {@const sum = data.variables.total} - {#if sum} -
- - - Key - Value - - - - {#each data.variables.variables.slice(offset, offset + limit) as variable, i} - - - - {variable.key} - - - - - - - - - - - { - selectedVar = variable; - showVariablesDropdown[i] = false; - showVariablesModal = true; - }}> - Edit - - { - handleVariableDeleted(variable); - showVariablesDropdown[i] = false; - }}> - Delete - - - - - - {/each} - -
- -
-

Total variables: {sum}

- -
-
- {:else} - (showVariablesModal = !showVariablesModal)}> - Create a variable to get started - - {/if} -
-
- -
- - Timeout -

- Limit the execution time of your function. Maximum value is 900 seconds (15 - minutes). -

- - - - - - - - - -
-
- - - Delete Function -

- The function will be permanently deleted, including all deployments associated with it. - This action is irreversible. -

- - - -
{$func.name}
-
-

Last Updated: {toLocaleDateTime($func.$updatedAt)}

-
-
- - - - -
+ + + + - - -{#if showVariablesModal} - -{/if} -{#if showVariablesUpload} - -{/if} diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/dangerZone.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/dangerZone.svelte new file mode 100644 index 000000000..d5ec9fbf4 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/dangerZone.svelte @@ -0,0 +1,33 @@ + + + + Delete Function +

+ The function will be permanently deleted, including all deployments associated with it. This + action is irreversible. +

+ + + +
{$func.name}
+
+

Last Updated: {toLocaleDateTime($func.$updatedAt)}

+
+
+ + + + +
+ + diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/delete.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/deleteModal.svelte similarity index 100% rename from src/routes/console/project-[project]/functions/function-[function]/settings/delete.svelte rename to src/routes/console/project-[project]/functions/function-[function]/settings/deleteModal.svelte diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte new file mode 100644 index 000000000..194b18bed --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte @@ -0,0 +1,36 @@ + + + +
+
+ technology +
+
+ {$func.name} + +

{$func.runtime}

+
+
+ +
+
+

Function ID: {$func.$id}

+

Created at: {toLocaleDateTime($func.$createdAt)}

+

Updated at: {toLocaleDateTime($func.$updatedAt)}

+
+
+
+ + + + +
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte new file mode 100644 index 000000000..431d12e5f --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte @@ -0,0 +1,66 @@ + + +
+ + Name + + +
    + +
+
+ + + + +
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte new file mode 100644 index 000000000..369f936a9 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte @@ -0,0 +1,78 @@ + + +
+ + Execute Access +

+ Choose who can execute this function using the client API. For more information, check + out the + Permissions Guide + . +

+ + + + + + + +
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte new file mode 100644 index 000000000..e60ba6e99 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte @@ -0,0 +1,71 @@ + + +
+ + Schedule +

+ Set a Cron schedule to trigger your function. Leave blank for no schedule. + More details on Cron syntax here. +

+ + + + + + + + + +
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte new file mode 100644 index 000000000..94489f929 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte @@ -0,0 +1,66 @@ + + +
+ + Timeout +

Limit the execution time of your function. Maximum value is 900 seconds (15 minutes).

+ + + + + + + + + +
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateVariables.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateVariables.svelte new file mode 100644 index 000000000..c3915babc --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateVariables.svelte @@ -0,0 +1,233 @@ + + + + Variables +

Set the variables (or secret keys) that will be passed to your function at runtime.

+ +
+ + +
+ {@const limit = 10} + {@const sum = variableList.total} + {#if sum} +
+ + + Key + Value + + + + {#each variableList.variables.slice(offset, offset + limit) as variable, i} + + + + {variable.key} + + + + + + + + + + + { + selectedVar = variable; + showVariablesDropdown[i] = false; + showVariablesModal = true; + }}> + Edit + + { + handleVariableDeleted(variable); + showVariablesDropdown[i] = false; + }}> + Delete + + + + + + {/each} + +
+ +
+

Total variables: {sum}

+ +
+
+ {:else} + (showVariablesModal = !showVariablesModal)}> + Create a variable to get started + + {/if} +
+
+ +{#if showVariablesModal} + +{/if} +{#if showVariablesUpload} + +{/if} diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariablesModal.svelte similarity index 100% rename from src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariables.svelte rename to src/routes/console/project-[project]/functions/function-[function]/settings/uploadVariablesModal.svelte From 71ccb987b6f2817e69802554dfdf4f8a3621e5c6 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 26 May 2023 14:14:09 +0200 Subject: [PATCH 35/35] fix: add scroll to tables in mobile --- .../databases/database-[database]/table.svelte | 8 ++++---- .../project-[project]/databases/table.svelte | 8 ++++---- .../settings/webhooks/+page.svelte | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/table.svelte b/src/routes/console/project-[project]/databases/database-[database]/table.svelte index 317956ae7..458baaa62 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/table.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/table.svelte @@ -3,13 +3,13 @@ import { page } from '$app/stores'; import { Id } from '$lib/components'; import { - Table, TableBody, TableCell, TableCellHead, TableCellText, TableHeader, - TableRowLink + TableRowLink, + TableScroll } from '$lib/elements/table'; import { toLocaleDateTime } from '$lib/helpers/date'; import type { PageData } from './$types'; @@ -20,7 +20,7 @@ const databaseId = $page.params.database; - + {#each $columns as column} {#if column.show} @@ -54,4 +54,4 @@ {/each} -
+ diff --git a/src/routes/console/project-[project]/databases/table.svelte b/src/routes/console/project-[project]/databases/table.svelte index 401364401..ac63aa184 100644 --- a/src/routes/console/project-[project]/databases/table.svelte +++ b/src/routes/console/project-[project]/databases/table.svelte @@ -3,13 +3,13 @@ import { page } from '$app/stores'; import { Id } from '$lib/components'; import { - Table, TableBody, TableCell, TableCellHead, TableCellText, TableHeader, - TableRowLink + TableRowLink, + TableScroll } from '$lib/elements/table'; import { toLocaleDateTime } from '$lib/helpers/date'; import type { PageData } from './$types'; @@ -19,7 +19,7 @@ const projectId = $page.params.project; - + {#each $columns as column} {#if column.show} @@ -55,4 +55,4 @@ {/each} -
+ diff --git a/src/routes/console/project-[project]/settings/webhooks/+page.svelte b/src/routes/console/project-[project]/settings/webhooks/+page.svelte index fde1c291e..1e22b243a 100644 --- a/src/routes/console/project-[project]/settings/webhooks/+page.svelte +++ b/src/routes/console/project-[project]/settings/webhooks/+page.svelte @@ -6,13 +6,13 @@ import { Button } from '$lib/elements/forms'; import { Pill } from '$lib/elements'; import { - Table, TableBody, TableRowLink, TableCellHead, TableCell, TableCellText, - TableHeader + TableHeader, + TableScroll } from '$lib/elements/table'; import { Container } from '$lib/layout'; import { wizard } from '$lib/stores/wizard'; @@ -46,10 +46,10 @@
{#if data.webhooks.total} - + - Name - POST URL + Name + POST URL Events @@ -57,7 +57,7 @@ -
+
{webhook.name} {#if webhook.security === false} SLL/TLS disabled @@ -69,7 +69,7 @@ {/each} -
+ {:else}