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
|
|
@ -17,47 +17,47 @@
|
|||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/server": "^11.11.0",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@fontsource/playfair-display": "^5.0.15",
|
||||
"@fontsource/playfair-display": "^5.0.17",
|
||||
"@fontsource/poppins": "^5.0.8",
|
||||
"@fontsource/roboto": "^5.0.8",
|
||||
"@mui/icons-material": "^5",
|
||||
"@mui/lab": "^5.0.0-alpha.148",
|
||||
"@mui/lab": "^5.0.0-alpha.149",
|
||||
"@mui/material": "^5",
|
||||
"@mui/x-data-grid-pro": "^6.16.2",
|
||||
"@mui/x-date-pickers-pro": "^6.16.2",
|
||||
"@mui/x-data-grid-pro": "^6.16.3",
|
||||
"@mui/x-date-pickers-pro": "^6.16.3",
|
||||
"@opensearch-project/opensearch": "^2.4.0",
|
||||
"cryptr": "^6.3.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"http-proxy-middleware": "^2.0.6",
|
||||
"leafcutter-common": "*",
|
||||
"material-ui-popup-state": "^5.0.9",
|
||||
"next": "13.5.4",
|
||||
"next-auth": "^4.23.2",
|
||||
"next": "13.5.6",
|
||||
"next-auth": "^4.24.3",
|
||||
"next-http-proxy-middleware": "^1.2.6",
|
||||
"nodemailer": "^6.9.6",
|
||||
"nodemailer": "^6.9.7",
|
||||
"react": "18.2.0",
|
||||
"react-cookie": "^6.1.1",
|
||||
"react-cookie-consent": "^8.0.1",
|
||||
"react-cookie-consent": "^9.0.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-iframe": "^1.8.5",
|
||||
"react-markdown": "^9.0.0",
|
||||
"react-polyglot": "^0.7.2",
|
||||
"sharp": "^0.32.6",
|
||||
"swr": "^2.2.4",
|
||||
"tss-react": "^4.9.2",
|
||||
"tss-react": "^4.9.3",
|
||||
"uuid": "^9.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.2",
|
||||
"@types/node": "^20.8.6",
|
||||
"@types/react": "18.2.28",
|
||||
"@types/uuid": "^9.0.5",
|
||||
"@types/node": "^20.8.7",
|
||||
"@types/react": "18.2.31",
|
||||
"@types/uuid": "^9.0.6",
|
||||
"babel-loader": "^9.1.3",
|
||||
"eslint": "^8.51.0",
|
||||
"eslint": "^8.52.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-next": "^13.5.4",
|
||||
"eslint-config-next": "^13.5.6",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.7.1",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
|
|
|
|||
|
|
@ -175,16 +175,23 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
|
|||
},
|
||||
{ refreshInterval: 10000 },
|
||||
);
|
||||
console.log({ overviewData });
|
||||
const findOverviewCountByID = (id: number) =>
|
||||
overviewData?.ticketOverviews?.edges?.find((overview: any) =>
|
||||
overview.node.id.endsWith(`/${id}`),
|
||||
const findOverviewByName = (name: string) =>
|
||||
overviewData?.ticketOverviews?.edges?.find(
|
||||
(overview: any) => overview.node.name === name,
|
||||
)?.node?.id;
|
||||
const findOverviewCountByID = (id: string) =>
|
||||
overviewData?.ticketOverviews?.edges?.find(
|
||||
(overview: any) => overview.node.id === id,
|
||||
)?.node?.ticketCount ?? 0;
|
||||
const recentCount = 0;
|
||||
const assignedCount = findOverviewCountByID(1);
|
||||
const openCount = findOverviewCountByID(5);
|
||||
const urgentCount = findOverviewCountByID(7);
|
||||
const unassignedCount = findOverviewCountByID(2);
|
||||
const assignedID = findOverviewByName("My Assigned Tickets");
|
||||
const assignedCount = findOverviewCountByID(assignedID);
|
||||
const openID = findOverviewByName("Open Tickets");
|
||||
const openCount = findOverviewCountByID(openID);
|
||||
const urgentID = findOverviewByName("Escalated Tickets");
|
||||
const urgentCount = findOverviewCountByID(urgentID);
|
||||
const unassignedID = findOverviewByName("Unassigned & Open Tickets");
|
||||
const unassignedCount = findOverviewCountByID(unassignedID);
|
||||
|
||||
const logout = () => {
|
||||
signOut({ callbackUrl: "/login" });
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Metadata } from "next";
|
||||
import { ZammadWrapper } from "../../../(main)/_components/ZammadWrapper";
|
||||
import { ZammadWrapper } from "app/(main)/_components/ZammadWrapper";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Zammad",
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
import { FC, useState } from "react";
|
||||
import { Grid, Box } from "@mui/material";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { StyledDataGrid } from "../../../_components/StyledDataGrid";
|
||||
import { Button } from "../../../../_components/Button";
|
||||
import { typography } from "../../../../_styles/theme";
|
||||
import { StyledDataGrid } from "app/(main)/_components/StyledDataGrid";
|
||||
import { Button } from "app/_components/Button";
|
||||
import { typography } from "app/_styles/theme";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { TicketCreateDialog } from "./TicketCreateDialog";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import { FC, useEffect, useState } from "react";
|
||||
import useSWR from "swr";
|
||||
import { TicketList } from "./TicketList";
|
||||
import { getTicketsByOverviewQuery } from "../../../../_graphql/getTicketsByOverviewQuery";
|
||||
import { getTicketsByOverviewQuery } from "app/_graphql/getTicketsByOverviewQuery";
|
||||
|
||||
type ZammadOverviewProps = {
|
||||
name: string;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import { DisplayError } from "../../../_components/DisplayError";
|
||||
import { DisplayError } from "app/_components/DisplayError";
|
||||
|
||||
type PageProps = {
|
||||
error: Error;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import { FC, useLayoutEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { CircularProgress, Box, Grid } from "@mui/material";
|
||||
import { ZammadWrapper } from "../../../(main)/_components/ZammadWrapper";
|
||||
import { ZammadWrapper } from "app/(main)/_components/ZammadWrapper";
|
||||
|
||||
export const Setup: FC = () => {
|
||||
const router = useRouter();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -15,29 +15,29 @@
|
|||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/server": "^11.11.0",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@fontsource/playfair-display": "^5.0.15",
|
||||
"@fontsource/playfair-display": "^5.0.17",
|
||||
"@fontsource/poppins": "^5.0.8",
|
||||
"@fontsource/roboto": "^5.0.8",
|
||||
"@mui/icons-material": "^5",
|
||||
"@mui/lab": "^5.0.0-alpha.148",
|
||||
"@mui/lab": "^5.0.0-alpha.149",
|
||||
"@mui/material": "^5",
|
||||
"@mui/x-data-grid-pro": "^6.16.2",
|
||||
"@mui/x-date-pickers-pro": "^6.16.2",
|
||||
"@mui/x-data-grid-pro": "^6.16.3",
|
||||
"@mui/x-date-pickers-pro": "^6.16.3",
|
||||
"cryptr": "^6.3.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"graphql-request": "^6.1.0",
|
||||
"leafcutter-common": "*",
|
||||
"material-ui-popup-state": "^5.0.9",
|
||||
"mui-chips-input": "^2.1.3",
|
||||
"next": "13.5.4",
|
||||
"next-auth": "^4.23.2",
|
||||
"next": "13.5.6",
|
||||
"next-auth": "^4.24.3",
|
||||
"ra-data-graphql": "^4.14.3",
|
||||
"ra-i18n-polyglot": "^4.15.0",
|
||||
"ra-input-rich-text": "^4.15.0",
|
||||
"ra-language-english": "^4.15.0",
|
||||
"ra-i18n-polyglot": "^4.15.1",
|
||||
"ra-input-rich-text": "^4.15.1",
|
||||
"ra-language-english": "^4.15.1",
|
||||
"ra-postgraphile": "^6.1.2",
|
||||
"react": "18.2.0",
|
||||
"react-admin": "^4.15.0",
|
||||
"react-admin": "^4.15.1",
|
||||
"react-cookie": "^6.1.1",
|
||||
"react-digit-input": "^2.1.0",
|
||||
"react-dom": "18.2.0",
|
||||
|
|
@ -47,20 +47,20 @@
|
|||
"react-timer-hook": "^3.0.7",
|
||||
"sharp": "^0.32.6",
|
||||
"swr": "^2.2.4",
|
||||
"tss-react": "^4.9.2",
|
||||
"twilio-client": "^1.15.0"
|
||||
"tss-react": "^4.9.3",
|
||||
"twilio-client": "^1.15.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.2",
|
||||
"@types/node": "^20.8.6",
|
||||
"@types/react": "18.2.28",
|
||||
"@types/uuid": "^9.0.5",
|
||||
"@types/node": "^20.8.7",
|
||||
"@types/react": "18.2.31",
|
||||
"@types/uuid": "^9.0.6",
|
||||
"babel-loader": "^9.1.3",
|
||||
"eslint": "^8.51.0",
|
||||
"eslint": "^8.52.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-next": "^13.5.4",
|
||||
"eslint-config-next": "^13.5.6",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.7.1",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
"@hapipal/schmervice": "^3.0.0",
|
||||
"@hapipal/toys": "^4.0.0",
|
||||
"blipp": "^4.0.2",
|
||||
"camelcase-keys": "^9.1.0",
|
||||
"camelcase-keys": "^9.1.2",
|
||||
"expiry-map": "^2.0.0",
|
||||
"fluent-ffmpeg": "^2.1.2",
|
||||
"graphile-migrate": "^1.4.1",
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
"postgraphile": "4.12.3",
|
||||
"postgraphile-plugin-connection-filter": "^2.3.0",
|
||||
"remeda": "^1.27.1",
|
||||
"twilio": "^4.18.1",
|
||||
"twilio": "^4.19.0",
|
||||
"typeorm": "^0.3.17",
|
||||
"@whiskeysockets/baileys": "^6.5.0"
|
||||
},
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
"@types/long": "^4.0.2",
|
||||
"@types/node": "*",
|
||||
"babel-preset-link": "*",
|
||||
"camelcase-keys": "^9.1.0",
|
||||
"camelcase-keys": "^9.1.2",
|
||||
"eslint-config-link": "*",
|
||||
"jest-config-link": "*",
|
||||
"nodemon": "^3.0.1",
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ export const TwilioRoutes = Helpers.noAuth([
|
|||
},
|
||||
async handler(request: Hapi.Request, _h: Hapi.ResponseToolkit) {
|
||||
const { voiceLineId } = request.params;
|
||||
const { To } = request.payload as { To: string };
|
||||
const { To } = request.payload as { To: string; };
|
||||
const voiceLine = await request.db().voiceLines.findBy({ number: To });
|
||||
if (!voiceLine) return Boom.notFound();
|
||||
if (voiceLine.id !== voiceLineId) return Boom.badRequest();
|
||||
|
|
@ -193,7 +193,7 @@ export const TwilioRoutes = Helpers.noAuth([
|
|||
},
|
||||
},
|
||||
async handler(request: Hapi.Request, h: Hapi.ResponseToolkit) {
|
||||
const { providerId } = request.params as { providerId: string };
|
||||
const { providerId } = request.params as { providerId: string; };
|
||||
const provider: SavedVoiceProvider = await request
|
||||
.db()
|
||||
.voiceProviders.findById({ id: providerId });
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
"graphql": "15.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.5",
|
||||
"@types/jest": "^29.5.6",
|
||||
"pino-pretty": "^10.2.3",
|
||||
"nodemon": "^3.0.1",
|
||||
"tsconfig-link": "*",
|
||||
|
|
|
|||
|
|
@ -15,15 +15,15 @@
|
|||
"node-fetch": "^3",
|
||||
"pg-promise": "^11.5.4",
|
||||
"remeda": "^1.27.1",
|
||||
"twilio": "^4.18.1"
|
||||
"twilio": "^4.19.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.23.2",
|
||||
"@babel/preset-env": "7.23.2",
|
||||
"@babel/preset-typescript": "7.23.2",
|
||||
"@types/fluent-ffmpeg": "^2.1.22",
|
||||
"@types/jest": "^29.5.5",
|
||||
"eslint": "^8.51.0",
|
||||
"@types/fluent-ffmpeg": "^2.1.23",
|
||||
"@types/jest": "^29.5.6",
|
||||
"eslint": "^8.52.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"jest-junit": "^16.0.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue