fix(plugin-object-viewer): CB-1029 metadata editor table stretch

This commit is contained in:
Wroud
2021-05-31 16:03:40 +03:00
parent f4eb6161f2
commit 7f56ead38d
2 changed files with 14 additions and 9 deletions
@@ -7,7 +7,6 @@
*/
import { observer } from 'mobx-react-lite';
import styled, { css } from 'reshadow';
import { useDatabaseObjectInfo } from '@cloudbeaver/core-app';
import { TableHeader, TableBody, Table } from '@cloudbeaver/core-blocks';
@@ -19,19 +18,13 @@ interface ObjectChildrenPropertyTableProps {
nodeIds: string[];
}
const styles = css`
Table {
flex: auto;
}
`;
export const ObjectChildrenPropertyTable = observer(function ObjectPropertyTable({
nodeIds,
}: ObjectChildrenPropertyTableProps) {
const firstChild = nodeIds[0] || '';
const properties = useDatabaseObjectInfo(firstChild).dbObject?.properties;
return styled(styles)(
return (
<Table>
<TableHeader>
<Header properties={properties || []} />
@@ -7,14 +7,22 @@
*/
import { observer } from 'mobx-react-lite';
import styled from 'reshadow';
import { useChildren } from '@cloudbeaver/core-app';
import { Loader, TextPlaceholder } from '@cloudbeaver/core-blocks';
import { useTranslate } from '@cloudbeaver/core-localization';
import { css } from '@reshadow/react';
import { useObjectFolder } from '../../useObjectFolder';
import { ObjectChildrenPropertyTable } from './ObjectChildrenPropertyTable';
const styles = css`
div {
flex: auto;
}
`;
interface ObjectPropertyTableProps {
objectId: string;
parentId: string;
@@ -36,7 +44,11 @@ export const ObjectPropertyTable = observer(function ObjectPropertyTable({
return <TextPlaceholder>{translate('plugin_object_viewer_table_no_items')}</TextPlaceholder>;
}
return <ObjectChildrenPropertyTable nodeIds={children.children} />;
return styled(styles)(
<div>
<ObjectChildrenPropertyTable nodeIds={children.children} />
</div>
);
});
export const objectPropertyTablePanel = (parentId: string, objectId: string) => (