Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import { type Attributes, collection, indexes } from '../store';
import { Icon, Layout } from '@appwrite.io/pink-svelte';
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
import { flags } from '$lib/flags';

export let showCreateIndex = false;
export let externalAttribute: Attributes = null;

Expand All @@ -39,8 +37,6 @@

let attributeList = [{ value: '', order: '', length: null }];

const showLengths = flags.showIndexLengths(page.data);

function generateIndexKey() {
let indexKeys = $indexes.map((index) => index.key);

Expand Down Expand Up @@ -152,7 +148,7 @@
placeholder="Select Order" />

<Layout.Stack direction="row" alignItems="flex-end" gap="xs">
{#if selectedType === IndexType.Key && showLengths}
{#if selectedType === IndexType.Key}
<InputNumber
id={`length-${i}`}
label={i === 0 ? 'Length' : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
import { InputText } from '$lib/elements/forms';
import { Layout } from '@appwrite.io/pink-svelte';
import type { Models } from '@appwrite.io/console';
import { page } from '$app/state';
import { flags } from '$lib/flags';

export let showOverview = false;
export let selectedIndex: Models.Index = null;

const showLengths = flags.showIndexLengths(page.data);
</script>

<Modal title="Overview" bind:show={showOverview}>
Expand Down Expand Up @@ -43,14 +39,12 @@
id={`value-${selectedIndex.orders[i]}`}
value={selectedIndex.orders[i]}
readonly />
{#if showLengths}
<InputText
required
label={i === 0 ? 'Length' : ''}
id={`value-${selectedIndex.lengths[i]}`}
value={selectedIndex.lengths[i]?.toString() ?? null}
readonly />
{/if}
<InputText
required
label={i === 0 ? 'Length' : ''}
id={`value-${selectedIndex.lengths[i]}`}
value={selectedIndex.lengths[i]?.toString() ?? null}
readonly />
</Layout.Stack>
{/each}
{/if}
Expand Down