mirror of
https://github.com/cpvalente/ontime.git
synced 2026-07-26 10:38:55 +00:00
fix: group end elements should only send timertype data nothing else
This commit is contained in:
@@ -154,12 +154,6 @@ function getCellData(key: OntimeEntryCommonKeys | 'blank', entry: OntimeEntry) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// we need to flatten the milestones
|
||||
if (key.startsWith('custom')) {
|
||||
const customKey = key.split(':')[1];
|
||||
return { userEnteredValue: { stringValue: entry.custom[customKey] } };
|
||||
}
|
||||
|
||||
// we need to remap the event type to timer type in the case of groups and milestones
|
||||
if (key === 'timerType') {
|
||||
if (isOntimeGroup(entry))
|
||||
@@ -168,6 +162,17 @@ function getCellData(key: OntimeEntryCommonKeys | 'blank', entry: OntimeEntry) {
|
||||
return { userEnteredValue: { stringValue: entry.timerType } };
|
||||
}
|
||||
|
||||
// all other data is not relevant for the group end entry
|
||||
if (entry.id.startsWith('group-end')) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// we need to flatten the milestones
|
||||
if (key.startsWith('custom')) {
|
||||
const customKey = key.split(':')[1];
|
||||
return { userEnteredValue: { stringValue: entry.custom[customKey] } };
|
||||
}
|
||||
|
||||
// typescript cannot guarantee that the key exists for every entry
|
||||
// so we check for the key existence and assert the type
|
||||
if (!(key in entry)) return {};
|
||||
|
||||
Reference in New Issue
Block a user