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:
Alex Christoffer Rasmussen
2026-01-27 20:42:07 +01:00
committed by GitHub
parent ec1890c275
commit 026e24bf84
28 changed files with 224 additions and 64 deletions
+20 -2
View File
@@ -1,4 +1,12 @@
import { MaybeNumber, MaybeString, OntimeEvent, TimerState, TimerType } from 'ontime-types';
import {
MaybeNumber,
MaybeString,
OntimeEvent,
OntimeGroup,
RundownEntries,
TimerState,
TimerType,
} from 'ontime-types';
import { MILLIS_PER_MINUTE, MILLIS_PER_SECOND, millisToString, removeLeadingZero, removeSeconds } from 'ontime-utils';
import { timerPlaceholder, timerPlaceholderMin } from '../../common/utils/styleUtils';
@@ -66,12 +74,22 @@ export function makeColourString(hex: string | null): string | undefined {
/**
* Retrieves a dynamic property from an event
* Considers custom fields
* if rundown entries are provided it can also find the parent title
*/
export function getPropertyValue(event: OntimeEvent | null, property: MaybeString): string | undefined {
export function getPropertyValue(
event: OntimeEvent | null,
property: MaybeString,
entries?: RundownEntries,
): string | undefined {
if (!event || typeof property !== 'string' || property === 'none') {
return undefined;
}
if (property === 'parent') {
if (!entries || !event.parent) return undefined;
return (entries[event.parent] as OntimeGroup)?.title;
}
if (property.startsWith('custom-')) {
const field = property.split('custom-')[1];
return event.custom?.[field];