Client: Fixed spool select table formatting

This commit is contained in:
Donkie
2023-09-16 11:01:40 +02:00
parent 9c2504d073
commit 58fdbb4d85
2 changed files with 6 additions and 7 deletions

View File

@@ -23,6 +23,7 @@ interface BaseColumnProps<Obj> {
i18nkey?: string;
dataSource: Obj[];
tableState: TableState;
width?: number;
}
interface FilteredColumnProps {
@@ -54,6 +55,9 @@ function Column<Obj>(props: BaseColumnProps<Obj> & FilteredColumnProps & CustomC
sortOrder: getSortOrderForField(typedSorters, props.dataId ?? props.id),
filterMultiple: props.allowMultipleFilters ?? true,
};
if (props.width) {
columnProps.width = props.width;
}
if (props.filters && props.filteredValue) {
columnProps.filters = props.filters;
columnProps.filteredValue = props.filteredValue;

View File

@@ -112,13 +112,7 @@ const SpoolSelectModal: React.FC<Props> = ({ visible, description, onCancel, onC
{contextHolder}
<Space direction="vertical" style={{ width: "100%" }}>
{description && <div>{description}</div>}
<Table
{...tableProps}
rowKey="id"
dataSource={dataSource}
pagination={false}
scroll={{ x: "max-content", y: 200 }}
>
<Table {...tableProps} rowKey="id" dataSource={dataSource} pagination={false} scroll={{ y: 200 }}>
<Table.Column
width={50}
render={(_, item: ISpool) => (
@@ -130,6 +124,7 @@ const SpoolSelectModal: React.FC<Props> = ({ visible, description, onCancel, onC
i18ncat: "spool",
dataSource,
tableState,
width: 80,
})}
{SpoolIconColumn({
id: "combined_name",