From 430b309879459c6238c325dbd755d3995ed1e708 Mon Sep 17 00:00:00 2001 From: ANIL SINGLA Date: Wed, 10 Jan 2024 17:03:26 +0530 Subject: [PATCH] cleanups, indetations and adding key properties and item properties (#518) --- .../AssessmentAnalytics/index.tsx | 162 ++++++--- .../AssessmentReport/index.tsx | 127 ++++--- src/pages/BesVersionHistory/index.tsx | 339 ++++++++++-------- src/routes.tsx | 1 + 4 files changed, 380 insertions(+), 249 deletions(-) diff --git a/src/pages/BesVersionHistory/AssessmentAnalytics/index.tsx b/src/pages/BesVersionHistory/AssessmentAnalytics/index.tsx index 5b4f8f2e..4e8158b7 100644 --- a/src/pages/BesVersionHistory/AssessmentAnalytics/index.tsx +++ b/src/pages/BesVersionHistory/AssessmentAnalytics/index.tsx @@ -75,15 +75,15 @@ const FetchCritical = ({ cqRiskData, sqRiskData }: any) => { tmpres = sqrisk.map(function(issue:any, innerindex:number){ if(issue.severity === "BLOCKER" || issue.severity === "CRITICAL"){ foundCrtical = true; - let keyval1: string = "sqriskdata" + {innerindex}; - let keyval2: string = "innersqriskdata" + {innerindex}; - let keyval3: string = "sq" + {innerindex}; return(<> - + {issue.rule} : - - {issue.message} - + + {issue.message} + ) }else{ @@ -104,8 +104,16 @@ const FetchCritical = ({ cqRiskData, sqRiskData }: any) => { foundCrtical = true; return ( <> - - {vul.rule.name} : {vul.rule.name} + + {vul.rule.name} : + + {vul.rule.name} + ) @@ -124,20 +132,26 @@ const FetchCritical = ({ cqRiskData, sqRiskData }: any) => { return(<>{sqres}) }else{ return(<> - + No Data Available ) } }else{ return(<> - + No critical issues found ) @@ -194,8 +208,13 @@ const FetchData = ({version, name, report, versionDetails, masterData}: any) => if(severityData.length !== 0){ return ( <> - - + + ); }else{ return( - - - - - - - + + + + + + + No Data Available @@ -234,11 +265,25 @@ const FetchData = ({version, name, report, versionDetails, masterData}: any) => }else if(report === "Critical Issues"){ return ( <> - - - - - + + + + + }else if(report === "Vulnerability History"){ return ( <> - - + + @@ -271,20 +321,20 @@ const GetHeadings = ({ receivedValue }: any) => { //const [fieldInfo, setfieldInfo]: any = React.useState({}); if(receivedValue === "Risk Posture"){ return(<> {" "} Risk Posture - + info ); }else if(receivedValue === "Critical Issues"){ return(<> {" "} Top Vulnerabilities - + info ); }else if(receivedValue === "Vulnerability History"){ return(<> {" "} CVE History - + info ); @@ -301,19 +351,37 @@ function AssessmentAnalytics({ title, name, version, versionDetails, masterData, "Vulnerability History" ]; return ( - - + + {report.map((value, index) => { return ( <> - - + - - + + - - + + diff --git a/src/pages/BesVersionHistory/AssessmentReport/index.tsx b/src/pages/BesVersionHistory/AssessmentReport/index.tsx index 4f787a06..be435ef9 100644 --- a/src/pages/BesVersionHistory/AssessmentReport/index.tsx +++ b/src/pages/BesVersionHistory/AssessmentReport/index.tsx @@ -116,7 +116,7 @@ const FetchCS = ({ data }: any) => { Age : {data.created_since} months - + { marginLeft: "1.5rem"}}> - { Critical : {critical} - { - { Medium : {medium} - + { marginLeft: "1.5rem"}}> - { Critical : {sqblocker} - { - { Medium : {sqmajor} - { style={{minWidth: "calc(10rem + 5vw)"}}> - - @@ -381,7 +391,8 @@ const FetchSAST = ({ cqData, sqData }: any) => { Critical : {cqcritical} - @@ -392,7 +403,8 @@ const FetchSAST = ({ cqData, sqData }: any) => { High : {cqhigh} - @@ -403,7 +415,8 @@ const FetchSAST = ({ cqData, sqData }: any) => { Medium : {cqmedium} - @@ -417,12 +430,14 @@ const FetchSAST = ({ cqData, sqData }: any) => { - - @@ -433,7 +448,8 @@ const FetchSAST = ({ cqData, sqData }: any) => { Critical : {sqblocker} - @@ -444,7 +460,8 @@ const FetchSAST = ({ cqData, sqData }: any) => { High : {sqcritical} - @@ -455,7 +472,8 @@ const FetchSAST = ({ cqData, sqData }: any) => { Medium : {sqmajor} - @@ -505,7 +523,8 @@ const FetchLicense = ({ data, uniq_lic, itemData }: any) => { style={{minWidth: "200px"}}> - { Project License : {project_lcesnse} - { No. of Non License Files : {non_lic_files} - { dis = tracked.map(function( td: string, index: number){ return(<> - - {codeQlData.length} - + - {Object.values(sonarqubeData).length} - + - - - + + - - + - + - + - - {uniqueLicenses.length} - @@ -852,22 +889,25 @@ const GetAssessmentData = ({ version, name, report, itemData, masterData }: any) if (report === "Dependencies" && jsonDataLength !== 0) { return (<> - {jsonData.packages.length} - - + diff --git a/src/pages/BesVersionHistory/index.tsx b/src/pages/BesVersionHistory/index.tsx index 2bf1b774..a6db6bcf 100644 --- a/src/pages/BesVersionHistory/index.tsx +++ b/src/pages/BesVersionHistory/index.tsx @@ -126,8 +126,12 @@ function BesVersionHistory() { return ( <> - - {data.map((item: any) => { + + {data.map((item: any, index: number) => { if (`:${item.name}` === besName) { let definedScore: string = "0"; if(item.hasOwnProperty('score')) @@ -138,71 +142,75 @@ function BesVersionHistory() { return ( <> - - + - - - - + + + + key={`TOPTYPO1${index}`} + variant="h6" + fontWeight="bold" + textTransform="capitalize" + style={{fontSize: "calc(0.4rem + 0.5vw)"}} + > Project Name:   - + {item.name} - - - + Version:   - { - versionSummary.map((option: any, index: any) => ( - + versionSummary.map((option: any, index1: any) => ( + {option.version} )) @@ -210,136 +218,145 @@ function BesVersionHistory() { - - - + + Score:   - + {definedScore} - - - - + + + + BeS Tracking Id:   - - + + {item.id} - - - - - - + + + + + + BeS Tech Stack:   - - + + {item.bes_technology_stack} - - - - - - + + + + + + BeS Environment:   - - - {item.name} - + + + + {item.name} + - - + - - - - + style={{height: "3.3rem"}}> + + + Description:   - + {item.description} @@ -348,12 +365,14 @@ function BesVersionHistory() { - - + - - - - + - , href: "https://github.com/Be-Secure/BeSLighthouse" }