Skip to content

Conversation

@SychevAndrey
Copy link
Contributor

Screenshot 2026-01-09 at 15 19 19 Screenshot 2026-01-09 at 15 20 31 Screenshot 2026-01-09 at 15 20 21 Screenshot 2026-01-09 at 15 19 35

For read-only connection we write "Read-only connection" in the tooltip,
If. there is other reason, we just write "Read-only" with the reason on the next line


const firstColumn = tableDataContext.columns[1];
const firstColumnData =
firstColumn?.key !== null && firstColumn?.key !== undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
firstColumn?.key !== null && firstColumn?.key !== undefined
isNotNullDefined(firstColumn?.key)

{readonly && (
<IconOrImage title={translate('data_grid_table_readonly_tooltip')} icon="/icons/lock.png" className={s(styles, { iconOrImage: true })} />
)}
<TableStatusIndicator readOnlyConnection={dataGridContext.model.isReadonly(dataGridContext.resultIndex)} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like this prop not needed, component itself uses dataGridContext and can retrieve this information by itself

Comment on lines +87 to +93
<div
className={clsx(
'tw:w-3 tw:h-3 tw:rounded-full tw:shrink-0 tw:bg-transparent tw:border',
"tw:before:content-[''] tw:before:block tw:before:w-1.5 tw:before:h-1.5 tw:before:rounded-full tw:before:m-0.5",
`tw:border-(--theme-${themeColor}) tw:before:bg-(--theme-${themeColor})`,
)}
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need to always show this indicator? if table is normal table without restrictions and limitations, what the purpose of this indicator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image To show the primary key of a table

Comment on lines +48 to +70
if (readOnlyConnection) {
tooltipParts.push(translate('data_grid_table_readonly_connection_tooltip'));
}

if (readOnlyStatus) {
if (!readOnlyConnection) {
tooltipParts.push(translate('data_grid_table_readonly_tooltip'));
}
tooltipParts.push(readOnlyStatus);
}

if (hasRowIdentifier) {
// TEMPORARY: Detect primary key by checking for required and not read-only columns
// TODO: Remove when backend provides the information
const pkColumn = tableDataContext.columns.find(col => {
const colData = col.key && (tableDataContext.data.getColumn(col.key) as SqlResultColumn | undefined);
return colData?.required && !colData?.readOnly;
})?.key;

if (pkColumn) {
tooltipParts.push(`Unique key: ${(tableDataContext.data.getColumn(pkColumn) as SqlResultColumn | undefined)?.name}`);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure that it's good idea to try to implement this logic on frontend, because it might be different from dbeaver or incomplete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants