Skip to content

Commit

Permalink
Drawer tab for reports should allow download on SucceededWithErrors
Browse files Browse the repository at this point in the history
Signed-off-by: Scott J Dickerson <[email protected]>
  • Loading branch information
sjd78 committed Jul 16, 2024
1 parent 849a2ec commit d061d53
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import { Paths } from "@app/Paths";
import { useFetchArchetypes } from "@app/queries/archetypes";
import { useFetchAssessments } from "@app/queries/assessments";
import { DecoratedApplication } from "../../applications-table/useDecoratedApplications";
import { TaskStates } from "@app/queries/tasks";

export interface IApplicationDetailDrawerProps
extends Pick<IPageDrawerContentProps, "onCloseClick"> {
Expand Down Expand Up @@ -364,6 +365,10 @@ const TabReportsContent: React.FC<{
})
);

const taskState = application.tasks.currentAnalyzer?.state ?? "";
const taskSucceeded = TaskStates.Success.includes(taskState);
const taskFailed = TaskStates.Failed.includes(taskState);

return (
<>
<TextContent className={spacing.mtMd}>
Expand Down Expand Up @@ -392,7 +397,7 @@ const TabReportsContent: React.FC<{
<Title headingLevel="h3" size="md">
Analysis
</Title>
{task?.state === "Succeeded" && application ? (
{taskSucceeded ? (
<>
<DescriptionList isHorizontal columnModifier={{ default: "2Col" }}>
<DescriptionListGroup>
Expand Down Expand Up @@ -458,7 +463,7 @@ const TabReportsContent: React.FC<{
</DescriptionList>
<Divider className={spacing.mtMd}></Divider>
</>
) : task?.state === "Failed" ? (
) : taskFailed ? (
task ? (
<>
<Button
Expand Down Expand Up @@ -511,6 +516,7 @@ const TabReportsContent: React.FC<{
</>
)}
</TextContent>

{!isFetching && !!facts.length && <ApplicationFacts facts={facts} />}
</>
);
Expand Down

0 comments on commit d061d53

Please sign in to comment.