fix: QA - index can't be created from rel attr

This commit is contained in:
Arman committed 2023-04-06 14:13:48 +02:00
1 parent e80f228111
commit 8c7bcbe56f
2 files changed
+18 -14

No files matched your search

@@ -144,16 +144,17 @@
}}>
Edit
</DropListItem>
<DropListItem
icon="plus"
on:click={() => {
selectedAttribute = attribute;
showCreateIndex = true;
showDropdown[index] = false;
}}>
Create Index
</DropListItem>
{#if !isRelationship(attribute)}
<DropListItem
icon="plus"
on:click={() => {
selectedAttribute = attribute;
showCreateIndex = true;
showDropdown[index] = false;
}}>
Create Index
</DropListItem>
{/if}
<DropListItem
icon="trash"
on:click={() => {
@@ -9,6 +9,7 @@
import { remove } from '$lib/helpers/array';
import { addNotification } from '$lib/stores/notifications';
import { sdk } from '$lib/stores/sdk';
import { isRelationship } from '../document-[document]/attributes/store';
import { indexes, type Attributes } from '../store';
import { collection } from '../store';
import Select from './select.svelte';
@@ -27,10 +28,12 @@
];
let selectedType = 'key';
let attributeOptions = $collection.attributes.map((attribute: Attributes) => ({
value: attribute.key,
label: attribute.key
}));
let attributeOptions = $collection.attributes
.filter((attribute) => !isRelationship(attribute))
.map((attribute) => ({
value: attribute.key,
label: attribute.key
}));
let attributeList = [{ value: '', order: '' }];