fix: parse nested events in rundown

This commit is contained in:
Carlos Valente
2025-07-14 09:08:29 +02:00
parent 6f9e13948d
commit 1e5081f4a2
3 changed files with 35 additions and 13 deletions
@@ -1,4 +1,12 @@
import { SupportedEntry, OntimeEvent, OntimeDelay, OntimeBlock, Rundown, CustomField } from 'ontime-types';
import {
SupportedEntry,
OntimeEvent,
OntimeDelay,
OntimeBlock,
Rundown,
CustomField,
OntimeMilestone,
} from 'ontime-types';
import { defaultRundown } from '../../../models/dataModel.js';
@@ -13,6 +21,12 @@ const baseBlock = {
entries: [],
};
const baseMilestone = {
type: SupportedEntry.Milestone,
cue: '',
title: '',
};
/**
* Utility to create a Ontime event
*/
@@ -37,6 +51,13 @@ export function makeOntimeBlock(patch: Partial<OntimeBlock>): OntimeBlock {
return { id: 'block', ...baseBlock, ...patch } as OntimeBlock;
}
/**
* Utility to create a block event
*/
export function makeOntimeMilestone(patch: Partial<OntimeMilestone>): OntimeMilestone {
return { id: 'milestone', ...baseMilestone, ...patch } as OntimeMilestone;
}
/**
* Utility to create a rundown object
*/