Client: Added some missing columns in table

Also configured the default columns to show
This commit is contained in:
Donkie
2023-07-14 12:05:05 +02:00
parent 14e758ea23
commit bfb63cbfdc
5 changed files with 65 additions and 2 deletions

View File

@@ -77,14 +77,23 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
"filament_name",
"used_weight",
"remaining_weight",
"used_length",
"remaining_length",
"location",
"lot_nr",
"first_used",
"last_used",
"registered",
"comment",
];
const defaultColumns = allColumns.filter(
(column_id) =>
["registered", "used_length", "remaining_length", "lot_nr"].indexOf(
column_id
) === -1
);
const [showColumns, setShowColumns] = React.useState<string[]>(
initialState.showColumns ?? allColumns
initialState.showColumns ?? defaultColumns
);
// Type the sorters and filters
@@ -208,6 +217,23 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
dataSource,
tableState,
})}
{NumberColumn({
id: "used_length",
i18ncat: "spool",
unit: "mm",
decimals: 0,
dataSource,
tableState,
})}
{NumberColumn({
id: "remaining_length",
i18ncat: "spool",
unit: "mm",
decimals: 0,
defaultText: t("unknown"),
dataSource,
tableState,
})}
{FilteredColumn({
id: "location",
i18ncat: "spool",
@@ -232,6 +258,12 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
dataSource,
tableState,
})}
{DateColumn({
id: "registered",
i18ncat: "spool",
dataSource,
tableState,
})}
{SortedColumn({
id: "comment",
i18ncat: "spool",