mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
feat: allow existing custom fields to keep its type on excel import (#1976)
This commit is contained in:
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,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user