mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 03:13:47 +00:00
chore: improve convention entry <> event
This commit is contained in:
committed by
Carlos Valente
parent
4180d0a337
commit
166be66ce3
@@ -18,7 +18,7 @@ import {
|
||||
OntimeBlock,
|
||||
OntimeEvent,
|
||||
Rundown,
|
||||
SupportedEvent,
|
||||
SupportedEntry,
|
||||
TimerType,
|
||||
TimeStrategy,
|
||||
} from 'ontime-types';
|
||||
@@ -232,10 +232,10 @@ export const parseExcel = (
|
||||
const maybeTimeType = makeString(column, '');
|
||||
if (maybeTimeType === 'block') {
|
||||
// we leave this as a clue for the object filtering later on
|
||||
entry.type = SupportedEvent.Block;
|
||||
entry.type = SupportedEntry.Block;
|
||||
} else if (maybeTimeType === '' || maybeTimeType === 'event' || isKnownTimerType(maybeTimeType)) {
|
||||
// @ts-expect-error -- we leave this as a clue for the object filtering later on
|
||||
entry.type = SupportedEvent.Event;
|
||||
entry.type = SupportedEntry.Event;
|
||||
entry.timerType = validateTimerType(maybeTimeType);
|
||||
} else {
|
||||
// if it is not a block or a known type, we dont import it
|
||||
@@ -320,7 +320,7 @@ export const parseExcel = (
|
||||
const event = {
|
||||
...entry,
|
||||
custom: { ...entryCustomFields },
|
||||
type: SupportedEvent.Event,
|
||||
type: SupportedEntry.Event,
|
||||
} as OntimeEvent;
|
||||
|
||||
if (timerTypeIndex === null) {
|
||||
@@ -407,7 +407,7 @@ export function createPatch(originalEvent: OntimeEvent, patchEvent: Partial<Onti
|
||||
|
||||
return {
|
||||
id: originalEvent.id,
|
||||
type: SupportedEvent.Event,
|
||||
type: SupportedEntry.Event,
|
||||
title: makeString(patchEvent.title, originalEvent.title),
|
||||
timeStart,
|
||||
timeEnd,
|
||||
|
||||
Reference in New Issue
Block a user