mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 11:53:49 +00:00
feat: add flag property
This commit is contained in:
@@ -69,6 +69,7 @@ export const parseExcel = (
|
||||
let colourIndex: number | null = null;
|
||||
|
||||
// options: booleans
|
||||
let flagIndex: number | null = null;
|
||||
let skipIndex: number | null = null;
|
||||
let countToEndIndex: number | null = null;
|
||||
|
||||
@@ -123,6 +124,10 @@ export const parseExcel = (
|
||||
titleIndex = col;
|
||||
rundownMetadata['title'] = { row, col };
|
||||
},
|
||||
[importMap.flag]: (row: number, col: number) => {
|
||||
flagIndex = col;
|
||||
rundownMetadata['flag'] = { row, col };
|
||||
},
|
||||
[importMap.countToEnd]: (row: number, col: number) => {
|
||||
countToEndIndex = col;
|
||||
rundownMetadata['countToEnd'] = { row, col };
|
||||
@@ -197,6 +202,8 @@ export const parseExcel = (
|
||||
entry.duration = parseExcelDate(column);
|
||||
} else if (j === cueIndex) {
|
||||
entry.cue = makeString(column, '');
|
||||
} else if (j === flagIndex) {
|
||||
entry.flag = parseBooleanString(column);
|
||||
} else if (j === countToEndIndex) {
|
||||
entry.countToEnd = parseBooleanString(column);
|
||||
} else if (j === skipIndex) {
|
||||
|
||||
@@ -88,6 +88,7 @@ export function createEventPatch(originalEvent: OntimeEvent, patchEvent: Partial
|
||||
return {
|
||||
id: originalEvent.id,
|
||||
type: SupportedEntry.Event,
|
||||
flag: typeof patchEvent.flag === 'boolean' ? patchEvent.flag : originalEvent.flag,
|
||||
title: makeString(patchEvent.title, originalEvent.title),
|
||||
timeStart,
|
||||
timeEnd,
|
||||
|
||||
@@ -185,6 +185,7 @@ export const startServer = async (): Promise<{ message: string; serverPort: numb
|
||||
eventNext: state.eventNext,
|
||||
blockNow: null,
|
||||
blockNext: null,
|
||||
nextFlag: null,
|
||||
auxtimer1: {
|
||||
duration: timerConfig.auxTimerDefault,
|
||||
current: timerConfig.auxTimerDefault,
|
||||
|
||||
@@ -59,6 +59,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'32d31': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '32d31',
|
||||
cue: 'SF1.01',
|
||||
title: 'Albania',
|
||||
@@ -88,6 +89,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'21cd2': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '21cd2',
|
||||
cue: 'SF1.02',
|
||||
title: 'Latvia',
|
||||
@@ -117,6 +119,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'0b371': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '0b371',
|
||||
cue: 'SF1.03',
|
||||
title: 'Lithuania',
|
||||
@@ -146,6 +149,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'3cd28': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '3cd28',
|
||||
cue: 'SF1.04',
|
||||
title: 'Switzerland',
|
||||
@@ -175,6 +179,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
e457f: {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: 'e457f',
|
||||
cue: 'SF1.05',
|
||||
title: 'Slovenia',
|
||||
@@ -221,6 +226,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'1c420': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '1c420',
|
||||
cue: 'SF1.06',
|
||||
title: 'Ukraine',
|
||||
@@ -250,6 +256,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
b7737: {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: 'b7737',
|
||||
cue: 'SF1.07',
|
||||
title: 'Bulgaria',
|
||||
@@ -279,6 +286,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
d3a80: {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: 'd3a80',
|
||||
cue: 'SF1.08',
|
||||
title: 'Netherlands',
|
||||
@@ -308,6 +316,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'8276c': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '8276c',
|
||||
cue: 'SF1.09',
|
||||
title: 'Moldova',
|
||||
@@ -337,6 +346,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'2340b': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '2340b',
|
||||
cue: 'SF1.10',
|
||||
title: 'Portugal',
|
||||
@@ -383,6 +393,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'503c4': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '503c4',
|
||||
cue: 'SF1.11',
|
||||
title: 'Croatia',
|
||||
@@ -412,6 +423,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
'5e965': {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: '5e965',
|
||||
cue: 'SF1.12',
|
||||
title: 'Denmark',
|
||||
@@ -441,6 +453,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
bab4a: {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: 'bab4a',
|
||||
cue: 'SF1.13',
|
||||
title: 'Austria',
|
||||
@@ -470,6 +483,7 @@ export const demoDb: DatabaseModel = {
|
||||
},
|
||||
d3eb1: {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
id: 'd3eb1',
|
||||
cue: 'SF1.14',
|
||||
title: 'Greece',
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
|
||||
export const event: Omit<OntimeEvent, 'id' | 'cue'> = {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
title: '',
|
||||
note: '',
|
||||
endAction: EndAction.None,
|
||||
|
||||
@@ -22,6 +22,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
test('string to string', () => {
|
||||
const event: OntimeEvent = {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
cue: '1',
|
||||
title: 'Fancy',
|
||||
note: 'Blue button on the right',
|
||||
@@ -70,6 +71,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
test('number to timer', () => {
|
||||
const event: OntimeEvent = {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
cue: '1',
|
||||
title: 'Fancy',
|
||||
note: 'Blue button on the right',
|
||||
@@ -120,6 +122,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
test('boolean to TRUE', () => {
|
||||
const event: OntimeEvent = {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
cue: '1',
|
||||
title: 'Fancy',
|
||||
note: 'Blue button on the right',
|
||||
@@ -168,6 +171,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
test('spacing in metadata', () => {
|
||||
const event: OntimeEvent = {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
cue: '1',
|
||||
title: 'Fancy',
|
||||
note: 'Blue button on the right',
|
||||
@@ -204,6 +208,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
test('metadata offset from zero', () => {
|
||||
const event: OntimeEvent = {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
cue: '1',
|
||||
title: 'Fancy',
|
||||
note: 'Blue button on the right',
|
||||
@@ -241,6 +246,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
test('sheet setup', () => {
|
||||
const event: OntimeEvent = {
|
||||
type: SupportedEntry.Event,
|
||||
flag: false,
|
||||
cue: '1',
|
||||
title: 'Fancy',
|
||||
note: 'Blue button on the right',
|
||||
|
||||
Reference in New Issue
Block a user