From 73b2ece151e0a58a8eb9bf285fdada820d510aa9 Mon Sep 17 00:00:00 2001 From: Sahiti Tarigoppula Date: Wed, 3 Aug 2022 20:22:38 +0530 Subject: [PATCH 1/2] canary url construction change in verification --- .../src/VerificationExecutionDetails.tsx | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/gate-verify/custom-stage-deck/src/VerificationExecutionDetails.tsx b/gate-verify/custom-stage-deck/src/VerificationExecutionDetails.tsx index 3443549..bbfbf44 100644 --- a/gate-verify/custom-stage-deck/src/VerificationExecutionDetails.tsx +++ b/gate-verify/custom-stage-deck/src/VerificationExecutionDetails.tsx @@ -25,11 +25,24 @@ export function VerificationExecutionDetails(props: IExecutionDetailsSectionProp useEffect(() => { if (props.stage.outputs?.canaryReportURL) { - let urlPath = props.stage.outputs.canaryReportURL.split("/"); + let urlPath = props.stage.outputs?.canaryReportURL.split("/"); + let startIndex = urlPath.findIndex((inp: any) => inp === 'deploymentverification') let path: any[] = []; - for (let i = urlPath?.length - 1; i >= 6; i--) - path = [urlPath[i], ...path] - var constructedPath = path.join("/") + for (let i = startIndex + 1; i < urlPath.length; i++) + path = [...path, urlPath[i]] + let constructedPath; + if (path.includes('fromPlugin')) constructedPath = path.join("/"); + else { + if (Number.isInteger(parseInt(path[path.length - 1])) && Number.isInteger(parseInt(path[path.length - 2]))) { + path.splice(2, 0, 'fromPlugin'); + constructedPath = path.join("/"); + } + else { + path = [...path, 'fromPlugin'] + constructedPath = path.join("/"); + } + } + console.log("constructed url",`${window.location.origin}/ui/plugin-isd/verification/${constructedPath}`) setCanaryUrl(`${window.location.origin}/ui/plugin-isd/verification/${constructedPath}`) } }, []) From a543b96f7dff213a773ee1223991e6a0c4e51a87 Mon Sep 17 00:00:00 2001 From: Sahiti Tarigoppula Date: Thu, 4 Aug 2022 12:34:46 +0530 Subject: [PATCH 2/2] url construction --- .../custom-stage-deck/src/VerificationExecutionDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gate-verify/custom-stage-deck/src/VerificationExecutionDetails.tsx b/gate-verify/custom-stage-deck/src/VerificationExecutionDetails.tsx index bbfbf44..9a1a1d1 100644 --- a/gate-verify/custom-stage-deck/src/VerificationExecutionDetails.tsx +++ b/gate-verify/custom-stage-deck/src/VerificationExecutionDetails.tsx @@ -25,7 +25,7 @@ export function VerificationExecutionDetails(props: IExecutionDetailsSectionProp useEffect(() => { if (props.stage.outputs?.canaryReportURL) { - let urlPath = props.stage.outputs?.canaryReportURL.split("/"); + let urlPath = props.stage.outputs.canaryReportURL.split("/"); let startIndex = urlPath.findIndex((inp: any) => inp === 'deploymentverification') let path: any[] = []; for (let i = startIndex + 1; i < urlPath.length; i++)