Skip to content

Commit

Permalink
Pass rowKey directly to RowCell
Browse files Browse the repository at this point in the history
  • Loading branch information
pavish committed Apr 17, 2023
1 parent c88341f commit 4e1af61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mathesar_ui/src/systems/table-view/row/Row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
hasErrors={hasAnyErrors}
/>
<ContextMenu>
<RowContextOptions recordId={String(rowKey)} {recordsData} {row} />
<RowContextOptions recordId={rowKey} {recordsData} {row} />
</ContextMenu>
{/if}
</div>
Expand Down Expand Up @@ -136,7 +136,7 @@
bind:value={row.record[columnId]}
{processedColumn}
{recordsData}
{primaryKeyColumnId}
{rowKey}
/>
{/each}
{/if}
Expand Down
6 changes: 2 additions & 4 deletions mathesar_ui/src/systems/table-view/row/RowCell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
type CellKey,
type ProcessedColumn,
type TabularDataSelection,
getRowKey,
} from '@mathesar/stores/table-data';
import {
isCellActive,
Expand Down Expand Up @@ -46,7 +45,7 @@
export let processedColumn: ProcessedColumn;
export let clientSideErrorMap: WritableMap<CellKey, string[]>;
export let value: unknown = undefined;
export let primaryKeyColumnId: number | undefined;
export let rowKey: string;
const userProfile = getUserProfileStoreFromContext();
Expand All @@ -63,7 +62,6 @@
$: columnId = column.id;
$: ({ activeCell, selectedCells } = selection);
$: isActive = $activeCell && isCellActive($activeCell, row, processedColumn);
$: rowKey = getRowKey(row, primaryKeyColumnId);
/**
* The name indicates that this boolean is only true when more than one cell
Expand Down Expand Up @@ -202,7 +200,7 @@
<!-- Column Attributes end -->
<MenuDivider />
<!-- Row -->
<RowContextOptions recordId={String(rowKey)} {recordsData} {row} />
<RowContextOptions recordId={rowKey} {recordsData} {row} />
<!-- Row end -->
{#if linkedRecordHref}
<LinkMenuItem icon={iconLinkToRecordPage} href={linkedRecordHref}>
Expand Down

0 comments on commit 4e1af61

Please sign in to comment.