diff --git a/src/lib/components/cardContainer.svelte b/src/lib/components/cardContainer.svelte new file mode 100644 index 000000000..4c37246ce --- /dev/null +++ b/src/lib/components/cardContainer.svelte @@ -0,0 +1,20 @@ + + + diff --git a/src/lib/components/empty.svelte b/src/lib/components/empty.svelte index f15300212..ed44984ce 100644 --- a/src/lib/components/empty.svelte +++ b/src/lib/components/empty.svelte @@ -1,5 +1,6 @@ + +
+
+ {#if $app.themeInUse === 'dark'} + + {:else} + + {/if} + +
+
+ +
+

Total results: 0

+ +
diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts index 363905ec0..179fbf1f3 100644 --- a/src/lib/components/index.ts +++ b/src/lib/components/index.ts @@ -2,6 +2,7 @@ export { default as Modal } from './modal.svelte'; export { default as Pagination } from './pagination.svelte'; export { default as Card } from './card.svelte'; export { default as CardGrid } from './cardGrid.svelte'; +export { default as CardContainer } from './cardContainer.svelte'; export { default as InnerModal } from './innerModal.svelte'; export { default as Tile } from './tile.svelte'; export { default as Tiles } from './tiles.svelte'; @@ -12,6 +13,7 @@ export { default as UploadBox } from './uploadBox.svelte'; export { default as List } from './list.svelte'; export { default as ListItem } from './listItem.svelte'; export { default as Empty } from './empty.svelte'; +export { default as EmptySearch } from './emptySearch.svelte'; export { default as DropList } from './dropList.svelte'; export { default as DropListItem } from './dropListItem.svelte'; export { default as DropListLink } from './dropListLink.svelte'; diff --git a/src/lib/images/empty-light.svg b/src/lib/images/empty-light.svg index 9babf164b..70d506979 100644 --- a/src/lib/images/empty-light.svg +++ b/src/lib/images/empty-light.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/routes/console/account/organizations/+page.svelte b/src/routes/console/account/organizations/+page.svelte index 1c1d09aef..138a18da8 100644 --- a/src/routes/console/account/organizations/+page.svelte +++ b/src/routes/console/account/organizations/+page.svelte @@ -1,6 +1,6 @@ @@ -129,21 +129,13 @@ {:else if search} - -
+ +
Sorry, we couldn’t find ‘{search}’ -
-

There are no users that match your search.

-
-
- -
+

There are no users that match your search.

- -
-

Total results: {$usersList.total}

- -
+ +
{:else} (showCreate = true)}>
@@ -84,21 +84,13 @@
{:else if search} - -
+ +
Sorry, we couldn’t find ‘{search}’ -
-

There are no teams that match your search.

-
- -
- -
-

Total results: {$teamsList.total}

- -
+ +
{:else} (showCreate = true)}>
import { page } from '$app/stores'; - import { Pagination, Empty, Avatar, Search } from '$lib/components'; + import { Pagination, Empty, EmptySearch, Avatar, Search } from '$lib/components'; import { Table, TableHeader, @@ -106,23 +106,13 @@
{:else if search} - -
+ +
Sorry, we couldn’t find ‘{search}’ -
-

There are no members that match your search.

-
-
- -
+

There are no members that match your search.

- -
-

Total results: {$memberships.total}

- -
+ +
{:else} (showCreate = true)}>

Add your first member to get started

diff --git a/src/routes/console/project-[project]/databases/+page.svelte b/src/routes/console/project-[project]/databases/+page.svelte index 940a2fcce..cc4249673 100644 --- a/src/routes/console/project-[project]/databases/+page.svelte +++ b/src/routes/console/project-[project]/databases/+page.svelte @@ -2,7 +2,7 @@ import { page } from '$app/stores'; import { goto } from '$app/navigation'; import { Button } from '$lib/elements/forms'; - import { Empty, Pagination, Copy, GridItem1 } from '$lib/components'; + import { Empty, Pagination, Copy, GridItem1, CardContainer } from '$lib/components'; import { Pill } from '$lib/elements'; import { Query, type Models } from '@aw-labs/appwrite-console'; import Create from './_create.svelte'; @@ -34,9 +34,7 @@
{#if $databaseList?.total} -
3 ? '22rem' : '25rem'};`}> + (showCreate = true)}> {#each $databaseList.databases as database} @@ -48,12 +46,10 @@ {/each} - {#if ($databaseList.total % 2 !== 0 || $databaseList.total % 4 === 0) && $databaseList.total - offset <= $cardLimit} - (showCreate = true)}> -

Create a new database

-
- {/if} -
+ +

Create a new database

+
+

Total results: {$databaseList.total}

diff --git a/src/routes/console/project-[project]/databases/database/[database]/+page.svelte b/src/routes/console/project-[project]/databases/database/[database]/+page.svelte index 109598432..7a3993733 100644 --- a/src/routes/console/project-[project]/databases/database/[database]/+page.svelte +++ b/src/routes/console/project-[project]/databases/database/[database]/+page.svelte @@ -2,7 +2,7 @@ import { page } from '$app/stores'; import { goto } from '$app/navigation'; import { Button } from '$lib/elements/forms'; - import { Empty, Pagination, Copy, GridItem1 } from '$lib/components'; + import { Empty, Pagination, Copy, GridItem1, CardContainer } from '$lib/components'; import { Pill } from '$lib/elements'; import { Query, type Models } from '@aw-labs/appwrite-console'; import Create from './_create.svelte'; @@ -12,7 +12,6 @@ import { cardLimit } from '$lib/stores/layout'; let showCreate = false; - let search = ''; let offset = 0; const project = $page.params.project; @@ -24,8 +23,7 @@ ); }; - $: collections.load(databaseId, [Query.limit($cardLimit), Query.offset(offset)], search); - $: if (search) offset = 0; + $: collections.load(databaseId, [Query.limit($cardLimit), Query.offset(offset)]); @@ -39,9 +37,7 @@
{#if $collections?.total} -
3 ? '22rem' : '25rem'};`}> + (showCreate = true)}> {#each $collections.collections as collection} @@ -62,33 +58,15 @@ {/each} - {#if ($collections.total % 2 !== 0 || $collections.total % 4 === 0) && $collections.total - offset <= $cardLimit} - (showCreate = true)}> -

Create a new collection

-
- {/if} -
+ +

Create a new collection

+
+

Total results: {$collections.total}

- {:else if search} - -
- Sorry, we couldn’t find ‘{search}’ -
-

There are no collections that match your search.

-
-
- -
-
-
-
-

Total results: {$collections?.total}

- -
{:else} (showCreate = true)}>

Create your first collection to get started

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 d538d15f2..3eb349bf2 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 @@ -1,6 +1,13 @@ @@ -36,11 +34,7 @@
{#if $bucketList?.total} -
    3 ? '22rem' : '25rem' - };`}> + (showCreate = true)}> {#each $bucketList.buckets as bucket} XX Files @@ -81,33 +75,15 @@ {/each} - {#if $bucketList?.total < $cardLimit + offset && ($bucketList?.total % 2 !== 0 || $bucketList?.total % 4 === 0)} - (showCreate = true)}> -

    Add a new bucket

    -
    - {/if} -
+ +

Add a new bucket

+
+

Total results: {$bucketList.total}

- {:else if search} - -
- Sorry, we couldn’t find ‘{search}’ -
-

There are no buckets that match your search.

-
-
- -
-
-
-
-

Total results: {$bucketList?.total}

- -
{:else} (showCreate = true)}>

Add your first bucket to get started

diff --git a/src/routes/console/project-[project]/storage/bucket/[bucket]/+page.svelte b/src/routes/console/project-[project]/storage/bucket/[bucket]/+page.svelte index 88faf3648..07852c7a6 100644 --- a/src/routes/console/project-[project]/storage/bucket/[bucket]/+page.svelte +++ b/src/routes/console/project-[project]/storage/bucket/[bucket]/+page.svelte @@ -5,6 +5,7 @@ import { Button } from '$lib/elements/forms'; import { Empty, + EmptySearch, Pagination, Avatar, Search, @@ -179,21 +180,13 @@
{:else if search} - -
+ +
Sorry, we couldn’t find ‘{search}’ -
-

There are no files that match your search.

-
-
- -
+

There are no files that match your search.

- -
-

Total results: {$files?.total}

- -
+ +
{:else} (showCreate = true)}>

Upload some files to get started

diff --git a/src/routes/console/project-[project]/storage/store.ts b/src/routes/console/project-[project]/storage/store.ts index 64130f4d3..dac5aed69 100644 --- a/src/routes/console/project-[project]/storage/store.ts +++ b/src/routes/console/project-[project]/storage/store.ts @@ -5,12 +5,12 @@ import { cachedStore } from '$lib/helpers/cache'; export const bucketList = cachedStore< Models.BucketList, { - load: (queries: string[], search: string) => Promise; + load: (queries: string[]) => Promise; } >('bucketList', function ({ set }) { return { - load: async (queries, search) => { - const response = await sdkForProject.storage.listBuckets(queries, search); + load: async (queries) => { + const response = await sdkForProject.storage.listBuckets(queries); set(response); } };