refactor: remove trivially inferred numEvents

This commit is contained in:
Carlos Valente
2025-05-19 22:09:28 +02:00
committed by Carlos Valente
parent 2f13d6c89e
commit 4ab9c81cb8
11 changed files with 5 additions and 20 deletions
@@ -90,7 +90,6 @@ export function createBlock(patch?: Partial<OntimeBlock>): OntimeBlock {
endTime: null,
duration: 0,
isFirstLinked: false,
numEvents: patch.events?.length ?? 0,
};
}
-3
View File
@@ -52,7 +52,6 @@ export const demoDb: DatabaseModel = {
endTime: null,
duration: 0,
isFirstLinked: false,
numEvents: 0,
custom: {
song: 'Sekret',
artist: 'Ronela Hajati',
@@ -219,7 +218,6 @@ export const demoDb: DatabaseModel = {
endTime: null,
duration: 0,
isFirstLinked: false,
numEvents: 0,
},
'1c420': {
type: SupportedEntry.Event,
@@ -382,7 +380,6 @@ export const demoDb: DatabaseModel = {
endTime: null,
duration: 0,
isFirstLinked: false,
numEvents: 0,
},
'503c4': {
type: SupportedEntry.Event,
@@ -54,5 +54,4 @@ export const block: Omit<OntimeBlock, 'id'> = {
endTime: null, // calculated at runtime
duration: 0, // calculated at runtime
isFirstLinked: false, // calculated at runtime
numEvents: 0, // calculated at runtime
};
@@ -550,7 +550,6 @@ describe('generate() v4', () => {
endTime: 400,
duration: 300,
isFirstLinked: false,
numEvents: 3,
},
'100': { type: SupportedEntry.Event, parent: '1' },
'200': { type: SupportedEntry.Event, parent: '1' },
@@ -591,7 +590,6 @@ describe('generate() v4', () => {
endTime: 400,
duration: 300,
isFirstLinked: false,
numEvents: 3,
},
'101': { parent: '1', gap: 90, linkStart: false },
'102': { parent: '1' },
@@ -603,7 +601,6 @@ describe('generate() v4', () => {
endTime: 800,
duration: 300,
isFirstLinked: false,
numEvents: 3,
},
'201': { id: '201', timeStart: 500, timeEnd: 600, duration: 100, gap: 100, linkStart: false },
'202': { id: '202', timeStart: 600, timeEnd: 700, duration: 100 },
@@ -615,7 +612,6 @@ describe('generate() v4', () => {
endTime: 1200,
duration: 300,
isFirstLinked: false,
numEvents: 3,
},
'301': { id: '301', timeStart: 900, timeEnd: 1000, duration: 100, gap: 100, linkStart: false },
'302': { id: '302', timeStart: 1000, timeEnd: 1100, duration: 100 },
@@ -169,7 +169,6 @@ export function generate(
processedEntry.endTime = blockEndTime;
processedEntry.isFirstLinked = isFirstLinked;
processedEntry.events = blockEvents;
processedEntry.numEvents = blockEvents.length;
}
}
@@ -416,7 +415,6 @@ export function remove({ rundown, eventIds }: RemoveArgs): MutatingReturn {
eventId: entry.parent,
patch: {
events: parentEvents,
numEvents: parentEvents.length,
},
});
}
+1
View File
@@ -1,3 +1,4 @@
/**
* This CSS file allows user customisation of the UI
* We expose some CSS properties to facilitate this (see below in :root)