mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
refactor: excel cleanup (#734)
* refactor: remove import of project data from excel
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { isExcelImportMap } from '../excelImport';
|
||||
|
||||
describe('isExcelImportMap', () => {
|
||||
test('migrate v2 map', () => {
|
||||
const v2ImportMap = {
|
||||
worksheet: 'event schedule',
|
||||
projectName: 'project name',
|
||||
projectDescription: 'project description',
|
||||
publicUrl: 'public url',
|
||||
publicInfo: 'public info',
|
||||
backstageUrl: 'backstage url',
|
||||
backstageInfo: 'backstage info',
|
||||
timeStart: 'time start',
|
||||
timeEnd: 'time end',
|
||||
duration: 'duration',
|
||||
cue: 'cue',
|
||||
title: 'title',
|
||||
presenter: 'presenter',
|
||||
subtitle: 'subtitle',
|
||||
isPublic: 'public',
|
||||
skip: 'skip',
|
||||
note: 'notes',
|
||||
colour: 'colour',
|
||||
endAction: 'end action',
|
||||
timerType: 'timer type',
|
||||
user0: 'header',
|
||||
user1: 'user1',
|
||||
user2: 'user2',
|
||||
user3: 'user3',
|
||||
user4: 'user4',
|
||||
user5: 'user5',
|
||||
user6: 'user6',
|
||||
user7: 'user7',
|
||||
user8: 'user8',
|
||||
user9: 'user9',
|
||||
timeWarning: 'warning time',
|
||||
timeDanger: 'danger time',
|
||||
};
|
||||
|
||||
expect(isExcelImportMap(v2ImportMap)).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -3,12 +3,6 @@ export type ExcelImportMap = typeof defaultExcelImportMap;
|
||||
|
||||
export const defaultExcelImportMap = {
|
||||
worksheet: 'event schedule',
|
||||
projectName: 'project name',
|
||||
projectDescription: 'project description',
|
||||
publicUrl: 'public url',
|
||||
publicInfo: 'public info',
|
||||
backstageUrl: 'backstage url',
|
||||
backstageInfo: 'backstage info',
|
||||
timeStart: 'time start',
|
||||
timeEnd: 'time end',
|
||||
duration: 'duration',
|
||||
@@ -41,6 +35,6 @@ export function isExcelImportMap(obj: unknown): obj is ExcelImportMap {
|
||||
return false;
|
||||
}
|
||||
|
||||
const keys = Object.keys(obj);
|
||||
return keys.every((key) => Object.hasOwn(defaultExcelImportMap, key));
|
||||
const keys = Object.keys(defaultExcelImportMap);
|
||||
return keys.every((key) => Object.hasOwn(obj, key));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user