mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-11 09:09:34 +00:00
95536902f5
* fix: prevent add filter from submitting form * refactor: event clarifies whether automations exist but are disabled * refactor: improve readability of automation form * refactor: add affordance for field warnings * refactor: improve visibility of automation off state * refactor: apply warning styles to other feature toggles * Adding playback actions to automations (#2024) * adding intial automation actions * cleaning up * fixing formatting * ran oxfmt * switching action names to playback- to match the dropdown strings * fixing flicker that was caused by scroll arrows gettting unmounted --------- Co-authored-by: Cameron Slipp <cdslipp@gmail.com>
90 lines
2.3 KiB
TypeScript
90 lines
2.3 KiB
TypeScript
import { OntimeEntry, Playback, SupportedEntry, isOntimeDelay, isOntimeEvent, isOntimeMilestone } from 'ontime-types';
|
|
|
|
import RundownDelay from './rundown-delay/RundownDelay';
|
|
import RundownEvent from './rundown-event/RundownEvent';
|
|
import RundownMilestone from './rundown-milestone/RundownMilestone';
|
|
|
|
interface RundownEntryProps {
|
|
type: SupportedEntry;
|
|
isPast: boolean;
|
|
data: OntimeEntry;
|
|
automationsEnabled?: boolean;
|
|
loaded: boolean;
|
|
eventIndex: number;
|
|
hasCursor: boolean;
|
|
isNext: boolean;
|
|
isNextDay: boolean;
|
|
playback?: Playback; // we only care about this if this event is playing
|
|
isRolling: boolean; // we need to know even if not related to this event
|
|
totalGap: number;
|
|
isLinkedToLoaded: boolean;
|
|
}
|
|
|
|
export default function RundownEntry({
|
|
isPast,
|
|
data,
|
|
automationsEnabled,
|
|
loaded,
|
|
hasCursor,
|
|
isNext,
|
|
playback,
|
|
isRolling,
|
|
eventIndex,
|
|
isNextDay,
|
|
totalGap,
|
|
isLinkedToLoaded,
|
|
}: RundownEntryProps) {
|
|
'use memo';
|
|
|
|
if (isOntimeEvent(data)) {
|
|
return (
|
|
<RundownEvent
|
|
eventId={data.id}
|
|
eventIndex={eventIndex}
|
|
cue={data.cue}
|
|
timeStart={data.timeStart}
|
|
timeEnd={data.timeEnd}
|
|
duration={data.duration}
|
|
timeStrategy={data.timeStrategy}
|
|
linkStart={data.linkStart}
|
|
flag={data.flag}
|
|
countToEnd={data.countToEnd}
|
|
endAction={data.endAction}
|
|
timerType={data.timerType}
|
|
title={data.title}
|
|
note={data.note}
|
|
delay={data.delay}
|
|
automationsEnabled={automationsEnabled}
|
|
colour={data.colour}
|
|
isPast={isPast}
|
|
isNext={isNext}
|
|
skip={data.skip}
|
|
parent={data.parent}
|
|
loaded={loaded}
|
|
hasCursor={hasCursor}
|
|
playback={playback}
|
|
isRolling={isRolling}
|
|
gap={data.gap}
|
|
isNextDay={isNextDay}
|
|
dayOffset={data.dayOffset}
|
|
totalGap={totalGap}
|
|
isLinkedToLoaded={isLinkedToLoaded}
|
|
hasTriggers={data.triggers.length > 0}
|
|
/>
|
|
);
|
|
} else if (isOntimeDelay(data)) {
|
|
return <RundownDelay data={data} hasCursor={hasCursor} />;
|
|
} else if (isOntimeMilestone(data)) {
|
|
return (
|
|
<RundownMilestone
|
|
colour={data.colour}
|
|
cue={data.cue}
|
|
entryId={data.id}
|
|
hasCursor={hasCursor}
|
|
title={data.title}
|
|
/>
|
|
);
|
|
}
|
|
return null;
|
|
}
|