From f1c148817acf9eee0874720a7f85a775b3aa3510 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 19:57:38 +0530 Subject: [PATCH 01/29] fix: lint --- package.json | 1 - src/components/run/RunContent.tsx | 274 +++++++++++++++--------------- 2 files changed, 137 insertions(+), 138 deletions(-) diff --git a/package.json b/package.json index 75350f1f..1cfa1894 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "lodash": "^4.17.21", "loglevel": "^1.8.0", "loglevel-plugin-remote": "^0.6.8", - "maxun-core": "^0.0.15", "minio": "^8.0.1", "moment-timezone": "^0.5.45", "node-cron": "^3.0.3", diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 781fba70..55a69ba8 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -38,16 +38,16 @@ interface RunContentProps { export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRef, abortRunHandler }: RunContentProps) => { const { t } = useTranslation(); const [tab, setTab] = React.useState('output'); - + const [schemaData, setSchemaData] = useState([]); const [schemaColumns, setSchemaColumns] = useState([]); - + const [listData, setListData] = useState([]); const [listColumns, setListColumns] = useState([]); const [currentListIndex, setCurrentListIndex] = useState(0); const [expandedView, setExpandedView] = useState(null); - + const [viewMode, setViewMode] = useState<'horizontal' | 'vertical'>('vertical'); const [legacyData, setLegacyData] = useState([]); @@ -61,10 +61,10 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe useEffect(() => { if (!row.serializableOutput) return; - if (!row.serializableOutput.scrapeSchema && - !row.serializableOutput.scrapeList && - Object.keys(row.serializableOutput).length > 0) { - + if (!row.serializableOutput.scrapeSchema && + !row.serializableOutput.scrapeList && + Object.keys(row.serializableOutput).length > 0) { + setIsLegacyData(true); processLegacyData(row.serializableOutput); return; @@ -75,7 +75,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe if (row.serializableOutput.scrapeSchema && Object.keys(row.serializableOutput.scrapeSchema).length > 0) { processDataCategory(row.serializableOutput.scrapeSchema, setSchemaData, setSchemaColumns); } - + if (row.serializableOutput.scrapeList) { processScrapeList(row.serializableOutput.scrapeList); } @@ -83,7 +83,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const processLegacyData = (legacyOutput: Record) => { let allData: any[] = []; - + Object.keys(legacyOutput).forEach(key => { const data = legacyOutput[key]; if (Array.isArray(data)) { @@ -93,13 +93,13 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe allData = [...allData, ...filteredData]; } }); - + if (allData.length > 0) { const allColumns = new Set(); allData.forEach(item => { Object.keys(item).forEach(key => allColumns.add(key)); }); - + setLegacyData(allData); setLegacyColumns(Array.from(allColumns)); } @@ -111,7 +111,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe setColumns: React.Dispatch> ) => { let allData: any[] = []; - + Object.keys(categoryData).forEach(key => { const data = categoryData[key]; if (Array.isArray(data)) { @@ -121,13 +121,13 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe allData = [...allData, ...filteredData]; } }); - + if (allData.length > 0) { const allColumns = new Set(); allData.forEach(item => { Object.keys(item).forEach(key => allColumns.add(key)); }); - + setData(allData); setColumns(Array.from(allColumns)); } @@ -136,22 +136,22 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const processScrapeList = (scrapeListData: any) => { const tablesList: any[][] = []; const columnsList: string[][] = []; - + if (Array.isArray(scrapeListData)) { scrapeListData.forEach(tableData => { if (Array.isArray(tableData) && tableData.length > 0) { const filteredData = tableData.filter(row => Object.values(row).some(value => value !== undefined && value !== "") ); - + if (filteredData.length > 0) { tablesList.push(filteredData); - + const tableColumns = new Set(); filteredData.forEach(item => { Object.keys(item).forEach(key => tableColumns.add(key)); }); - + columnsList.push(Array.from(tableColumns)); } } @@ -163,21 +163,21 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const filteredData = tableData.filter(row => Object.values(row).some(value => value !== undefined && value !== "") ); - + if (filteredData.length > 0) { tablesList.push(filteredData); - + const tableColumns = new Set(); filteredData.forEach(item => { Object.keys(item).forEach(key => tableColumns.add(key)); }); - + columnsList.push(Array.from(tableColumns)); } } }); } - + setListData(tablesList); setListColumns(columnsList); setCurrentListIndex(0); @@ -217,7 +217,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe document.body.appendChild(link); link.click(); document.body.removeChild(link); - + setTimeout(() => { URL.revokeObjectURL(url); }, 100); @@ -225,7 +225,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const downloadAllJSON = () => { let allData; - + if (isLegacyData) { allData = { data: legacyData }; } else { @@ -234,7 +234,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe list: listData.flat(), }; } - + const blob = new Blob([JSON.stringify(allData, null, 2)], { type: 'application/json;charset=utf-8;' }); const url = URL.createObjectURL(blob); @@ -265,12 +265,12 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe ) => { if (!isPaginatedList && data.length === 0) return null; if (isPaginatedList && (listData.length === 0 || currentListIndex >= listData.length)) return null; - + const currentData = isPaginatedList ? listData[currentListIndex] : data; const currentColumns = isPaginatedList ? listColumns[currentListIndex] : columns; - + if (!currentData || currentData.length === 0) return null; - + return ( {isPaginatedList ? ( - 1 + 1 ? `Table ${currentListIndex + 1} of ${listData.length} (${currentData.length} ${currentData.length === 1 ? 'item' : 'items'})` : `${currentData.length} ${currentData.length === 1 ? 'item' : 'items'}` - } - size="small" - sx={{ ml: 2, backgroundColor: '#FF00C3', color: 'white' }} + } + size="small" + sx={{ ml: 2, backgroundColor: '#FF00C3', color: 'white' }} /> ) : ( - )} @@ -308,7 +308,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe startIcon={} onClick={() => { if (isPaginatedList) { - downloadCSV(currentData, currentColumns, `list_table_${currentListIndex+1}.csv`); + downloadCSV(currentData, currentColumns, `list_table_${currentListIndex + 1}.csv`); } else { downloadCSV(data, columns, csvFilename); } @@ -321,7 +321,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe startIcon={} onClick={() => { if (isPaginatedList) { - downloadJSON(currentData, `list_table_${currentListIndex+1}.json`); + downloadJSON(currentData, `list_table_${currentListIndex + 1}.json`); } else { downloadJSON(data, jsonFilename); } @@ -331,14 +331,14 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe JSON - + {isPaginatedList && listData.length > 1 && ( - - - + @@ -780,7 +780,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {t('run_content.loading')} ) : (!hasData && !hasScreenshots - ? {t('run_content.empty_output')} + ? {t('run_content.empty_output')} : null)} {hasData && ( @@ -791,23 +791,23 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {t('run_content.captured_data.title')} - setViewMode('horizontal')} color={viewMode === 'horizontal' ? 'primary' : 'default'} sx={{ color: viewMode === 'horizontal' ? '#FF00C3' : 'inherit' }} > - setViewMode('vertical')} color={viewMode === 'vertical' ? 'primary' : 'default'} sx={{ color: viewMode === 'vertical' ? '#FF00C3' : 'inherit' }} > - - + {isLegacyData && ( viewMode === 'vertical' ? ( renderDataTable( @@ -843,7 +843,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe ) )} - + {!isLegacyData && ( viewMode === 'vertical' ? ( <> @@ -855,27 +855,27 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe 'schema_data.csv', 'schema_data.json' )} - + {listData.length > 0 && renderDataTable( - [], - [], + [], + [], t('run_content.captured_data.list_title'), , 'list_data.csv', 'list_data.json', - true + true )} ) : ( {(() => { const dataCategoriesCount = [ - schemaData.length > 0, - listData.length > 0, + schemaData.length > 0, + listData.length > 0, ].filter(Boolean).length; - + const columnWidth = dataCategoriesCount === 1 ? 12 : dataCategoriesCount === 2 ? 6 : 4; - + return ( <> {schemaData.length > 0 && ( @@ -891,18 +891,18 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe )} )} - + {listData.length > 0 && ( {renderDataCard( - [], - [], + [], + [], t('run_content.captured_data.list_title'), , 'list', 'list_data.csv', 'list_data.json', - true + true )} )} @@ -912,14 +912,14 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe ) )} - + {renderExpandedView('schema')} {renderExpandedView('legacy')} - + {listData.map((_, index) => renderExpandedView(`list-${index}`))} )} - + {hasScreenshots && ( <> @@ -927,21 +927,21 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {t('run_content.captured_screenshot.title')} - - setViewMode('horizontal')} color={viewMode === 'horizontal' ? 'primary' : 'default'} sx={{ color: viewMode === 'horizontal' ? '#FF00C3' : 'inherit' }} > - setViewMode('vertical')} color={viewMode === 'vertical' ? 'primary' : 'default'} sx={{ color: viewMode === 'vertical' ? '#FF00C3' : 'inherit' }} @@ -951,7 +951,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe - + {viewMode === 'vertical' ? ( <> {Object.keys(row.binaryOutput).map((key, index) => { @@ -967,7 +967,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe - Screenshot {index+1} + Screenshot {index + 1} @@ -985,15 +985,15 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe - {`Screenshot @@ -1033,16 +1033,16 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe /> - {`Screenshot From 0c5e98c37c47c99e608961e98b1faa12f916a0af Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 19:58:27 +0530 Subject: [PATCH 02/29] fix: lint --- src/components/run/RunContent.tsx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 55a69ba8..f0e15d18 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -1,4 +1,23 @@ -import { Box, Tabs, Typography, Tab, Paper, Button, CircularProgress, Accordion, AccordionSummary, AccordionDetails, Divider, Card, CardHeader, CardContent, Grid, IconButton, Chip, ButtonGroup } from "@mui/material"; +import { + Box, + Tabs, + Typography, + Tab, + Paper, + Button, + CircularProgress, + Accordion, + AccordionSummary, + AccordionDetails, + Divider, + Card, + CardHeader, + CardContent, + Grid, + IconButton, + Chip, + ButtonGroup +} from "@mui/material"; import Highlight from "react-highlight"; import * as React from "react"; import { Data } from "./RunsTable"; From d0f284ce9a2df5078958a87844bff27b2cf856f1 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 19:58:48 +0530 Subject: [PATCH 03/29] chore: -rm unused imports --- src/components/run/RunContent.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index f0e15d18..1c365916 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -9,7 +9,6 @@ import { Accordion, AccordionSummary, AccordionDetails, - Divider, Card, CardHeader, CardContent, @@ -26,7 +25,6 @@ import ArticleIcon from '@mui/icons-material/Article'; import ImageIcon from '@mui/icons-material/Image'; import ListIcon from '@mui/icons-material/List'; import SchemaIcon from '@mui/icons-material/Schema'; -import MoreHorizIcon from '@mui/icons-material/MoreHoriz'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import CloudDownloadIcon from '@mui/icons-material/CloudDownload'; import DownloadIcon from '@mui/icons-material/Download'; From f65dda0633e3f6e88c1b9c8c51c51e7a0b288191 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:02:12 +0530 Subject: [PATCH 04/29] feat: -rm download all json --- src/components/run/RunContent.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 1c365916..6407d32c 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -822,15 +822,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe > - From 302ec004d394af63e10dd737484f605ede8fc247 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:02:47 +0530 Subject: [PATCH 05/29] feat: -rm horizontal view --- src/components/run/RunContent.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 6407d32c..65b82d27 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -808,13 +808,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {t('run_content.captured_data.title')} - setViewMode('horizontal')} - color={viewMode === 'horizontal' ? 'primary' : 'default'} - sx={{ color: viewMode === 'horizontal' ? '#FF00C3' : 'inherit' }} - > - - setViewMode('vertical')} color={viewMode === 'vertical' ? 'primary' : 'default'} From e5f63be8f3d776c3c9455859acbabf323ed74cd5 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:03:51 +0530 Subject: [PATCH 06/29] feat: -rm vertical view --- src/components/run/RunContent.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 65b82d27..34721bd0 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -808,13 +808,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {t('run_content.captured_data.title')} - setViewMode('vertical')} - color={viewMode === 'vertical' ? 'primary' : 'default'} - sx={{ color: viewMode === 'vertical' ? '#FF00C3' : 'inherit' }} - > - - + From 9eeb367d669fc762c0025ec5031f37b306be46ee Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:04:03 +0530 Subject: [PATCH 07/29] feat: -rm box --- src/components/run/RunContent.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 34721bd0..3b21cfd2 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -807,9 +807,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {t('run_content.captured_data.title')} - - - {isLegacyData && ( From 458392d65183a990919a914c7cbf5e5698b05559 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:05:09 +0530 Subject: [PATCH 08/29] feat: -rm horizontal view from screenshots --- src/components/run/RunContent.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 3b21cfd2..80108544 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -926,13 +926,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe /> - setViewMode('horizontal')} - color={viewMode === 'horizontal' ? 'primary' : 'default'} - sx={{ color: viewMode === 'horizontal' ? '#FF00C3' : 'inherit' }} - > - - setViewMode('vertical')} color={viewMode === 'vertical' ? 'primary' : 'default'} From db890e041f97b12035ba58f4a61c5b8203f4e071 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:05:23 +0530 Subject: [PATCH 09/29] feat: -rm vertical view from screenshots --- src/components/run/RunContent.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 80108544..f4a096be 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -926,13 +926,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe /> - setViewMode('vertical')} - color={viewMode === 'vertical' ? 'primary' : 'default'} - sx={{ color: viewMode === 'vertical' ? '#FF00C3' : 'inherit' }} - > - - From e6a7fdfcf2670b8a2b2b9cd95d2b5313d3efffed Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:05:36 +0530 Subject: [PATCH 10/29] feat: -rm box --- src/components/run/RunContent.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index f4a096be..b9686b1c 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -925,8 +925,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe sx={{ ml: 2, backgroundColor: '#FF00C3', color: 'white' }} /> - - From 2b046340f5763e076c967d866f75c332470d5589 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:10:15 +0530 Subject: [PATCH 11/29] feat: -rm unused icons --- src/components/run/RunContent.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index b9686b1c..377014e2 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -26,11 +26,8 @@ import ImageIcon from '@mui/icons-material/Image'; import ListIcon from '@mui/icons-material/List'; import SchemaIcon from '@mui/icons-material/Schema'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import CloudDownloadIcon from '@mui/icons-material/CloudDownload'; import DownloadIcon from '@mui/icons-material/Download'; import FullscreenIcon from '@mui/icons-material/Fullscreen'; -import ViewModuleIcon from '@mui/icons-material/ViewModule'; -import ViewListIcon from '@mui/icons-material/ViewList'; import DataObjectIcon from '@mui/icons-material/DataObject'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; From c202a507cb4d9a7d7890f4930820c5e727010b82 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:14:06 +0530 Subject: [PATCH 12/29] feat: -rm icons for capture text and list --- src/components/run/RunContent.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 377014e2..65ceb1b0 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -272,7 +272,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe data: any[], columns: string[], title: string, - icon: React.ReactNode, csvFilename: string, jsonFilename: string, isPaginatedList: boolean = false @@ -293,7 +292,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe id={`${title.toLowerCase()}-header`} > - {icon} {title} @@ -812,7 +810,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe legacyData, legacyColumns, t('run_content.captured_data.title'), - , 'data.csv', 'data.json' ) @@ -840,7 +837,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe schemaData, schemaColumns, t('run_content.captured_data.schema_title'), - , 'schema_data.csv', 'schema_data.json' )} @@ -849,7 +845,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe [], [], t('run_content.captured_data.list_title'), - , 'list_data.csv', 'list_data.json', true From cf5be61b72f4b9a162bc96a23c01ed2ffad15b92 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:15:27 +0530 Subject: [PATCH 13/29] feat: -rm icons --- src/components/run/RunContent.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 65ceb1b0..8d05b2d3 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -405,7 +405,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe data: any[], columns: string[], title: string, - icon: React.ReactNode, dataType: string, csvFilename: string, jsonFilename: string, @@ -434,7 +433,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe boxShadow: 3 }}> @@ -820,7 +818,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe legacyData, legacyColumns, t('run_content.captured_data.title'), - , 'legacy', 'data.csv', 'data.json' @@ -868,7 +865,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe schemaData, schemaColumns, t('run_content.captured_data.schema_title'), - , 'schema', 'schema_data.csv', 'schema_data.json' @@ -882,7 +878,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe [], [], t('run_content.captured_data.list_title'), - , 'list', 'list_data.csv', 'list_data.json', From 47ed5cef714a1f5f74771025900a6ffddcffe969 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:15:49 +0530 Subject: [PATCH 14/29] feat: -rm icons --- src/components/run/RunContent.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 8d05b2d3..0a7acb25 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -23,8 +23,6 @@ import { Data } from "./RunsTable"; import { TabPanel, TabContext } from "@mui/lab"; import ArticleIcon from '@mui/icons-material/Article'; import ImageIcon from '@mui/icons-material/Image'; -import ListIcon from '@mui/icons-material/List'; -import SchemaIcon from '@mui/icons-material/Schema'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import DownloadIcon from '@mui/icons-material/Download'; import FullscreenIcon from '@mui/icons-material/Fullscreen'; From 7c7116a0420f905d0d4bbd009cb44a98a12ac524 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:19:48 +0530 Subject: [PATCH 15/29] feat: -rm captured data --- src/components/run/RunContent.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 0a7acb25..57ca7bd0 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -793,13 +793,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {hasData && ( - - - - {t('run_content.captured_data.title')} - - - {isLegacyData && ( viewMode === 'vertical' ? ( renderDataTable( From 1f06bcd232579cc6b80d2e7af63c1676a5ab3c3a Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:21:22 +0530 Subject: [PATCH 16/29] feat: -rm captured screenshots --- src/components/run/RunContent.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 57ca7bd0..5bbe3a3d 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -892,19 +892,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {hasScreenshots && ( <> - - - - - {t('run_content.captured_screenshot.title')} - - - - {viewMode === 'vertical' ? ( <> From 9bc981593ac525256ebdeb2c5e86892f1347a8c6 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:26:02 +0530 Subject: [PATCH 17/29] feat: -rm chips --- src/components/run/RunContent.tsx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 5bbe3a3d..5ed6ed1f 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -293,22 +293,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {title} - {isPaginatedList ? ( - 1 - ? `Table ${currentListIndex + 1} of ${listData.length} (${currentData.length} ${currentData.length === 1 ? 'item' : 'items'})` - : `${currentData.length} ${currentData.length === 1 ? 'item' : 'items'}` - } - size="small" - sx={{ ml: 2, backgroundColor: '#FF00C3', color: 'white' }} - /> - ) : ( - - )} From 94fecc131e19e5a59f3f883ed20af47c17e26f3f Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:33:14 +0530 Subject: [PATCH 18/29] feat: -rm download all json --- src/components/run/RunContent.tsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 5ed6ed1f..2106b3ee 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -235,18 +235,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe }, 100); }; - const downloadAllJSON = () => { - let allData; - - if (isLegacyData) { - allData = { data: legacyData }; - } else { - allData = { - schema: schemaData, - list: listData.flat(), - }; - } - const blob = new Blob([JSON.stringify(allData, null, 2)], { type: 'application/json;charset=utf-8;' }); const url = URL.createObjectURL(blob); From 9c5782402216bbb499d345fe1624208c83a9064f Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:33:45 +0530 Subject: [PATCH 19/29] feat: -rm download all json --- src/components/run/RunContent.tsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 2106b3ee..59b91af0 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -235,17 +235,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe }, 100); }; - const blob = new Blob([JSON.stringify(allData, null, 2)], { type: 'application/json;charset=utf-8;' }); - const url = URL.createObjectURL(blob); - - const link = document.createElement("a"); - link.href = url; - link.setAttribute("download", "all_data.json"); - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - }; - const navigateListTable = (direction: 'next' | 'prev') => { if (direction === 'next' && currentListIndex < listData.length - 1) { setCurrentListIndex(currentListIndex + 1); From decf14a9ba2137a81681cc2e83524473dbbec91d Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:35:21 +0530 Subject: [PATCH 20/29] fix: cleanup --- src/components/run/RunContent.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 59b91af0..1fdf6f40 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -853,7 +853,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {hasScreenshots && ( <> - {viewMode === 'vertical' ? ( <> {Object.keys(row.binaryOutput).map((key, index) => { From b72d0dc264a562dfc7703d47bc72784d21d0475f Mon Sep 17 00:00:00 2001 From: amhsirak Date: Wed, 30 Apr 2025 20:35:43 +0530 Subject: [PATCH 21/29] chore: remove unused import --- src/components/run/RunContent.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 1fdf6f40..ccd314dd 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -21,7 +21,6 @@ import Highlight from "react-highlight"; import * as React from "react"; import { Data } from "./RunsTable"; import { TabPanel, TabContext } from "@mui/lab"; -import ArticleIcon from '@mui/icons-material/Article'; import ImageIcon from '@mui/icons-material/Image'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import DownloadIcon from '@mui/icons-material/Download'; From 43b7a7d463761cdd6b09f282148005eb09e943e9 Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 20:59:23 +0530 Subject: [PATCH 22/29] feat: rm view mode logic --- src/components/run/RunContent.tsx | 222 ++++-------------------------- 1 file changed, 26 insertions(+), 196 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index ccd314dd..c3166720 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -59,8 +59,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const [expandedView, setExpandedView] = useState(null); - const [viewMode, setViewMode] = useState<'horizontal' | 'vertical'>('vertical'); - const [legacyData, setLegacyData] = useState([]); const [legacyColumns, setLegacyColumns] = useState([]); const [isLegacyData, setIsLegacyData] = useState(false); @@ -754,93 +752,34 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe {hasData && ( {isLegacyData && ( - viewMode === 'vertical' ? ( - renderDataTable( - legacyData, - legacyColumns, - t('run_content.captured_data.title'), - 'data.csv', - 'data.json' - ) - ) : ( - - - {renderDataCard( - legacyData, - legacyColumns, - t('run_content.captured_data.title'), - 'legacy', - 'data.csv', - 'data.json' - )} - - + renderDataTable( + legacyData, + legacyColumns, + t('run_content.captured_data.title'), + 'data.csv', + 'data.json' ) )} {!isLegacyData && ( - viewMode === 'vertical' ? ( - <> - {renderDataTable( - schemaData, - schemaColumns, - t('run_content.captured_data.schema_title'), - 'schema_data.csv', - 'schema_data.json' - )} + <> + {renderDataTable( + schemaData, + schemaColumns, + t('run_content.captured_data.schema_title'), + 'schema_data.csv', + 'schema_data.json' + )} - {listData.length > 0 && renderDataTable( - [], - [], - t('run_content.captured_data.list_title'), - 'list_data.csv', - 'list_data.json', - true - )} - - ) : ( - - {(() => { - const dataCategoriesCount = [ - schemaData.length > 0, - listData.length > 0, - ].filter(Boolean).length; - - const columnWidth = dataCategoriesCount === 1 ? 12 : dataCategoriesCount === 2 ? 6 : 4; - - return ( - <> - {schemaData.length > 0 && ( - - {renderDataCard( - schemaData, - schemaColumns, - t('run_content.captured_data.schema_title'), - 'schema', - 'schema_data.csv', - 'schema_data.json' - )} - - )} - - {listData.length > 0 && ( - - {renderDataCard( - [], - [], - t('run_content.captured_data.list_title'), - 'list', - 'list_data.csv', - 'list_data.json', - true - )} - - )} - - ); - })()} - - ) + {listData.length > 0 && renderDataTable( + [], + [], + t('run_content.captured_data.list_title'), + 'list_data.csv', + 'list_data.json', + true + )} + )} {renderExpandedView('schema')} @@ -850,120 +789,11 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe )} - {hasScreenshots && ( + {/* {hasScreenshots && ( <> - {viewMode === 'vertical' ? ( - <> - {Object.keys(row.binaryOutput).map((key, index) => { - try { - const imageUrl = row.binaryOutput[key]; - return ( - - } - aria-controls={`screenshot-${key}-content`} - id={`screenshot-${key}-header`} - > - - - - Screenshot {index + 1} - - - - - - - - - - - {`Screenshot - - - - ); - } catch (e) { - console.log(e); - return ( - - {key}: {t('run_content.captured_screenshot.render_failed')} - - ); - } - })} - - ) : ( - - {Object.keys(row.binaryOutput).map((key) => { - try { - const imageUrl = row.binaryOutput[key]; - return ( - - - } - title={`Screenshot ${key}`} - action={ - - - - } - /> - - - {`Screenshot - - - - - ); - } catch (e) { - console.log(e); - return ( - - - {key}: {t('run_content.captured_screenshot.render_failed')} - - - ); - } - })} - - )} + {renderPaginatedScreenshots()} - )} + )} */} From 02a150d135d962bf84b5aea60a913240ad955c64 Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 21:02:38 +0530 Subject: [PATCH 23/29] feat: paginate capture screenshots --- src/components/run/RunContent.tsx | 103 +++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 3 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index c3166720..f0074adb 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -57,6 +57,9 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const [listColumns, setListColumns] = useState([]); const [currentListIndex, setCurrentListIndex] = useState(0); + const [screenshotKeys, setScreenshotKeys] = useState([]); + const [currentScreenshotIndex, setCurrentScreenshotIndex] = useState(0); + const [expandedView, setExpandedView] = useState(null); const [legacyData, setLegacyData] = useState([]); @@ -90,6 +93,13 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe } }, [row.serializableOutput]); + useEffect(() => { + if (row.binaryOutput && Object.keys(row.binaryOutput).length > 0) { + setScreenshotKeys(Object.keys(row.binaryOutput)); + setCurrentScreenshotIndex(0); + } + }, [row.binaryOutput]); + const processLegacyData = (legacyOutput: Record) => { let allData: any[] = []; @@ -240,6 +250,14 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe } }; + const navigateScreenshots = (direction: 'next' | 'prev') => { + if (direction === 'next' && currentScreenshotIndex < screenshotKeys.length - 1) { + setCurrentScreenshotIndex(currentScreenshotIndex + 1); + } else if (direction === 'prev' && currentScreenshotIndex > 0) { + setCurrentScreenshotIndex(currentScreenshotIndex - 1); + } + }; + const renderDataTable = ( data: any[], columns: string[], @@ -789,11 +807,90 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe )} - {/* {hasScreenshots && ( + {hasScreenshots && ( <> - {renderPaginatedScreenshots()} + + } + aria-controls="screenshot-content" + id="screenshot-header" + > + + + + {t('run_content.captured_screenshot.title', 'Screenshots')} + + + + + + + + {screenshotKeys.length > 1 && ( + + + + + )} + + + + {screenshotKeys.length > 1 && ( + + )} + + {`Screenshot + + + + - )} */} + )} From b83fcb27f0f77b7e75a6335f09e141a87b177eb2 Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 21:05:05 +0530 Subject: [PATCH 24/29] feat: rm left space --- src/components/run/RunContent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index f0074adb..350dc3bb 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -282,7 +282,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe id={`${title.toLowerCase()}-header`} > - + {title} From db256270c5f74a530532707674269f83898ce208 Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 21:39:05 +0530 Subject: [PATCH 25/29] feat: change translations --- public/locales/de.json | 9 ++++----- public/locales/en.json | 7 +++---- public/locales/es.json | 15 +++++++-------- public/locales/ja.json | 13 ++++++------- public/locales/zh.json | 7 +++---- 5 files changed, 23 insertions(+), 28 deletions(-) diff --git a/public/locales/de.json b/public/locales/de.json index 1256be22..54c009f0 100644 --- a/public/locales/de.json +++ b/public/locales/de.json @@ -543,16 +543,15 @@ "captured_data": { "title": "Erfasste Daten", "download_csv": "CSV herunterladen", - "download_all_json": "Gesamte JSON herunterladen", "view_full": "Vollständige Daten anzeigen", "items": "Elemente", - "schema_title": "Text erfassen", - "list_title": "Liste erfassen" + "schema_title": "Erfasste Texte", + "list_title": "Erfasste Listen" }, "captured_screenshot": { "title": "Erfasste Screenshots", - "download": "Screenshot herunterladen", - "render_failed": "Screenshot konnte nicht gerendert werden" + "download": "Herunterladen", + "render_failed": "Fehler beim Rendern des Screenshots" } }, "navbar": { diff --git a/public/locales/en.json b/public/locales/en.json index 531aa2e7..4f765f6e 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -564,15 +564,14 @@ "captured_data": { "title": "Captured Data", "download_csv": "Download CSV", - "download_all_json": "Download All JSON", "view_full": "View Full Data", "items": "items", - "schema_title": "Capture Text", - "list_title": "Capture List" + "schema_title": "Captured Texts", + "list_title": "Captured Lists" }, "captured_screenshot": { "title": "Captured Screenshots", - "download": "Download Screenshot", + "download": "Download", "render_failed": "Failed to render screenshot" } }, diff --git a/public/locales/es.json b/public/locales/es.json index b28fc5cf..d2d487c1 100644 --- a/public/locales/es.json +++ b/public/locales/es.json @@ -542,18 +542,17 @@ "loading": "Cargando datos...", "empty_output": "No hay datos de salida disponibles", "captured_data": { - "title": "Datos Capturados", + "title": "Datos capturados", "download_csv": "Descargar CSV", - "download_all_json": "Descargar Todo JSON", - "view_full": "Ver Datos Completos", + "view_full": "Ver datos completos", "items": "elementos", - "schema_title": "Capturar Texto", - "list_title": "Capturar Lista" + "schema_title": "Textos capturados", + "list_title": "Listas capturadas" }, "captured_screenshot": { - "title": "Capturas de Pantalla", - "download": "Descargar Captura", - "render_failed": "Error al renderizar la captura" + "title": "Capturas de pantalla", + "download": "Descargar", + "render_failed": "Error al renderizar la captura de pantalla" } }, "navbar": { diff --git a/public/locales/ja.json b/public/locales/ja.json index 52fed446..833494ee 100644 --- a/public/locales/ja.json +++ b/public/locales/ja.json @@ -542,17 +542,16 @@ "loading": "データを読み込み中...", "empty_output": "出力データがありません", "captured_data": { - "title": "キャプチャされたデータ", + "title": "キャプチャしたデータ", "download_csv": "CSVをダウンロード", - "download_all_json": "すべてのJSONをダウンロード", - "view_full": "すべてのデータを表示", + "view_full": "完全なデータを表示", "items": "アイテム", - "schema_title": "テキストをキャプチャ", - "list_title": "リストをキャプチャ" + "schema_title": "キャプチャしたテキスト", + "list_title": "キャプチャしたリスト" }, "captured_screenshot": { - "title": "キャプチャされたスクリーンショット", - "download": "スクリーンショットをダウンロード", + "title": "キャプチャしたスクリーンショット", + "download": "ダウンロード", "render_failed": "スクリーンショットのレンダリングに失敗しました" } }, diff --git a/public/locales/zh.json b/public/locales/zh.json index b4512bb3..27bb1e63 100644 --- a/public/locales/zh.json +++ b/public/locales/zh.json @@ -544,15 +544,14 @@ "captured_data": { "title": "已捕获的数据", "download_csv": "下载CSV", - "download_all_json": "下载所有JSON", "view_full": "查看完整数据", "items": "项目", - "schema_title": "捕获文本", - "list_title": "捕获列表" + "schema_title": "已捕获的文本", + "list_title": "已捕获的列表" }, "captured_screenshot": { "title": "已捕获的截图", - "download": "下载截图", + "download": "下载", "render_failed": "渲染截图失败" } }, From 5cd756c74238d14651b2e9eaba8e6af184a7d97a Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 21:39:55 +0530 Subject: [PATCH 26/29] feat: rm card componenent --- src/components/run/RunContent.tsx | 186 ------------------------------ 1 file changed, 186 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 350dc3bb..007e7f37 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -9,11 +9,6 @@ import { Accordion, AccordionSummary, AccordionDetails, - Card, - CardHeader, - CardContent, - Grid, - IconButton, Chip, ButtonGroup } from "@mui/material"; @@ -375,187 +370,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe ); }; - const renderDataCard = ( - data: any[], - columns: string[], - title: string, - dataType: string, - csvFilename: string, - jsonFilename: string, - isPaginatedList: boolean = false - ) => { - if (!isPaginatedList && data.length === 0) return null; - if (isPaginatedList && (listData.length === 0 || currentListIndex >= listData.length)) return null; - - const currentData = isPaginatedList ? listData[currentListIndex] : data; - const currentColumns = isPaginatedList ? listColumns[currentListIndex] : columns; - - if (!currentData || currentData.length === 0) return null; - - const previewData = currentData.slice(0, 1); - const previewColumns = currentColumns.slice(0, 3); - - const showMoreColumns = currentColumns.length > 3; - - return ( - - - { - if (isPaginatedList) { - downloadCSV(currentData, currentColumns, `list_table_${currentListIndex + 1}.csv`); - } else { - downloadCSV(data, columns, csvFilename); - } - }} - title={t('run_content.captured_data.download_csv')} - > - - - { - if (isPaginatedList) { - downloadJSON(currentData, `list_table_${currentListIndex + 1}.json`); - } else { - downloadJSON(data, jsonFilename); - } - }} - title="Download JSON" - sx={{ mx: 0.5 }} - > - - - { - if (isPaginatedList) { - setExpandedView(`list-${currentListIndex}`); - } else { - setExpandedView(dataType); - } - }} - title={t('run_content.captured_data.view_full')} - > - - - - } - sx={{ pb: 1 }} - /> - - - {isPaginatedList ? ( - 1 - ? `Table ${currentListIndex + 1} of ${listData.length} (${currentData.length} ${currentData.length === 1 ? 'item' : 'items'})` - : `${currentData.length} ${currentData.length === 1 ? 'item' : 'items'}` - } - size="small" - sx={{ backgroundColor: '#FF00C3', color: 'white' }} - /> - ) : ( - - )} - - {isPaginatedList && listData.length > 1 && ( - - - - - )} - - -
- - - {previewColumns.map((column) => ( - {column} - ))} - {showMoreColumns && ...} - - - - {previewData.map((row, index) => ( - - {previewColumns.map((column) => ( - - {row[column] === undefined || row[column] === "" ? "-" : row[column]} - - ))} - {showMoreColumns && ...} - - ))} - {currentData.length > 1 && ( - - - - - - )} - -
-
- - - ); - }; - const renderExpandedView = (dataTypeWithIndex: string) => { if (expandedView !== dataTypeWithIndex) return null; From 3b618d8d5d59997f1378fd90937203d1ab1e14c7 Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 21:43:24 +0530 Subject: [PATCH 27/29] feat: rm screenshot items chip --- src/components/run/RunContent.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 007e7f37..dbdfe41e 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -681,13 +681,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe - {screenshotKeys.length > 1 && ( - - )} Date: Wed, 30 Apr 2025 21:59:51 +0530 Subject: [PATCH 28/29] feat: buttons ui change, rm render expand --- src/components/run/RunContent.tsx | 199 +++++++----------------------- 1 file changed, 43 insertions(+), 156 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index dbdfe41e..374d7518 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -284,34 +284,44 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe
- - - - + {isPaginatedList && listData.length > 1 && ( @@ -370,132 +380,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe ); }; - const renderExpandedView = (dataTypeWithIndex: string) => { - if (expandedView !== dataTypeWithIndex) return null; - - let data: any[] = []; - let columns: string[] = []; - let title = ""; - let csvFilename = ""; - let jsonFilename = ""; - - if (dataTypeWithIndex.startsWith('list-')) { - const indexStr = dataTypeWithIndex.split('-')[1]; - const index = parseInt(indexStr, 10); - - if (index >= 0 && index < listData.length) { - data = listData[index]; - columns = listColumns[index]; - title = `${t('run_content.captured_data.list_title')} - Table ${index + 1}`; - csvFilename = `list_table_${index + 1}.csv`; - jsonFilename = `list_table_${index + 1}.json`; - } - } else { - switch (dataTypeWithIndex) { - case 'schema': - data = schemaData; - columns = schemaColumns; - title = t('run_content.captured_data.schema_title'); - csvFilename = 'schema_data.csv'; - jsonFilename = 'schema_data.json'; - break; - case 'list': - if (listData.length > 0 && listColumns.length > 0) { - data = listData[currentListIndex]; - columns = listColumns[currentListIndex]; - } - title = t('run_content.captured_data.list_title'); - csvFilename = 'list_data.csv'; - jsonFilename = 'list_data.json'; - break; - case 'legacy': - data = legacyData; - columns = legacyColumns; - title = t('run_content.captured_data.title'); - csvFilename = 'data.csv'; - jsonFilename = 'data.json'; - break; - } - } - - return ( - - - - {title} - - - - - - - - - - - - - - {columns.map((column) => ( - {column} - ))} - - - - {data.map((row, index) => ( - - {columns.map((column) => ( - - {row[column] === undefined || row[column] === "" ? "-" : row[column]} - - ))} - - ))} - -
-
-
-
- ); - }; - const hasData = schemaData.length > 0 || listData.length > 0 || legacyData.length > 0; const hasScreenshots = row.binaryOutput && Object.keys(row.binaryOutput).length > 0; @@ -613,11 +497,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe )} )} - - {renderExpandedView('schema')} - {renderExpandedView('legacy')} - - {listData.map((_, index) => renderExpandedView(`list-${index}`))} )} @@ -630,8 +509,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe id="screenshot-header" > - - + {t('run_content.captured_screenshot.title', 'Screenshots')} @@ -639,11 +517,20 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe From daa9779cb1d43454ba82212cd26a760323786535 Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 22:00:50 +0530 Subject: [PATCH 29/29] feat: rm unnecessray imports --- src/components/run/RunContent.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 374d7518..e554eaac 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -9,18 +9,13 @@ import { Accordion, AccordionSummary, AccordionDetails, - Chip, ButtonGroup } from "@mui/material"; import Highlight from "react-highlight"; import * as React from "react"; import { Data } from "./RunsTable"; import { TabPanel, TabContext } from "@mui/lab"; -import ImageIcon from '@mui/icons-material/Image'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import DownloadIcon from '@mui/icons-material/Download'; -import FullscreenIcon from '@mui/icons-material/Fullscreen'; -import DataObjectIcon from '@mui/icons-material/DataObject'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; import { useEffect, useState } from "react"; @@ -55,8 +50,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const [screenshotKeys, setScreenshotKeys] = useState([]); const [currentScreenshotIndex, setCurrentScreenshotIndex] = useState(0); - const [expandedView, setExpandedView] = useState(null); - const [legacyData, setLegacyData] = useState([]); const [legacyColumns, setLegacyColumns] = useState([]); const [isLegacyData, setIsLegacyData] = useState(false);