From 4d1260321f1c01d65ef42ede86b9e644debfd24a Mon Sep 17 00:00:00 2001 From: Bianca Procopio Date: Mon, 8 Apr 2024 14:46:28 -0400 Subject: [PATCH] update multiple events "defaults" --- .../event-editor/EventEditorWrapper.tsx | 36 +++++++++---------- .../types/src/definitions/EndAction.type.ts | 1 + .../src/definitions/TimeStrategy.type.ts | 1 + .../types/src/definitions/TimerType.type.ts | 1 + 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/apps/client/src/features/rundown/event-editor/EventEditorWrapper.tsx b/apps/client/src/features/rundown/event-editor/EventEditorWrapper.tsx index 9c2dbcae5..bc8cb499d 100644 --- a/apps/client/src/features/rundown/event-editor/EventEditorWrapper.tsx +++ b/apps/client/src/features/rundown/event-editor/EventEditorWrapper.tsx @@ -99,27 +99,27 @@ export default function EventEditorWrapper() { } } - const multipleEvents: OntimeEvent = { + const multipleEvents: Partial = { id: eventsIds.trim().split(' ').join(', '), - colour: allHaveSameValue(events, 'colour') ? events[0]['colour'] : '', - custom: allHaveSameValue(events, 'custom') ? events[0]['custom'] : {}, - duration: allHaveSameValue(events, 'duration') ? events[0]['duration'] : 600000, - endAction: allHaveSameValue(events, 'endAction') ? events[0]['endAction'] : EndAction.None, - delay: allHaveSameValue(events, 'delay') ? events[0]['delay'] : 0, - isPublic: allHaveSameValue(events, 'isPublic') ? events[0]['isPublic'] : true, + colour: allHaveSameValue(events, 'colour') ? events[0]['colour'] : 'unkown', + custom: allHaveSameValue(events, 'custom') ? events[0]['custom'] : undefined, + duration: allHaveSameValue(events, 'duration') ? events[0]['duration'] : undefined, + endAction: allHaveSameValue(events, 'endAction') ? events[0]['endAction'] : EndAction.Unkown, + delay: allHaveSameValue(events, 'delay') ? events[0]['delay'] : undefined, + isPublic: allHaveSameValue(events, 'isPublic') ? events[0]['isPublic'] : true, // ?? linkStart: allHaveSameValue(events, 'linkStart') ? events[0]['linkStart'] : null, - note: allHaveSameValue(events, 'note') ? events[0]['note'] : '', - revision: allHaveSameValue(events, 'revision') ? events[0]['revision'] : 0, - skip: allHaveSameValue(events, 'skip') ? events[0]['skip'] : false, - timeDanger: allHaveSameValue(events, 'timeDanger') ? events[0]['timeDanger'] : 60000, - timeEnd: allHaveSameValue(events, 'timeEnd') ? events[0]['timeEnd'] : 600000, - timeStart: allHaveSameValue(events, 'timeStart') ? events[0]['timeStart'] : 0, - timeStrategy: allHaveSameValue(events, 'timeStrategy') ? events[0]['timeStrategy'] : TimeStrategy.LockDuration, - timeWarning: allHaveSameValue(events, 'timeWarning') ? events[0]['timeWarning'] : 120000, - timerType: allHaveSameValue(events, 'timerType') ? events[0]['timerType'] : TimerType.CountDown, - title: allHaveSameValue(events, 'title') ? events[0]['title'] : '', + note: allHaveSameValue(events, 'note') ? events[0]['note'] : '', // ?? + revision: allHaveSameValue(events, 'revision') ? events[0]['revision'] : undefined, + skip: allHaveSameValue(events, 'skip') ? events[0]['skip'] : undefined, + timeDanger: allHaveSameValue(events, 'timeDanger') ? events[0]['timeDanger'] : undefined, + timeEnd: allHaveSameValue(events, 'timeEnd') ? events[0]['timeEnd'] : undefined, + timeStart: allHaveSameValue(events, 'timeStart') ? events[0]['timeStart'] : undefined, + timeStrategy: allHaveSameValue(events, 'timeStrategy') ? events[0]['timeStrategy'] : TimeStrategy.Unkown, + timeWarning: allHaveSameValue(events, 'timeWarning') ? events[0]['timeWarning'] : undefined, + timerType: allHaveSameValue(events, 'timerType') ? events[0]['timerType'] : TimerType.Unkown, + title: allHaveSameValue(events, 'title') ? events[0]['title'] : '', // ?? type: allHaveSameValue(events, 'type') ? events[0]['type'] : SupportedEvent.Event, - cue: allHaveSameValue(events, 'cue') ? events[0]['cue'] : '0.01', + cue: allHaveSameValue(events, 'cue') ? events[0]['cue'] : 'unkown', }; return { diff --git a/packages/types/src/definitions/EndAction.type.ts b/packages/types/src/definitions/EndAction.type.ts index 7db64a69b..b82ae12ee 100644 --- a/packages/types/src/definitions/EndAction.type.ts +++ b/packages/types/src/definitions/EndAction.type.ts @@ -3,4 +3,5 @@ export enum EndAction { None = 'none', PlayNext = 'play-next', Stop = 'stop', + Unkown = 'unkown', } diff --git a/packages/types/src/definitions/TimeStrategy.type.ts b/packages/types/src/definitions/TimeStrategy.type.ts index 385c6bff9..ca7c9b2f4 100644 --- a/packages/types/src/definitions/TimeStrategy.type.ts +++ b/packages/types/src/definitions/TimeStrategy.type.ts @@ -1,4 +1,5 @@ export enum TimeStrategy { LockEnd = 'lock-end', LockDuration = 'lock-duration', + Unkown = 'unkown', } diff --git a/packages/types/src/definitions/TimerType.type.ts b/packages/types/src/definitions/TimerType.type.ts index eb8022109..aac356f22 100644 --- a/packages/types/src/definitions/TimerType.type.ts +++ b/packages/types/src/definitions/TimerType.type.ts @@ -3,4 +3,5 @@ export enum TimerType { CountUp = 'count-up', TimeToEnd = 'time-to-end', Clock = 'clock', + Unkown = 'unkown', }