From 42c76adff3db8d55e91d43b80987a693ca426870 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 6 Jun 2024 13:18:02 +0530 Subject: [PATCH] modal details updated --- .../src/app/tabs/locales/en/udapp.json | 4 ++-- .../src/lib/components/solScanTable.tsx | 9 ++++++-- .../src/lib/components/universalDappUI.tsx | 23 ++++++++++++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index 27b5b4cb40..e33a897607 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -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", diff --git a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx index 10da3376ff..f9d6b4b910 100644 --- a/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/solScanTable.tsx @@ -3,13 +3,17 @@ import React from 'react' import parse from 'html-react-parser'; interface SolScanTableProps { - scanDetails: Record[] + scanDetails: Record[], + fileName: string } export function SolScanTable(props: SolScanTableProps) { - const { scanDetails } = props + const { scanDetails, fileName } = props return ( + <> +

Scanning successful! {scanDetails.length} warnings found for file: {fileName}

+

See the warning details below. For more details, Sign up with SolidityScan

@@ -35,5 +39,6 @@ export function SolScanTable(props: SolScanTableProps) {
+ ) } diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index ca2cfd9cac..eae66a0b5f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -275,12 +275,23 @@ export function UniversalDappUI(props: UdappProps) { const { data: scanData } = await axios.post('https://solidityscan.remixproject.org/downloadResult', { url }) const scanDetails: Record[] = scanData.scan_report.multi_file_scan_details - const modal: AppModal = { - id: 'SolidityScanSuccess', - title: , - message: , - okLabel: 'Close', - modalParentClass: 'modal-lg' + let modal: AppModal + + if (scanDetails && scanDetails.length) { + modal = { + id: 'SolidityScanSuccess', + title: , + message: , + okLabel: 'Close', + modalParentClass: 'modal-lg' + } + } else { + modal = { + id: 'SolidityScanError', + title: , + message: "Some error occurred! Please try again", + okLabel: 'Close' + } } await props.plugin.call('notification', 'modal', modal) }