chore: rename time-to-end to count-to-end

This commit is contained in:
Carlos Valente
2024-12-18 19:43:12 +01:00
committed by Carlos Valente
parent c9ef2465f8
commit 2f2c26ed00
30 changed files with 115 additions and 122 deletions
@@ -158,7 +158,7 @@ export default function RundownEntry(props: RundownEntryProps) {
duration={data.duration}
timeStrategy={data.timeStrategy}
linkStart={data.linkStart}
isTimeToEnd={data.isTimeToEnd}
countToEnd={data.countToEnd}
isPublic={data.isPublic}
endAction={data.endAction}
timerType={data.timerType}
@@ -31,7 +31,7 @@ interface EventBlockProps {
duration: number;
timeStrategy: TimeStrategy;
linkStart: MaybeString;
isTimeToEnd: boolean;
countToEnd: boolean;
eventIndex: number;
isPublic: boolean;
endAction: EndAction;
@@ -69,7 +69,7 @@ export default function EventBlock(props: EventBlockProps) {
duration,
timeStrategy,
linkStart,
isTimeToEnd,
countToEnd,
isPublic = true,
eventIndex,
endAction,
@@ -288,7 +288,7 @@ export default function EventBlock(props: EventBlockProps) {
timeEnd={timeEnd}
duration={duration}
linkStart={linkStart}
isTimeToEnd={isTimeToEnd}
countToEnd={countToEnd}
timeStrategy={timeStrategy}
eventId={eventId}
eventIndex={eventIndex}
@@ -29,7 +29,7 @@ interface EventBlockInnerProps {
duration: number;
timeStrategy: TimeStrategy;
linkStart: MaybeString;
isTimeToEnd: boolean;
countToEnd: boolean;
eventIndex: number;
isPublic: boolean;
endAction: EndAction;
@@ -52,7 +52,7 @@ function EventBlockInner(props: EventBlockInnerProps) {
duration,
timeStrategy,
linkStart,
isTimeToEnd,
countToEnd,
isPublic = true,
endAction,
timerType,
@@ -93,7 +93,7 @@ function EventBlockInner(props: EventBlockInnerProps) {
delay={delay}
timeStrategy={timeStrategy}
linkStart={linkStart}
isTimeToEnd={isTimeToEnd}
countToEnd={countToEnd}
/>
</div>
<div className={style.titleSection}>
@@ -124,9 +124,9 @@ function EventBlockInner(props: EventBlockInnerProps) {
<EndActionIcon action={endAction} className={style.statusIcon} />
</span>
</Tooltip>
<Tooltip label={`${isTimeToEnd ? 'Time to End' : 'Count from start'}`} openDelay={tooltipDelayMid}>
<Tooltip label={`${countToEnd ? 'Count to End' : 'Count duration'}`} openDelay={tooltipDelayMid}>
<span>
<IoFlag className={`${style.statusIcon} ${isTimeToEnd ? style.active : style.disabled}`} />
<IoFlag className={`${style.statusIcon} ${countToEnd ? style.active : style.disabled}`} />
</span>
</Tooltip>
<Tooltip label={`${isPublic ? 'Event is public' : 'Event is private'}`} openDelay={tooltipDelayMid}>
@@ -61,7 +61,7 @@ export default function EventEditor(props: EventEditorProps) {
duration={event.duration}
timeStrategy={event.timeStrategy}
linkStart={event.linkStart}
isTimeToEnd={event.isTimeToEnd}
countToEnd={event.countToEnd}
delay={event.delay ?? 0}
isPublic={event.isPublic}
endAction={event.endAction}
@@ -18,7 +18,7 @@ interface EventEditorTimesProps {
duration: number;
timeStrategy: TimeStrategy;
linkStart: MaybeString;
isTimeToEnd: boolean;
countToEnd: boolean;
delay: number;
isPublic: boolean;
endAction: EndAction;
@@ -27,7 +27,7 @@ interface EventEditorTimesProps {
timeDanger: number;
}
type HandledActions = 'isTimeToEnd' | 'timerType' | 'endAction' | 'isPublic' | 'timeWarning' | 'timeDanger';
type HandledActions = 'countToEnd' | 'timerType' | 'endAction' | 'isPublic' | 'timeWarning' | 'timeDanger';
function EventEditorTimes(props: EventEditorTimesProps) {
const {
@@ -37,7 +37,7 @@ function EventEditorTimes(props: EventEditorTimesProps) {
duration,
timeStrategy,
linkStart,
isTimeToEnd,
countToEnd,
delay,
isPublic,
endAction,
@@ -53,8 +53,8 @@ function EventEditorTimes(props: EventEditorTimesProps) {
return;
}
if (field === 'isTimeToEnd') {
updateEvent({ id: eventId, isTimeToEnd: !(value as boolean) });
if (field === 'countToEnd') {
updateEvent({ id: eventId, countToEnd: !(value as boolean) });
return;
}
@@ -91,13 +91,12 @@ function EventEditorTimes(props: EventEditorTimesProps) {
timeStrategy={timeStrategy}
linkStart={linkStart}
delay={delay}
isTimeToEnd={isTimeToEnd}
countToEnd={countToEnd}
/>
</div>
<div className={style.delayLabel}>{delayLabel}</div>
</div>
<Editor.Title>Event behaviour</Editor.Title>
<div className={style.splitTwo}>
<div>
<Editor.Label htmlFor='endAction'>End Action</Editor.Label>
@@ -116,22 +115,21 @@ function EventEditorTimes(props: EventEditorTimesProps) {
</Select>
</div>
<div>
<Editor.Label htmlFor='timeToEnd'>Target Event Scheduled End</Editor.Label>
<Editor.Label htmlFor='countToEnd'>Count to End</Editor.Label>
<Editor.Label className={style.switchLabel}>
<Switch
id='timeToEnd'
id='countToEnd'
size='md'
isChecked={isTimeToEnd}
onChange={() => handleSubmit('isTimeToEnd', isTimeToEnd)}
isChecked={countToEnd}
onChange={() => handleSubmit('countToEnd', countToEnd)}
variant='ontime'
/>
{isTimeToEnd ? 'On' : 'Off'}
{countToEnd ? 'On' : 'Off'}
</Editor.Label>
</div>
</div>
</div>
<div className={style.column}>
<Editor.Title>Display options</Editor.Title>
<div className={style.splitTwo}>
<div>
<Editor.Label htmlFor='timerType'>Timer Type</Editor.Label>
@@ -29,7 +29,6 @@ const EventEditorTitles = (props: EventEditorTitlesProps) => {
return (
<div className={style.column}>
<Editor.Title>Event data</Editor.Title>
<div className={style.splitTwo}>
<div>
<Editor.Label htmlFor='eventId'>Event ID (read only)</Editor.Label>
@@ -16,7 +16,7 @@ import style from './TimeInputFlow.module.scss';
interface EventBlockTimerProps {
eventId: string;
isTimeToEnd: boolean;
countToEnd: boolean;
timeStart: number;
timeEnd: number;
duration: number;
@@ -26,7 +26,7 @@ interface EventBlockTimerProps {
}
function TimeInputFlow(props: EventBlockTimerProps) {
const { eventId, isTimeToEnd, timeStart, timeEnd, duration, timeStrategy, linkStart, delay } = props;
const { eventId, countToEnd, timeStart, timeEnd, duration, timeStrategy, linkStart, delay } = props;
const { updateEvent, updateTimer } = useEventAction();
// In sync with EventEditorTimes
@@ -47,8 +47,8 @@ function TimeInputFlow(props: EventBlockTimerProps) {
warnings.push('Over midnight');
}
if (isTimeToEnd) {
warnings.push('Target event scheduled end');
if (countToEnd) {
warnings.push('Count to End');
}
const hasDelay = delay !== 0;