mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
refactor: remove unused and legacy code
- remove legacy migrations - remove unused server code - remove unused UI code
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import {
|
||||
CustomFields,
|
||||
DatabaseModel,
|
||||
EndAction,
|
||||
OntimeEvent,
|
||||
OntimeRundown,
|
||||
Settings,
|
||||
SupportedEvent,
|
||||
TimeStrategy,
|
||||
TimerType,
|
||||
URLPreset,
|
||||
} from 'ontime-types';
|
||||
|
||||
@@ -362,46 +359,3 @@ describe('parseRundown() linking', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseRundown() migrations', () => {
|
||||
const legacyEvent = {
|
||||
id: '1',
|
||||
type: SupportedEvent.Event,
|
||||
cue: '',
|
||||
title: '',
|
||||
note: '',
|
||||
endAction: EndAction.None,
|
||||
timerType: 'time-to-end',
|
||||
linkStart: null,
|
||||
timeStrategy: TimeStrategy.LockDuration,
|
||||
timeStart: 0,
|
||||
timeEnd: 0,
|
||||
duration: 0,
|
||||
isPublic: false,
|
||||
skip: false,
|
||||
colour: '',
|
||||
revision: 0,
|
||||
timeWarning: 120000,
|
||||
timeDanger: 60000,
|
||||
custom: {},
|
||||
};
|
||||
|
||||
it('migrates an event with time-to-end', () => {
|
||||
const result = parseRundown({ rundown: [legacyEvent] as OntimeRundown });
|
||||
expect(result.rundown[0]).toMatchObject({
|
||||
id: '1',
|
||||
timerType: TimerType.CountDown,
|
||||
countToEnd: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('migrates an event without time-to-end', () => {
|
||||
const countdownEvent = { ...legacyEvent, timerType: TimerType.CountDown };
|
||||
const result = parseRundown({ rundown: [countdownEvent] as OntimeRundown });
|
||||
expect(result.rundown[0]).toMatchObject({
|
||||
id: '1',
|
||||
timerType: TimerType.CountDown,
|
||||
countToEnd: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user