Skip to content

Commit

Permalink
✨ Add link for jira ticket in drawer view
Browse files Browse the repository at this point in the history
Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 committed Nov 15, 2023
1 parent 44e6eeb commit 1c7e3d8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/src/app/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ export interface Ticket {
reference?: string | null;
readonly status?: TicketStatus | null;
error?: boolean;
link?: string;
}

export type Role = "Owner" | "Contributor" | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ 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;
onEditClick: () => void;
onCloseClick: () => void;
}> = ({ application, onEditClick, onCloseClick }) => {
const { t } = useTranslation();
const { tickets } = useFetchTickets();
const matchingTicket = tickets?.find(
(ticket) => ticket.application?.id === application?.id
);

return (
<>
Expand Down Expand Up @@ -143,11 +148,40 @@ export const ApplicationDetailFields: React.FC<{
<Title headingLevel="h3" size="md">
{t("terms.migrationWave")}
</Title>
<Text component="small">
<Text
component={TextVariants.small}
className="pf-v5-u-color-200 pf-v5-u-font-weight-light"
>
Wave name{": "}
</Text>
<Text
component={TextVariants.small}
className="pf-v5-u-color-200 pf-v5-u-font-weight-light"
>
{application?.migrationWave
? application.migrationWave.name
: t("terms.unassigned")}
</Text>
<br />
<Text
component={TextVariants.small}
className="pf-v5-u-color-200 pf-v5-u-font-weight-light"
>
Ticket{": "}
</Text>
<Text
component={TextVariants.small}
className="pf-v5-u-color-200 pf-v5-u-font-weight-light"
>
{matchingTicket ? (
<a href={matchingTicket.link} target="_">
{matchingTicket?.link}
</a>
) : (
t("terms.unassigned")
)}
</Text>

<Title headingLevel="h3" size="md">
{t("terms.commentsFromApplication")}
</Title>
Expand Down

0 comments on commit 1c7e3d8

Please sign in to comment.