Skip to content

Commit

Permalink
DEVPROD-1971: Remove table for custom tickets (evergreen-ci#2171)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad authored Dec 12, 2023
1 parent ae092e1 commit 9f1f0fb
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import WithToastContext from "test_utils/toast-decorator";
import { CustomMeta, CustomStoryObj } from "test_utils/types";
import CustomCreatedTickets from "./CustomCreatedTickets";

export default {
component: CustomCreatedTickets,
decorators: [(Story: () => JSX.Element) => WithToastContext(Story)],
} satisfies CustomMeta<typeof CustomCreatedTickets>;

export const Default: CustomStoryObj<typeof CustomCreatedTickets> = {
render: (args) => <CustomCreatedTickets {...args} />,
argTypes: {},
args: {
execution: 0,
taskId: "123",
tickets: [
{
confidenceScore: 0.25,
issueKey: "DEVPROD-1",
jiraTicket: {
key: "key",
fields: {
summary: "Issue Summary",
status: {
id: "id",
name: "Done",
},
created: "2020-01-27",
updated: "2023-11-28",
assigneeDisplayName: "sophie.stadler",
assignedTeam: "evg-ui",
},
},
url: "https://spruce.mongodb.com",
},
{
confidenceScore: 0.5,
issueKey: "DEVPROD-2",
jiraTicket: {
key: "key",
fields: {
summary: "Issue Summary",
status: {
id: "id",
name: "In Progress",
},
created: "2020-01-28",
updated: "2023-11-29",
assigneeDisplayName: "mohamed.khelif",
assignedTeam: "evg-ui",
},
},
url: "https://spruce.mongodb.com",
},
],
},
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import styled from "@emotion/styled";
import { size } from "constants/tokens";
import { IssueLink } from "gql/generated/types";
import { AnnotationTicketRow } from "../AnnotationTicketsTable/AnnotationTicketRow";
import { TicketsTitle } from "../BBComponents";
import FileTicketButton from "../FileTicketButton";
import CustomCreatedTicketsTable from "./CustomCreatedTicketsTable";

interface CustomCreatedTicketProps {
taskId: string;
Expand All @@ -19,11 +21,27 @@ const CustomCreatedTickets: React.FC<CustomCreatedTicketProps> = ({
<FileTicketButton taskId={taskId} execution={execution} />
{!!tickets?.length && (
<>
<TicketsTitle>Tickets Created From This Task</TicketsTitle>
<CustomCreatedTicketsTable tickets={tickets} />
<TicketsTitle margin>Tickets Created From This Task</TicketsTitle>
<TicketContainer>
{tickets.map(({ confidenceScore, issueKey, jiraTicket, url }) => (
<AnnotationTicketRow
confidenceScore={confidenceScore}
issueKey={issueKey}
jiraTicket={jiraTicket}
key={issueKey}
url={url}
/>
))}
</TicketContainer>
</>
)}
</>
);

const TicketContainer = styled.div`
display: flex;
flex-direction: column;
gap: ${size.s};
`;

export default CustomCreatedTickets;

This file was deleted.

0 comments on commit 9f1f0fb

Please sign in to comment.