Client: Fixed spool select table formatting
This commit is contained in:
@@ -23,6 +23,7 @@ interface BaseColumnProps<Obj> {
|
|||||||
i18nkey?: string;
|
i18nkey?: string;
|
||||||
dataSource: Obj[];
|
dataSource: Obj[];
|
||||||
tableState: TableState;
|
tableState: TableState;
|
||||||
|
width?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FilteredColumnProps {
|
interface FilteredColumnProps {
|
||||||
@@ -54,6 +55,9 @@ function Column<Obj>(props: BaseColumnProps<Obj> & FilteredColumnProps & CustomC
|
|||||||
sortOrder: getSortOrderForField(typedSorters, props.dataId ?? props.id),
|
sortOrder: getSortOrderForField(typedSorters, props.dataId ?? props.id),
|
||||||
filterMultiple: props.allowMultipleFilters ?? true,
|
filterMultiple: props.allowMultipleFilters ?? true,
|
||||||
};
|
};
|
||||||
|
if (props.width) {
|
||||||
|
columnProps.width = props.width;
|
||||||
|
}
|
||||||
if (props.filters && props.filteredValue) {
|
if (props.filters && props.filteredValue) {
|
||||||
columnProps.filters = props.filters;
|
columnProps.filters = props.filters;
|
||||||
columnProps.filteredValue = props.filteredValue;
|
columnProps.filteredValue = props.filteredValue;
|
||||||
|
|||||||
@@ -112,13 +112,7 @@ const SpoolSelectModal: React.FC<Props> = ({ visible, description, onCancel, onC
|
|||||||
{contextHolder}
|
{contextHolder}
|
||||||
<Space direction="vertical" style={{ width: "100%" }}>
|
<Space direction="vertical" style={{ width: "100%" }}>
|
||||||
{description && <div>{description}</div>}
|
{description && <div>{description}</div>}
|
||||||
<Table
|
<Table {...tableProps} rowKey="id" dataSource={dataSource} pagination={false} scroll={{ y: 200 }}>
|
||||||
{...tableProps}
|
|
||||||
rowKey="id"
|
|
||||||
dataSource={dataSource}
|
|
||||||
pagination={false}
|
|
||||||
scroll={{ x: "max-content", y: 200 }}
|
|
||||||
>
|
|
||||||
<Table.Column
|
<Table.Column
|
||||||
width={50}
|
width={50}
|
||||||
render={(_, item: ISpool) => (
|
render={(_, item: ISpool) => (
|
||||||
@@ -130,6 +124,7 @@ const SpoolSelectModal: React.FC<Props> = ({ visible, description, onCancel, onC
|
|||||||
i18ncat: "spool",
|
i18ncat: "spool",
|
||||||
dataSource,
|
dataSource,
|
||||||
tableState,
|
tableState,
|
||||||
|
width: 80,
|
||||||
})}
|
})}
|
||||||
{SpoolIconColumn({
|
{SpoolIconColumn({
|
||||||
id: "combined_name",
|
id: "combined_name",
|
||||||
|
|||||||
Reference in New Issue
Block a user