feat: allow existing custom fields to keep its type on excel import (#1976)

This commit is contained in:
Alex Christoffer Rasmussen
2026-02-17 07:59:27 +08:00
committed by GitHub
parent c3a7cd6a39
commit 0b3ba65df3
@@ -33,10 +33,11 @@ export function getCustomFieldData(
// we lower case the excel key to make it easier to match // we lower case the excel key to make it easier to match
const columnNameInExcel = importMap.custom[ontimeLabel].toLowerCase(); const columnNameInExcel = importMap.custom[ontimeLabel].toLowerCase();
const maybeExistingColour = existingCustomFields[keyInCustomFields]?.colour ?? ''; const maybeExistingColour = existingCustomFields[keyInCustomFields]?.colour ?? '';
const maybeExistingType = existingCustomFields[keyInCustomFields]?.type ?? 'text';
// 1. add the custom field to the merged custom fields // 1. add the custom field to the merged custom fields
mergedCustomFields[keyInCustomFields] = { mergedCustomFields[keyInCustomFields] = {
type: 'text', // we currently only support text custom fields type: maybeExistingType,
colour: maybeExistingColour, colour: maybeExistingColour,
label: ontimeLabel, label: ontimeLabel,
}; };