From 4dbfb83b6e61a761e61eb89f1c46e78b15d2ceb0 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 25 Nov 2022 16:19:38 +0100 Subject: [PATCH 1/2] feat: unbundled document settings --- .../settings/+page.svelte | 263 +----------------- .../settings/dangerZone.svelte | 31 +++ .../settings/updateName.svelte | 66 +++++ .../settings/updatePermissions.svelte | 74 +++++ .../settings/updateSecurity.svelte | 70 +++++ .../settings/updateStatus.svelte | 68 +++++ 6 files changed, 319 insertions(+), 253 deletions(-) create mode 100644 src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/dangerZone.svelte create mode 100644 src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateName.svelte create mode 100644 src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updatePermissions.svelte create mode 100644 src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateSecurity.svelte create mode 100644 src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateStatus.svelte 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 0ba34d8892..707864dc43 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,262 +1,19 @@ {#if $collection} - - {$collection.name} - - -
    - -
-
-

Created: {toLocaleDateTime($collection.$createdAt)}

-

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

-
-
- - - - -
- - - Update Name - - -
    - - {#if showError === 'name'} - {errorMessage} - {/if} -
-
- - - - -
- - - Update Permissions -

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

- - {#if collectionPermissions} - - {/if} - - - - -
- - - 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 -

- The collection will be permanently deleted, including all the documents within it. - This action is irreversible. -

- - - -
{$collection.name}
-
-

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

-
-
- - - - -
+ + + + + {/if}
- - diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/dangerZone.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/dangerZone.svelte new file mode 100644 index 0000000000..53653a2d4c --- /dev/null +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/dangerZone.svelte @@ -0,0 +1,31 @@ + + + + Delete Collection +

+ The collection will be permanently deleted, including all the documents within it. This + action is irreversible. +

+ + + +
{$collection.name}
+
+

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

+
+
+ + + + +
+ + diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateName.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateName.svelte new file mode 100644 index 0000000000..e98422453f --- /dev/null +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateName.svelte @@ -0,0 +1,66 @@ + + +
+ + Update Name + + +
    + +
+
+ + + + +
+
diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updatePermissions.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updatePermissions.svelte new file mode 100644 index 0000000000..9548472e3f --- /dev/null +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updatePermissions.svelte @@ -0,0 +1,74 @@ + + + + Update Permissions +

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

+ + {#if collectionPermissions} + + {/if} + + + + +
diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateSecurity.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateSecurity.svelte new file mode 100644 index 0000000000..87d601be6d --- /dev/null +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateSecurity.svelte @@ -0,0 +1,70 @@ + + + + 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. +

+
+ + + +
diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateStatus.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateStatus.svelte new file mode 100644 index 0000000000..6c1353320f --- /dev/null +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updateStatus.svelte @@ -0,0 +1,68 @@ + + + + {$collection.name} + + +
    + +
+
+

Created: {toLocaleDateTime($collection.$createdAt)}

+

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

+
+
+ + + + +
From 7f315c19d7007385079d4935f95d229cc8b6343b Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 25 Nov 2022 16:27:34 +0100 Subject: [PATCH 2/2] fix: add missing class --- .../collection-[collection]/settings/updatePermissions.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updatePermissions.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updatePermissions.svelte index 9548472e3f..6589c22c04 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updatePermissions.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/updatePermissions.svelte @@ -61,7 +61,8 @@ Choose who can access your collection and documents. For more information, check out the Permissions Guide in our documentation. + rel="noopener noreferrer" + class="link">Permissions Guide in our documentation.

{#if collectionPermissions}