From 527dec4d49e8d57d710ad780574ea0ceee379d9f Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 19 Feb 2025 12:35:24 -0500 Subject: [PATCH] Adjust validation table, add custom fields --- .../steps/ValidationStep/ValidationStep.tsx | 154 ++++--- inventory/src/pages/import/Import.tsx | 426 ++++++++++++------ 2 files changed, 378 insertions(+), 202 deletions(-) diff --git a/inventory/src/lib/react-spreadsheet-import/src/steps/ValidationStep/ValidationStep.tsx b/inventory/src/lib/react-spreadsheet-import/src/steps/ValidationStep/ValidationStep.tsx index d8330f8..d3843e9 100644 --- a/inventory/src/lib/react-spreadsheet-import/src/steps/ValidationStep/ValidationStep.tsx +++ b/inventory/src/lib/react-spreadsheet-import/src/steps/ValidationStep/ValidationStep.tsx @@ -411,93 +411,97 @@ export const ValidationStep = ({ initialData, file, onBack }:
-
-
-

- {translations.validationStep.title} -

-
- -
- - +
+
+
+

+ {translations.validationStep.title} +

+
+ +
+ + +
-
-
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} - - - {table.getRowModel().rows?.length ? ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - +
+
+
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + - {flexRender(cell.column.columnDef.cell, cell.getContext())} - + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + ))} - )) - ) : ( - - - {filterByErrors - ? translations.validationStep.noRowsMessageWhenFiltered - : translations.validationStep.noRowsMessage} - - - )} - -
+ ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + + {filterByErrors + ? translations.validationStep.noRowsMessageWhenFiltered + : translations.validationStep.noRowsMessage} + + + )} + + +
-
+
{onBack && (