mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 19:33:46 +00:00
Merge remote-tracking branch 'org/master' into google-sheets-lite
This commit is contained in:
@@ -201,7 +201,7 @@ describe('test json parser with valid def', () => {
|
||||
},
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
timeFormat: '24',
|
||||
},
|
||||
viewSettings: {},
|
||||
@@ -260,7 +260,7 @@ describe('test json parser with valid def', () => {
|
||||
it('settings are for right app and version', () => {
|
||||
const settings = parseResponse?.settings;
|
||||
expect(settings.app).toBe('ontime');
|
||||
expect(settings.version).toBe(2);
|
||||
expect(settings.version).toEqual(expect.any(String));
|
||||
});
|
||||
|
||||
it('missing settings', () => {
|
||||
@@ -387,7 +387,7 @@ describe('test corrupt data', () => {
|
||||
},
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
serverPort: 4001,
|
||||
lock: null,
|
||||
timeFormat: '24',
|
||||
@@ -410,7 +410,7 @@ describe('test corrupt data', () => {
|
||||
},
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
serverPort: 4001,
|
||||
lock: null,
|
||||
timeFormat: '24',
|
||||
@@ -427,7 +427,7 @@ describe('test corrupt data', () => {
|
||||
project: {},
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
serverPort: 4001,
|
||||
lock: null,
|
||||
timeFormat: '24',
|
||||
@@ -444,7 +444,7 @@ describe('test corrupt data', () => {
|
||||
event: {},
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -734,7 +734,7 @@ describe('test aliases import', () => {
|
||||
rundown: [],
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
aliases: [
|
||||
{
|
||||
@@ -773,7 +773,7 @@ describe('test userFields import', () => {
|
||||
rundown: [],
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
userFields: testUserFields,
|
||||
};
|
||||
@@ -800,7 +800,7 @@ describe('test userFields import', () => {
|
||||
rundown: [],
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
userFields: testUserFields,
|
||||
};
|
||||
@@ -814,7 +814,7 @@ describe('test userFields import', () => {
|
||||
rundown: [],
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -828,7 +828,7 @@ describe('test userFields import', () => {
|
||||
rundown: [],
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
userFields: {
|
||||
notThis: 'this shouldng be accepted',
|
||||
@@ -847,7 +847,7 @@ describe('test views import', () => {
|
||||
rundown: [],
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
viewSettings: {
|
||||
normalColor: '#ffffffcc',
|
||||
@@ -881,7 +881,7 @@ describe('test views import', () => {
|
||||
rundown: [],
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
};
|
||||
const parsed = parseViewSettings(testData);
|
||||
|
||||
@@ -34,13 +34,13 @@ describe('mergeObject()', () => {
|
||||
third: 'yes',
|
||||
};
|
||||
const b = {
|
||||
first: 0,
|
||||
first: 'no',
|
||||
second: null,
|
||||
third: '',
|
||||
};
|
||||
const merged = mergeObject(a, b);
|
||||
expect(merged).toStrictEqual({
|
||||
first: 0,
|
||||
first: 'no',
|
||||
second: null,
|
||||
third: '',
|
||||
});
|
||||
@@ -57,6 +57,7 @@ describe('mergeObject()', () => {
|
||||
third: '',
|
||||
forth: 'not-this',
|
||||
};
|
||||
// @ts-expect-error -- testing changing type
|
||||
const merged = mergeObject(a, b);
|
||||
expect(merged).toStrictEqual({
|
||||
first: 0,
|
||||
@@ -83,6 +84,7 @@ describe('mergeObject()', () => {
|
||||
},
|
||||
};
|
||||
|
||||
// @ts-expect-error -- testing missing property
|
||||
const merged = mergeObject(a, b);
|
||||
|
||||
expect(merged.name).toBe('Doe');
|
||||
|
||||
@@ -331,7 +331,7 @@ export const parseExcel = (excelData: unknown[][], options?: Partial<ExcelImport
|
||||
project: projectData,
|
||||
settings: {
|
||||
app: 'ontime',
|
||||
version: 2,
|
||||
version: '2.0.0',
|
||||
},
|
||||
userFields: customUserFields,
|
||||
projectMetadata: projectMetadata,
|
||||
@@ -474,9 +474,6 @@ export const fileHandler = async (file: string, options: ExcelImportOptions): Pr
|
||||
let uploadedJson = null;
|
||||
|
||||
uploadedJson = JSON.parse(rawdata);
|
||||
if (uploadedJson.settings.version !== 2) {
|
||||
throw new Error(`Project version unknown ${uploadedJson.settings.version}`);
|
||||
}
|
||||
res.data = await parseJson(uploadedJson);
|
||||
|
||||
// delete file
|
||||
|
||||
@@ -114,6 +114,7 @@ export const parseSettings = (data): Settings => {
|
||||
console.log('ERROR: unknown app version, skipping');
|
||||
} else {
|
||||
const settings = {
|
||||
version: dbModel.settings.version,
|
||||
serverPort: s.serverPort || dbModel.settings.serverPort,
|
||||
editorKey: s.editorKey || null,
|
||||
operatorKey: s.operatorKey || null,
|
||||
|
||||
Reference in New Issue
Block a user