mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:05:25 +02:00
fix(sync): trust Dropbox data
This commit is contained in:
-41
@@ -338,37 +338,6 @@ export default function App() {
|
||||
}
|
||||
|
||||
const resolvedCols = resolveColumnIndices(extendedHeaders);
|
||||
const editableColumns = new Set([
|
||||
resolvedCols.CLASSIFICATION,
|
||||
resolvedCols.LONG_DE,
|
||||
resolvedCols.LONG_EN,
|
||||
resolvedCols.SHORT_DE,
|
||||
resolvedCols.SHORT_EN,
|
||||
resolvedCols.DETAILS_DE,
|
||||
resolvedCols.DETAILS_EN,
|
||||
resolvedCols.INNER_L,
|
||||
resolvedCols.INNER_W,
|
||||
resolvedCols.INNER_H,
|
||||
resolvedCols.OUTER_L,
|
||||
resolvedCols.OUTER_W,
|
||||
resolvedCols.OUTER_H,
|
||||
resolvedCols.UNITS_OUTER,
|
||||
resolvedCols.MOQ,
|
||||
resolvedCols.VERIFIED_DIMS,
|
||||
resolvedCols.VALIDATED_CHECK,
|
||||
resolvedCols.VALIDATED_NOTE,
|
||||
resolvedCols.PRODUCT_TYPE,
|
||||
resolvedCols.ITEM_TO_LOGISTIC,
|
||||
resolvedCols.CPNP_NO
|
||||
]);
|
||||
|
||||
headers.forEach((h: any, i: number) => {
|
||||
const headerText = String(h || '').toLowerCase();
|
||||
if (headerText.includes('srp') || headerText.includes('uvp') || headerText.includes('price')) {
|
||||
editableColumns.add(i);
|
||||
}
|
||||
});
|
||||
|
||||
const articleNoIdx = resolvedCols.ARTICLE_NO;
|
||||
const processedRows = rows.map(row => {
|
||||
const articleNo = String(row[articleNoIdx]);
|
||||
@@ -425,16 +394,6 @@ export default function App() {
|
||||
finalRow[COLUMNS.CPNP_NO] = legacyCpnp;
|
||||
}
|
||||
|
||||
// When a row is still in an edited/pending state, restore editable business fields too.
|
||||
// This includes historical CPNP edits that were persisted directly in products.
|
||||
if (synced?.status === 'pending' || synced?.status === 'edited') {
|
||||
editableColumns.forEach(idx => {
|
||||
if (idx < 100 && sourceForInternal[idx] !== undefined && sourceForInternal[idx] !== null) {
|
||||
finalRow[idx] = sourceForInternal[idx];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update row status in UI if it's not the default 'excel'
|
||||
if (synced?.status && synced.status !== 'excel') {
|
||||
setRowStatuses(prev => ({ ...prev, [articleNo]: synced.status! }));
|
||||
|
||||
Reference in New Issue
Block a user