mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +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 {};
|
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
|
// we need to remap the event type to timer type in the case of groups and milestones
|
||||||
if (key === 'timerType') {
|
if (key === 'timerType') {
|
||||||
if (isOntimeGroup(entry))
|
if (isOntimeGroup(entry))
|
||||||
@@ -168,6 +162,17 @@ function getCellData(key: OntimeEntryCommonKeys | 'blank', entry: OntimeEntry) {
|
|||||||
return { userEnteredValue: { stringValue: entry.timerType } };
|
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
|
// typescript cannot guarantee that the key exists for every entry
|
||||||
// so we check for the key existence and assert the type
|
// so we check for the key existence and assert the type
|
||||||
if (!(key in entry)) return {};
|
if (!(key in entry)) return {};
|
||||||
|
|||||||
Reference in New Issue
Block a user