mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-21 23:19:09 +00:00
Remove public event feature (#1645)
This commit is contained in:
committed by
GitHub
parent
4e561cf01f
commit
c522860d28
@@ -175,7 +175,6 @@ export default function RundownEntry(props: RundownEntryProps) {
|
||||
timeStrategy={data.timeStrategy}
|
||||
linkStart={data.linkStart}
|
||||
countToEnd={data.countToEnd}
|
||||
isPublic={data.isPublic}
|
||||
endAction={data.endAction}
|
||||
timerType={data.timerType}
|
||||
title={data.title}
|
||||
@@ -196,6 +195,7 @@ export default function RundownEntry(props: RundownEntryProps) {
|
||||
totalGap={totalGap}
|
||||
isLinkedToLoaded={isLinkedToLoaded}
|
||||
actionHandler={actionHandler}
|
||||
hasTriggers={data.triggers.length > 0}
|
||||
/>
|
||||
);
|
||||
} else if (isOntimeDelay(data)) {
|
||||
|
||||
@@ -4,8 +4,6 @@ import {
|
||||
IoDuplicateOutline,
|
||||
IoFolder,
|
||||
IoLink,
|
||||
IoPeople,
|
||||
IoPeopleOutline,
|
||||
IoReorderTwo,
|
||||
IoSwapVertical,
|
||||
IoTrash,
|
||||
@@ -36,7 +34,6 @@ interface EventBlockProps {
|
||||
linkStart: boolean;
|
||||
countToEnd: boolean;
|
||||
eventIndex: number;
|
||||
isPublic: boolean;
|
||||
endAction: EndAction;
|
||||
timerType: TimerType;
|
||||
title: string;
|
||||
@@ -65,6 +62,7 @@ interface EventBlockProps {
|
||||
value: unknown;
|
||||
},
|
||||
) => void;
|
||||
hasTriggers: boolean;
|
||||
}
|
||||
|
||||
export default function EventBlock(props: EventBlockProps) {
|
||||
@@ -77,7 +75,6 @@ export default function EventBlock(props: EventBlockProps) {
|
||||
timeStrategy,
|
||||
linkStart,
|
||||
countToEnd,
|
||||
isPublic = true,
|
||||
eventIndex,
|
||||
endAction,
|
||||
timerType,
|
||||
@@ -99,6 +96,7 @@ export default function EventBlock(props: EventBlockProps) {
|
||||
totalGap,
|
||||
isLinkedToLoaded,
|
||||
actionHandler,
|
||||
hasTriggers,
|
||||
} = props;
|
||||
const { selectedEventId, setSelectedEventId, clearSelectedEventId } = useEventIdSwapping();
|
||||
const { selectedEvents, setSelectedEvents } = useEventSelection();
|
||||
@@ -126,25 +124,6 @@ export default function EventBlock(props: EventBlockProps) {
|
||||
value: null,
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: 'Make public',
|
||||
icon: IoPeople,
|
||||
onClick: () =>
|
||||
actionHandler('update', {
|
||||
field: 'isPublic',
|
||||
value: true,
|
||||
}),
|
||||
withDivider: true,
|
||||
},
|
||||
{
|
||||
label: 'Make private',
|
||||
icon: IoPeopleOutline,
|
||||
onClick: () =>
|
||||
actionHandler('update', {
|
||||
field: 'isPublic',
|
||||
value: false,
|
||||
}),
|
||||
},
|
||||
{ withDivider: true, label: 'Group', icon: IoFolder, onClick: () => actionHandler('group') },
|
||||
{ withDivider: true, label: 'Delete', icon: IoTrash, onClick: () => actionHandler('delete') },
|
||||
]
|
||||
@@ -158,16 +137,6 @@ export default function EventBlock(props: EventBlockProps) {
|
||||
value: linkStart,
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: 'Toggle public',
|
||||
icon: IoPeopleOutline,
|
||||
onClick: () =>
|
||||
actionHandler('update', {
|
||||
field: 'isPublic',
|
||||
value: !isPublic,
|
||||
}),
|
||||
withDivider: true,
|
||||
},
|
||||
{
|
||||
label: 'Add to swap',
|
||||
icon: IoAdd,
|
||||
@@ -308,7 +277,6 @@ export default function EventBlock(props: EventBlockProps) {
|
||||
timeStrategy={timeStrategy}
|
||||
eventId={eventId}
|
||||
eventIndex={eventIndex}
|
||||
isPublic={isPublic}
|
||||
endAction={endAction}
|
||||
timerType={timerType}
|
||||
title={title}
|
||||
@@ -323,6 +291,7 @@ export default function EventBlock(props: EventBlockProps) {
|
||||
isPast={isPast}
|
||||
totalGap={totalGap}
|
||||
isLinkedToLoaded={isLinkedToLoaded}
|
||||
hasTriggers={hasTriggers}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
IoArrowUp,
|
||||
IoBan,
|
||||
IoFlag,
|
||||
IoPeople,
|
||||
IoFlash,
|
||||
IoPlay,
|
||||
IoPlayForward,
|
||||
IoPlaySkipForward,
|
||||
@@ -33,7 +33,6 @@ interface EventBlockInnerProps {
|
||||
linkStart: boolean;
|
||||
countToEnd: boolean;
|
||||
eventIndex: number;
|
||||
isPublic: boolean;
|
||||
endAction: EndAction;
|
||||
timerType: TimerType;
|
||||
title: string;
|
||||
@@ -48,6 +47,7 @@ interface EventBlockInnerProps {
|
||||
isPast: boolean;
|
||||
totalGap: number;
|
||||
isLinkedToLoaded: boolean;
|
||||
hasTriggers: boolean;
|
||||
}
|
||||
|
||||
function EventBlockInner(props: EventBlockInnerProps) {
|
||||
@@ -59,7 +59,6 @@ function EventBlockInner(props: EventBlockInnerProps) {
|
||||
timeStrategy,
|
||||
linkStart,
|
||||
countToEnd,
|
||||
isPublic = true,
|
||||
endAction,
|
||||
timerType,
|
||||
title,
|
||||
@@ -74,6 +73,7 @@ function EventBlockInner(props: EventBlockInnerProps) {
|
||||
isPast,
|
||||
totalGap,
|
||||
isLinkedToLoaded,
|
||||
hasTriggers,
|
||||
} = props;
|
||||
|
||||
const [renderInner, setRenderInner] = useState(false);
|
||||
@@ -132,7 +132,7 @@ function EventBlockInner(props: EventBlockInnerProps) {
|
||||
duration={duration}
|
||||
/>
|
||||
)}
|
||||
<div className={style.statusElements} id='block-status' data-ispublic={isPublic}>
|
||||
<div className={style.statusElements} id='block-status' data-timerType={timerType}>
|
||||
<span className={style.eventNote}>{note}</span>
|
||||
<div className={loaded ? style.progressBg : `${style.progressBg} ${style.hidden}`}>
|
||||
{loaded && <EventBlockProgressBar />}
|
||||
@@ -153,9 +153,9 @@ function EventBlockInner(props: EventBlockInnerProps) {
|
||||
<IoFlag className={`${style.statusIcon} ${countToEnd ? style.active : style.disabled}`} />
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip label={`${isPublic ? 'Event is public' : 'Event is private'}`} openDelay={tooltipDelayMid}>
|
||||
<Tooltip label='Event has Triggers' openDelay={tooltipDelayMid}>
|
||||
<span>
|
||||
<IoPeople className={`${style.statusIcon} ${isPublic ? style.active : style.disabled}`} />
|
||||
<IoFlash className={`${style.statusIcon} ${hasTriggers ? style.active : style.disabled}`} />
|
||||
</span>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +56,6 @@ export default function EventEditor(props: EventEditorProps) {
|
||||
linkStart={event.linkStart}
|
||||
countToEnd={event.countToEnd}
|
||||
delay={event.delay ?? 0}
|
||||
isPublic={event.isPublic}
|
||||
endAction={event.endAction}
|
||||
timerType={event.timerType}
|
||||
timeWarning={event.timeWarning}
|
||||
|
||||
@@ -21,14 +21,13 @@ interface EventEditorTimesProps {
|
||||
linkStart: boolean;
|
||||
countToEnd: boolean;
|
||||
delay: number;
|
||||
isPublic: boolean;
|
||||
endAction: EndAction;
|
||||
timerType: TimerType;
|
||||
timeWarning: number;
|
||||
timeDanger: number;
|
||||
}
|
||||
|
||||
type HandledActions = 'countToEnd' | 'timerType' | 'endAction' | 'isPublic' | 'timeWarning' | 'timeDanger';
|
||||
type HandledActions = 'countToEnd' | 'timerType' | 'endAction' | 'timeWarning' | 'timeDanger';
|
||||
|
||||
function EventEditorTimes(props: EventEditorTimesProps) {
|
||||
const {
|
||||
@@ -40,7 +39,6 @@ function EventEditorTimes(props: EventEditorTimesProps) {
|
||||
linkStart,
|
||||
countToEnd,
|
||||
delay,
|
||||
isPublic,
|
||||
endAction,
|
||||
timerType,
|
||||
timeWarning,
|
||||
@@ -49,11 +47,6 @@ function EventEditorTimes(props: EventEditorTimesProps) {
|
||||
const { updateEntry } = useEntryActions();
|
||||
|
||||
const handleSubmit = (field: HandledActions, value: string | boolean) => {
|
||||
if (field === 'isPublic') {
|
||||
updateEntry({ id: eventId, isPublic: !(value as boolean) });
|
||||
return;
|
||||
}
|
||||
|
||||
if (field === 'countToEnd') {
|
||||
updateEntry({ id: eventId, countToEnd: !(value as boolean) });
|
||||
return;
|
||||
@@ -160,6 +153,9 @@ function EventEditorTimes(props: EventEditorTimesProps) {
|
||||
<option value={TimerType.None}>None</option>
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
{/* TODO: rearrange this grid */}
|
||||
</div>
|
||||
<div>
|
||||
<Editor.Label htmlFor='timeWarning'>Warning Time</Editor.Label>
|
||||
<TimeInput
|
||||
@@ -171,19 +167,6 @@ function EventEditorTimes(props: EventEditorTimesProps) {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Editor.Label htmlFor='isPublic'>Event Visibility</Editor.Label>
|
||||
<Editor.Label className={style.switchLabel}>
|
||||
<Switch
|
||||
id='isPublic'
|
||||
size='md'
|
||||
isChecked={isPublic}
|
||||
onChange={() => handleSubmit('isPublic', isPublic)}
|
||||
variant='ontime'
|
||||
/>
|
||||
{isPublic ? 'Public' : 'Private'}
|
||||
</Editor.Label>
|
||||
</div>
|
||||
<div>
|
||||
<Editor.Label htmlFor='timeDanger'>Danger Time</Editor.Label>
|
||||
<TimeInput
|
||||
|
||||
@@ -20,7 +20,6 @@ function QuickAddBlock(props: QuickAddBlockProps) {
|
||||
const { addEntry } = useEntryActions();
|
||||
|
||||
const doLinkPrevious = useRef<HTMLInputElement | null>(null);
|
||||
const doPublic = useRef<HTMLInputElement | null>(null);
|
||||
|
||||
const addEvent = () => {
|
||||
addEntry(
|
||||
@@ -30,7 +29,6 @@ function QuickAddBlock(props: QuickAddBlockProps) {
|
||||
},
|
||||
{
|
||||
after: previousEventId,
|
||||
defaultPublic: doPublic?.current?.checked,
|
||||
lastEventId: previousEventId,
|
||||
linkPrevious: doLinkPrevious?.current?.checked,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user