mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-07 07:19:16 +00:00
refactor: add rundown summary to import preview
This commit is contained in:
committed by
Carlos Valente
parent
3918664945
commit
e6070e6efd
+6
-1
@@ -36,6 +36,8 @@ export default function SourcesPanel() {
|
||||
const setRundown = useSheetStore((state) => state.setRundown);
|
||||
const customFields = useSheetStore((state) => state.customFields);
|
||||
const setCustomFields = useSheetStore((state) => state.setCustomFields);
|
||||
const summary = useSheetStore((state) => state.summary);
|
||||
const setSummary = useSheetStore((state) => state.setSummary);
|
||||
const setSheetId = useSheetStore((state) => state.setSheetId);
|
||||
const sheetId = useSheetStore((state) => state.sheetId);
|
||||
const resetPreview = useSheetStore((state) => state.resetPreview);
|
||||
@@ -76,6 +78,7 @@ export default function SourcesPanel() {
|
||||
setHasFile('none');
|
||||
setWorksheets(null);
|
||||
setCustomFields(null);
|
||||
setSummary(null);
|
||||
setError('');
|
||||
setSheetId(null);
|
||||
};
|
||||
@@ -109,6 +112,7 @@ export default function SourcesPanel() {
|
||||
const previewData = await importRundownPreviewExcel(importMap);
|
||||
setRundown(previewData.rundown);
|
||||
setCustomFields(previewData.customFields);
|
||||
setSummary(previewData.summary);
|
||||
} catch (error) {
|
||||
setError(maybeAxiosError(error));
|
||||
}
|
||||
@@ -151,7 +155,7 @@ export default function SourcesPanel() {
|
||||
const showCompleted = importFlow === 'finished';
|
||||
const showAuth = isGSheetFlow && !isAuthenticated;
|
||||
const showImportMap = (isGSheetFlow && isAuthenticated) || (isExcelFlow && hasFile === 'done');
|
||||
const showReview = rundown !== null && customFields !== null;
|
||||
const showReview = rundown !== null && customFields !== null && summary !== null;
|
||||
|
||||
return (
|
||||
<Panel.Section>
|
||||
@@ -218,6 +222,7 @@ export default function SourcesPanel() {
|
||||
<ImportReview
|
||||
rundown={rundown}
|
||||
customFields={customFields}
|
||||
summary={summary}
|
||||
onFinished={handleFinished}
|
||||
onCancel={cancelImportMap}
|
||||
onBack={resetPreview}
|
||||
|
||||
Reference in New Issue
Block a user