From 1c7e3d8c711c5abea338b7bd2d2ffe466da072a2 Mon Sep 17 00:00:00 2001 From: ibolton336 Date: Wed, 15 Nov 2023 13:36:29 -0500 Subject: [PATCH] :sparkles: Add link for jira ticket in drawer view Signed-off-by: ibolton336 --- client/src/app/api/models.ts | 1 + .../application-detail-fields.tsx | 36 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/client/src/app/api/models.ts b/client/src/app/api/models.ts index 5191e8aa8e..ee723beb5a 100644 --- a/client/src/app/api/models.ts +++ b/client/src/app/api/models.ts @@ -622,6 +622,7 @@ export interface Ticket { reference?: string | null; readonly status?: TicketStatus | null; error?: boolean; + link?: string; } export type Role = "Owner" | "Contributor" | null; diff --git a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx index 33acc20d92..703e3bf4b0 100644 --- a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx +++ b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx @@ -14,6 +14,7 @@ import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; import { ApplicationBusinessService } from "../application-business-service"; import { EmptyTextMessage } from "@app/components/EmptyTextMessage"; import { EditIcon } from "@patternfly/react-icons"; +import { useFetchTickets } from "@app/queries/tickets"; export const ApplicationDetailFields: React.FC<{ application: Application | null; @@ -21,6 +22,10 @@ export const ApplicationDetailFields: React.FC<{ onCloseClick: () => void; }> = ({ application, onEditClick, onCloseClick }) => { const { t } = useTranslation(); + const { tickets } = useFetchTickets(); + const matchingTicket = tickets?.find( + (ticket) => ticket.application?.id === application?.id + ); return ( <> @@ -143,11 +148,40 @@ export const ApplicationDetailFields: React.FC<{ {t("terms.migrationWave")} - + + Wave name{": "} + + {application?.migrationWave ? application.migrationWave.name : t("terms.unassigned")} +
+ + Ticket{": "} + + + {matchingTicket ? ( + + {matchingTicket?.link} + + ) : ( + t("terms.unassigned") + )} + + {t("terms.commentsFromApplication")}