Feat: export custom fileds to sheets (#926)

* export custom keys to sheets

* use `:` in place of `-`
This commit is contained in:
Alex Christoffer Rasmussen
2024-04-29 15:15:18 +02:00
committed by GitHub
parent b52fb0f9ee
commit 5e39c9b51f
2 changed files with 5 additions and 1 deletions
@@ -121,6 +121,10 @@ function getCellData(key: string, event: OntimeRundownEntry) {
if (key === 'colour') {
return { userEnteredValue: { stringValue: event[key] } };
}
if (key.startsWith('custom')) {
const customKey = key.split(':')[1];
return { userEnteredValue: { stringValue: event.custom[customKey] } };
}
const dataType = typeof event[key];
if (dataType === 'number') {
+1 -1
View File
@@ -180,7 +180,7 @@ export const parseExcel = (excelData: unknown[][], options?: Partial<ImportMap>)
},
custom: (row: number, col: number, columnText: string) => {
customFieldIndexes[col] = columnText;
rundownMetadata[`custom-${columnText}`] = { row, col };
rundownMetadata[`custom:${columnText}`] = { row, col };
},
} as const;