Don't show spinner for a failed analysis
This commit is contained in:
@@ -132,6 +132,9 @@ export function VariantAnalysis({
|
||||
return <VariantAnalysisLoading />;
|
||||
}
|
||||
|
||||
const onViewLogsClick =
|
||||
variantAnalysis.actionsWorkflowRunId === undefined ? undefined : openLogs;
|
||||
|
||||
return (
|
||||
<>
|
||||
<VariantAnalysisHeader
|
||||
@@ -141,7 +144,7 @@ export function VariantAnalysis({
|
||||
onStopQueryClick={stopQuery}
|
||||
onCopyRepositoryListClick={copyRepositoryList}
|
||||
onExportResultsClick={exportResults}
|
||||
onViewLogsClick={openLogs}
|
||||
onViewLogsClick={onViewLogsClick}
|
||||
/>
|
||||
<VariantAnalysisOutcomePanels
|
||||
variantAnalysis={variantAnalysis}
|
||||
|
||||
@@ -24,7 +24,7 @@ export type VariantAnalysisHeaderProps = {
|
||||
onCopyRepositoryListClick: () => void;
|
||||
onExportResultsClick: () => void;
|
||||
|
||||
onViewLogsClick: () => void;
|
||||
onViewLogsClick?: () => void;
|
||||
};
|
||||
|
||||
const Container = styled.div`
|
||||
|
||||
@@ -20,7 +20,7 @@ export type VariantAnalysisStatsProps = {
|
||||
createdAt: Date;
|
||||
completedAt?: Date | undefined;
|
||||
|
||||
onViewLogsClick: () => void;
|
||||
onViewLogsClick?: () => void;
|
||||
};
|
||||
|
||||
const Row = styled.div`
|
||||
@@ -88,6 +88,7 @@ export const VariantAnalysisStats = ({
|
||||
</StatItem>
|
||||
<StatItem title={completionHeaderName}>
|
||||
<VariantAnalysisStatusStats
|
||||
variantAnalysisStatus={variantAnalysisStatus}
|
||||
completedAt={completedAt}
|
||||
onViewLogsClick={onViewLogsClick}
|
||||
/>
|
||||
|
||||
@@ -2,11 +2,13 @@ import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react";
|
||||
import { formatDate } from "../../pure/date";
|
||||
import { VariantAnalysisStatus } from "../../remote-queries/shared/variant-analysis";
|
||||
|
||||
type Props = {
|
||||
completedAt?: Date | undefined;
|
||||
variantAnalysisStatus: VariantAnalysisStatus;
|
||||
completedAt?: Date;
|
||||
|
||||
onViewLogsClick: () => void;
|
||||
onViewLogsClick?: () => void;
|
||||
};
|
||||
|
||||
const Container = styled.div`
|
||||
@@ -21,17 +23,20 @@ const Icon = styled.span`
|
||||
`;
|
||||
|
||||
export const VariantAnalysisStatusStats = ({
|
||||
variantAnalysisStatus,
|
||||
completedAt,
|
||||
onViewLogsClick,
|
||||
}: Props) => {
|
||||
if (completedAt === undefined) {
|
||||
if (variantAnalysisStatus === VariantAnalysisStatus.InProgress) {
|
||||
return <Icon className="codicon codicon-loading codicon-modifier-spin" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<span>{formatDate(completedAt)}</span>
|
||||
<VSCodeLink onClick={onViewLogsClick}>View logs</VSCodeLink>
|
||||
<span>{completedAt !== undefined ? formatDate(completedAt) : "-"}</span>
|
||||
{onViewLogsClick && (
|
||||
<VSCodeLink onClick={onViewLogsClick}>View logs</VSCodeLink>
|
||||
)}
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user