mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
fix: rebase master
This commit is contained in:
@@ -5,7 +5,7 @@ import { TimerLifeCycle, timerLifecycleValues, Trigger } from 'ontime-types';
|
|||||||
import { generateId } from 'ontime-utils';
|
import { generateId } from 'ontime-utils';
|
||||||
|
|
||||||
import Tag from '../../../../common/components/tag/Tag';
|
import Tag from '../../../../common/components/tag/Tag';
|
||||||
import { useEventAction } from '../../../../common/hooks/useEventAction';
|
import { useEntryActions } from '../../../../common/hooks/useEntryAction';
|
||||||
import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings';
|
import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings';
|
||||||
|
|
||||||
import { eventTriggerOptions } from './eventTrigger.constants';
|
import { eventTriggerOptions } from './eventTrigger.constants';
|
||||||
@@ -37,7 +37,7 @@ interface EventTriggerFormProps {
|
|||||||
function EventTriggerForm(props: EventTriggerFormProps) {
|
function EventTriggerForm(props: EventTriggerFormProps) {
|
||||||
const { eventId, triggers } = props;
|
const { eventId, triggers } = props;
|
||||||
const { data: automationSettings } = useAutomationSettings();
|
const { data: automationSettings } = useAutomationSettings();
|
||||||
const { updateEvent } = useEventAction();
|
const { updateEntry } = useEntryActions();
|
||||||
const [automationId, setAutomationId] = useState<string | undefined>(undefined);
|
const [automationId, setAutomationId] = useState<string | undefined>(undefined);
|
||||||
const [cycleValue, setCycleValue] = useState(TimerLifeCycle.onStart);
|
const [cycleValue, setCycleValue] = useState(TimerLifeCycle.onStart);
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ function EventTriggerForm(props: EventTriggerFormProps) {
|
|||||||
const newTriggers = triggers ?? new Array<Trigger>();
|
const newTriggers = triggers ?? new Array<Trigger>();
|
||||||
const id = generateId();
|
const id = generateId();
|
||||||
newTriggers.push({ id, title: '', trigger: triggerLifeCycle, automationId });
|
newTriggers.push({ id, title: '', trigger: triggerLifeCycle, automationId });
|
||||||
updateEvent({ id: eventId, triggers: newTriggers });
|
updateEntry({ id: eventId, triggers: newTriggers });
|
||||||
};
|
};
|
||||||
|
|
||||||
const getValidationError = (cycle: TimerLifeCycle, automationId?: string): string | undefined => {
|
const getValidationError = (cycle: TimerLifeCycle, automationId?: string): string | undefined => {
|
||||||
@@ -123,15 +123,15 @@ interface ExistingEventTriggersProps {
|
|||||||
|
|
||||||
function ExistingEventTriggers(props: ExistingEventTriggersProps) {
|
function ExistingEventTriggers(props: ExistingEventTriggersProps) {
|
||||||
const { eventId, triggers } = props;
|
const { eventId, triggers } = props;
|
||||||
const { updateEvent } = useEventAction();
|
const { updateEntry } = useEntryActions();
|
||||||
const { data: automationSettings } = useAutomationSettings();
|
const { data: automationSettings } = useAutomationSettings();
|
||||||
|
|
||||||
const handleDelete = useCallback(
|
const handleDelete = useCallback(
|
||||||
(triggerId: string) => {
|
(triggerId: string) => {
|
||||||
const newTriggers = triggers.filter((trigger) => trigger.id !== triggerId);
|
const newTriggers = triggers.filter((trigger) => trigger.id !== triggerId);
|
||||||
updateEvent({ id: eventId, triggers: newTriggers });
|
updateEntry({ id: eventId, triggers: newTriggers });
|
||||||
},
|
},
|
||||||
[eventId, triggers, updateEvent],
|
[eventId, triggers, updateEntry],
|
||||||
);
|
);
|
||||||
|
|
||||||
const filteredTriggers: Record<string, Trigger[]> = {};
|
const filteredTriggers: Record<string, Trigger[]> = {};
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
isPlayableEvent,
|
isPlayableEvent,
|
||||||
MaybeNumber,
|
MaybeNumber,
|
||||||
MaybeString,
|
MaybeString,
|
||||||
|
OffsetMode,
|
||||||
OntimeBlock,
|
OntimeBlock,
|
||||||
OntimeEvent,
|
OntimeEvent,
|
||||||
PlayableEvent,
|
PlayableEvent,
|
||||||
@@ -98,7 +99,7 @@ export function clearEventData() {
|
|||||||
runtimeState.runtime.selectedEventIndex = null;
|
runtimeState.runtime.selectedEventIndex = null;
|
||||||
|
|
||||||
runtimeState.timer.playback = Playback.Stop;
|
runtimeState.timer.playback = Playback.Stop;
|
||||||
runtimeState.clock = clock.timeNow();
|
runtimeState.clock = timeNow();
|
||||||
runtimeState.timer = { ...runtimeStorePlaceholder.timer };
|
runtimeState.timer = { ...runtimeStorePlaceholder.timer };
|
||||||
|
|
||||||
// when clearing, we maintain the total delay from the rundown
|
// when clearing, we maintain the total delay from the rundown
|
||||||
@@ -749,3 +750,7 @@ export function loadBlock(rundown: Rundown, state = runtimeState) {
|
|||||||
const currentBlock = rundown.entries[currentBlockId];
|
const currentBlock = rundown.entries[currentBlockId];
|
||||||
state.currentBlock.block = currentBlock as OntimeBlock;
|
state.currentBlock.block = currentBlock as OntimeBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setOffsetMode(mode: OffsetMode) {
|
||||||
|
runtimeState.runtime.offsetMode = mode;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user