mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 05:34:09 +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') {
|
if (key === 'colour') {
|
||||||
return { userEnteredValue: { stringValue: event[key] } };
|
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];
|
const dataType = typeof event[key];
|
||||||
if (dataType === 'number') {
|
if (dataType === 'number') {
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ export const parseExcel = (excelData: unknown[][], options?: Partial<ImportMap>)
|
|||||||
},
|
},
|
||||||
custom: (row: number, col: number, columnText: string) => {
|
custom: (row: number, col: number, columnText: string) => {
|
||||||
customFieldIndexes[col] = columnText;
|
customFieldIndexes[col] = columnText;
|
||||||
rundownMetadata[`custom-${columnText}`] = { row, col };
|
rundownMetadata[`custom:${columnText}`] = { row, col };
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user