diff --git a/public/electron/constants.js b/public/electron/constants.js index b7f0900..73514f4 100644 --- a/public/electron/constants.js +++ b/public/electron/constants.js @@ -124,8 +124,6 @@ const getPathVariable = () => { const scanResultsPath = path.join(resultsPath, "results"); -const customFlowGeneratedScriptsPath = path.join(resultsPath, "custom_flow_scripts"); - const updateBackupsFolder = path.join( appPath, "30789f0f-73f5-43bc-93a6-e499e4a20f7a" @@ -644,7 +642,6 @@ module.exports = { playwrightBrowsersPath, getPathVariable, scanResultsPath, - customFlowGeneratedScriptsPath, updateBackupsFolder, phZipPath, resultsPath, diff --git a/public/electron/preload.js b/public/electron/preload.js index 2244d2a..ddb2a63 100644 --- a/public/electron/preload.js +++ b/public/electron/preload.js @@ -26,13 +26,10 @@ contextBridge.exposeInMainWorld("services", { const results = await ipcRenderer.invoke("startScan", scanDetails); return results; }, - abortScan: async (scanDetails) => { + abortScan: async () => { await ipcRenderer.invoke("abortScan"); }, - startReplay: async (generatedScript, scanDetails, isReplay) => { - const results = await ipcRenderer.invoke("startReplay", generatedScript, scanDetails, isReplay); - return results; - }, + generateReport: (customFormLabel, scanId) => { ipcRenderer.send("generateReport", customFormLabel, scanId); }, @@ -45,9 +42,6 @@ contextBridge.exposeInMainWorld("services", { openUploadFolder: () => { ipcRenderer.send("openUploadFolder"); }, - cleanUpCustomFlowScripts: (() => { - ipcRenderer.send("cleanUpCustomFlowScripts"); - }), getEngineVersion: async () => { const phEngineVersion = await ipcRenderer.invoke('getEngineVersion'); return phEngineVersion; diff --git a/public/electron/scanManager.js b/public/electron/scanManager.js index 46dd469..c4c64f7 100644 --- a/public/electron/scanManager.js +++ b/public/electron/scanManager.js @@ -13,15 +13,9 @@ const { enginePath, appPath, getPathVariable, - customFlowGeneratedScriptsPath, playwrightBrowsersPath, resultsPath, scanResultsPath, - forbiddenCharactersInDirPath, - createPlaywrightContext, - deleteClonedProfiles, - backendPath, - isWindows, } = require("./constants"); const { browserTypes, @@ -29,11 +23,7 @@ const { getDefaultEdgeDataDir, uploadFolderName, } = require("./constants"); -const { env, report } = require("process"); const { readUserDataFromFile, createExportDir } = require("./userDataManager"); -const { escape } = require("querystring"); -const { json } = require("react-router-dom"); -const { time } = require("console"); const scanHistory = {}; let currentChildProcess; @@ -143,7 +133,7 @@ const validateUrlConnectivity = async (scanDetails) => { const response = await new Promise(async (resolve) => { const check = spawn( "node", - [path.join(enginePath, "cli.js"), ...getScanOptions(scanDetails)], + [`${enginePath}/dist/cli.js`, ...getScanOptions(scanDetails)], { cwd: resultsPath, env: { @@ -204,7 +194,7 @@ const startScan = async (scanDetails, scanEvent) => { let intermediateFolderName; const scan = spawn( "node", - [path.join(enginePath, "cli.js"), ...getScanOptions(scanDetails)], + [`${enginePath}/dist/cli.js`, ...getScanOptions(scanDetails)], { cwd: resultsPath, env: { @@ -258,13 +248,6 @@ const startScan = async (scanDetails, scanEvent) => { resolve({ success: false }); } - if (scanDetails.scanType === 'custom' && data.includes('generatedScript')) { - const generatedScriptName = data.trim(); - console.log('generated script: ', generatedScriptName); - const generatedScript = path.join(customFlowGeneratedScriptsPath, generatedScriptName); - resolve({ success: true, generatedScript: generatedScript}); - } - // The true success where the process ran and pages were scanned if (data.includes("Results directory is at")) { console.log(data); @@ -313,87 +296,6 @@ const startScan = async (scanDetails, scanEvent) => { return response; }; -const startReplay = async (generatedScript, scanDetails, scanEvent, isReplay) => { - let useChromium = false; - if ( - scanDetails.browser === browserTypes.chromium || - (!getDefaultChromeDataDir() && !getDefaultEdgeDataDir()) - ) { - useChromium = true; - } - - if (isReplay && scanDetails.encryptionParams) { - decryptGeneratedScript(generatedScript, scanDetails.encryptionParams); - } - - const response = await new Promise((resolve, reject) => { - const replay = spawn( - "node", - [path.join(enginePath, "runCustomFlowFromGUI.js"), generatedScript], { - cwd: resultsPath, - env: { - ...process.env, - RUNNING_FROM_PH_GUI: true, - PLAYWRIGHT_BROWSERS_PATH: `${playwrightBrowsersPath}`, - PATH: getPathVariable(), - }, - }); - - currentChildProcess = replay; - - replay.stderr.setEncoding("utf8"); - replay.stderr.on("data", function (data) { - console.log("stderr: " + data); - }); - - replay.stdout.setEncoding("utf8"); - replay.stdout.on("data", async (data) => { - if (data.includes("An error has occurred when running the custom flow scan.")) { - replay.kill("SIGKILL"); - currentChildProcess = null; - resolve({ success: false }); - } - - // Handle live crawling output - if (data.includes("crawling::")) { - const urlScannedNum = parseInt(data.split("::")[1].trim()); - const status = data.split("::")[2].trim(); - const url = data.split("::")[3].trim(); - console.log(urlScannedNum, ":", status, ":", url); - scanEvent.emit("scanningUrl", {status, url, urlScannedNum}); - } - - if (data.includes("Scan completed")) { - scanEvent.emit("scanningCompleted"); - } - - if (data.includes("results/")) { - console.log(data); - const resultsFolderName = data.split(" ").slice(-2)[0].split("/").pop(); - console.log(resultsFolderName); - - const scanId = randomUUID(); - scanHistory[scanId] = resultsFolderName; - - const encryptionParams = encryptGeneratedScript(generatedScript); - moveCustomFlowResultsToExportDir(scanId, resultsFolderName, isReplay); - replay.kill("SIGKILL"); - currentChildProcess = null; - await cleanUpIntermediateFolders(resultsFolderName); - resolve({ success: true, scanId, encryptionParams }); - } - }); - - replay.on("close", (code) => { - if (code !== 0) { - resolve({ success: false, statusCode: code }); - } - }); - }); - - return response; -}; - const encryptGeneratedScript = (generatedScript) => { // Generate random password and IV const password = randomBytes(32); @@ -574,18 +476,6 @@ const cleanUpIntermediateFolders = async (folderName, setDefaultFolders = false) }); }; -const cleanUpCustomFlowGeneratedScripts = () => { - if (fs.existsSync(customFlowGeneratedScriptsPath)) { - fs.rm(customFlowGeneratedScriptsPath, { recursive: true }, (err) => { - if (err) { - console.error( - `Error while deleting ${customFlowGeneratedScriptsPath}.` - ); - } - }); - } -} - const moveCustomFlowResultsToExportDir = (scanId, resultsFolderName, isReplay) => { const currentResultsPath = path.join(scanResultsPath, resultsFolderName); let newResultsPath; @@ -616,10 +506,6 @@ const init = (scanEvent) => { setKillChildProcessSignal(); }); - ipcMain.handle("startReplay", async (_event, generatedScript, scanDetails, isReplay) => { - return await startReplay(generatedScript, scanDetails, scanEvent, isReplay); - }) - ipcMain.on("generateReport", (_event, customFlowLabel, scanId) => { return generateReport(customFlowLabel, scanId); }); @@ -685,10 +571,6 @@ const init = (scanEvent) => { return allErrors; }) - ipcMain.on("cleanUpCustomFlowScripts", async () => { - cleanUpCustomFlowGeneratedScripts(); - }) - ipcMain.handle("mailReport", (_event, formDetails, scanId) => { return mailResults(formDetails, scanId); }); diff --git a/src/MainWindow/CustomFlow/components/ButtonWithBoxRightArrowIcon.jsx b/src/MainWindow/CustomFlow/components/ButtonWithBoxRightArrowIcon.jsx deleted file mode 100644 index 1f4df3c..0000000 --- a/src/MainWindow/CustomFlow/components/ButtonWithBoxRightArrowIcon.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import boxRightArrowIcon from "../../../assets/box-arrow-up-right-white.svg"; - - const ButtonWithBoxRightArrowIcon = ({onClick, buttonLabel}) => { - return ( - - ) -} - -export default ButtonWithBoxRightArrowIcon; \ No newline at end of file diff --git a/src/MainWindow/CustomFlow/components/CustomFlowDisplay.jsx b/src/MainWindow/CustomFlow/components/CustomFlowDisplay.jsx index a2f145a..26c8755 100644 --- a/src/MainWindow/CustomFlow/components/CustomFlowDisplay.jsx +++ b/src/MainWindow/CustomFlow/components/CustomFlowDisplay.jsx @@ -1,10 +1,8 @@ const CustomFlowDisplay = ({ icon, - step, title, url, description, - scanType //optional }) => { return ( <> @@ -12,7 +10,7 @@ const CustomFlowDisplay = ({
-

{(scanType == 'Custom flow 2.0')? 'FINAL STEP' : `STEP ${step} of 4`}

+

FINAL STEP

{title}

diff --git a/src/MainWindow/CustomFlow/components/ProgressStepComponent.jsx b/src/MainWindow/CustomFlow/components/ProgressStepComponent.jsx deleted file mode 100644 index 5f6c652..0000000 --- a/src/MainWindow/CustomFlow/components/ProgressStepComponent.jsx +++ /dev/null @@ -1,52 +0,0 @@ -import { useEffect } from "react"; -import fullPurpleCheckIcon from "../../../assets/full-purple-check-circle.svg"; - -const ProgressStepComponent = ({step}) => { - useEffect(() => { - const currentProgressStepItemID = `#progress-step-item-${step}`; - const currentProgressStepItemElement = document.querySelector(currentProgressStepItemID); - currentProgressStepItemElement.setAttribute("aria-current", "step"); - - return () => { - currentProgressStepItemElement.removeAttribute("aria-current"); - } - }) - - const ProgressStepItemComponent = ({num, label}) => { - const progressStepClassName = num === step ? 'progress-step active' : 'progress-step'; - const progressStepID = `progress-step-item-${num}`; - - return ( -
- {num < step - ? - :
{num}
} - {label} -
- ) - } - - const ProgressStepBarComponent = ({num}) => { - const classNameToUse = num < step ? 'progress-step-bar active' : 'progress-step-bar'; - return ( -
- ) - } - - return ( -
-

CUSTOM FLOW

-
- - - - - - - -
-
- ) -} - -export default ProgressStepComponent; \ No newline at end of file diff --git a/src/MainWindow/CustomFlow/index.jsx b/src/MainWindow/CustomFlow/index.jsx index 074f6d3..6d7e2d9 100644 --- a/src/MainWindow/CustomFlow/index.jsx +++ b/src/MainWindow/CustomFlow/index.jsx @@ -1,208 +1,24 @@ import { useEffect, useState } from "react"; import { useLocation, useNavigate } from "react-router"; -import { cliErrorCodes, cliErrorTypes, errorStates } from "../../common/constants"; import services from "../../services"; import './CustomFlow.scss'; -import arrowLeft from "../../assets/arrow-left-purple.svg"; -import arrowRightGrey from "../../assets/arrow-right-grey.svg"; -import arrowRightWhite from "../../assets/arrow-right-white.svg"; -import editIcon from "../../assets/box-edit.svg"; -import exclaimTriangleIcon from "../../assets/exclamation-triangle-purple.svg"; -import thumbsUpIcon from "../../assets/hand-thumbs-up-purple.svg"; -import recordIcon from "../../assets/record-icon.svg"; -import replayIcon from "../../assets/replay-icon.svg"; import labelIcon from "../../assets/label-icon.svg"; -import ScanningComponent from "../../common/components/ScanningComponent"; -import ProgressStepComponent from "./components/ProgressStepComponent"; import CustomFlowDisplay from "./components/CustomFlowDisplay"; -import ButtonWithBoxRightArrowIcon from "./components/ButtonWithBoxRightArrowIcon"; -import DoneScanningStatus from "../../common/components/DoneScanningStatus"; -import LoadingScanningStatus from "../../common/components/LoadingScanningStatus"; -import Alert from "../../common/components/Alert"; -import { Link } from "react-router-dom"; -const PrepareStep = ({ scanDetails, setStep, setScanDetails }) => { - const [isPostLogin, setIsPostLogin] = useState(null); - const [isFileUpload, setIsFileUpload] = useState(null); - const [fileUploadFolder, setFileUploadFolder] = useState(undefined); - - useEffect(() => { - const getUploadFolderPath = async () => { - const path = await services.getUploadFolderPath(); - setFileUploadFolder(path); - }; - getUploadFolderPath(); - }, []); - - const handleOpenUploadFolder = async (e) => { - e.preventDefault(); - window.services.openResultsFolder(fileUploadFolder); - }; - - const onClickNextStep = (e) => { - e.preventDefault(); - // get responses - const scanMetadata = { isPostLogin, isFileUpload }; - const newScanDetails = { ...scanDetails, scanMetadata }; - setScanDetails(newScanDetails); - setStep(2); - }; - - const handleCheckInput = (setState, stateVal) => { - return (e) => { - e.target.checked = true; - setState(stateVal); - }; - }; - - const isAllSet = isPostLogin !== null && isFileUpload !== null && !isPostLogin && !isFileUpload; - const isButtonDisabled = isPostLogin === null || isFileUpload === null; - - return ( - <> - -
-
- 1. Does your custom flow have any post-login webpages? -
- - -
-
- - -
- {isPostLogin && - - Ensure post-login webpages can be revisited using the same login credentials to allow Purple A11y to replay the steps for scanning. - } -
- -
- 2. Does your custom flow have any file upload fields? -
- - -
-
- - -
- {isFileUpload && fileUploadFolder && - -

- If form contains file upload fields, place the same file{"(s)"} in{" "} - {fileUploadFolder}{" "} - to allow Purple A11y to attach the same file{"(s)"} when replaying the steps. -

-
} -
- - {isAllSet && - - It looks like you're all set for the custom flow scan, let's get started! - } - -
- - ) -}; const CustomFlowPage = ({ completedScanId, setCompletedScanId }) => { const { state }= useLocation(); const navigate = useNavigate(); const [scanDetails, setScanDetails] = useState(null); - const [generatedScript, setGeneratedScript] = useState(null); const [customFlowLabel, setCustomFlowLabel] = useState(''); - const [loading, setLoading] = useState(false); - const [done, setDone] = useState(false); - const [step, setStep] = useState(1); - const [isReplay, setIsReplay] = useState(false); const [inputErrorMessage, setInputErrorMessage] = useState(null); useEffect(() => { if (state?.scanDetails) { setScanDetails(state.scanDetails); } - - if (state?.isReplay) { - setIsReplay(true); - const generatedScript = window.sessionStorage.getItem("latestCustomFlowGeneratedScript"); - const scanDetails = JSON.parse(window.sessionStorage.getItem("latestCustomFlowScanDetails")); - let encryptionParams = window.sessionStorage.getItem('latestCustomFlowEncryptionParams'); - if (encryptionParams) { - scanDetails.encryptionParams = JSON.parse(encryptionParams); - window.sessionStorage.removeItem('latestCustomFlowEncryptionParams'); - } - setGeneratedScript(generatedScript); - setScanDetails(scanDetails); - setStep(3); - } - - if (state.scanDetails.scanType=='Custom flow 2.0'){ - setStep(4); - } }, []) - useEffect(() => { - if (done) { - const timer = setTimeout(() => { - setStep(step + 1); - setDone(false); - }, 3000) - - return () => { - window.clearTimeout(timer); - } - } - }, [done]) - - const onClickRecord = async () => { - setLoading(true); - await startRecording(); - } - - const startRecording = async () => { - const response = await services.startScan(scanDetails); - - if (response.success) { - window.sessionStorage.setItem("latestCustomFlowGeneratedScript", response.generatedScript); - window.sessionStorage.setItem("latestCustomFlowScanDetails", JSON.stringify(scanDetails)); - setGeneratedScript(response.generatedScript); - setLoading(false); - setDone(true); - return; - } - } - - const onClickReplay = async () => { - setLoading(true); - await startReplaying(); - } - - const startReplaying = async () => { - const response = await window.services.startReplay(generatedScript, scanDetails, isReplay); - - if (response.success) { - window.sessionStorage.setItem('latestCustomFlowEncryptionParams', JSON.stringify(response.encryptionParams)); - setCompletedScanId(response.scanId); - setLoading(false); - setDone(true); - return; - } - - navigate("/error", {state: { errorState: errorStates.customScanError }}); - return; - } - const validateLabel = () => { const {isValid, errorMessage} = services.isValidCustomFlowLabel(customFlowLabel); if (!isValid) { @@ -223,91 +39,36 @@ const CustomFlowPage = ({ completedScanId, setCompletedScanId }) => { const validated = validateLabel(); if (validated) { window.services.generateReport(customFlowLabel.trim(), completedScanId); - window.localStorage.setItem("latestCustomFlowGeneratedScript", generatedScript); window.localStorage.setItem("latestCustomFlowScanDetails", JSON.stringify(scanDetails)); - navigate("/result", {state: { isCustomScan: state.scanDetails.scanType !== 'Custom flow 2.0', customFlowLabel: customFlowLabel }}); + navigate("/result", {state: {customFlowLabel: customFlowLabel }}); } return; } const currentDisplay = () => { - switch (step) { - case 1: { - return ( - - ) - } - case 2: { - return ( - <> - - Record your custom flow by manually navigating on a new browser window that will open automatically after starting the recording. In the event of a login page, we will solely capture your credentials for this scan and promptly remove them thereafter. -



- After finishing your flow, please close the browser to continue to the next step. - } - /> - { !loading - ? done - ? - : - : - } - - ) - } - case 3: { - return ( - <> - - { !loading - ? done - ? - : - : - } - - ) - } - case 4: { - return ( - <> - - -
{generateReport(e)}}> - -
{inputErrorMessage}
- -
- - ) - } - } + return ( + <> + + +
{generateReport(e)}}> + +
{inputErrorMessage}
+ +
+ + ) } @@ -315,17 +76,6 @@ const CustomFlowPage = ({ completedScanId, setCompletedScanId }) => {
{ scanDetails && <> - { state.scanDetails.scanType != 'Custom flow 2.0' && -
- {/*
- - -  Back to Home - -
*/} - -
- }
{currentDisplay()}
} diff --git a/src/MainWindow/ErrorPage/index.jsx b/src/MainWindow/ErrorPage/index.jsx index 9677730..63aa4ee 100644 --- a/src/MainWindow/ErrorPage/index.jsx +++ b/src/MainWindow/ErrorPage/index.jsx @@ -1,7 +1,6 @@ import Button from "../../common/components/Button"; import ButtonSvgIcon from "../../common/components/ButtonSvgIcon"; import "./ErrorPage.scss"; -import returnIcon from "../../assets/return-purple.svg"; import { useNavigate, useLocation } from "react-router"; import { ReactComponent as ExclamationCircleIcon } from "../../assets/exclamation-circle.svg"; import { useState, useEffect } from "react"; @@ -25,17 +24,7 @@ const ErrorPage = () => { getErrorLog(); }, []); - const replayCustomFlow = async () => { - navigate("/custom_flow", { state: { isReplay: true } }); - return; - }; - const handleBackToHome = () => { - if (errorState === errorStates.customScanError) { - window.services.cleanUpCustomFlowScripts(); - window.localStorage.removeItem("latestCustomFlowGeneratedScript"); - window.localStorage.removeItem("latestCustomFlowScanDetails"); - } navigate("/"); return; } @@ -71,22 +60,10 @@ const ErrorPage = () => { /> {errorMessageToDisplay()}
- {errorState === errorStates.customScanError - ? ( - <> - - - - ) - : } - {errorLog&&} + + {errorLog && }
diff --git a/src/MainWindow/HomePage/AdvancedScanOptions.jsx b/src/MainWindow/HomePage/AdvancedScanOptions.jsx index 29c19bb..f7597f1 100644 --- a/src/MainWindow/HomePage/AdvancedScanOptions.jsx +++ b/src/MainWindow/HomePage/AdvancedScanOptions.jsx @@ -183,8 +183,7 @@ const AdvancedScanOptions = ({ /> )} - {advancedOptions.scanType !== scanTypeOptions[2] && - advancedOptions.scanType !== scanTypeOptions[3] && ( + {advancedOptions.scanType !== scanTypeOptions[2] && ( } - {advancedOptions.scanType !== scanTypeOptions[3] && ( + {advancedOptions.scanType !== scanTypeOptions[2] && ( <>
{ const checkUrlResponse = await services.validateUrlConnectivity(scanDetails); if (checkUrlResponse.success) { - if (scanDetails.scanType === 'Custom flow') { - navigate('/custom_flow', { state: { scanDetails }}); - return; - } else { navigate('/scanning', { state: { url: urlWithoutAuth(scanDetails.scanUrl).toString() } }); const scanResponse = await services.startScan(scanDetails); @@ -213,7 +209,7 @@ const HomePage = ({ isProxy, appVersionInfo, setCompletedScanId }) => { if (scanResponse.success) { setCompletedScanId(scanResponse.scanId); - if (scanDetails.scanType === 'Custom flow 2.0') { + if (scanDetails.scanType === 'Custom flow') { navigate('/custom_flow', { state: { scanDetails }}) } else { navigate("/result"); @@ -225,7 +221,6 @@ const HomePage = ({ isProxy, appVersionInfo, setCompletedScanId }) => { navigate("/error", { state: { errorState: errorStates.noPagesScannedError,timeOfScan }}); return; } - } } else { setScanButtonIsClicked(false); if (checkUrlResponse.failedToCreateExportDir) { diff --git a/src/MainWindow/Onboarding/OnboardingComponent.jsx b/src/MainWindow/Onboarding/OnboardingComponent.jsx index edf5d13..5d21e72 100644 --- a/src/MainWindow/Onboarding/OnboardingComponent.jsx +++ b/src/MainWindow/Onboarding/OnboardingComponent.jsx @@ -144,8 +144,7 @@ const OnboardingComponent = ({ setDataExistStatus }) => {

Custom Flow Scan

- This scan type allows you to specify a user journey of choice by - recording a series of actions on the browser and replaying them. + This scan type allows you to specify a user journey by enabling you to click the scan button on each desired webpage on a browser to initiate scan.

diff --git a/src/MainWindow/ResultPage/index.jsx b/src/MainWindow/ResultPage/index.jsx index ab19b44..d8b3576 100644 --- a/src/MainWindow/ResultPage/index.jsx +++ b/src/MainWindow/ResultPage/index.jsx @@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from "react"; import Button from "../../common/components/Button"; import "./ResultPage.scss"; import services from "../../services"; -import { Link, useLocation, useNavigate } from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; import { handleClickLink } from "../../common/constants"; import ButtonSvgIcon from "../../common/components/ButtonSvgIcon"; import { ReactComponent as MailIcon } from "../../assets/mail-purple.svg"; @@ -14,28 +14,17 @@ import boxArrowUpRightIcon from "../../assets/box-arrow-up-right-white.svg"; import EditMailDetailsModal from "./EditMailDetailsModal"; const ResultPage = ({ completedScanId: scanId }) => { - const { state } = useLocation(); const navigate = useNavigate(); const [scanType, setScanType] = useState(null); const [email, setEmail] = useState(""); const [isEvent, setIsEvent] = useState(false); const [resultsPath, setResultsPath] = useState(null); - const [showCustomFlowReplayButton, setShowCustomFlowReplayButton] = - useState(false); - const [customFlowLabel, setCustomFlowLabel] = useState(""); const [feedbackFormUrl, setFeedbackFormUrl] = useState(null); const [isWindows, setIsWindows] = useState(false); const [mailStatus, setMailStatus] = useState("send"); const [showEditMailDetailsModal, setShowEditMailDetailsModal] = useState(false); - useEffect(() => { - if (state?.isCustomScan) { - setShowCustomFlowReplayButton(state.isCustomScan); - setCustomFlowLabel(state.customFlowLabel); - } - }, []); - useEffect(() => { const getDataForForm = async () => { const data = await services.getDataForForm(); @@ -85,8 +74,6 @@ const ResultPage = ({ completedScanId: scanId }) => { }; const handleScanAgain = () => { - window.services.cleanUpCustomFlowScripts(); - window.sessionStorage.removeItem("latestCustomFlowGeneratedScript"); window.sessionStorage.removeItem("latestCustomFlowScanDetails"); window.sessionStorage.removeItem("latestCustomFlowEncryptionParams"); navigate("/"); @@ -99,11 +86,6 @@ const ResultPage = ({ completedScanId: scanId }) => { window.services.openResultsFolder(resultsPath); }; - const replayCustomFlow = async () => { - navigate("/custom_flow", { state: { isReplay: true } }); - return; - }; - const handleSubmitMail = async (finalEmails, finalSubject) => { setMailStatus("sending"); @@ -185,14 +167,6 @@ const ResultPage = ({ completedScanId: scanId }) => { Help us improve - {showCustomFlowReplayButton && ( -
  • - - - Rerun custom flow {`(${customFlowLabel})`} - -
  • - )}

  • diff --git a/src/assets/replay-icon.svg b/src/assets/replay-icon.svg deleted file mode 100644 index 5a55374..0000000 --- a/src/assets/replay-icon.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/common/components/DoneScanningStatus.jsx b/src/common/components/DoneScanningStatus.jsx deleted file mode 100644 index 6b36898..0000000 --- a/src/common/components/DoneScanningStatus.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import purpleCheckIcon from "../../assets/purple-check-circle.svg"; - -const DoneScanningStatus = () => { - return ( -
    - -

    Done!

    -
    - ) -} - -export default DoneScanningStatus; \ No newline at end of file diff --git a/src/common/constants.js b/src/common/constants.js index 65f0a90..0d5eff7 100644 --- a/src/common/constants.js +++ b/src/common/constants.js @@ -4,7 +4,6 @@ export const scanTypes = { "Website crawl": "website", "Sitemap crawl": "sitemap", "Custom flow": "custom", - "Custom flow 2.0": "custom2", }; export const viewportTypes = { @@ -107,7 +106,6 @@ export const cliErrorTypes = { export const errorStates = { browserError: 'browserError', - customScanError: 'customScanError', noPagesScannedError: 'noPagesScannedError' } diff --git a/src/services.js b/src/services.js index 23d4e7c..95d9ddf 100644 --- a/src/services.js +++ b/src/services.js @@ -53,10 +53,6 @@ const validateUrlConnectivity = async (scanDetails) => { return response; }; -const abortScan = async () => { - await window.services.abortScan() -}; - const startScan = async (scanDetails) => { const { scanType: selectedScanType, @@ -82,8 +78,7 @@ const startScan = async (scanDetails) => { scanType: scanTypes[selectedScanType], url: scanUrl, headlessMode: - scanTypes[selectedScanType] !== "custom" && - scanTypes[selectedScanType] !== "custom2", + scanTypes[selectedScanType] !== "custom", browser: browser, maxConcurrency: maxConcurrency, fileTypes: fileTypes[selectedFileTypes], @@ -95,8 +90,7 @@ const startScan = async (scanDetails) => { }; if ( - scanTypes[selectedScanType] !== "custom" && - scanTypes[selectedScanType] !== "custom2" + scanTypes[selectedScanType] !== "custom" ) { scanArgs.maxPages = pageLimit; } @@ -242,7 +236,6 @@ const isValidName = (name) => { }; const services = { - abortScan, startScan, openReport, getResultsFolderPath,