From 82c8a49e5be0bf9a1a839b6b1581cb53186b341e Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 12:07:38 +0200 Subject: [PATCH 01/21] fix: naming & add promise type to button #discussion_r909384722 --- src/lib/components/alert.svelte | 12 ++++++------ src/lib/layout/notification.svelte | 10 +++++----- src/lib/layout/notifications.svelte | 2 +- src/lib/stores/notifications.ts | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/components/alert.svelte b/src/lib/components/alert.svelte index 36e1ed44a..921f54b28 100644 --- a/src/lib/components/alert.svelte +++ b/src/lib/components/alert.svelte @@ -1,10 +1,10 @@ @@ -25,11 +25,11 @@

- {#if func?.length} + {#if buttons?.length}
- {#each func as f} - {/each}
diff --git a/src/lib/layout/notification.svelte b/src/lib/layout/notification.svelte index ca5b33c4b..7b77e5d51 100644 --- a/src/lib/layout/notification.svelte +++ b/src/lib/layout/notification.svelte @@ -4,7 +4,7 @@ export let type: Notification['type'] = 'info'; export let title: Notification['title']; - export let func: Notification['func']; + export let buttons: Notification['buttons']; let icon: string; switch (type) { @@ -44,11 +44,11 @@ {/if}

- {#if func} + {#if buttons}
- {#each func as f} - {/each}
diff --git a/src/lib/layout/notifications.svelte b/src/lib/layout/notifications.svelte index dde7dcdda..7b019f930 100644 --- a/src/lib/layout/notifications.svelte +++ b/src/lib/layout/notifications.svelte @@ -11,7 +11,7 @@ type={notification.type} title={notification.title} on:dismiss={() => dismissNotification(notification.id)} - func={notification?.func}> + buttons={notification?.buttons}> {notification.message} {/each} diff --git a/src/lib/stores/notifications.ts b/src/lib/stores/notifications.ts index ce67f7899..0642824df 100644 --- a/src/lib/stores/notifications.ts +++ b/src/lib/stores/notifications.ts @@ -7,11 +7,11 @@ export type Notification = { timeout?: number; message: string; title?: string; - func?: Func[]; + buttons?: Buttons[]; }; -export type Func = { - method: () => void; //TODO Check if promise is needed rather tha () => void +export type Buttons = { + method: () => void | Promise; name: string; }; From 0f38c8d0d7b6edb7888f123e6e5423b5c33d661e Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 12:33:46 +0200 Subject: [PATCH 02/21] fix: hide divider when slot empty #discussion_r909388432 --- src/lib/components/cardGrid.svelte | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/components/cardGrid.svelte b/src/lib/components/cardGrid.svelte index 886edfd2b..78fd2a128 100644 --- a/src/lib/components/cardGrid.svelte +++ b/src/lib/components/cardGrid.svelte @@ -1,5 +1,9 @@ @@ -11,7 +15,9 @@ -
- -
+ {#if actions?.textContent} +
+ +
+ {/if}
From 8dabe660b825591f7097273996bb58b1d9710215 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 12:40:26 +0200 Subject: [PATCH 03/21] fix: renamed 'right' to 'aside' #discussion_r909387286 --- src/lib/components/cardGrid.svelte | 2 +- src/routes/console/[project]/users/security.svelte | 4 ++-- .../[project]/users/teams/[team]/index.svelte | 4 ++-- .../console/[project]/users/user/[user]/index.svelte | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/components/cardGrid.svelte b/src/lib/components/cardGrid.svelte index 78fd2a128..02b387f29 100644 --- a/src/lib/components/cardGrid.svelte +++ b/src/lib/components/cardGrid.svelte @@ -12,7 +12,7 @@
- +
{#if actions?.textContent} diff --git a/src/routes/console/[project]/users/security.svelte b/src/routes/console/[project]/users/security.svelte index e220206d8..6884f6146 100644 --- a/src/routes/console/[project]/users/security.svelte +++ b/src/routes/console/[project]/users/security.svelte @@ -76,7 +76,7 @@ method. You can still create users from your Appwrite console.

- +
  • @@ -126,7 +126,7 @@ If you reduce the limit, users who are currently logged in will be logged out of the application.

    - +
      diff --git a/src/routes/console/[project]/users/teams/[team]/index.svelte b/src/routes/console/[project]/users/teams/[team]/index.svelte index f750dadd4..e20cb20ff 100644 --- a/src/routes/console/[project]/users/teams/[team]/index.svelte +++ b/src/routes/console/[project]/users/teams/[team]/index.svelte @@ -66,7 +66,7 @@
      Update Name
      - +
        - + {$user.response.emailVerification ? 'Verified' : 'Unverified'} {/if}
    - +
    {$user.response.email}

    Joined: {toLocaleDate($user.response.registration)}

    @@ -239,7 +239,7 @@
    Update Name
    - +
      Update Email
      - +
        Enter a new password. A password must contain at least 8 characters.

        - +
          - +
            {#if prefs} @@ -413,7 +413,7 @@ The user will be permanently deleted, including all data associated with this user. This action is irreversible.

            - + Date: Wed, 29 Jun 2022 12:43:45 +0200 Subject: [PATCH 04/21] fix: add {#if...} #discussion_r909389425 --- src/lib/components/copy.svelte | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/components/copy.svelte b/src/lib/components/copy.svelte index 1d66a0377..7eb0900e7 100644 --- a/src/lib/components/copy.svelte +++ b/src/lib/components/copy.svelte @@ -3,14 +3,14 @@ export let value: string; - let showTooltip = 'none'; + let showTooltip = false; const copy = async () => { try { await navigator.clipboard.writeText(value); - showTooltip = 'block'; + showTooltip = true; setTimeout(() => { - showTooltip = 'none'; + showTooltip = false; }, 1000); } catch (error) { addNotification({ @@ -26,9 +26,9 @@
    From ac523d38c41f9c3ccd4cbc46e6f2ccf391403b71 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 12:45:02 +0200 Subject: [PATCH 05/21] todo: explore other solutions compatible with testing library --- src/lib/components/modal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/modal.svelte b/src/lib/components/modal.svelte index c770ec075..e4b02785a 100644 --- a/src/lib/components/modal.svelte +++ b/src/lib/components/modal.svelte @@ -5,7 +5,7 @@ export let show = false; let browser = false; - + //TODO: explore other solutions compatible with testing library onMount(() => { browser = true; }); From cce91dfae83ea9f8b89ccb1b106ad408a6ce1bb8 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 12:45:53 +0200 Subject: [PATCH 06/21] fix: order #discussion_r909391209 --- src/lib/elements/forms/button.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elements/forms/button.svelte b/src/lib/elements/forms/button.svelte index 26e6112f5..1b17010d2 100644 --- a/src/lib/elements/forms/button.svelte +++ b/src/lib/elements/forms/button.svelte @@ -5,8 +5,8 @@ export let danger = false; export let disabled = false; export let round = false; - export let href: string = null; export let external = false; + export let href: string = null; //TODO: add option to add aria-label to buttons that are only icons From 703896cdfd1afbffe8f3fd2323e7c575b7f372c7 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 13:32:57 +0200 Subject: [PATCH 07/21] fix: rename component --- src/lib/components/copyInput.svelte | 34 +++++++++++++++++++ src/lib/components/index.ts | 2 +- .../document/[document]/index.svelte | 4 +-- .../storage/bucket/[bucket]/_update.svelte | 4 +-- .../[project]/users/_appleOAuth.svelte | 4 +-- .../[project]/users/_auth0OAuth.svelte | 4 +-- .../console/[project]/users/_mainOAuth.svelte | 4 +-- .../[project]/users/_microsoftOAuth.svelte | 4 +-- .../console/[project]/users/_oktaOAuth.svelte | 4 +-- 9 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 src/lib/components/copyInput.svelte diff --git a/src/lib/components/copyInput.svelte b/src/lib/components/copyInput.svelte new file mode 100644 index 000000000..7eb0900e7 --- /dev/null +++ b/src/lib/components/copyInput.svelte @@ -0,0 +1,34 @@ + + +
    + + +
    diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts index b1ecf9f35..e261beb37 100644 --- a/src/lib/components/index.ts +++ b/src/lib/components/index.ts @@ -5,7 +5,7 @@ export { default as CardGrid } from './cardGrid.svelte'; export { default as Tile } from './tile.svelte'; export { default as Tiles } from './tiles.svelte'; export { default as Back } from './back.svelte'; -export { default as Copy } from './copy.svelte'; +export { default as CopyInput } from './copyInput.svelte'; export { default as UploadBox } from './uploadBox.svelte'; export { default as List } from './list.svelte'; export { default as ListItem } from './listItem.svelte'; diff --git a/src/routes/console/[project]/database/collection/[collection]/document/[document]/index.svelte b/src/routes/console/[project]/database/collection/[collection]/document/[document]/index.svelte index 0767773f4..9222b68e6 100644 --- a/src/routes/console/[project]/database/collection/[collection]/document/[document]/index.svelte +++ b/src/routes/console/[project]/database/collection/[collection]/document/[document]/index.svelte @@ -1,6 +1,6 @@ -
    - - -
    + + + diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts index e261beb37..17ee9437a 100644 --- a/src/lib/components/index.ts +++ b/src/lib/components/index.ts @@ -5,6 +5,7 @@ export { default as CardGrid } from './cardGrid.svelte'; export { default as Tile } from './tile.svelte'; export { default as Tiles } from './tiles.svelte'; export { default as Back } from './back.svelte'; +export { default as Copy } from './copy.svelte'; export { default as CopyInput } from './copyInput.svelte'; export { default as UploadBox } from './uploadBox.svelte'; export { default as List } from './list.svelte'; diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index b82975ba8..76f59b9eb 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -3,8 +3,8 @@ import { tabs, title, backButton, copyData } from '$lib/stores/layout'; import { fade } from 'svelte/transition'; import { Cover } from '.'; + import { Copy } from '$lib/components'; import { Pill } from '$lib/elements'; - import { addNotification } from '$lib/stores/notifications'; export let isOpen = false; @@ -52,21 +52,6 @@ } }; }; - - const copy = async (value: string) => { - try { - await navigator.clipboard.writeText(value); - addNotification({ - message: 'Copied to clipboard.', - type: 'success' - }); - } catch (error) { - addNotification({ - message: error.message, - type: 'error' - }); - } - }; @@ -93,16 +78,16 @@ {$title} {#if $copyData?.value} - copy($copyData.value)} - >{$copyData.text} - + + {$copyData.text} + {/if} {:else} {$title} {#if $copyData?.value} - copy($copyData.value)} - >{$copyData.text} - + + {$copyData.text} + {/if} {/if}
    diff --git a/src/routes/console/[project]/storage/index.svelte b/src/routes/console/[project]/storage/index.svelte index 16dfa0a43..8aa6d2268 100644 --- a/src/routes/console/[project]/storage/index.svelte +++ b/src/routes/console/[project]/storage/index.svelte @@ -3,13 +3,12 @@ import { goto } from '$app/navigation'; import { sdkForProject } from '$lib/stores/sdk'; import { Button } from '$lib/elements/forms'; - import { Empty, Pagination, Tiles, Tooltip } from '$lib/components'; + import { Empty, Pagination, Tiles, Tooltip, Copy } from '$lib/components'; import { Pill } from '$lib/elements'; import type { Models } from 'src/sdk'; import Create from './_create.svelte'; import { Container } from '$lib/layout'; import { base } from '$app/paths'; - import { addNotification } from '$lib/stores/notifications'; let showCreate = false; let search = ''; @@ -24,21 +23,6 @@ $: request = sdkForProject.storage.listBuckets(search, limit, offset); $: if (search) offset = 0; - - const copy = async (value: string) => { - try { - await navigator.clipboard.writeText(value); - addNotification({ - message: 'Copied to clipboard.', - type: 'success' - }); - } catch (error) { - addNotification({ - message: error.message, - type: 'error' - }); - } - }; @@ -66,9 +50,9 @@

    {bucket.name}

    - copy(bucket.$id)} - >Bucket ID - + + Bucket ID +
    import { page } from '$app/stores'; import { sdkForProject } from '$lib/stores/sdk'; - import { Empty, Pagination, Avatar } from '$lib/components'; + import { Empty, Pagination, Avatar, Copy } from '$lib/components'; import { Button } from '$lib/elements/forms'; - import { addNotification } from '$lib/stores/notifications'; import { Table, TableHeader, @@ -50,21 +49,6 @@ offset = queryOffset; } }); - - const copy = async (value: string) => { - try { - await navigator.clipboard.writeText(value); - addNotification({ - message: 'Copied to clipboard.', - type: 'success' - }); - } catch (error) { - addNotification({ - message: error.message, - type: 'error' - }); - } - }; @@ -113,9 +97,9 @@ {/if} - copy(user.$id)} - >User ID - + + User ID + {toLocaleDateTime(user.registration)} diff --git a/tests/unit/components/copy.test.svelte b/tests/unit/components/copy.test.svelte new file mode 100644 index 000000000..b808e0190 --- /dev/null +++ b/tests/unit/components/copy.test.svelte @@ -0,0 +1,9 @@ + + + + Content + diff --git a/tests/unit/components/copy.test.ts b/tests/unit/components/copy.test.ts index 1d8e385ea..a144da3cf 100644 --- a/tests/unit/components/copy.test.ts +++ b/tests/unit/components/copy.test.ts @@ -1,22 +1,11 @@ import '@testing-library/jest-dom'; import { render, fireEvent } from '@testing-library/svelte'; -import { Copy } from '../../../src/lib/components'; +import Copy from './copy.test.svelte'; const value = 'This is a test'; -test('shows copy component', () => { - const { getByRole } = render(Copy, { value }); - const input = document.querySelector('input'); - const button = getByRole('button'); - - expect(input).toBeInTheDocument(); - expect(button).toBeInTheDocument(); - expect(input).toHaveAttribute('type', 'text'); - expect(input).toBeDisabled(); -}); - test('copy to clipboard function called on click', async () => { - const { getByRole } = render(Copy, { value }); + const { getByTestId } = render(Copy, { value }); Object.assign(window.navigator, { clipboard: { @@ -24,7 +13,7 @@ test('copy to clipboard function called on click', async () => { } }); - const button = getByRole('button'); + const button = getByTestId('copy-content'); await fireEvent.click(button); expect(window.navigator.clipboard.writeText).toHaveBeenCalledWith('This is a test'); diff --git a/tests/unit/components/copyInput.test.ts b/tests/unit/components/copyInput.test.ts new file mode 100644 index 000000000..fb78dbe79 --- /dev/null +++ b/tests/unit/components/copyInput.test.ts @@ -0,0 +1,31 @@ +import '@testing-library/jest-dom'; +import { render, fireEvent } from '@testing-library/svelte'; +import { CopyInput } from '../../../src/lib/components'; + +const value = 'This is a test'; + +test('shows CopyInput component', () => { + const { getByRole } = render(CopyInput, { value }); + const input = document.querySelector('input'); + const button = getByRole('button'); + + expect(input).toBeInTheDocument(); + expect(button).toBeInTheDocument(); + expect(input).toHaveAttribute('type', 'text'); + expect(input).toBeDisabled(); +}); + +test('copy to clipboard function called on click', async () => { + const { getByRole } = render(CopyInput, { value }); + + Object.assign(window.navigator, { + clipboard: { + writeText: jest.fn().mockImplementation(() => Promise.resolve()) + } + }); + + const button = getByRole('button'); + await fireEvent.click(button); + + expect(window.navigator.clipboard.writeText).toHaveBeenCalledWith('This is a test'); +}); From 5e2e57a3522c0538ce3eb48d2f0b92a08865819f Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 14:06:31 +0200 Subject: [PATCH 09/21] fix: remove try catch from user store #discussion_r909402785 --- src/lib/stores/user.ts | 6 +----- src/routes/__layout.svelte | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/lib/stores/user.ts b/src/lib/stores/user.ts index 4967920da..8ac579d7c 100644 --- a/src/lib/stores/user.ts +++ b/src/lib/stores/user.ts @@ -9,11 +9,7 @@ function createUserStore() { subscribe, set, fetchUser: async () => { - try { - set(await sdkForConsole.account.get()); - } catch (error) { - //TODO: take care what happens here - } + set(await sdkForConsole.account.get()); } }; } diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 52abb8f62..7ed613c2c 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -15,11 +15,7 @@ onMount(async () => { try { if (!$user) { - //TODO: find out if it's the correct implementation await user.fetchUser(); - if (!$user) { - throw 'No user found'; - } } if (!$page.url.pathname.startsWith('/console')) { From 211f91659818119b9cf91d1d5eecae36e4d44e12 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 14:37:13 +0200 Subject: [PATCH 10/21] fix: remove unused try/catch --- src/routes/console/[project]/users/store.ts | 70 ++++++++----------- .../[project]/users/teams/[team]/store.ts | 44 +++++------- .../[project]/users/user/[user]/store.ts | 14 ++-- 3 files changed, 52 insertions(+), 76 deletions(-) diff --git a/src/routes/console/[project]/users/store.ts b/src/routes/console/[project]/users/store.ts index b1d840ea1..afc6a2c13 100644 --- a/src/routes/console/[project]/users/store.ts +++ b/src/routes/console/[project]/users/store.ts @@ -23,22 +23,18 @@ function createUsersListStore() { subscribe, set, load: async (search: string, limit: number, offset: number) => { - try { - const response = await sdkForProject.users.list( - search, - limit, - offset, - undefined, - undefined, - 'DESC' - ); - set({ - loading: false, - response - }); - } catch (error) { - //TODO: take care what happens here - } + const response = await sdkForProject.users.list( + search, + limit, + offset, + undefined, + undefined, + 'DESC' + ); + set({ + loading: false, + response + }); } }; } @@ -53,22 +49,18 @@ function createTeamsListStore() { subscribe, set, load: async (search: string, limit: number, offset: number) => { - try { - const response = await sdkForProject.teams.list( - search, - limit, - offset, - undefined, - undefined, - 'DESC' - ); - set({ - loading: false, - response - }); - } catch (error) { - //TODO: take care what happens here - } + const response = await sdkForProject.teams.list( + search, + limit, + offset, + undefined, + undefined, + 'DESC' + ); + set({ + loading: false, + response + }); } }; } @@ -82,15 +74,11 @@ function createUsersUsageStore() { subscribe, set, load: async (range: string) => { - try { - const response = await sdkForProject.users.getUsage(range); - set({ - loading: false, - response - }); - } catch (error) { - //TODO: take care what happens here - } + const response = await sdkForProject.users.getUsage(range); + set({ + loading: false, + response + }); } }; } diff --git a/src/routes/console/[project]/users/teams/[team]/store.ts b/src/routes/console/[project]/users/teams/[team]/store.ts index 4221f6b0d..4982baee2 100644 --- a/src/routes/console/[project]/users/teams/[team]/store.ts +++ b/src/routes/console/[project]/users/teams/[team]/store.ts @@ -22,15 +22,11 @@ function createTeamStore() { subscribe, set, load: async (teamId: string) => { - try { - const response = await sdkForProject.teams.get(teamId); - set({ - loading: false, - response - }); - } catch (error) { - //TODO: take care what happens here - } + const response = await sdkForProject.teams.get(teamId); + set({ + loading: false, + response + }); } }; } @@ -44,23 +40,19 @@ function createMembershipStore() { subscribe, set, load: async (teamId: string, search: string, limit: number, offset: number) => { - try { - const response = await sdkForProject.teams.getMemberships( - teamId, - search, - limit, - offset, - undefined, - undefined, - 'DESC' - ); - set({ - loading: false, - response - }); - } catch (error) { - //TODO: take care what happens here - } + const response = await sdkForProject.teams.getMemberships( + teamId, + search, + limit, + offset, + undefined, + undefined, + 'DESC' + ); + set({ + loading: false, + response + }); } }; } diff --git a/src/routes/console/[project]/users/user/[user]/store.ts b/src/routes/console/[project]/users/user/[user]/store.ts index 05f3ba721..7ac50b0bd 100644 --- a/src/routes/console/[project]/users/user/[user]/store.ts +++ b/src/routes/console/[project]/users/user/[user]/store.ts @@ -18,15 +18,11 @@ function createUserStore() { subscribe, set, load: async (userId: string) => { - try { - const response = await sdkForProject.users.get(userId); - set({ - loading: false, - response - }); - } catch (error) { - //TODO: take care what happens here - } + const response = await sdkForProject.users.get(userId); + set({ + loading: false, + response + }); } }; } From 36ef28e4e542a1e8452cc9cbda3772d3273a2e5a Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 16:57:04 +0200 Subject: [PATCH 11/21] feat create search component + implementation #discussion_r909406009 --- src/lib/components/index.ts | 1 + src/lib/components/search.svelte | 13 +++++++++++++ .../database/collection/[collection]/index.svelte | 14 +++----------- src/routes/console/[project]/users/index.svelte | 15 +++------------ src/routes/console/[project]/users/teams.svelte | 15 +++------------ .../[project]/users/teams/[team]/members.svelte | 15 +++------------ 6 files changed, 26 insertions(+), 47 deletions(-) create mode 100644 src/lib/components/search.svelte diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts index 17ee9437a..01de65cfb 100644 --- a/src/lib/components/index.ts +++ b/src/lib/components/index.ts @@ -23,3 +23,4 @@ export { default as SwitchBox } from './switchBox.svelte'; export { default as SwitchBoxes } from './switchBoxes.svelte'; export { default as Alert } from './alert.svelte'; export { default as Box } from './box.svelte'; +export { default as Search } from './search.svelte'; diff --git a/src/lib/components/search.svelte b/src/lib/components/search.svelte new file mode 100644 index 000000000..879e0d041 --- /dev/null +++ b/src/lib/components/search.svelte @@ -0,0 +1,13 @@ + + +
    +
    + +
    + +
    diff --git a/src/routes/console/[project]/database/collection/[collection]/index.svelte b/src/routes/console/[project]/database/collection/[collection]/index.svelte index 6a175a1b8..99fab42cf 100644 --- a/src/routes/console/[project]/database/collection/[collection]/index.svelte +++ b/src/routes/console/[project]/database/collection/[collection]/index.svelte @@ -9,7 +9,7 @@ TableCellHead, TableCellLink } from '$lib/elements/table'; - import { Empty, Pagination } from '$lib/components'; + import { Empty, Pagination, Search } from '$lib/components'; import { collection } from './store'; import { Container } from '$lib/layout'; import { Button } from '$lib/elements/forms'; @@ -35,20 +35,12 @@ {#await request}
    {:then response} -
    -
    - -
    + -
    + {#if response.total} diff --git a/src/routes/console/[project]/users/index.svelte b/src/routes/console/[project]/users/index.svelte index 9214ccbaf..8f9ee833f 100644 --- a/src/routes/console/[project]/users/index.svelte +++ b/src/routes/console/[project]/users/index.svelte @@ -1,7 +1,7 @@ -
    -
    - -
    - + -
    + {#if $usersList?.response?.total}
    diff --git a/src/routes/console/[project]/users/teams.svelte b/src/routes/console/[project]/users/teams.svelte index c8e5fb76c..21806e6a6 100644 --- a/src/routes/console/[project]/users/teams.svelte +++ b/src/routes/console/[project]/users/teams.svelte @@ -11,7 +11,7 @@ TableCellText } from '$lib/elements/table'; import { Button } from '$lib/elements/forms'; - import { Empty, Pagination, Avatar } from '$lib/components'; + import { Empty, Pagination, Avatar, Search } from '$lib/components'; import Create from './_createTeam.svelte'; import { goto } from '$app/navigation'; import { toLocaleDateTime } from '$lib/helpers/date'; @@ -47,20 +47,11 @@ -
    -
    - -
    - + -
    + {#if $teamsList?.response?.total}
    diff --git a/src/routes/console/[project]/users/teams/[team]/members.svelte b/src/routes/console/[project]/users/teams/[team]/members.svelte index 16aa39b7f..9f51506ea 100644 --- a/src/routes/console/[project]/users/teams/[team]/members.svelte +++ b/src/routes/console/[project]/users/teams/[team]/members.svelte @@ -1,6 +1,6 @@ -
    -
    - -
    - + -
    + {#if $memberships.response?.total}
    From 18f3bf6ca0b8aa4d81dde0d04caac7c5b478750b Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 29 Jun 2022 17:07:39 +0200 Subject: [PATCH 12/21] chore: remove unused comments --- src/routes/console/[project]/index.svelte | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/routes/console/[project]/index.svelte b/src/routes/console/[project]/index.svelte index 10eec2fe8..5a0e7566b 100644 --- a/src/routes/console/[project]/index.svelte +++ b/src/routes/console/[project]/index.svelte @@ -5,8 +5,6 @@ import { project } from './store'; import { Card, List, ListItem } from '$lib/components'; import { Cover, Container } from '$lib/layout'; - // import { Line } from '$lib/charts'; - // import { page } from '$app/stores'; import { base } from '$app/paths'; import CreatePlatform from './_createPlatform.svelte'; @@ -20,9 +18,6 @@ }); let addPlatform = false; - // let range: '24h' | '30d' | '90d' = '30d'; - - // $: requestUsage = sdkForConsole.projects.getUsage($page.params.project, range); @@ -53,9 +48,6 @@ - - -

    Platforms

    {#each $project.platforms as platform} From 116afa8a7b5282db421fab16bdb0f48c89d1b10e Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 30 Jun 2022 10:52:15 +0200 Subject: [PATCH 13/21] fix: replace card with cardGrid component #discussion_r909418818 --- .../[project]/users/authentication.svelte | 76 +++++++++---------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/src/routes/console/[project]/users/authentication.svelte b/src/routes/console/[project]/users/authentication.svelte index aae4b4b8b..e4c2350ef 100644 --- a/src/routes/console/[project]/users/authentication.svelte +++ b/src/routes/console/[project]/users/authentication.svelte @@ -1,5 +1,5 @@ - -
    -
    -

    Auth Methods

    -

    Enable the auth methods you wish to use.

    -
    -
    - -
      - {#each $authMethods.list as box} -
    • - -
    • - {/each} + +

      Auth Methods

      +

      Enable the auth methods you wish to use.

      + + +
        + {#each $authMethods.list as box}
      • -
      • -
      - -
    -
    -
    + {/each} +
  • + +
  • + + + +

    OAuth2 Providers

      From 7d06b7c225e9e4ed4c091fe5d75eb2432299babf Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 30 Jun 2022 11:30:01 +0200 Subject: [PATCH 14/21] feat: extend inputswitch with on:change, implemented it #discussion_r909418996 --- src/lib/elements/forms/inputSwitch.svelte | 27 +++++++++++-------- .../[project]/users/authentication.svelte | 25 ++++++----------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/lib/elements/forms/inputSwitch.svelte b/src/lib/elements/forms/inputSwitch.svelte index a8fded417..38a6f2a40 100644 --- a/src/lib/elements/forms/inputSwitch.svelte +++ b/src/lib/elements/forms/inputSwitch.svelte @@ -9,15 +9,20 @@ - -
      - -
      +
      diff --git a/src/routes/console/[project]/users/authentication.svelte b/src/routes/console/[project]/users/authentication.svelte index e4c2350ef..aa2618ac2 100644 --- a/src/routes/console/[project]/users/authentication.svelte +++ b/src/routes/console/[project]/users/authentication.svelte @@ -1,6 +1,7 @@