modal details updated

pull/4845/head
aniket-engg 6 months ago committed by Aniket
parent 9139c08810
commit 42c76adff3
  1. 4
      apps/remix-ide/src/app/tabs/locales/en/udapp.json
  2. 9
      libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx
  3. 23
      libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx

@ -85,8 +85,8 @@
"udapp.solScan.modalMessage": "To scan the contract for vulnerabilities & possible risks, smart contract code will be shared to third-party SolidityScan (https://solidityscan.com/).\n\n Would you like to continue?",
"udapp.solScan.modalOkLabel": "Continue",
"udapp.solScan.modalCancelLabel": "Cancel",
"udapp.solScan.errModalTitle": "Scanning error",
"udapp.solScan.successModalTitle": "Scanning successful",
"udapp.solScan.errModalTitle": "Scan error",
"udapp.solScan.successModalTitle": "Scan result",
"udapp._comment_recorderCardUI.tsx": "libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx",

@ -3,13 +3,17 @@ import React from 'react'
import parse from 'html-react-parser';
interface SolScanTableProps {
scanDetails: Record<string, any>[]
scanDetails: Record<string, any>[],
fileName: string
}
export function SolScanTable(props: SolScanTableProps) {
const { scanDetails } = props
const { scanDetails, fileName } = props
return (
<>
<p>Scanning successful! <b>{scanDetails.length} warnings </b> found for file: <b>{fileName}</b></p>
<p>See the warning details below. For more details, <a href="https://solidityscan.com/signup">Sign up with SolidityScan</a></p>
<table className="table table-bordered table-hover">
<thead>
<tr>
@ -35,5 +39,6 @@ export function SolScanTable(props: SolScanTableProps) {
</tbody>
</table>
</>
)
}

@ -275,12 +275,23 @@ export function UniversalDappUI(props: UdappProps) {
const { data: scanData } = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url })
const scanDetails: Record<string, any>[] = scanData.scan_report.multi_file_scan_details
const modal: AppModal = {
id: 'SolidityScanSuccess',
title: <FormattedMessage id="udapp.solScan.successModalTitle" />,
message: <SolScanTable scanDetails={scanDetails} />,
okLabel: 'Close',
modalParentClass: 'modal-lg'
let modal: AppModal
if (scanDetails && scanDetails.length) {
modal = {
id: 'SolidityScanSuccess',
title: <FormattedMessage id="udapp.solScan.successModalTitle" />,
message: <SolScanTable scanDetails={scanDetails} fileName={fileName}/>,
okLabel: 'Close',
modalParentClass: 'modal-lg'
}
} else {
modal = {
id: 'SolidityScanError',
title: <FormattedMessage id="udapp.solScan.errModalTitle" />,
message: "Some error occurred! Please try again",
okLabel: 'Close'
}
}
await props.plugin.call('notification', 'modal', modal)
}

Loading…
Cancel
Save