Set UPC validation loading state to only show on item number field
This commit is contained in:
@@ -2,11 +2,8 @@
|
||||
4. Validation isn't happening beyond checking if a cell is required or not - needs to respect rules in import.tsx
|
||||
* Red cell outline if cell is required and it's empty
|
||||
* Red outline + alert circle icon with tooltip if cell is NOT empty and isn't valid
|
||||
5. Description column needs to have an expanded view of some sort, maybe a popover to allow for easier editing
|
||||
* Don't distort table to make it happen
|
||||
8. When you enter a value in 2+ cells before validation finishes, contents from all edited cells get erased when validation finishes
|
||||
9. Import dialog state not fully reset when closing? (validate data step appears scrolled to the middle of the table where I left it)
|
||||
10. UPC column doesn't need to show loading state when Item Number is being processed, only show on item number column
|
||||
11. Copy down needs to show a loading state on the cells that it will copy to
|
||||
15. Enhance copy down feature by allowing user to choose the last cell to copy to, instead of going all the way to the bottom
|
||||
|
||||
@@ -21,8 +18,11 @@
|
||||
✅FIXED 1. The red row background should go away when all cells in the row are valid and all required cells are populated
|
||||
✅FIXED 2. Columns alignment with header is slightly off, gets worse the further right you go
|
||||
✅FIXED 3. The copy down button is in the way of the validation error icon and the select open trigger - all three need to be in unique locations
|
||||
✅FIXED 5. Description column needs to have an expanded view of some sort, maybe a popover to allow for easier editing
|
||||
* Don't distort table to make it happen
|
||||
✅FIXED 6. Need to ensure all cell's contents don't overflow the input (truncate). COO does this currently, probably more
|
||||
✅FIXED 7. The template select cell is expanding, needs to be fixed size and truncate
|
||||
✅FIXED 10. UPC column doesn't need to show loading state when Item Number is being processed, only show on item number column
|
||||
✅FIXED 12. Shipping restrictions/tax category should default to ID 0 if we didn't get it elsewhere
|
||||
✅FIXED 13. Header row should be sticky (both up/down and left/right)
|
||||
✅FIXED 14. Need a way to scroll around table if user doesn't have mouse wheel for left/right
|
||||
|
||||
@@ -279,8 +279,8 @@ const ItemNumberCell = React.memo(({
|
||||
</div>
|
||||
)}
|
||||
{isValidating ? (
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<Loader2 className="h-4 w-4 animate-spin text-blue-500" />
|
||||
<div className={`flex items-center justify-center gap-2 border ${hasError || isRequiredButEmpty ? 'border-red-500' : 'border-input'} rounded-md h-10`}>
|
||||
<Loader2 className="h-4 w-4 animate-spin text-foreground ml-2" />
|
||||
<span>{displayValue || ''}</span>
|
||||
</div>
|
||||
) : (
|
||||
@@ -395,7 +395,7 @@ const ValidationCell = ({
|
||||
</div>
|
||||
)}
|
||||
{isValidating ? (
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<div className={`flex items-center justify-center gap-2 border ${hasError || isRequiredButEmpty ? 'border-red-500' : 'border-input'} rounded-sm px-2 py-1.5`}>
|
||||
<Loader2 className="h-4 w-4 animate-spin text-blue-500" />
|
||||
<span>Loading...</span>
|
||||
</div>
|
||||
|
||||
@@ -852,12 +852,11 @@ const ValidationContainer = <T extends string>({
|
||||
|
||||
// Memoize the enhanced validation table component
|
||||
const EnhancedValidationTable = useMemo(() => React.memo((props: React.ComponentProps<typeof ValidationTable>) => {
|
||||
// Create validatingCells set from validatingUpcRows, but only for UPC and item_number fields
|
||||
// This ensures supplier fields don't disappear during UPC validation
|
||||
// Create validatingCells set from validatingUpcRows, but only for item_number fields
|
||||
// This ensures only the item_number column shows loading state during UPC validation
|
||||
const validatingCells = new Set<string>();
|
||||
validatingUpcRows.forEach(rowIndex => {
|
||||
// Only mark the UPC and item_number cells as validating, NOT the supplier
|
||||
validatingCells.add(`${rowIndex}-upc`);
|
||||
// Only mark the item_number cells as validating, NOT the UPC or supplier
|
||||
validatingCells.add(`${rowIndex}-item_number`);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user