Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions webapp/packages/plugin-object-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@cloudbeaver/plugin-navigation-tabs": "workspace:*",
"@cloudbeaver/plugin-navigation-tree": "workspace:*",
"@dbeaver/js-helpers": "workspace:^",
"@dbeaver/ui-kit": "workspace:^",
"mobx": "^6",
"mobx-react-lite": "^4",
"react": "^19",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@
composes: theme-background-surface theme-text-on-surface theme-border-color-background from global;
border-top: 1px solid;
}

.boolean {
display: flex;
align-items: center;
justify-content: center;

&[data-disabled] {
opacity: 1;
}
}

@layer components {
.boolean {
composes: checkbox-markup-theme--tertiary from global;
--dbv-kit-checkbox-border-width: 1px;
--dbv-kit-checkbox-check-size: 0.8;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { useService } from '@cloudbeaver/core-di';
import { type DBObject, NavTreeResource } from '@cloudbeaver/core-navigation-tree';
import { useTabLocalState } from '@cloudbeaver/core-ui';
import { DataGrid, useCreateGridReactiveValue } from '@cloudbeaver/plugin-data-grid';
import { getObjectPropertyDisplayValue } from '@cloudbeaver/core-sdk';
import { getObjectPropertyDisplayValue, getObjectPropertyType, getObjectPropertyValue } from '@cloudbeaver/core-sdk';
import { Checkbox } from '@dbeaver/ui-kit';

import { ObjectPropertyTableFooter } from '../ObjectPropertyTableFooter.js';
import classes from './Table.module.css';
Expand Down Expand Up @@ -76,7 +77,19 @@ export const Table = observer<TableProps>(function Table({ objects, hasNextPage,
}

const property = objects[rowIdx]?.object?.properties?.[colIdx];
return property ? getObjectPropertyDisplayValue(property) : '';

if (property) {
const type = getObjectPropertyType(property);

if (type === 'checkbox') {
const value = getObjectPropertyValue(property);
return <Checkbox className={s(styles, { boolean: true })} size="small" checked={value} disabled />;
}

return getObjectPropertyDisplayValue(property);
}

return '';
}
const cell = useCreateGridReactiveValue(getCell, (onValueChange, rowIdx, colIdx) => reaction(() => getCell(rowIdx, colIdx), onValueChange), [
objects,
Expand Down
3 changes: 3 additions & 0 deletions webapp/packages/plugin-object-viewer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"composite": true
},
"references": [
{
"path": "../../common-react/@dbeaver/ui-kit"
},
{
"path": "../../common-typescript/@dbeaver/js-helpers"
},
Expand Down
1 change: 1 addition & 0 deletions webapp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3374,6 +3374,7 @@ __metadata:
"@cloudbeaver/plugin-navigation-tree": "workspace:*"
"@cloudbeaver/tsconfig": "workspace:*"
"@dbeaver/js-helpers": "workspace:^"
"@dbeaver/ui-kit": "workspace:^"
"@types/react": "npm:^19"
mobx: "npm:^6"
mobx-react-lite: "npm:^4"
Expand Down
Loading