Fix for storage locations import [SCI-11152]

This commit is contained in:
Anton 2024-10-08 14:39:08 +02:00
parent 920505d59c
commit e88cc66e69
2 changed files with 4 additions and 2 deletions

View file

@ -15,7 +15,7 @@ module StorageLocations
end
def import_items
@rows = SpreadsheetParser.spreadsheet_enumerator(@sheet).reject { |r| r.all?(&:blank?) }
@rows = SpreadsheetParser.spreadsheet_enumerator(@sheet).to_a
# Check if the file has proper headers
header = SpreadsheetParser.parse_row(@rows[0], @sheet)
@ -73,6 +73,8 @@ module StorageLocations
repository_row_id: (row[1].to_s.gsub('IT', '') if row[1].present?)
}
end
@rows.reject! { |r| r[:repository_row_id].blank? && r[:position].blank? }
end
def import_row!(row)

View file

@ -2709,7 +2709,7 @@ en:
import_modal:
import_button: 'Import items'
title: "Import items to a box"
description: "Import items to a box allows for assigning items to a box and updating positions within a grid box. First, export the current box data to download a file listing the items already in the box. Then, edit the exported file to add or update the items you want to place in the box. When importing the file, ensure it includes the Position and Item ID columns for a successful import."
description: "Import items to a box allows for assigning items to a box and updating positions within a grid box. First, export the current box data to download a file listing the items already in the box. Then, edit the exported file to add or update the items you want to place in the box. When importing the file, ensure it includes the Box position and Item ID columns for a successful import."
export: "Export"
export_button: "Export current box"
import: "Import"