Select overviews by name instead of index
This commit is contained in:
parent
f13530f043
commit
7df947f35a
28 changed files with 1581 additions and 2809 deletions
|
|
@ -10,7 +10,7 @@ import {
|
|||
TextField,
|
||||
} from "@mui/material";
|
||||
import { useSWRConfig } from "swr";
|
||||
import { updateTicketMutation } from "../../../../../_graphql/updateTicketMutation";
|
||||
import { updateTicketMutation } from "app/_graphql/updateTicketMutation";
|
||||
|
||||
interface ArticleCreateDialogProps {
|
||||
ticketID: string;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
import { FC, useState } from "react";
|
||||
import useSWR from "swr";
|
||||
import { getTicketQuery } from "../../../../../_graphql/getTicketQuery";
|
||||
import { getTicketArticlesQuery } from "../../../../../_graphql/getTicketArticlesQuery";
|
||||
import { getTicketQuery } from "app/_graphql/getTicketQuery";
|
||||
import { getTicketArticlesQuery } from "app/_graphql/getTicketArticlesQuery";
|
||||
import {
|
||||
Grid,
|
||||
Box,
|
||||
|
|
@ -51,12 +51,14 @@ export const TicketDetail: FC<TicketDetailProps> = ({ id }) => {
|
|||
const mostRecentExternalArticle = externalArticles?.length
|
||||
? externalArticles[externalArticles.length - 1].node
|
||||
: null;
|
||||
console.log({ mostRecentExternalArticle });
|
||||
const mostRecentExternalArticleKind =
|
||||
mostRecentExternalArticle?.type?.name ?? "phone";
|
||||
const mostRecentEmailRecipient = mostRecentExternalArticle?.to?.name ?? "";
|
||||
console.log({ mostRecentExternalArticleKind, mostRecentEmailRecipient });
|
||||
const [dialogOpen, setDialogOpen] = useState(false);
|
||||
const [articleKind, setArticleKind] = useState("phone");
|
||||
const [recipient, setRecipient] = useState("");
|
||||
const [recipient, setRecipient] = useState(mostRecentEmailRecipient);
|
||||
const closeDialog = () => setDialogOpen(false);
|
||||
|
||||
const shouldRender =
|
||||
|
|
@ -189,6 +191,7 @@ export const TicketDetail: FC<TicketDetailProps> = ({ id }) => {
|
|||
open={dialogOpen}
|
||||
closeDialog={closeDialog}
|
||||
kind={articleKind}
|
||||
recipient={recipient}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import { DisplayError } from "../../../_components/DisplayError";
|
||||
import { DisplayError } from "app/_components/DisplayError";
|
||||
|
||||
type PageProps = {
|
||||
error: Error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue