handle timer type whitespace (#1225)

This commit is contained in:
Alex Christoffer Rasmussen
2024-09-28 20:34:04 +02:00
committed by GitHub
parent 8a5cef79a8
commit 78e2f217a4
3 changed files with 157 additions and 24 deletions
+4 -3
View File
@@ -195,11 +195,12 @@ export const parseExcel = (excelData: unknown[][], options?: Partial<ImportMap>)
const column = row[j];
// 1. we check if we have set a flag for a known field
if (j === timerTypeIndex) {
if (column === 'block') {
const maybeTimeType = makeString(column, '');
if (maybeTimeType === 'block') {
event.type = SupportedEvent.Block;
} else if (column === '' || isKnownTimerType(column)) {
} else if (maybeTimeType === '' || isKnownTimerType(maybeTimeType)) {
event.type = SupportedEvent.Event;
event.timerType = validateTimerType(column);
event.timerType = validateTimerType(maybeTimeType);
} else {
// if it is not a block or a known type, we dont import it
return;