mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
Feat: unify view search params (#1947)
* feat: main src in backstage view * feat: main src in timeline view * feat: main src in countdown view * feat: main src in studio view * feat: hide past events in countdown view * notes can not be set as main src * feat: show group title as secondary src * chore: spelling Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> --------- Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ec1890c275
commit
026e24bf84
@@ -1,4 +1,13 @@
|
||||
import { MaybeNumber, MessageState, OntimeEvent, Playback, TimerMessage, TimerPhase, TimerType } from 'ontime-types';
|
||||
import {
|
||||
MaybeNumber,
|
||||
MessageState,
|
||||
OntimeEvent,
|
||||
Playback,
|
||||
RundownEntries,
|
||||
TimerMessage,
|
||||
TimerPhase,
|
||||
TimerType,
|
||||
} from 'ontime-types';
|
||||
import { isPlaybackActive } from 'ontime-utils';
|
||||
|
||||
import { getFormattedTimer, getPropertyValue } from '../common/viewUtils';
|
||||
@@ -141,10 +150,11 @@ export function getSecondaryDisplay(
|
||||
export function getCardData(
|
||||
eventNow: OntimeEvent | null,
|
||||
eventNext: OntimeEvent | null,
|
||||
mainSource: keyof OntimeEvent | null,
|
||||
secondarySource: keyof OntimeEvent | null,
|
||||
mainSource: keyof OntimeEvent | null | 'none',
|
||||
secondarySource: keyof OntimeEvent | null | 'none',
|
||||
playback: Playback,
|
||||
phase: TimerPhase,
|
||||
entries: RundownEntries,
|
||||
) {
|
||||
if (playback === Playback.Stop) {
|
||||
return {
|
||||
@@ -162,19 +172,19 @@ export function getCardData(
|
||||
|
||||
// if we are loaded, we show the upcoming event as next
|
||||
const nowMain = hasActiveTimer ? getPropertyValue(eventNow, mainSource ?? 'title') : undefined;
|
||||
const nowSecondary = hasActiveTimer ? getPropertyValue(eventNow, secondarySource) : undefined;
|
||||
const nowSecondary = hasActiveTimer ? getPropertyValue(eventNow, secondarySource, entries) : undefined;
|
||||
const nextMain = hasActiveTimer
|
||||
? getPropertyValue(eventNext, mainSource ?? 'title')
|
||||
: getPropertyValue(eventNow, mainSource ?? 'title');
|
||||
const nextSecondary = hasActiveTimer
|
||||
? getPropertyValue(eventNext, secondarySource)
|
||||
: getPropertyValue(eventNow, secondarySource);
|
||||
? getPropertyValue(eventNext, secondarySource, entries)
|
||||
: getPropertyValue(eventNow, secondarySource, entries);
|
||||
|
||||
return {
|
||||
showNow: Boolean(nowMain) || Boolean(nowSecondary),
|
||||
showNow: mainSource !== 'none' || Boolean(nowSecondary),
|
||||
nowMain,
|
||||
nowSecondary,
|
||||
showNext: Boolean(nextMain) || Boolean(nextSecondary),
|
||||
showNext: mainSource !== 'none' || Boolean(nextSecondary),
|
||||
nextMain,
|
||||
nextSecondary,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user