Fix email replies, update dependencies
This commit is contained in:
parent
8d86db882d
commit
7688730e4f
21 changed files with 539 additions and 567 deletions
|
|
@ -21,7 +21,7 @@
|
|||
"@fontsource/poppins": "^5.0.8",
|
||||
"@fontsource/roboto": "^5.0.8",
|
||||
"@mui/icons-material": "^5",
|
||||
"@mui/lab": "^5.0.0-alpha.152",
|
||||
"@mui/lab": "^5.0.0-alpha.153",
|
||||
"@mui/material": "^5",
|
||||
"@mui/x-data-grid-pro": "^6.18.1",
|
||||
"@mui/x-date-pickers-pro": "^6.18.1",
|
||||
|
|
@ -31,8 +31,8 @@
|
|||
"http-proxy-middleware": "^2.0.6",
|
||||
"leafcutter-common": "*",
|
||||
"material-ui-popup-state": "^5.0.10",
|
||||
"next": "14.0.2",
|
||||
"next-auth": "^4.24.4",
|
||||
"next": "14.0.3",
|
||||
"next-auth": "^4.24.5",
|
||||
"next-http-proxy-middleware": "^1.2.6",
|
||||
"nodemailer": "^6.9.7",
|
||||
"react": "18.2.0",
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
"react-cookie-consent": "^9.0.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-iframe": "^1.8.5",
|
||||
"react-markdown": "^9.0.0",
|
||||
"react-markdown": "^9.0.1",
|
||||
"react-polyglot": "^0.7.2",
|
||||
"sharp": "^0.32.6",
|
||||
"swr": "^2.2.4",
|
||||
|
|
@ -49,18 +49,18 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.3",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "18.2.37",
|
||||
"@types/node": "^20.9.4",
|
||||
"@types/react": "18.2.38",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"babel-loader": "^9.1.3",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint": "^8.54.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-next": "^14.0.2",
|
||||
"eslint-config-next": "^14.0.3",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"typescript": "5.2.2"
|
||||
"typescript": "5.3.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import { FC, useState } from "react";
|
||||
import { FC, useEffect, useState } from "react";
|
||||
import useSWR from "swr";
|
||||
import { getTicketQuery } from "app/_graphql/getTicketQuery";
|
||||
import { getTicketArticlesQuery } from "app/_graphql/getTicketArticlesQuery";
|
||||
|
|
@ -28,6 +28,8 @@ interface TicketDetailProps {
|
|||
}
|
||||
|
||||
export const TicketDetail: FC<TicketDetailProps> = ({ id }) => {
|
||||
const [dialogOpen, setDialogOpen] = useState(false);
|
||||
const [articleKind, setArticleKind] = useState("note");
|
||||
const { data: ticketData, error: ticketError }: any = useSWR(
|
||||
{
|
||||
document: getTicketQuery,
|
||||
|
|
@ -49,26 +51,15 @@ export const TicketDetail: FC<TicketDetailProps> = ({ id }) => {
|
|||
body: JSON.stringify({ object: "Ticket", o_id: id }),
|
||||
});
|
||||
|
||||
const closeDialog = () => setDialogOpen(false);
|
||||
console.log({ recentViewData, recentViewError });
|
||||
|
||||
const ticket = ticketData?.ticket;
|
||||
const ticketArticles = ticketArticlesData?.ticketArticles;
|
||||
const externalArticles = ticketArticles?.edges.filter(
|
||||
({ node: article }: any) => !article.internal,
|
||||
);
|
||||
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(mostRecentEmailRecipient);
|
||||
const closeDialog = () => setDialogOpen(false);
|
||||
|
||||
const firstArticle = ticketArticles?.edges[0]?.node;
|
||||
const firstArticleKind = firstArticle?.type?.name ?? "phone";
|
||||
const firstEmailSender = firstArticle?.from?.parsed?.[0]?.emailAddress ?? "";
|
||||
const recipient = firstEmailSender;
|
||||
const shouldRender =
|
||||
ticketData && !ticketError && ticketArticlesData && !ticketArticlesError;
|
||||
|
||||
|
|
@ -109,11 +100,11 @@ export const TicketDetail: FC<TicketDetailProps> = ({ id }) => {
|
|||
article.internal
|
||||
? "internal-note"
|
||||
: article?.sender?.name === "Agent"
|
||||
? "outgoing-message"
|
||||
: "incoming-message"
|
||||
? "outgoing-message"
|
||||
: "incoming-message"
|
||||
}
|
||||
model={{
|
||||
message: article.body.replace(/<div>*<br>*<div>/g, ""),
|
||||
message: article.bodyWithUrls,
|
||||
sentTime: article.updated_at,
|
||||
sender: article.from,
|
||||
direction:
|
||||
|
|
@ -159,7 +150,7 @@ export const TicketDetail: FC<TicketDetailProps> = ({ id }) => {
|
|||
mt: 2,
|
||||
}}
|
||||
onClick={() => {
|
||||
setArticleKind(mostRecentExternalArticleKind);
|
||||
setArticleKind(firstArticleKind);
|
||||
setDialogOpen(true);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ query getTicketArticles($ticketId: ID!) {
|
|||
edges {
|
||||
node {
|
||||
id
|
||||
body
|
||||
bodyWithUrls
|
||||
internal
|
||||
type {
|
||||
name
|
||||
|
|
@ -14,6 +14,11 @@ query getTicketArticles($ticketId: ID!) {
|
|||
sender {
|
||||
name
|
||||
}
|
||||
from {
|
||||
parsed {
|
||||
emailAddress
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@ const handler = NextAuth({
|
|||
|
||||
callbacks: {
|
||||
signIn: async ({ user, account, profile }) => {
|
||||
console.log("SIGN IN");
|
||||
const roles = await getUserRoles(user.email) ?? [];
|
||||
return roles.includes("admin") || roles.includes("agent") || process.env.SETUP_MODE === "true";
|
||||
},
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
"@fontsource/poppins": "^5.0.8",
|
||||
"@fontsource/roboto": "^5.0.8",
|
||||
"@mui/icons-material": "^5",
|
||||
"@mui/lab": "^5.0.0-alpha.152",
|
||||
"@mui/lab": "^5.0.0-alpha.153",
|
||||
"@mui/material": "^5",
|
||||
"@mui/x-data-grid-pro": "^6.18.1",
|
||||
"@mui/x-date-pickers-pro": "^6.18.1",
|
||||
|
|
@ -29,15 +29,15 @@
|
|||
"leafcutter-common": "*",
|
||||
"material-ui-popup-state": "^5.0.10",
|
||||
"mui-chips-input": "^2.1.3",
|
||||
"next": "14.0.2",
|
||||
"next-auth": "^4.24.4",
|
||||
"ra-data-graphql": "^4.14.3",
|
||||
"ra-i18n-polyglot": "^4.15.2",
|
||||
"ra-input-rich-text": "^4.15.3",
|
||||
"ra-language-english": "^4.15.2",
|
||||
"next": "14.0.3",
|
||||
"next-auth": "^4.24.5",
|
||||
"ra-data-graphql": "^4.16.0",
|
||||
"ra-i18n-polyglot": "^4.16.0",
|
||||
"ra-input-rich-text": "^4.16.0",
|
||||
"ra-language-english": "^4.16.0",
|
||||
"ra-postgraphile": "^6.1.2",
|
||||
"react": "18.2.0",
|
||||
"react-admin": "^4.15.3",
|
||||
"react-admin": "^4.16.0",
|
||||
"react-cookie": "^6.1.1",
|
||||
"react-digit-input": "^2.1.0",
|
||||
"react-dom": "18.2.0",
|
||||
|
|
@ -52,18 +52,18 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.3",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "18.2.37",
|
||||
"@types/node": "^20.9.4",
|
||||
"@types/react": "18.2.38",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"babel-loader": "^9.1.3",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint": "^8.54.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-next": "^14.0.2",
|
||||
"eslint-config-next": "^14.0.3",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"typescript": "5.2.2"
|
||||
"typescript": "5.3.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
"tsc-watch": "^6.0.4",
|
||||
"tsconfig-link": "*",
|
||||
"typedoc": "^0.25.3",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.3.2"
|
||||
},
|
||||
"nodemonConfig": {
|
||||
"ignore": [
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@
|
|||
"graphql": "15.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.8",
|
||||
"@types/jest": "^29.5.10",
|
||||
"pino-pretty": "^10.2.3",
|
||||
"nodemon": "^3.0.1",
|
||||
"tsconfig-link": "*",
|
||||
"eslint-config-link": "*",
|
||||
"jest-config-link": "*",
|
||||
"babel-preset-link": "*",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"migrate": "NODE_ENV=development node --unhandled-rejections=strict build/main/index.js db -- migrate",
|
||||
|
|
|
|||
|
|
@ -22,17 +22,17 @@
|
|||
"@babel/preset-env": "7.23.3",
|
||||
"@babel/preset-typescript": "7.23.3",
|
||||
"@types/fluent-ffmpeg": "^2.1.24",
|
||||
"@types/jest": "^29.5.8",
|
||||
"eslint": "^8.53.0",
|
||||
"@types/jest": "^29.5.10",
|
||||
"eslint": "^8.54.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"jest-junit": "^16.0.0",
|
||||
"nodemon": "^3.0.1",
|
||||
"pino-pretty": "^10.2.3",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"typedoc": "^0.25.3",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.3.2"
|
||||
},
|
||||
"nodemonConfig": {
|
||||
"ignore": [
|
||||
|
|
|
|||
938
package-lock.json
generated
938
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -54,11 +54,12 @@
|
|||
"typeorm": {
|
||||
"pg": "^8.11.0"
|
||||
},
|
||||
"graphql": "15.8.0"
|
||||
"graphql": "15.8.0",
|
||||
"typescript": "^5.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dotenv-cli": "latest",
|
||||
"prettier": "^3.0.3"
|
||||
"prettier": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"npm": ">=9.6.7",
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@
|
|||
},
|
||||
"peerDependencies": {},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.53.0"
|
||||
"eslint": "^8.54.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
"fmt": "prettier \"profile/**/*.js\" --write"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rushstack/eslint-patch": "^1.5.1",
|
||||
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
||||
"@typescript-eslint/parser": "^6.10.0",
|
||||
"@rushstack/eslint-patch": "^1.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
||||
"@typescript-eslint/parser": "^6.12.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-config-xo-space": "^0.34.0",
|
||||
"eslint-plugin-cypress": "^2.15.1",
|
||||
|
|
@ -28,8 +28,8 @@
|
|||
"typescript": "^4.9.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.53.0",
|
||||
"eslint": "^8.54.0",
|
||||
"jest": "^29.7.0",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.3.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"private": false,
|
||||
"devDependencies": {
|
||||
"@hapi/basic": "^7.0.2",
|
||||
"@types/jest": "^29.5.8",
|
||||
"@types/jest": "^29.5.10",
|
||||
"babel-preset-link": "*",
|
||||
"eslint-config-link": "*",
|
||||
"jest-config-link": "*",
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
"@hapi/hapi": "^21.3.2",
|
||||
"@hapi/hoek": "^11.0.2",
|
||||
"joi": "^17.11.0",
|
||||
"next-auth": "4.24.4"
|
||||
"next-auth": "4.24.5"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"license": "AGPL-3.0-or-later",
|
||||
"private": false,
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.8",
|
||||
"@types/jest": "^29.5.10",
|
||||
"tsc-watch": "^6.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"node": ">=14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/jest": "^29.5.8",
|
||||
"@types/jest": "^29.5.10",
|
||||
"jest": "^29.7.0",
|
||||
"jest-junit": "^16.0.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
"@fontsource/poppins": "^5.0.8",
|
||||
"@fontsource/roboto": "^5.0.8",
|
||||
"@mui/icons-material": "^5",
|
||||
"@mui/lab": "^5.0.0-alpha.152",
|
||||
"@mui/lab": "^5.0.0-alpha.153",
|
||||
"@mui/material": "^5",
|
||||
"@mui/x-data-grid-pro": "^6.18.1",
|
||||
"@mui/x-date-pickers-pro": "^6.18.1",
|
||||
|
|
@ -21,8 +21,8 @@
|
|||
"date-fns": "^2.30.0",
|
||||
"http-proxy-middleware": "^2.0.6",
|
||||
"material-ui-popup-state": "^5.0.10",
|
||||
"next": "14.0.2",
|
||||
"next-auth": "^4.24.4",
|
||||
"next": "14.0.3",
|
||||
"next-auth": "^4.24.5",
|
||||
"next-http-proxy-middleware": "^1.2.6",
|
||||
"nodemailer": "^6.9.7",
|
||||
"react": "18.2.0",
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
"react-cookie-consent": "^9.0.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-iframe": "^1.8.5",
|
||||
"react-markdown": "^9.0.0",
|
||||
"react-markdown": "^9.0.1",
|
||||
"react-polyglot": "^0.7.2",
|
||||
"sharp": "^0.32.6",
|
||||
"swr": "^2.2.4",
|
||||
|
|
@ -39,19 +39,19 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.3",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "18.2.37",
|
||||
"@types/node": "^20.9.4",
|
||||
"@types/react": "18.2.38",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"babel-loader": "^9.1.3",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint": "^8.54.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-next": "^14.0.2",
|
||||
"eslint-config-next": "^14.0.3",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"file-loader": "^6.2.0",
|
||||
"typescript": "5.2.2"
|
||||
"typescript": "5.3.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -18,14 +18,14 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/figlet": "^1.5.8",
|
||||
"@types/lodash": "^4.14.201",
|
||||
"@types/lodash": "^4.14.202",
|
||||
"@types/node": "*",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"camelcase-keys": "^9.1.2",
|
||||
"pg-monitor": "^2.0.0",
|
||||
"tsc-watch": "^6.0.4",
|
||||
"typedoc": "^0.25.3",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@digiresilience/hapi-nextauth": "*",
|
||||
|
|
@ -54,9 +54,9 @@
|
|||
"http-terminator": "^3.2.0",
|
||||
"joi": "^17.11.0",
|
||||
"lodash": "^4.17.21",
|
||||
"next-auth": "^4.24.4",
|
||||
"next-auth": "^4.24.5",
|
||||
"pg-promise": "^11.5.4",
|
||||
"pino": "^8.16.1",
|
||||
"pino": "^8.16.2",
|
||||
"pino-pretty": "^10.2.3",
|
||||
"prom-client": "^15.x.x",
|
||||
"uuid": "^9.0.1"
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@
|
|||
"@babel/core": "7.23.3",
|
||||
"@babel/preset-env": "7.23.3",
|
||||
"@babel/preset-typescript": "7.23.3",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint": "^8.54.0",
|
||||
"pino-pretty": "^10.2.3",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"tsc-watch": "^6.0.4",
|
||||
"typedoc": "^0.25.3",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.3.2"
|
||||
},
|
||||
"files": [
|
||||
"build",
|
||||
|
|
|
|||
|
|
@ -20,16 +20,16 @@
|
|||
"@babel/core": "7.23.3",
|
||||
"@babel/preset-env": "7.23.3",
|
||||
"@babel/preset-typescript": "7.23.3",
|
||||
"@types/jest": "^29.5.8",
|
||||
"eslint": "^8.53.0",
|
||||
"@types/jest": "^29.5.10",
|
||||
"eslint": "^8.54.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-junit": "^16.0.0",
|
||||
"pino-pretty": "^10.2.3",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"tsc-watch": "^6.0.4",
|
||||
"typedoc": "^0.25.3",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
"node": ">=14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.8",
|
||||
"@types/jest": "^29.5.10",
|
||||
"babel-preset-link": "*",
|
||||
"eslint-config-link": "*",
|
||||
"jest-config-link": "*",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue