From 6419d31e1e13be2b72c40b2faaa4012553302f40 Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 21:59:51 +0530 Subject: [PATCH] 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