diff --git a/src/lib/components/cardContainer.svelte b/src/lib/components/cardContainer.svelte index 5ba3ee68b..835ced4d6 100644 --- a/src/lib/components/cardContainer.svelte +++ b/src/lib/components/cardContainer.svelte @@ -12,7 +12,7 @@ style={`--grid-gap:1.5rem; --grid-item-size:${total > 3 ? '22rem' : '25rem'};`}> - {#if limit + offset > total && (total % 2 !== 0 || total % 4 === 0)} + {#if total > 3 ? total < limit + offset : total % 2 !== 0} diff --git a/src/lib/components/copyInput.svelte b/src/lib/components/copyInput.svelte index 782e89c80..65bd6bb81 100644 --- a/src/lib/components/copyInput.svelte +++ b/src/lib/components/copyInput.svelte @@ -22,21 +22,23 @@ }; -
+
-
+
- +
+ +
diff --git a/src/lib/components/emptySearch.svelte b/src/lib/components/emptySearch.svelte index 8034da844..b0c54e647 100644 --- a/src/lib/components/emptySearch.svelte +++ b/src/lib/components/emptySearch.svelte @@ -3,6 +3,8 @@ import Light from '$lib/images/search-light.svg'; import Dark from '$lib/images/search-dark.svg'; import PaginationInline from './paginationInline.svelte'; + + export let hidePages = false;
@@ -18,5 +20,5 @@

Total results: 0

- +
diff --git a/src/lib/components/innerModal.svelte b/src/lib/components/innerModal.svelte index 384880389..b2d488dce 100644 --- a/src/lib/components/innerModal.svelte +++ b/src/lib/components/innerModal.svelte @@ -1,27 +1,33 @@ {#if show} - + + + {/if} diff --git a/src/lib/components/permissions/actions.svelte b/src/lib/components/permissions/actions.svelte index 9f2022e80..d97edeffd 100644 --- a/src/lib/components/permissions/actions.svelte +++ b/src/lib/components/permissions/actions.svelte @@ -1,6 +1,5 @@ - + dispatch('create', ['any'])}> Any diff --git a/src/lib/components/permissions/index.ts b/src/lib/components/permissions/index.ts index 01de280d9..cd32ba0ea 100644 --- a/src/lib/components/permissions/index.ts +++ b/src/lib/components/permissions/index.ts @@ -1,3 +1,4 @@ export { default as Permissions } from './permissions.svelte'; +export { default as Roles } from './roles.svelte'; export { default as Team } from './team.svelte'; export { default as User } from './user.svelte'; diff --git a/src/lib/components/permissions/permissions.svelte b/src/lib/components/permissions/permissions.svelte index 67d7c7c63..b9d9ea7f6 100644 --- a/src/lib/components/permissions/permissions.svelte +++ b/src/lib/components/permissions/permissions.svelte @@ -10,26 +10,23 @@ {#if [...$groups]?.length} Role - {#if withCrud} - {#if withCreate} - Create - {/if} - Read - Update - Delete + {#if withCreate} + Create {/if} + Read + Update + Delete {#each [...$groups].sort(sortRoles) as [role, permission]} - + - + - {#if withCrud} - {#if withCreate} - - togglePermission(role, 'create')} /> - - {/if} - + {#if withCreate} + togglePermission(role, 'read')} /> - - - togglePermission(role, 'update')} /> - - - togglePermission(role, 'delete')} /> + aria-label="Create" + checked={permission.create} + on:change={() => togglePermission(role, 'create')} /> {/if} + + togglePermission(role, 'read')} /> + + + togglePermission(role, 'update')} /> + + + togglePermission(role, 'delete')} /> +
@@ -231,18 +213,38 @@ {/each}
+ + + + {:else} - ROLE - - (showDropdown = !showDropdown)}> - Add a role to get started - +
+
+
+ + + +
+
+ Add a role to get started +
+
+
{/if} - - diff --git a/src/lib/components/permissions/roles.svelte b/src/lib/components/permissions/roles.svelte index 81fe38ced..2bcca253f 100644 --- a/src/lib/components/permissions/roles.svelte +++ b/src/lib/components/permissions/roles.svelte @@ -1,7 +1,9 @@ - - - Role - - - - {#each [...$groups.keys()] as role} - - - - - -
- -
-
-
- {/each} -
-
- - +{#if [...$groups.keys()]?.length} + + + Role + + + + {#each [...$groups.keys()].sort(sortRoles) as role} + + + + + +
+ +
+
+
+ {/each} +
+
+ + + +{:else} +
+
+
+ + + +
+
+ Add a role to get started +
+
+
+{/if} diff --git a/src/lib/components/permissions/team.svelte b/src/lib/components/permissions/team.svelte index 073acd082..43d08d1a6 100644 --- a/src/lib/components/permissions/team.svelte +++ b/src/lib/components/permissions/team.svelte @@ -3,7 +3,7 @@ import { createEventDispatcher } from 'svelte'; import { sdkForProject } from '$lib/stores/sdk'; import { Query, type Models } from '@aw-labs/appwrite-console'; - import { AvatarInitials, Modal, PaginationInline } from '..'; + import { AvatarInitials, EmptySearch, Modal, PaginationInline } from '..'; import type { Writable } from 'svelte/store'; import type { Permission } from './permissions.svelte'; @@ -60,8 +60,8 @@ Select teams - - {#if results?.teams} + + {#if results?.teams?.length}
@@ -93,11 +93,43 @@
+
+

Total results: {results?.total}

+ +
+ {:else if search} + +
+
+ Sorry we couldn't find "{search}" +

There are no Teams that match your search.

+
+
+ + +
+
+
+ {:else} + +
+
+ Sorry we couldn't find "{search}" + +

You have no Teams. Create a user to see them here.

+

+ Need a hand? Check out our + documentation. +

+
+
+
{/if} -
-

Total results: {results?.total}

- -
+ diff --git a/src/lib/components/permissions/user.svelte b/src/lib/components/permissions/user.svelte index 30a83fcb3..a01e85f1e 100644 --- a/src/lib/components/permissions/user.svelte +++ b/src/lib/components/permissions/user.svelte @@ -1,7 +1,7 @@ -
+ + -
+ diff --git a/src/lib/layout/logs.svelte b/src/lib/layout/logs.svelte index 70a71c273..7b9c14fa5 100644 --- a/src/lib/layout/logs.svelte +++ b/src/lib/layout/logs.svelte @@ -35,8 +35,17 @@ .getElementsByClassName('code-panel-content')[0] .scrollTo({ top: 0, left: 0, behavior: 'smooth' }); } + + function handleKeydown(event: KeyboardEvent) { + if (event.key === 'Escape') { + event.preventDefault(); + $log.show = false; + } + } + + {#if $log.data}
diff --git a/src/lib/layout/wizard.svelte b/src/lib/layout/wizard.svelte index 40b8e2f23..6ca867e00 100644 --- a/src/lib/layout/wizard.svelte +++ b/src/lib/layout/wizard.svelte @@ -28,7 +28,8 @@ let showExitModal = false; function handleKeydown(event: KeyboardEvent) { - if (event.key === 'Escape' && !showExitModal) { + const openDialog = document.querySelectorAll('dialog[open]'); + if (event.key === 'Escape' && !showExitModal && !openDialog?.length) { event.preventDefault(); dispatch('exit'); wizard.hide(); diff --git a/src/routes/console/project-[project]/authentication/user-[user]/+page.svelte b/src/routes/console/project-[project]/authentication/user-[user]/+page.svelte index 73778b8ca..e60509c0d 100644 --- a/src/routes/console/project-[project]/authentication/user-[user]/+page.svelte +++ b/src/routes/console/project-[project]/authentication/user-[user]/+page.svelte @@ -422,6 +422,7 @@ {/if} @@ -226,14 +240,17 @@ {/each} {:else} - (showCreateEvent = !showCreateEvent)} - >Add a event to get started + (showCreateEvent = true)}> + Add a event to get started + {/if} - +
+ +
@@ -317,9 +334,5 @@ - { - events.push(e.detail[0]); - events = events; - }} /> + + diff --git a/src/routes/console/project-[project]/settings/webhooks/wizard/step3.svelte b/src/routes/console/project-[project]/settings/webhooks/wizard/step3.svelte index 0e669d50b..b5651e67e 100644 --- a/src/routes/console/project-[project]/settings/webhooks/wizard/step3.svelte +++ b/src/routes/console/project-[project]/settings/webhooks/wizard/step3.svelte @@ -5,7 +5,7 @@ - Security (optional) + Security Set an optional basic HTTP authentication username and password to protect your endpoint from unauthorized access. diff --git a/static/icons/dark/grayscale/code.svg b/static/icons/dark/grayscale/code.svg new file mode 100644 index 000000000..04af95237 --- /dev/null +++ b/static/icons/dark/grayscale/code.svg @@ -0,0 +1 @@ + diff --git a/static/icons/light/grayscale/code.svg b/static/icons/light/grayscale/code.svg new file mode 100644 index 000000000..7e092440a --- /dev/null +++ b/static/icons/light/grayscale/code.svg @@ -0,0 +1 @@ +