Fix more build errors

This commit is contained in:
Darren Clarke 2023-03-15 12:17:43 +00:00
parent 1bdc1e60db
commit 30ce47826f
61 changed files with 1161 additions and 541 deletions

View file

@ -1,10 +1,11 @@
// @ts-nocheck
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Metamigo = () => (
const Metamigo: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Zammad: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -21,13 +22,10 @@ const Link = () => (
width: "100%",
}}
>
<ZammadWrapper
path="/#manage"
hideSidebar={false}
/>
<ZammadWrapper path="/#manage" hideSidebar={false} />
</Grid>
</Grid>
</Layout>
);
export default Link;
export default Zammad;

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const About: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org/about"
);
@ -34,4 +34,4 @@ const Leafcutter = () => {
);
};
export default Leafcutter;
export default About;

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const Create: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org/create"
);
@ -34,4 +34,4 @@ const Leafcutter = () => {
);
};
export default Leafcutter;
export default Create;

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const FAQ: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org/faq"
);
@ -34,4 +34,4 @@ const Leafcutter = () => {
);
};
export default Leafcutter;
export default FAQ;

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const Leafcutter: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org"
);

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const Trends: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org/trends"
);
@ -34,4 +34,4 @@ const Leafcutter = () => {
);
};
export default Leafcutter;
export default Trends;

View file

@ -1,9 +1,10 @@
import { NextPage } from "next";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Profile = () => (
const Profile: NextPage = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -21,10 +22,7 @@ const Profile = () => (
width: "100%",
}}
>
<ZammadWrapper
path="/#profile"
hideSidebar={false}
/>
<ZammadWrapper path="/#profile" hideSidebar={false} />
</Grid>
</Grid>
</Layout>

View file

@ -3,26 +3,26 @@ import Head from "next/head";
import useSWR from "swr";
import { request, gql } from "graphql-request";
import { NextPage } from "next";
import { Grid, } from "@mui/material";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { TicketDetail } from "components/TicketDetail";
import { TicketEdit } from "components/TicketEdit";
type TicketProps = {
id: string;
};
const Ticket: NextPage<TicketProps> = ({ id }) => {
const origin = typeof window !== 'undefined' && window.location.origin
? window.location.origin
: '';
const origin =
typeof window !== "undefined" && window.location.origin
? window.location.origin
: "";
const graphQLFetcher = async ({ document, variables }: any) => {
const data = await request({
url: `${origin}/graphql`,
document,
variables
})
console.log({ data })
variables,
});
console.log({ data });
return data;
};
@ -31,32 +31,31 @@ const Ticket: NextPage<TicketProps> = ({ id }) => {
{
document: gql`
query getTicket($ticketId: Int!) {
ticket(
ticket: {
ticketInternalId: $ticketId
}
) {
id,
internalId,
title,
note,
number,
createdAt,
updatedAt,
closeAt,
articles {
edges {
node {
id,
body,
internal,
sender {
name
ticket(ticket: { ticketInternalId: $ticketId }) {
id
internalId
title
note
number
createdAt
updatedAt
closeAt
articles {
edges {
node {
id
body
internal
sender {
name
}
}
}
}
}
}}`, variables: { ticketId: parseInt(id, 10) }
}
`,
variables: { ticketId: parseInt(id, 10) },
},
graphQLFetcher,
{ refreshInterval: 1000 }
@ -65,8 +64,7 @@ const Ticket: NextPage<TicketProps> = ({ id }) => {
const { data: graphqlData2, error: graphqlError2 } = useSWR(
{
document: gql`
{
{
__schema {
queryType {
name
@ -75,8 +73,9 @@ const Ticket: NextPage<TicketProps> = ({ id }) => {
}
}
}
}`, variables: {}
}
`,
variables: {},
},
graphQLFetcher
);
@ -91,22 +90,23 @@ const Ticket: NextPage<TicketProps> = ({ id }) => {
{shouldRender && (
<Grid container spacing={0} sx={{ height: "100vh" }} direction="row">
<Grid item sx={{ height: "100vh" }} xs={12}>
<TicketDetail ticket={ticketData.ticket} />
</Grid>
{/*<Grid item xs={0} sx={{ height: "100vh" }}>
<TicketEdit ticket={ticketData.ticket} />
</Grid>*/}
</Grid>)}
</Grid>
)}
{ticketError && <div>{ticketError.toString()}</div>}
</Layout>
);
}
};
export const getServerSideProps: GetServerSideProps = async (
context: GetServerSidePropsContext) => {
context: GetServerSidePropsContext
) => {
const { id } = context.query;
return { props: { id } };
}
};
export default Ticket;

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Assigned: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -27,4 +28,4 @@ const Link = () => (
</Layout>
);
export default Link;
export default Assigned;

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Pending: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -27,4 +28,4 @@ const Link = () => (
</Layout>
);
export default Link;
export default Pending;

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Unassigned: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -27,4 +28,4 @@ const Link = () => (
</Layout>
);
export default Link;
export default Unassigned;

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Urgent: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -27,4 +28,4 @@ const Link = () => (
</Layout>
);
export default Link;
export default Urgent;