mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-05 15:33:59 +00:00
Feat: export custom fileds to sheets (#926)
* export custom keys to sheets * use `:` in place of `-`
This commit is contained in:
committed by
GitHub
parent
b52fb0f9ee
commit
5e39c9b51f
@@ -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') {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user