diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte index e7803f9247..acad8b8970 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte @@ -137,14 +137,16 @@ {#if 'format' in attribute && attribute.format} {attribute.format} {:else} - {attribute.type} - {#if isRelationship(attribute)} - - with {attribute?.key} - - {/if} +

+ {attribute.type} + {#if isRelationship(attribute)} + + with {attribute?.key} + + {/if} +

{/if} {attribute.array ? '[]' : ''} @@ -167,12 +169,13 @@ - + { - selectedAttribute = attribute; + on:click={(event) => { + toggle(event); showEdit = true; + selectedAttribute = attribute; showDropdown[index] = false; }}> Update @@ -180,7 +183,8 @@ {#if !isRelationship(attribute)} { + on:click={(event) => { + toggle(event); selectedAttribute = attribute; showCreateIndex = true; showDropdown[index] = false; @@ -191,10 +195,11 @@ {#if attribute.status !== 'processing'} { - selectedAttribute = attribute; + on:click={(event) => { + toggle(event); showDelete = true; showDropdown[index] = false; + selectedAttribute = attribute; trackEvent(Click.DatabaseAttributeDelete); }}> Delete diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte index d9007b1967..da920f4e77 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte @@ -11,10 +11,12 @@ data: Partial ) { if (!isValueOfStringEnum(RelationshipType, data.relationType)) { - throw new Error(`Invalid relationship type: ${data.relationType}`); + throw new Error( + `Invalid relationship type${data.relationType ? ` : ${data.relationType}` : ''}` + ); } if (!isValueOfStringEnum(RelationMutate, data.onDelete)) { - throw new Error(`Invalid on delete: ${data.onDelete}`); + throw new Error(`Invalid deletion method${data.onDelete ? ` : ${data.onDelete}` : ''}`); } await sdk @@ -137,7 +139,7 @@ $: search = data.relatedCollection || undefined; $: if (search) { - const exists = collectionList.collections?.some((c) => + const exists = collectionList?.collections?.some((c) => c.$id.toLocaleLowerCase().includes(search.toLocaleLowerCase()) ); @@ -157,7 +159,7 @@ name="one" value="one" icon={IconArrowSmRight}> -

One Relation attribute within this collection

+ One Relation attribute within this collection -

- One Relation attribute within this collection and another within the related collection -

+ One Relation attribute within this collection and another within the related collection
@@ -179,6 +179,7 @@ bind:value={data.relatedCollection} on:change={updateKeyName} options={collections?.map((n) => ({ value: n.$id, label: `${n.name} (${n.$id})` })) ?? []} /> + {#if data?.relatedCollection} +
@@ -214,7 +216,7 @@ {#if data.twoWay} {'Two {:else} - {'One + {'One {/if} {data.key}