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
5 changes: 5 additions & 0 deletions src/components/QueryResultTable/QueryResultTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const TABLE_SETTINGS: Settings = {
...DEFAULT_TABLE_SETTINGS,
stripedRows: true,
sortable: false,
displayIndices: true,
};

export const b = cn('ydb-query-result-table');
Expand Down Expand Up @@ -69,6 +70,9 @@ const prepareGenericColumns = (data: KeyValueRow[]) => {

const getRowIndex = (_: unknown, index: number) => index;

// Display row number in format 1-10 instead of 0-9
const getVisibleRowIndex = (_: unknown, index: number) => index + 1;

interface QueryResultTableProps
extends Omit<ResizeableDataTableProps<KeyValueRow>, 'data' | 'columns'> {
data?: KeyValueRow[];
Expand Down Expand Up @@ -100,6 +104,7 @@ export const QueryResultTable = (props: QueryResultTableProps) => {
settings={TABLE_SETTINGS}
// prevent accessing row.id in case it is present but is not the PK (i.e. may repeat)
rowKey={getRowIndex}
visibleRowIndex={getVisibleRowIndex}
{...restProps}
/>
);
Expand Down
1 change: 1 addition & 0 deletions src/styles/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
max-width: 600px;

cursor: pointer;
vertical-align: middle;
white-space: nowrap;
text-overflow: ellipsis;
}
Expand Down
Loading