Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: maissa SOUISSI <[email protected]>
  • Loading branch information
souissimai committed Jul 8, 2024
1 parent e033708 commit 7b6fd08
Showing 1 changed file with 39 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,56 +301,6 @@ export const SecurityAnalysisResultTab: FunctionComponent<
// empty array result
result.length === 0;

// Function to render the content of the tabs
const renderTabContent = () => {
if (enableDeveloperMode && tabIndex === N_RESULTS_TAB_INDEX) {
return (
<SecurityAnalysisResultN
result={result}
isLoadingResult={isLoadingResult}
columnDefs={columnDefs}
/>
);
}
if (
tabIndex ===
(enableDeveloperMode
? NMK_RESULTS_TAB_INDEX
: NMK_RESULTS_TAB_INDEX - 1)
) {
return (
<SecurityAnalysisResultNmk
result={result}
isLoadingResult={isLoadingResult || filterEnumsLoading}
isFromContingency={
nmkType === NMK_TYPE.CONSTRAINTS_FROM_CONTINGENCIES
}
paginationProps={{
count,
rowsPerPage,
page,
onPageChange: handleChangePage,
onRowsPerPageChange: handleChangeRowsPerPage,
}}
columnDefs={columnDefs}
/>
);
}
if (
tabIndex ===
(enableDeveloperMode ? LOGS_TAB_INDEX : LOGS_TAB_INDEX - 1)
) {
return (
(securityAnalysisStatus === RunningStatus.SUCCEED ||
securityAnalysisStatus === RunningStatus.FAILED) && (
<ComputationReportViewer
reportType={REPORT_TYPES.SECURITY_ANALYSIS}
/>
)
);
}
};

return (
<>
<Box sx={styles.tabsAndToolboxContainer}>
Expand Down Expand Up @@ -411,7 +361,45 @@ export const SecurityAnalysisResultTab: FunctionComponent<
<Box sx={styles.loader}>
{shouldOpenLoader && <LinearProgress />}
</Box>
<Box sx={styles.resultContainer}>{renderTabContent()}</Box>
<Box sx={styles.resultContainer}>
{tabIndex === N_RESULTS_TAB_INDEX && enableDeveloperMode && (
<SecurityAnalysisResultN
result={result}
isLoadingResult={isLoadingResult}
columnDefs={columnDefs}
/>
)}
{tabIndex ===
(enableDeveloperMode
? NMK_RESULTS_TAB_INDEX
: NMK_RESULTS_TAB_INDEX - 1) && (
<SecurityAnalysisResultNmk
result={result}
isLoadingResult={isLoadingResult || filterEnumsLoading}
isFromContingency={
nmkType === NMK_TYPE.CONSTRAINTS_FROM_CONTINGENCIES
}
paginationProps={{
count,
rowsPerPage,
page,
onPageChange: handleChangePage,
onRowsPerPageChange: handleChangeRowsPerPage,
}}
columnDefs={columnDefs}
/>
)}
{tabIndex ===
(enableDeveloperMode
? LOGS_TAB_INDEX
: LOGS_TAB_INDEX - 1) &&
(securityAnalysisStatus === RunningStatus.SUCCEED ||
securityAnalysisStatus === RunningStatus.FAILED) && (
<ComputationReportViewer
reportType={REPORT_TYPES.SECURITY_ANALYSIS}
/>
)}
</Box>
</>
);
};

0 comments on commit 7b6fd08

Please sign in to comment.