refactor: eliminate automatic 'End of Life' (EOL) logic and yellow highlighting for OOC products with no stock

This commit is contained in:
Christian Vidal Wolf
2026-04-24 17:24:47 +02:00
parent 91fe855434
commit 9655da8164
-14
View File
@@ -184,14 +184,6 @@ export function ProductDescriptions({ data, headers, asinColumnIndex, onEdit, ro
}; };
const getRowColor = (row: ExcelRow) => { const getRowColor = (row: ExcelRow) => {
// EOL Rule: OOC Classification and 0 or negative stock (Item Available)
const classification = String(row[COLUMNS.CLASSIFICATION] || '').toUpperCase().trim();
const stock = Number(row[COLUMNS.ITEM_AVAILABLE] || 0);
if (classification === 'OOC' && stock <= 0) {
return 'bg-yellow-500/10 hover:bg-yellow-500/20'; // EOL Highlight
}
const fields = [ const fields = [
row[COLUMNS.LONG_DE], row[COLUMNS.LONG_EN], row[COLUMNS.LONG_DE], row[COLUMNS.LONG_EN],
row[COLUMNS.SHORT_DE], row[COLUMNS.SHORT_EN] row[COLUMNS.SHORT_DE], row[COLUMNS.SHORT_EN]
@@ -205,13 +197,7 @@ export function ProductDescriptions({ data, headers, asinColumnIndex, onEdit, ro
const Badge = ({ content, row }: { content: any, row: ExcelRow }) => { const Badge = ({ content, row }: { content: any, row: ExcelRow }) => {
if (content !== undefined && content !== null && content !== '') return <span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-500/20 text-green-400 border border-green-500/30"></span>; if (content !== undefined && content !== null && content !== '') return <span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-500/20 text-green-400 border border-green-500/30"></span>;
// EOL Exception: OOC and stock <= 0
const classification = String(row[COLUMNS.CLASSIFICATION] || '').toUpperCase().trim();
const stock = Number(row[COLUMNS.ITEM_AVAILABLE] || 0);
if (classification === 'OOC' && stock <= 0) {
return <span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-500/20 text-yellow-400 border border-yellow-500/30">EOL not neccessary</span>;
}
return <span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-500/20 text-red-400 border border-red-500/30"> Missing</span>; return <span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-500/20 text-red-400 border border-red-500/30"> Missing</span>;
}; };