mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-03 13:29:06 +00:00
refactor: align property names between block and event
This commit is contained in:
@@ -62,7 +62,6 @@ export default function BlockEditor({ block }: BlockEditorProps) {
|
|||||||
|
|
||||||
const isEditor = window.location.pathname.includes('editor');
|
const isEditor = window.location.pathname.includes('editor');
|
||||||
const planOffset = typeof block.targetDuration !== 'number' ? null : block.targetDuration - block.duration;
|
const planOffset = typeof block.targetDuration !== 'number' ? null : block.targetDuration - block.duration;
|
||||||
console.log('targetDuration:', block.targetDuration);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={style.content}>
|
<div className={style.content}>
|
||||||
@@ -75,13 +74,13 @@ export default function BlockEditor({ block }: BlockEditorProps) {
|
|||||||
}
|
}
|
||||||
<Editor.Label>First event start</Editor.Label>
|
<Editor.Label>First event start</Editor.Label>
|
||||||
<TextLikeInput className={style.textLikeInput}>
|
<TextLikeInput className={style.textLikeInput}>
|
||||||
{millisToString(block.startTime, { fallback: timerPlaceholder })}
|
{millisToString(block.timeStart, { fallback: timerPlaceholder })}
|
||||||
</TextLikeInput>
|
</TextLikeInput>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Editor.Label htmlFor='endTime'>Last event end</Editor.Label>
|
<Editor.Label>Last event end</Editor.Label>
|
||||||
<TextLikeInput className={style.textLikeInput}>
|
<TextLikeInput className={style.textLikeInput}>
|
||||||
{millisToString(block.endTime, { fallback: timerPlaceholder })}
|
{millisToString(block.timeEnd, { fallback: timerPlaceholder })}
|
||||||
</TextLikeInput>
|
</TextLikeInput>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -132,11 +132,11 @@ export default function RundownBlock({ data, hasCursor, collapsed, onCollapse }:
|
|||||||
<div className={style.metaRow}>
|
<div className={style.metaRow}>
|
||||||
<div className={style.metaEntry}>
|
<div className={style.metaEntry}>
|
||||||
<div>Start</div>
|
<div>Start</div>
|
||||||
<div>{formatTime(data.startTime)}</div>
|
<div>{formatTime(data.timeStart)}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={style.metaEntry}>
|
<div className={style.metaEntry}>
|
||||||
<div>End</div>
|
<div>End</div>
|
||||||
<div>{formatTime(data.endTime)}</div>
|
<div>{formatTime(data.timeEnd)}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={style.metaEntry}>
|
<div className={style.metaEntry}>
|
||||||
<div>Duration</div>
|
<div>Duration</div>
|
||||||
|
|||||||
@@ -585,8 +585,8 @@ describe('processRundown()', () => {
|
|||||||
'1': {
|
'1': {
|
||||||
type: SupportedEntry.Block,
|
type: SupportedEntry.Block,
|
||||||
entries: ['100', '200', '300'],
|
entries: ['100', '200', '300'],
|
||||||
startTime: 100,
|
timeStart: 100,
|
||||||
endTime: 400,
|
timeEnd: 400,
|
||||||
duration: 300,
|
duration: 300,
|
||||||
isFirstLinked: false,
|
isFirstLinked: false,
|
||||||
},
|
},
|
||||||
@@ -625,8 +625,8 @@ describe('processRundown()', () => {
|
|||||||
'1': {
|
'1': {
|
||||||
type: SupportedEntry.Block,
|
type: SupportedEntry.Block,
|
||||||
entries: ['101', '102', '103'],
|
entries: ['101', '102', '103'],
|
||||||
startTime: 100,
|
timeStart: 100,
|
||||||
endTime: 400,
|
timeEnd: 400,
|
||||||
duration: 300,
|
duration: 300,
|
||||||
isFirstLinked: false,
|
isFirstLinked: false,
|
||||||
},
|
},
|
||||||
@@ -636,8 +636,8 @@ describe('processRundown()', () => {
|
|||||||
'2': {
|
'2': {
|
||||||
type: SupportedEntry.Block,
|
type: SupportedEntry.Block,
|
||||||
entries: ['201', '202', '203'],
|
entries: ['201', '202', '203'],
|
||||||
startTime: 500,
|
timeStart: 500,
|
||||||
endTime: 800,
|
timeEnd: 800,
|
||||||
duration: 300,
|
duration: 300,
|
||||||
isFirstLinked: false,
|
isFirstLinked: false,
|
||||||
},
|
},
|
||||||
@@ -647,8 +647,8 @@ describe('processRundown()', () => {
|
|||||||
'3': {
|
'3': {
|
||||||
type: SupportedEntry.Block,
|
type: SupportedEntry.Block,
|
||||||
entries: ['301', '302', '303'],
|
entries: ['301', '302', '303'],
|
||||||
startTime: 900,
|
timeStart: 900,
|
||||||
endTime: 1200,
|
timeEnd: 1200,
|
||||||
duration: 300,
|
duration: 300,
|
||||||
isFirstLinked: false,
|
isFirstLinked: false,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -747,8 +747,8 @@ export function processRundown(
|
|||||||
|
|
||||||
// update block metadata
|
// update block metadata
|
||||||
processedEntry.duration = totalBlockDuration;
|
processedEntry.duration = totalBlockDuration;
|
||||||
processedEntry.startTime = blockStartTime;
|
processedEntry.timeStart = blockStartTime;
|
||||||
processedEntry.endTime = blockEndTime;
|
processedEntry.timeEnd = blockEndTime;
|
||||||
processedEntry.isFirstLinked = isFirstLinked;
|
processedEntry.isFirstLinked = isFirstLinked;
|
||||||
processedEntry.entries = blockEvents;
|
processedEntry.entries = blockEvents;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,8 +162,8 @@ export function createBlock(patch?: Partial<OntimeBlock>): OntimeBlock {
|
|||||||
colour: makeString(patch.colour, ''),
|
colour: makeString(patch.colour, ''),
|
||||||
custom: patch.custom ?? {},
|
custom: patch.custom ?? {},
|
||||||
revision: 0,
|
revision: 0,
|
||||||
startTime: null,
|
timeStart: null,
|
||||||
endTime: null,
|
timeEnd: null,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
isFirstLinked: false,
|
isFirstLinked: false,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ export const demoDb: DatabaseModel = {
|
|||||||
targetDuration: null,
|
targetDuration: null,
|
||||||
colour: 'hotpink',
|
colour: 'hotpink',
|
||||||
revision: 0,
|
revision: 0,
|
||||||
startTime: null,
|
timeStart: null,
|
||||||
endTime: null,
|
timeEnd: null,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
isFirstLinked: false,
|
isFirstLinked: false,
|
||||||
custom: {
|
custom: {
|
||||||
@@ -216,8 +216,8 @@ export const demoDb: DatabaseModel = {
|
|||||||
targetDuration: null,
|
targetDuration: null,
|
||||||
custom: {},
|
custom: {},
|
||||||
revision: 0,
|
revision: 0,
|
||||||
startTime: null,
|
timeStart: null,
|
||||||
endTime: null,
|
timeEnd: null,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
isFirstLinked: false,
|
isFirstLinked: false,
|
||||||
},
|
},
|
||||||
@@ -379,8 +379,8 @@ export const demoDb: DatabaseModel = {
|
|||||||
targetDuration: null,
|
targetDuration: null,
|
||||||
custom: {},
|
custom: {},
|
||||||
revision: 0,
|
revision: 0,
|
||||||
startTime: null,
|
timeStart: null,
|
||||||
endTime: null,
|
timeEnd: null,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
isFirstLinked: false,
|
isFirstLinked: false,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ export const block: Omit<OntimeBlock, 'id'> = {
|
|||||||
custom: {},
|
custom: {},
|
||||||
// !==== RUNTIME METADATA ====! //
|
// !==== RUNTIME METADATA ====! //
|
||||||
revision: 0, // calculated at runtime
|
revision: 0, // calculated at runtime
|
||||||
startTime: null, // calculated at runtime
|
timeStart: null, // calculated at runtime
|
||||||
endTime: null, // calculated at runtime
|
timeEnd: null, // calculated at runtime
|
||||||
duration: 0, // calculated at runtime
|
duration: 0, // calculated at runtime
|
||||||
isFirstLinked: false, // calculated at runtime
|
isFirstLinked: false, // calculated at runtime
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -172,8 +172,8 @@
|
|||||||
"skip": false,
|
"skip": false,
|
||||||
"custom": {},
|
"custom": {},
|
||||||
"revision": 0,
|
"revision": 0,
|
||||||
"startTime": null,
|
"timeStart": null,
|
||||||
"endTime": null,
|
"timeEnd": null,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"isFirstLinked": false
|
"isFirstLinked": false
|
||||||
},
|
},
|
||||||
@@ -327,8 +327,8 @@
|
|||||||
"skip": false,
|
"skip": false,
|
||||||
"custom": {},
|
"custom": {},
|
||||||
"revision": 0,
|
"revision": 0,
|
||||||
"startTime": null,
|
"timeStart": null,
|
||||||
"endTime": null,
|
"timeEnd": null,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"isFirstLinked": false,
|
"isFirstLinked": false,
|
||||||
"numEvents": 0
|
"numEvents": 0
|
||||||
|
|||||||
Vendored
+4
-4
@@ -190,8 +190,8 @@
|
|||||||
"skip": false,
|
"skip": false,
|
||||||
"custom": {},
|
"custom": {},
|
||||||
"revision": 0,
|
"revision": 0,
|
||||||
"startTime": null,
|
"timeStart": null,
|
||||||
"endTime": null,
|
"timeEnd": null,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"isFirstLinked": false
|
"isFirstLinked": false
|
||||||
},
|
},
|
||||||
@@ -345,8 +345,8 @@
|
|||||||
"skip": false,
|
"skip": false,
|
||||||
"custom": {},
|
"custom": {},
|
||||||
"revision": 0,
|
"revision": 0,
|
||||||
"startTime": null,
|
"timeStart": null,
|
||||||
"endTime": null,
|
"timeEnd": null,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"isFirstLinked": false
|
"isFirstLinked": false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ export type OntimeBlock = OntimeBaseEvent & {
|
|||||||
custom: EntryCustomFields;
|
custom: EntryCustomFields;
|
||||||
// !==== RUNTIME METADATA ====! //
|
// !==== RUNTIME METADATA ====! //
|
||||||
revision: number;
|
revision: number;
|
||||||
startTime: MaybeNumber; // calculated at runtime
|
timeStart: MaybeNumber; // calculated at runtime
|
||||||
endTime: MaybeNumber; // calculated at runtime
|
timeEnd: MaybeNumber; // calculated at runtime
|
||||||
duration: number; // calculated at runtime
|
duration: number; // calculated at runtime
|
||||||
isFirstLinked: boolean; // calculated at runtime, whether the first event is linked
|
isFirstLinked: boolean; // calculated at runtime, whether the first event is linked
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user