File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/view/variant-analysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ export function VariantAnalysis({
132132 return < VariantAnalysisLoading /> ;
133133 }
134134
135+ const onViewLogsClick =
136+ variantAnalysis . actionsWorkflowRunId === undefined ? undefined : openLogs ;
137+
135138 return (
136139 < >
137140 < VariantAnalysisHeader
@@ -141,7 +144,7 @@ export function VariantAnalysis({
141144 onStopQueryClick = { stopQuery }
142145 onCopyRepositoryListClick = { copyRepositoryList }
143146 onExportResultsClick = { exportResults }
144- onViewLogsClick = { openLogs }
147+ onViewLogsClick = { onViewLogsClick }
145148 />
146149 < VariantAnalysisOutcomePanels
147150 variantAnalysis = { variantAnalysis }
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export type VariantAnalysisHeaderProps = {
2424 onCopyRepositoryListClick : ( ) => void ;
2525 onExportResultsClick : ( ) => void ;
2626
27- onViewLogsClick : ( ) => void ;
27+ onViewLogsClick ? : ( ) => void ;
2828} ;
2929
3030const Container = styled . div `
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export type VariantAnalysisStatsProps = {
2020 createdAt : Date ;
2121 completedAt ?: Date | undefined ;
2222
23- onViewLogsClick : ( ) => void ;
23+ onViewLogsClick ? : ( ) => void ;
2424} ;
2525
2626const Row = styled . div `
@@ -88,6 +88,7 @@ export const VariantAnalysisStats = ({
8888 </ StatItem >
8989 < StatItem title = { completionHeaderName } >
9090 < VariantAnalysisStatusStats
91+ variantAnalysisStatus = { variantAnalysisStatus }
9192 completedAt = { completedAt }
9293 onViewLogsClick = { onViewLogsClick }
9394 />
Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import * as React from "react";
22import styled from "styled-components" ;
33import { VSCodeLink } from "@vscode/webview-ui-toolkit/react" ;
44import { formatDate } from "../../pure/date" ;
5+ import { VariantAnalysisStatus } from "../../remote-queries/shared/variant-analysis" ;
56
67type Props = {
7- completedAt ?: Date | undefined ;
8+ variantAnalysisStatus : VariantAnalysisStatus ;
9+ completedAt ?: Date ;
810
9- onViewLogsClick : ( ) => void ;
11+ onViewLogsClick ? : ( ) => void ;
1012} ;
1113
1214const Container = styled . div `
@@ -21,17 +23,20 @@ const Icon = styled.span`
2123` ;
2224
2325export const VariantAnalysisStatusStats = ( {
26+ variantAnalysisStatus,
2427 completedAt,
2528 onViewLogsClick,
2629} : Props ) => {
27- if ( completedAt === undefined ) {
30+ if ( variantAnalysisStatus === VariantAnalysisStatus . InProgress ) {
2831 return < Icon className = "codicon codicon-loading codicon-modifier-spin" /> ;
2932 }
3033
3134 return (
3235 < Container >
33- < span > { formatDate ( completedAt ) } </ span >
34- < VSCodeLink onClick = { onViewLogsClick } > View logs</ VSCodeLink >
36+ < span > { completedAt !== undefined ? formatDate ( completedAt ) : "-" } </ span >
37+ { onViewLogsClick && (
38+ < VSCodeLink onClick = { onViewLogsClick } > View logs</ VSCodeLink >
39+ ) }
3540 </ Container >
3641 ) ;
3742} ;
You can’t perform that action at this time.
0 commit comments