-
Notifications
You must be signed in to change notification settings - Fork 529
dbeaver/pro#4999 Data editor icons to see pk details #4040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
serge-rider
merged 14 commits into
devel
from
4999-cb-5633-data-editor-icons-to-see-pk-details
Feb 10, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8ef4207
dbeaver/pro#4999 feat: add TableStatusIndicator component and update …
SychevAndrey 19b47c0
dbeaver/pro#4999 feat: update TableStatusIndicator to handle read-onl…
SychevAndrey 5d9ce80
Merge branch 'devel' into 4999-cb-5633-data-editor-icons-to-see-pk-de…
SychevAndrey 81aa2a1
dbeaver/pro#4999 feat: use new backend endpoint to provide info about…
SychevAndrey 4c72715
Merge branch 'devel' into 4999-cb-5633-data-editor-icons-to-see-pk-de…
SychevAndrey 0f630b8
Merge branch 'devel' into 4999-cb-5633-data-editor-icons-to-see-pk-de…
SychevAndrey b3ca642
dbeaver/pro#4999 refactor: simplify TableStatusIndicator by removing …
SychevAndrey b4076b4
dbeaver/pro#4999 refactor: move hasElementIdentifier to ResultSetData…
SychevAndrey 10e9b54
pr fixes
sergeyteleshev bd85526
Merge branch 'devel' into 4999-cb-5633-data-editor-icons-to-see-pk-de…
sergeyteleshev e510296
Merge branch 'devel' into 4999-cb-5633-data-editor-icons-to-see-pk-de…
sergeyteleshev 1be5042
fixes indicator center position + removes duplicated translation
sergeyteleshev f11df70
Merge branch 'devel' into 4999-cb-5633-data-editor-icons-to-see-pk-de…
dariamarutkina 0cbd60b
fixes contrast for color-status (JSON edit row + keys indicator for t…
sergeyteleshev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...lugin-data-spreadsheet-new/src/DataGrid/TableColumnHeader/TableStatusIndicator.module.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2026 DBeaver Corp and others | ||
| * | ||
| * Licensed under the Apache License, Version 2.0. | ||
| * you may not use this file except in compliance with the License. | ||
| */ | ||
|
|
||
| .indicator { | ||
| width: 12px; | ||
| height: 12px; | ||
| border-radius: 50%; | ||
| flex-shrink: 0; | ||
| border: 1px solid; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .primaryKey { | ||
| border-color: var(--theme-positive); | ||
| background: radial-gradient(circle, var(--theme-positive) 2.5px, transparent 3.5px); | ||
| } | ||
|
|
||
| .virtualKey { | ||
| border-color: var(--theme-link-color); | ||
| background: radial-gradient(circle, var(--theme-link-color) 2.5px, transparent 3.5px); | ||
| } | ||
|
|
||
| .defaultStatus { | ||
| border-color: var(--theme-status); | ||
| background: radial-gradient(circle, var(--theme-status) 2.5px, transparent 3.5px); | ||
| } |
81 changes: 81 additions & 0 deletions
81
...kages/plugin-data-spreadsheet-new/src/DataGrid/TableColumnHeader/TableStatusIndicator.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2026 DBeaver Corp and others | ||
| * | ||
| * Licensed under the Apache License, Version 2.0. | ||
| * you may not use this file except in compliance with the License. | ||
| */ | ||
| import { SqlRowIdentifierState, type SqlResultColumn } from '@cloudbeaver/core-sdk'; | ||
| import { observer } from 'mobx-react-lite'; | ||
| import { useContext } from 'react'; | ||
|
|
||
| import { IconOrImage, s, useS, useTranslate } from '@cloudbeaver/core-blocks'; | ||
| import { isResultSetDataSource } from '@cloudbeaver/plugin-data-viewer'; | ||
|
|
||
| import { DataGridContext } from '../DataGridContext.js'; | ||
| import { TableDataContext } from '../TableDataContext.js'; | ||
| import { isNotNullDefined } from '@dbeaver/js-helpers'; | ||
| import styles from './TableStatusIndicator.module.css'; | ||
|
|
||
| export const TableStatusIndicator = observer(function TableStatusIndicator() { | ||
| const dataGridContext = useContext(DataGridContext); | ||
| const tableDataContext = useContext(TableDataContext); | ||
| const readOnlyConnection = dataGridContext.model.isReadonly(dataGridContext.resultIndex); | ||
| const translate = useTranslate(); | ||
| const style = useS(styles); | ||
|
|
||
| if (!tableDataContext || !dataGridContext) { | ||
| return null; | ||
| } | ||
|
|
||
| const source = dataGridContext.model.source; | ||
| const resultSetSource = isResultSetDataSource(source) ? source : null; | ||
| const rowIdentifierInfo = resultSetSource?.getRowIdentifierInfo(dataGridContext.resultIndex); | ||
| const hasRowIdentifier = resultSetSource?.hasElementIdentifier(dataGridContext.resultIndex); | ||
|
|
||
| const firstColumn = tableDataContext.columns[1]; | ||
| const firstColumnData = isNotNullDefined(firstColumn?.key) | ||
| ? (tableDataContext.data.getColumn(firstColumn.key) as SqlResultColumn | undefined) | ||
| : undefined; | ||
| const readOnlyStatus = firstColumnData?.readOnlyStatus; | ||
|
|
||
| const isVirtualKey = rowIdentifierInfo?.state === SqlRowIdentifierState.VirtualKey; | ||
| const isPrimaryKey = rowIdentifierInfo?.state === SqlRowIdentifierState.PrimaryKey; | ||
| const tooltipParts: string[] = []; | ||
|
|
||
| if (readOnlyConnection) { | ||
| tooltipParts.push(translate('data_grid_table_readonly_connection_tooltip')); | ||
| } | ||
|
|
||
| if (readOnlyStatus) { | ||
| tooltipParts.push(readOnlyStatus); | ||
| } | ||
|
|
||
| if (hasRowIdentifier && rowIdentifierInfo?.identifier) { | ||
| const constraintType = rowIdentifierInfo.identifier.constraintType; | ||
| const attributeNames = rowIdentifierInfo.identifier.attributes.map(attr => attr.name).join(', '); | ||
| tooltipParts.push(`${constraintType}: ${attributeNames}`); | ||
| } else if (isVirtualKey) { | ||
| tooltipParts.push(translate('data_grid_table_virtual_key_tooltip')); | ||
| } | ||
|
|
||
| const tooltip = tooltipParts.join('\n'); | ||
|
|
||
| return ( | ||
| <div | ||
| title={tooltip} | ||
| className="tw:absolute tw:top-1/2 tw:left-1 tw:-translate-y-1/2 tw:z-1 tw:pointer-events-auto tw:flex tw:items-center tw:gap-1 tw:cursor-help" | ||
| > | ||
| {readOnlyConnection && <IconOrImage icon="/icons/lock.png" className="tw:w-2.5 tw:cursor-help" />} | ||
| <div | ||
| className={s( | ||
| style, | ||
| { indicator: true }, | ||
| isPrimaryKey && style['primaryKey'], | ||
| isVirtualKey && style['virtualKey'], | ||
| !isPrimaryKey && !isVirtualKey && style['defaultStatus'], | ||
| )} | ||
| /> | ||
|
Wroud marked this conversation as resolved.
|
||
| </div> | ||
| ); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.