chore: rename currentBlock > parent

This commit is contained in:
Carlos Valente
2025-04-13 20:57:54 +02:00
committed by Carlos Valente
parent 030c8f897f
commit 3ca0abad53
15 changed files with 90 additions and 90 deletions
@@ -203,7 +203,7 @@ describe('swapEventData', () => {
duration: 1,
delay: 1,
revision: 3,
currentBlock: null,
parent: null,
} as OntimeEvent;
const eventB = {
id: '2',
@@ -213,7 +213,7 @@ describe('swapEventData', () => {
duration: 2,
delay: 2,
revision: 7,
currentBlock: 'testing',
parent: 'testing',
} as OntimeEvent;
const [newA, newB] = swapEventData(eventA, eventB);
@@ -226,7 +226,7 @@ describe('swapEventData', () => {
duration: 1,
delay: 1,
revision: 3,
currentBlock: null,
parent: null,
});
expect(newB).toMatchObject({
id: '2',
@@ -236,7 +236,7 @@ describe('swapEventData', () => {
duration: 2,
delay: 2,
revision: 7,
currentBlock: 'testing',
parent: 'testing',
});
});
});
@@ -341,9 +341,9 @@ describe('getLastEvent', () => {
entries: {
1: { id: '1', type: SupportedEvent.Event } as OntimeEvent,
block: { id: 'block', type: SupportedEvent.Block, events: ['21', '22', '23'] } as OntimeBlock,
21: { id: '21', type: SupportedEvent.Event, currentBlock: 'block' } as OntimeEvent,
22: { id: '22', type: SupportedEvent.Event, currentBlock: 'block' } as OntimeEvent,
23: { id: '23', type: SupportedEvent.Event, currentBlock: 'block' } as OntimeEvent,
21: { id: '21', type: SupportedEvent.Event, parent: 'block' } as OntimeEvent,
22: { id: '22', type: SupportedEvent.Event, parent: 'block' } as OntimeEvent,
23: { id: '23', type: SupportedEvent.Event, parent: 'block' } as OntimeEvent,
},
order: ['1', 'block'],
};
@@ -278,7 +278,7 @@ export const swapEventData = (eventA: OntimeEvent, eventB: OntimeEvent): [newA:
timeEnd: eventA.timeEnd,
duration: eventA.duration,
linkStart: eventA.linkStart,
currentBlock: eventA.currentBlock,
parent: eventA.parent,
// keep schedule metadata
delay: eventA.delay,
gap: eventA.gap,
@@ -296,7 +296,7 @@ export const swapEventData = (eventA: OntimeEvent, eventB: OntimeEvent): [newA:
timeEnd: eventB.timeEnd,
duration: eventB.duration,
linkStart: eventB.linkStart,
currentBlock: eventB.currentBlock,
parent: eventB.parent,
// keep schedule metadata
delay: eventB.delay,
gap: eventB.gap,
@@ -365,8 +365,8 @@ export function getPreviousBlock(rundown: Pick<Rundown, 'entries' | 'order'>, cu
const currentEvent = rundown.entries[currentId];
// check if event is inside a block
if (isOntimeEvent(currentEvent) && currentEvent.currentBlock) {
return rundown.entries[currentEvent.currentBlock] as OntimeBlock;
if (isOntimeEvent(currentEvent) && currentEvent.parent) {
return rundown.entries[currentEvent.parent] as OntimeBlock;
}
let foundCurrentEvent = false;