Merge pull request #3114 from appwrite/fix-index-column-icons-and-relationship-checkbox

fix(databases): correct enum icon and hide indexed checkbox for relationships
This commit is contained in:
Harsh Mahajan authored and GitHub committed 2026-07-10 11:40:58 +05:30
commit c2b07b090a
2 files changed
+27 -18

No files matched your search

@@ -57,7 +57,12 @@
.map((field) => ({
value: field.key,
label: field.key,
leadingIcon: baseColumnOptions.find((option) => option.type === field.type)?.icon
leadingIcon: baseColumnOptions.find(
(option) =>
option.type === field.type &&
option.format ===
('format' in field && field.format ? field.format : undefined)
)?.icon
}))
);
@@ -515,26 +515,30 @@
{columnType.toLowerCase()}
</Spreadsheet.Cell>
<Spreadsheet.Cell column="indexed" {root} isEditable={false}>
<!-- $id is always indexed internally -->
{@const isActuallyIndexed =
isId || $indexes.some((index) => index.columns.includes(column.key))}
{#if !isRelationship(column)}
<!-- $id is always indexed internally -->
{@const isActuallyIndexed =
isId ||
$indexes.some((index) => index.columns.includes(column.key))}
<!-- $id is always indexed internally -->
{@const checked = isId || isActuallyIndexed || !!columnIndexMap[column.key]}
<!-- $id is always indexed internally -->
{@const checked =
isId || isActuallyIndexed || !!columnIndexMap[column.key]}
<Selector.Checkbox
size="s"
{checked}
disabled={isActuallyIndexed}
on:change={(e) => {
if (!isActuallyIndexed) {
if (e.detail) {
columnIndexMap[column.key] = true;
$showCreateIndexSheet.show = true;
$showCreateIndexSheet.column = column.key;
<Selector.Checkbox
size="s"
{checked}
disabled={isActuallyIndexed}
on:change={(e) => {
if (!isActuallyIndexed) {
if (e.detail) {
columnIndexMap[column.key] = true;
$showCreateIndexSheet.show = true;
$showCreateIndexSheet.column = column.key;
}
}
}
}} />
}} />
{/if}
</Spreadsheet.Cell>
<Spreadsheet.Cell column="default" {root} isEditable={false}>
{@const _default = column.required