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 @@ -227,8 +227,11 @@
size="s"
secondary
class="small-button-dimensions"
disabled={!(hasColumns && hasValidColumns && data.rows.total) ||
disableButton}
disabled={!(
hasColumns &&
hasValidColumns &&
data.rows?.total
) || disableButton}
on:click={() => {
trackEvent(Click.DatabaseExportCsv);
goto(getTableExportUrl());
Expand All @@ -239,13 +242,13 @@
<svelte:fragment slot="tooltip">Export CSV</svelte:fragment>
</Tooltip>

<Tooltip disabled={isRefreshing || !data.rows.total} placement="top">
<Tooltip disabled={isRefreshing || !data.rows?.total} placement="top">
<Button
icon
size="s"
secondary
disabled={isRefreshing ||
!data.rows.total ||
!data.rows?.total ||
!(hasColumns && hasValidColumns) ||
disableButton}
class="small-button-dimensions"
Expand Down Expand Up @@ -299,7 +302,7 @@

<div class="databases-spreadsheet">
{#if hasColumns && hasValidColumns && $tableColumnSuggestions.force !== true}
{#if data.rows.total}
{#if data.rows?.total}
<Divider />
<SpreadSheet {data} bind:showRowCreateSheet={$showRowCreateSheet} />
{:else if $hasPageQueries}
Expand Down Expand Up @@ -347,7 +350,7 @@
</EmptySheet>
{/if}
{:else if isCloud && canShowSuggestionsSheet}
<SuggestionsEmptySheet userColumns={$tableColumns} userDataRows={data.rows.rows} />
<SuggestionsEmptySheet userColumns={$tableColumns} userDataRows={data.rows?.rows} />
{:else}
<EmptySheet mode="rows" showActions={$canWriteTables} title="You have no columns yet">
{#snippet subtitle()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@
{@const option = columnOptions.find(
(option) =>
option.type === column.type &&
option.format === ('format' in column ? column.format : undefined)
option.format ===
('format' in column && column.format ? column.format : undefined)
)}
{@const isSelectable =
column['system'] || column.type === 'relationship' ? 'disabled' : true}
Expand Down Expand Up @@ -425,7 +426,7 @@
{:else if column.key === '$id'}
<Icon icon={IconFingerPrint} size="s" />
{:else}
<Icon icon={option.icon} size="s" />
<Icon icon={option?.icon ?? IconViewList} size="s" />
{/if}

<Layout.Stack
Expand Down