diff --git a/apps/client/src/features/modals/upload-modal/upload-options/ExcelFileOptions.tsx b/apps/client/src/features/modals/upload-modal/upload-options/ExcelFileOptions.tsx index fd719689b..41254d58c 100644 --- a/apps/client/src/features/modals/upload-modal/upload-options/ExcelFileOptions.tsx +++ b/apps/client/src/features/modals/upload-modal/upload-options/ExcelFileOptions.tsx @@ -1,19 +1,18 @@ import { MutableRefObject } from 'react'; - -import { ExcelInputOptions } from '../UploadModal'; +import { ExcelImportMap } from 'ontime-utils'; import ImportMapTable, { type TableEntry } from './ImportMapTable'; import style from '../UploadModal.module.scss'; interface ExcelFileOptionsProps { - optionsRef: MutableRefObject; + optionsRef: MutableRefObject; } export default function ExcelFileOptions(props: ExcelFileOptionsProps) { const { optionsRef } = props; - const updateRef = (field: T, value: ExcelInputOptions[T]) => { + const updateRef = (field: T, value: ExcelImportMap[T]) => { // avoid unnecessary changes if (optionsRef.current[field] !== value) { optionsRef.current = { ...optionsRef.current, [field]: value }; @@ -39,6 +38,7 @@ export default function ExcelFileOptions(props: ExcelFileOptionsProps) { const options: TableEntry[] = [ { label: 'Is Public', title: 'isPublic', value: optionsRef.current.isPublic }, + { label: 'Skip', title: 'skip', value: optionsRef.current.skip }, { label: 'Timer Type', title: 'timerType', value: optionsRef.current.timerType }, { label: 'End Action', title: 'endAction', value: optionsRef.current.endAction }, ]; diff --git a/apps/client/src/features/modals/upload-modal/upload-options/ImportMapTable.tsx b/apps/client/src/features/modals/upload-modal/upload-options/ImportMapTable.tsx index 1e5577ed4..309e1585d 100644 --- a/apps/client/src/features/modals/upload-modal/upload-options/ImportMapTable.tsx +++ b/apps/client/src/features/modals/upload-modal/upload-options/ImportMapTable.tsx @@ -1,16 +1,14 @@ import { Input } from '@chakra-ui/react'; - -import { ExcelInputOptions } from '../UploadModal'; +import { ExcelImportMap } from 'ontime-utils'; import style from './ImportMapTable.module.scss'; -// TODO: make this generic -export type TableEntry = { label: string; title: keyof ExcelInputOptions; value: string }; +export type TableEntry = { label: string; title: keyof ExcelImportMap; value: string }; interface ImportMapTableProps { title: string; fields: TableEntry[]; - handleOnChange: (field: keyof ExcelInputOptions, value: string) => void; + handleOnChange: (field: keyof ExcelImportMap, value: string) => void; } export default function ImportMapTable(props: ImportMapTableProps) {