diff --git a/package-lock.json b/package-lock.json index 40cf403bae..66182949f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "0.0.1", "dependencies": { "@aw-labs/appwrite-console": "^10.0.0", - "@aw-labs/icons": "0.0.0-74", - "@aw-labs/ui": "0.0.0-74", + "@aw-labs/icons": "0.0.0-75", + "@aw-labs/ui": "0.0.0-75", "@popperjs/core": "^2.11.6", "echarts": "^5.4.0", "pretty-bytes": "^6.0.0", @@ -81,14 +81,14 @@ } }, "node_modules/@aw-labs/icons": { - "version": "0.0.0-74", - "resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-74.tgz", - "integrity": "sha512-aWb1OV8QEvw2BgJNK3P92wmfXlHw15wKOqMndx4kGrof+FCEekplohCnO1WZYZODoE+rF8DKHUE8RodVbJzo4A==" + "version": "0.0.0-75", + "resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-75.tgz", + "integrity": "sha512-3ajSt88EulmGyk0P8PUGROJehx+uNyUCfRzg29rE2h/SYMNwwyNWilh7qSRXJqbpBvC9y8IjwZ0D9MbILFzbFA==" }, "node_modules/@aw-labs/ui": { - "version": "0.0.0-74", - "resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-74.tgz", - "integrity": "sha512-bg8j0XiB9+PwBUXVehKcxjdIS/GH9aJ1+RtdghDNBhOPc2A5zX+MmTCDsN071qlmDfW3pnufiCoQlek/qBvcdQ==", + "version": "0.0.0-75", + "resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-75.tgz", + "integrity": "sha512-Kk27kWH4Mxszpfpr954gqrJMkyjZwZS/X5zU4Jg/sCCg2QMYXbxRGmPoit0qNIRGVHf72hf8eJCUU17/2IHCSQ==", "dependencies": { "@aw-labs/icons": "*", "normalize.css": "^8.0.1", @@ -7467,14 +7467,14 @@ } }, "@aw-labs/icons": { - "version": "0.0.0-74", - "resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-74.tgz", - "integrity": "sha512-aWb1OV8QEvw2BgJNK3P92wmfXlHw15wKOqMndx4kGrof+FCEekplohCnO1WZYZODoE+rF8DKHUE8RodVbJzo4A==" + "version": "0.0.0-75", + "resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-75.tgz", + "integrity": "sha512-3ajSt88EulmGyk0P8PUGROJehx+uNyUCfRzg29rE2h/SYMNwwyNWilh7qSRXJqbpBvC9y8IjwZ0D9MbILFzbFA==" }, "@aw-labs/ui": { - "version": "0.0.0-74", - "resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-74.tgz", - "integrity": "sha512-bg8j0XiB9+PwBUXVehKcxjdIS/GH9aJ1+RtdghDNBhOPc2A5zX+MmTCDsN071qlmDfW3pnufiCoQlek/qBvcdQ==", + "version": "0.0.0-75", + "resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-75.tgz", + "integrity": "sha512-Kk27kWH4Mxszpfpr954gqrJMkyjZwZS/X5zU4Jg/sCCg2QMYXbxRGmPoit0qNIRGVHf72hf8eJCUU17/2IHCSQ==", "requires": { "@aw-labs/icons": "*", "normalize.css": "^8.0.1", diff --git a/package.json b/package.json index fed4a0d116..bd563e7da7 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ }, "dependencies": { "@aw-labs/appwrite-console": "^10.0.0", - "@aw-labs/icons": "0.0.0-74", - "@aw-labs/ui": "0.0.0-74", + "@aw-labs/icons": "0.0.0-75", + "@aw-labs/ui": "0.0.0-75", "@popperjs/core": "^2.11.6", "echarts": "^5.4.0", "pretty-bytes": "^6.0.0", diff --git a/src/lib/components/alert.svelte b/src/lib/components/alert.svelte index bf06d2c280..32351e47a5 100644 --- a/src/lib/components/alert.svelte +++ b/src/lib/components/alert.svelte @@ -18,6 +18,7 @@
{#if dismissible} . +

+ {#if results?.teams?.length}
diff --git a/src/lib/components/permissions/user.svelte b/src/lib/components/permissions/user.svelte index 9b068db512..d5468b47d9 100644 --- a/src/lib/components/permissions/user.svelte +++ b/src/lib/components/permissions/user.svelte @@ -60,7 +60,12 @@ Select users - +

Grant access to any authenticated or anonymous user.

+ {#if results?.users?.length}
diff --git a/src/lib/elements/forms/inputChoice.svelte b/src/lib/elements/forms/inputChoice.svelte index be04a386ab..f3348f148e 100644 --- a/src/lib/elements/forms/inputChoice.svelte +++ b/src/lib/elements/forms/inputChoice.svelte @@ -1,5 +1,5 @@ @@ -18,7 +34,9 @@ {required} type="checkbox" class:switch={type === 'switchbox'} - bind:checked={value} /> + bind:this={element} + bind:checked={value} + on:invalid={handleInvalid} />
{label}
@@ -27,4 +45,7 @@ {/if}
+ {#if error} + {error} + {/if}
diff --git a/src/routes/console/project-[project]/auth/settings/+page.svelte b/src/routes/console/project-[project]/auth/settings/+page.svelte index 66032e6c30..f2b845303a 100644 --- a/src/routes/console/project-[project]/auth/settings/+page.svelte +++ b/src/routes/console/project-[project]/auth/settings/+page.svelte @@ -64,33 +64,35 @@

OAuth2 Providers

    {#each $OAuthProviders.providers.sort( (a, b) => (a.enabled === b.enabled ? 0 : a.enabled ? -1 : 1) ) as provider} - +
  • + +
  • {/each}
diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte index c8abe4744f..838e832a3d 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte @@ -1,5 +1,5 @@ @@ -160,49 +181,18 @@ on:click={updateName}>Update + Update Permissions -

- Assign read or write permissions at the Collection Level or - Document Level. If collection Level permissions are assigned, permissions - applied to individual documents are ignored. +

+ Choose who can access your collection and documents. For more information, check out + the Permissions Guide in our documentation.

-
    -
  • - -
  • -
  • - -
  • -
- - {#if collectionDocumentSecurity} - -

- Manage permissions at the Document Level to control access over - every document in your collection. Check out our documentation for more - on - Permissions -

-
- {:else if collectionPermissions !== null} + {#if collectionPermissions} {/if}
@@ -211,6 +201,32 @@
+ + Update Document Security + + + + +

+ When document security is enabled, users will be able to access documents for + which they have been granted either Document or Collection permissions. +

+

+ If document security is disabled, users can access documents only if they have Collection permissions. Document permissions will be ignored. +

+
+ + + +
+ Delete Collection

diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/wizard/step2.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/wizard/step2.svelte index e987e82545..fd4ec4b4e2 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/wizard/step2.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/wizard/step2.svelte @@ -2,16 +2,34 @@ import { Permissions } from '$lib/components/permissions'; import { WizardStep } from '$lib/layout'; import { createDocument } from './store'; + import { collection } from '../store'; + import { Alert } from '$lib/components'; Set Permissions - Assign read or write permissions at the Collection Level or - Document Level. If collection Level permissions are assigned, permissions applied to - individual documents are ignored. + Choose who can access your collection and documents. For more information, check out the Permissions Guide in our documentation. -

- -
+ {#if $collection.documentSecurity} +
+ + Document security is enabled + Users will be able to access this document if they have been granted + either Document or Collection permissions. + +
+
+ +
+ {:else} + + Document security is disabled + If you want to assign document permissions, navigate to Collection settings and enable document + security. Otherwise, only Collection permissions will be used. + + {/if} diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/create.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/create.svelte index b881da6750..a4c831b82b 100644 --- a/src/routes/console/project-[project]/storage/bucket-[bucket]/create.svelte +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/create.svelte @@ -1,7 +1,7 @@