diff --git a/react-web/src/pages/certification/Certification.scss b/react-web/src/pages/certification/Certification.scss index 65ccf1e2..6138fa1e 100644 --- a/react-web/src/pages/certification/Certification.scss +++ b/react-web/src/pages/certification/Certification.scss @@ -23,10 +23,13 @@ margin-bottom: 20px; color: $body-text-gray; } - .btn { + .footer { display: flex; - margin: 0 auto; - min-width: 160px; + justify-content: center; + column-gap: 10px; + .btn { + display: flex; + } } } diff --git a/react-web/src/pages/certification/Certification.tsx b/react-web/src/pages/certification/Certification.tsx index a9c8f1fc..8f299eb6 100644 --- a/react-web/src/pages/certification/Certification.tsx +++ b/react-web/src/pages/certification/Certification.tsx @@ -30,6 +30,8 @@ import CreateCertificate from "components/CreateCertificate/CreateCertificate"; import { useAppDispatch, useAppSelector } from "store/store"; import { clearUuid, setUuid } from "./slices/certification.slice"; +import { deleteTestHistoryData } from "pages/testHistory/slices/deleteTestHistory.slice"; +import { useConfirm } from "material-ui-confirm"; const TIMEOFFSET = 1000; @@ -42,6 +44,7 @@ const Certification = () => { const { uuid } = useAppSelector((state) => state.certification); const { userDetails } = useAppSelector((state) => state.auth); const dispatch = useAppDispatch(); + const confirm = useConfirm(); const [submitting, setSubmitting] = useState(false); const [formSubmitted, setFormSubmitted] = useState(false); const [timelineConfig, setTimelineConfig] = useState(TIMELINE_CONFIG); @@ -188,6 +191,14 @@ const Certification = () => { exportObjectToJsonFile(resultData); }; + const abortRun = () => { + confirm({ title: "", description: "Are sure you want to abort this run!" }) + .then(async () => { + await dispatch(deleteTestHistoryData({ url: "/run/" + uuid + "?delete=true" })); + resetStates() + }).catch(() => { }); + } + useEffect(() => { if (uuid.length) { triggerFetchRunStatus(); @@ -252,17 +263,26 @@ const Certification = () => { disabled={submitting} {...form.register("commit")} /> +
diff --git a/react-web/src/pages/testHistory/TestHistory.tsx b/react-web/src/pages/testHistory/TestHistory.tsx index 4c074c88..b5ed5c18 100644 --- a/react-web/src/pages/testHistory/TestHistory.tsx +++ b/react-web/src/pages/testHistory/TestHistory.tsx @@ -23,7 +23,7 @@ interface ICampaign { finishedAt: string; syncedAt: string; repoUrl: string; - runStatus: "queued" | "failed" | "succeeded" | "certified"; + runStatus: "queued" | "failed" | "succeeded" | "certified" | "ready-for-certification" | "aborted"; runId: string; } @@ -163,6 +163,13 @@ const TestHistory = () => { ); + } else if (value === "aborted") { + return Aborted; + } else if (value === "ready-for-certification") { + return Ready for Certification; } }; @@ -249,7 +256,7 @@ const TestHistory = () => { disableSortBy: true, accessor: "viewReport", Cell: (props: any) => { - if (props.row.original.runStatus === "succeeded" || props.row.original.runStatus === "certified") { + if (props.row.original.runStatus === "succeeded" || props.row.original.runStatus === "ready-for-certification" || props.row.original.runStatus === "certified") { return ( - ); + if (props.row.original.runStatus !== "certified" && props.row.original.runStatus !== "ready-for-certification") { + return (<> + + ); + } }, } ],