From 12027e0897127e84b581d2bcdc2c939f1dc2f39d Mon Sep 17 00:00:00 2001 From: ibolton336 Date: Thu, 24 Aug 2023 17:15:22 -0400 Subject: [PATCH] Add styling Signed-off-by: ibolton336 --- .../application-detail-drawer-analysis.tsx | 50 +++++++++++++------ .../components/download-button.tsx | 12 +++-- 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-analysis.tsx b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-analysis.tsx index 05c6f2f68a..03682c911e 100644 --- a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-analysis.tsx +++ b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-analysis.tsx @@ -6,6 +6,11 @@ import { Title, Tooltip, Button, + Divider, + TextList, + TextListItem, + TextListVariants, + TextListItemVariants, } from "@patternfly/react-core"; import { CheckCircleIcon, @@ -26,7 +31,7 @@ import { SimpleDocumentViewerModal } from "@app/components/SimpleDocumentViewer" import { APPLICATIONS, getTaskById } from "@app/api/rest"; import { COLOR_HEX_VALUES_BY_NAME } from "@app/Constants"; import { Link } from "react-router-dom"; -import DownloadButton from "./components/download-button"; +import DownloadButton, { MimeType } from "./components/download-button"; export interface IApplicationDetailDrawerAnalysisProps extends Pick< @@ -120,21 +125,36 @@ export const ApplicationDetailDrawerAnalysis: React.FC< Analysis details - - + + - - - {" | "} - - - - + Download + + + + + + {" | "} + + + + + ) : task?.state === "Failed" ? ( task ? ( diff --git a/client/src/app/pages/applications/components/application-detail-drawer/components/download-button.tsx b/client/src/app/pages/applications/components/application-detail-drawer/components/download-button.tsx index 6de90b79b4..4e0cb99673 100644 --- a/client/src/app/pages/applications/components/application-detail-drawer/components/download-button.tsx +++ b/client/src/app/pages/applications/components/application-detail-drawer/components/download-button.tsx @@ -5,12 +5,16 @@ import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; import { Application } from "@app/api/models"; import { Spinner } from "@patternfly/react-core"; +export enum MimeType { + TAR = "tar", + YAML = "yaml", +} function DownloadButton({ application, mimeType, }: { application: Application; - mimeType: string; + mimeType: MimeType; }) { const [isLoading, setIsLoading] = useState(false); @@ -18,10 +22,10 @@ function DownloadButton({ let acceptHeader = "application/x-tar"; switch (mimeType) { - case "yaml": + case MimeType.YAML: acceptHeader = "application/x-yaml"; break; - case "tar": + case MimeType.TAR: default: acceptHeader = "application/x-tar"; } @@ -70,7 +74,7 @@ function DownloadButton({ variant="link" className={spacing.pXs} > - {`Download ${mimeType.toUpperCase()}`} + {mimeType === MimeType.YAML ? "YAML" : "Report"} )}