From 94ed716f89cd4c317afafe2b88125f978d9631e2 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 11 May 2023 16:54:50 +0200 Subject: [PATCH 1/5] fix: relationships from design review --- CONTRIBUTING.md | 3 +++ src/lib/components/viewSelector.svelte | 2 +- src/lib/elements/forms/formItem.svelte | 6 ++++- src/lib/elements/forms/inputText.svelte | 3 ++- src/lib/elements/table/tableScroll.svelte | 3 ++- .../project-[project]/databases/+page.svelte | 7 +++++- .../database-[database]/+page.svelte | 7 +++++- .../document-[document]/data/+page.svelte | 2 +- .../document-[document]/delete.svelte | 24 ++++++++++--------- .../document-[document]/document.svelte | 2 +- .../settings/displayName.svelte | 22 +++++++++++------ 11 files changed, 55 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 607bb07f6c..ad67fbd688 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,12 +40,15 @@ git clone https://github.com/appwrite/console.git appwrite-console ``` ### 2. Install dependencies with npm + Navigate to the Appwrite Console repository and install dependencies. + ```bash cd appwrite-console && npm install ``` ### 3. Install and run Appwrite locally + When you run the Appwrite Console locally, it needs to point to a backend as well. The easiest way to do this is to run an Appwrite instance locally. Follow the [install instructions](https://appwrite.io/docs/installation) in the Appwrite docs. diff --git a/src/lib/components/viewSelector.svelte b/src/lib/components/viewSelector.svelte index 82d7d499b8..7ac403079b 100644 --- a/src/lib/components/viewSelector.svelte +++ b/src/lib/components/viewSelector.svelte @@ -84,7 +84,7 @@ class="icon-view-boards u-opacity-50" aria-hidden="true" aria-label="columns" /> - Columns + Columns {selectedColumnsNumber} diff --git a/src/lib/elements/forms/formItem.svelte b/src/lib/elements/forms/formItem.svelte index d1301d5d66..3e08ea2712 100644 --- a/src/lib/elements/forms/formItem.svelte +++ b/src/lib/elements/forms/formItem.svelte @@ -1,3 +1,7 @@ -
  • + + +
  • diff --git a/src/lib/elements/forms/inputText.svelte b/src/lib/elements/forms/inputText.svelte index 28123a30fd..3b434549de 100644 --- a/src/lib/elements/forms/inputText.svelte +++ b/src/lib/elements/forms/inputText.svelte @@ -16,6 +16,7 @@ export let readonly = false; export let autofocus = false; export let autocomplete = false; + export let fullWidth = false; export let maxlength: number = null; export let tooltip: string = null; @@ -58,7 +59,7 @@ $: showNullCheckbox = nullable && !required; - + diff --git a/src/lib/elements/table/tableScroll.svelte b/src/lib/elements/table/tableScroll.svelte index 814fe00e51..9dfa46e2a8 100644 --- a/src/lib/elements/table/tableScroll.svelte +++ b/src/lib/elements/table/tableScroll.svelte @@ -2,6 +2,7 @@ import type { Action } from 'svelte/action'; export let isSticky = false; + export let noMargin = false; const hasOverflow: Action void> = (node, callback) => { const observer = new ResizeObserver((entries) => { @@ -22,7 +23,7 @@ let isOverflowing = false; -
    +
    (isOverflowing = v)}> diff --git a/src/routes/console/project-[project]/databases/+page.svelte b/src/routes/console/project-[project]/databases/+page.svelte index 0d0e1e553b..490fdb8d11 100644 --- a/src/routes/console/project-[project]/databases/+page.svelte +++ b/src/routes/console/project-[project]/databases/+page.svelte @@ -24,7 +24,12 @@ - + diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/document.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/document.svelte index c2a85e9a57..2c0f7faa7f 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/document.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/document.svelte @@ -65,7 +65,7 @@ trackEvent(Submit.DocumentUpdate); disableUpdate = true; addNotification({ - message: 'Document was updated!', + message: 'Document has been updated', type: 'success' }); } catch (error) { diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/displayName.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/displayName.svelte index 3a5f769576..8ee09ffdb5 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/displayName.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/displayName.svelte @@ -66,13 +66,21 @@
    -
      - +
        +
      • + +
        + +
        +
      • {#if names?.length} {#each names as name, i}
        From 3cf82e4fc165962d9fbb0b304535ee9d8cd1a630 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 12 May 2023 14:21:45 +0200 Subject: [PATCH 2/5] fix: clickable list small fixes --- src/lib/components/clickableListItem.svelte | 16 ++++++++++------ .../relationshipsModal.svelte | 5 ++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/lib/components/clickableListItem.svelte b/src/lib/components/clickableListItem.svelte index 00308d47a5..78a4dbe08d 100644 --- a/src/lib/components/clickableListItem.svelte +++ b/src/lib/components/clickableListItem.svelte @@ -4,11 +4,15 @@
      • -
        - -
        -
        -

        -
        + {#if $$slots.default} +
        + +
        + {/if} + {#if $$slots.desc} +
        +

        +
        + {/if}
      • diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/relationshipsModal.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/relationshipsModal.svelte index f2576dd6a7..a0917e087b 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/relationshipsModal.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/relationshipsModal.svelte @@ -12,7 +12,10 @@ const databaseId = $page.params.database; const limit = 10; - $: args = preferences.getDisplayNames()?.[selectedRelationship?.relatedCollection] ?? []; + $: args = + preferences + .getDisplayNames() + ?.[selectedRelationship?.relatedCollection]?.filter((p) => p !== '$id') ?? []; $: if (!show) { data = null; From 8bf896b444e8f119eca948bfb18aebaa2561127d Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 17 May 2023 17:33:19 +0200 Subject: [PATCH 3/5] fix: id not updating on firefox, new sdk --- package-lock.json | 8 ++++---- package.json | 2 +- .../document-[document]/attributes/relationship.svelte | 2 +- .../collection-[collection]/header.svelte | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 46a8434389..fabe4808dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "name": "@appwrite/console", "dependencies": { "@analytics/google-analytics": "^1.0.5", - "@appwrite.io/console": "0.1.0", + "@appwrite.io/console": "0.1.1", "@appwrite.io/pink": "^0.0.6-rc.10", "@popperjs/core": "^2.11.6", "@sentry/svelte": "^7.44.2", @@ -147,9 +147,9 @@ "integrity": "sha512-1Yw7u/COtxx06BfwlI+kVhsa/upKYzmCNrT4c8QDeCY2KMYlnijkUjtHiPU08HxyTIVB5j6d75O0YWVIHwQS8g==" }, "node_modules/@appwrite.io/console": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-0.1.0.tgz", - "integrity": "sha512-GzCRUmaXAVgpGwxBNI3PrtCLHz7CM+epBHDDTHw8B2u61KbijGBO3GrwreXy91fy00RJiEzGlMSRzDgwsF3Tsg==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-0.1.1.tgz", + "integrity": "sha512-7aBh/8QxKmaMsP9tVJgNsrOBstuikKasSUoSyRNxblK3J/OdPXnQRInZELT9uaK+vqjZaCYspA3B+5UH+DZ9Dw==", "dependencies": { "cross-fetch": "3.1.5", "isomorphic-form-data": "2.0.0" diff --git a/package.json b/package.json index 0e7ec8d6e1..4629c459a2 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@analytics/google-analytics": "^1.0.5", - "@appwrite.io/console": "0.1.0", + "@appwrite.io/console": "0.1.1", "@appwrite.io/pink": "^0.0.6-rc.10", "@popperjs/core": "^2.11.6", "@sentry/svelte": "^7.44.2", diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte index f01e54ca58..2731ad750e 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/relationship.svelte @@ -61,7 +61,7 @@ const documents = await sdk.forProject.databases.listDocuments( databaseId, attribute.relatedCollection, - [Query.search('$id', search), Query.orderDesc('$createdAt')] + [Query.startsWith('$id', search), Query.orderDesc('$createdAt')] ); return documents; } else { diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/header.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/header.svelte index 51f5f0a45d..2fe829bef0 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/header.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/header.svelte @@ -51,7 +51,9 @@ {$collection?.name} - {$collection?.$id} + {#key $collection?.$id} + {$collection?.$id} + {/key} From bf65ad2629ade63f6952346e35a38a5507b48341 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 1 Jun 2023 13:53:31 +0200 Subject: [PATCH 4/5] feat: remove 50 char limit for display names, and update description --- .../settings/displayName.svelte | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/displayName.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/displayName.svelte index 8ee09ffdb5..ae13e46295 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/displayName.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/displayName.svelte @@ -37,10 +37,7 @@ $: options = ($attributes as Models.AttributeString[]) .filter( (attr) => - attr.type === 'string' && - attr?.size <= 50 && - !attr?.array && - !names?.some((name) => name === attr.key) + attr.type === 'string' && !attr?.array && !names?.some((name) => name === attr.key) ) .map((attr) => { return { @@ -60,8 +57,9 @@ Display Name

        - Set string attributes with maximum 50 characters to be used as a display name in the - Appwrite console. Maximum 5 names. + Select string attributes as display names for your documents. The selected names will be + used as short forms to identify documents in the Appwrite console, like when creating + database relationships. You can specify up to 5 names.

        From 38ef1d918323fb6b576a4fe60c464c30cde60064 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 6 Jun 2023 09:37:13 +0200 Subject: [PATCH 5/5] fix: rel trim --- package-lock.json | 8 ++++---- package.json | 2 +- .../collection-[collection]/table.svelte | 15 ++++++++++----- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index fabe4808dd..c1a447658f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "dependencies": { "@analytics/google-analytics": "^1.0.5", "@appwrite.io/console": "0.1.1", - "@appwrite.io/pink": "^0.0.6-rc.10", + "@appwrite.io/pink": "^0.0.6-rc.14", "@popperjs/core": "^2.11.6", "@sentry/svelte": "^7.44.2", "@sentry/tracing": "^7.44.2", @@ -156,9 +156,9 @@ } }, "node_modules/@appwrite.io/pink": { - "version": "0.0.6-rc.10", - "resolved": "https://registry.npmjs.org/@appwrite.io/pink/-/pink-0.0.6-rc.10.tgz", - "integrity": "sha512-mhpgjQVfQvghItgcCzsHN0Ynn4U9JNg8HlSJ+HVDUi/bNHxmlm7XdNJE6s65LMJ6LfepROn6zZMHquANvGfNDg==", + "version": "0.0.6-rc.14", + "resolved": "https://registry.npmjs.org/@appwrite.io/pink/-/pink-0.0.6-rc.14.tgz", + "integrity": "sha512-KSfuW/MIc9aXaSjHmOB0TSyd2G/nTX8Yj49LOqOw41v649tVNfPGutvI6eTULCKve24HTYSspnHLil5Eb4Kk2Q==", "dependencies": { "@appwrite.io/pink-icons": "*", "normalize.css": "^8.0.1", diff --git a/package.json b/package.json index 4629c459a2..b6e02805b7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "dependencies": { "@analytics/google-analytics": "^1.0.5", "@appwrite.io/console": "0.1.1", - "@appwrite.io/pink": "^0.0.6-rc.10", + "@appwrite.io/pink": "^0.0.6-rc.14", "@popperjs/core": "^2.11.6", "@sentry/svelte": "^7.44.2", "@sentry/tracing": "^7.44.2", diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/table.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/table.svelte index 727be175c9..fcc281bd81 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/table.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/table.svelte @@ -19,6 +19,7 @@ import { isRelationship, isRelationshipToMany } from './document-[document]/attributes/store'; import RelationshipsModal from './relationshipsModal.svelte'; import { attributes, collection, columns } from './store'; + import { clickOnEnter } from '$lib/helpers/a11y'; export let data: PageData; @@ -111,22 +112,26 @@ {#if !isRelationshipToMany(attr)} {#if document[column.id]} {@const related = document[column.id]} - +
        {:else} n/a {/if}