Fix initial columns size

This commit is contained in:
Laurent Nguyen 2024-03-20 14:22:25 +01:00
parent 8f5479923d
commit 4a3b092b8b
2 changed files with 10 additions and 8 deletions

View File

@ -440,7 +440,6 @@ const DocumentsTabComponent: React.FunctionComponent<{
}
}
return item;
// TODO: for now, merge all the pk values into a single string/column
// type: documentId.partitionKeyProperties ? documentId.stringPartitionKeyValues.join(",") : undefined,

View File

@ -65,19 +65,22 @@ export const DocumentsTableComponent: React.FC<IDocumentsTableComponentProps> =
const [activeItemIndex, setActiveItemIndex] = React.useState<number>(undefined);
const [columnSizingOptions, setColumnSizingOptions] = React.useState<TableColumnSizingOptions>({
const initialSizingOptions: TableColumnSizingOptions = {
id: {
idealWidth: 280,
// minWidth: 273,
},
// TODO FIX THIS
// type: {
// defaultWidth: 100,
// // minWidth: 110,
// // defaultWidth: 120,
// },
};
columnHeaders.partitionKeyHeaders.forEach((pkHeader) => {
initialSizingOptions[pkHeader] = {
idealWidth: 200,
minWidth: 50,
};
});
const [columnSizingOptions, setColumnSizingOptions] = React.useState<TableColumnSizingOptions>(initialSizingOptions);
const onColumnResize = React.useCallback((_, { columnId, width }) => {
setColumnSizingOptions((state) => ({
...state,