From 74cdd72f364b6b71c11122fab15edd2c7552fd3e Mon Sep 17 00:00:00 2001 From: Allen Zhang <37892968+zhangtao25@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:50:05 +0800 Subject: [PATCH] feat: update jacoco --- .../JacocoReport}/helper/handleOnSelect.ts | 0 .../JacocoReport}/index.tsx | 2 +- .../index/projects/[id]/commits/[sha].tsx | 29 ++++++++++++------- 3 files changed, 19 insertions(+), 12 deletions(-) rename packages/canyon-platform/src/{pages/jacoco/projects/[id]/commits/[sha] => components/JacocoReport}/helper/handleOnSelect.ts (100%) rename packages/canyon-platform/src/{pages/jacoco/projects/[id]/commits/[sha] => components/JacocoReport}/index.tsx (96%) diff --git a/packages/canyon-platform/src/pages/jacoco/projects/[id]/commits/[sha]/helper/handleOnSelect.ts b/packages/canyon-platform/src/components/JacocoReport/helper/handleOnSelect.ts similarity index 100% rename from packages/canyon-platform/src/pages/jacoco/projects/[id]/commits/[sha]/helper/handleOnSelect.ts rename to packages/canyon-platform/src/components/JacocoReport/helper/handleOnSelect.ts diff --git a/packages/canyon-platform/src/pages/jacoco/projects/[id]/commits/[sha]/index.tsx b/packages/canyon-platform/src/components/JacocoReport/index.tsx similarity index 96% rename from packages/canyon-platform/src/pages/jacoco/projects/[id]/commits/[sha]/index.tsx rename to packages/canyon-platform/src/components/JacocoReport/index.tsx index 436efe0f..09b4bfb8 100644 --- a/packages/canyon-platform/src/pages/jacoco/projects/[id]/commits/[sha]/index.tsx +++ b/packages/canyon-platform/src/components/JacocoReport/index.tsx @@ -50,7 +50,7 @@ const ReportPage = () => { // path: path, // }); - nav(`/jacoco/projects/${projectID}/commits/${sha}?path=${path}`); + nav(`/projects/${projectID}/commits/${sha}?path=${path}`); // console.log(path); console.log(path, 'path'); diff --git a/packages/canyon-platform/src/pages/index/projects/[id]/commits/[sha].tsx b/packages/canyon-platform/src/pages/index/projects/[id]/commits/[sha].tsx index 82597d73..4c92ae13 100755 --- a/packages/canyon-platform/src/pages/index/projects/[id]/commits/[sha].tsx +++ b/packages/canyon-platform/src/pages/index/projects/[id]/commits/[sha].tsx @@ -3,6 +3,7 @@ import { useRequest } from 'ahooks'; import { useLocation, useNavigate, useParams, useSearchParams } from 'react-router-dom'; import CanyonReport from '../../../../../components/CanyonReport'; +import ReportPage from '../../../../../components/JacocoReport'; import { GetProjectByIdDocument } from '../../../../../helpers/backend/gen/graphql.ts'; import { getCoverageSummaryMapService, handleSelectFile } from './helper'; const { useToken } = theme; @@ -84,17 +85,23 @@ const Sha = () => { > {/*{pathWithNamespace}111*/} {/*{pathWithNamespace}*/} - { - setActivatedPath(v.path); - }} - /> + + <>{getProjectByIdDocumentData?.getProjectByID.language === 'Java' && } + <> + {getProjectByIdDocumentData?.getProjectByID.language === 'JavaScript' && ( + { + setActivatedPath(v.path); + }} + /> + )} + ); };