Project structure update

This commit is contained in:
Darren Clarke 2023-02-09 21:51:12 +00:00
parent 86c616de0a
commit e556cdceba
70 changed files with 4127 additions and 56 deletions

View file

@ -0,0 +1,54 @@
import Head from "next/head";
import { NextPage, GetServerSideProps, GetServerSidePropsContext } from "next";
import { Grid, Box } from "@mui/material";
import { Layout } from "components/Layout";
import { TicketDetail } from "components/TicketDetail";
import { TicketEdit } from "components/TicketEdit";
const Link: NextPage = ({ ticket, articles }: any) => (
<Layout>
<Head>
<title>Link Shell</title>
</Head>
<Grid container spacing={0} sx={{ height: "100vh" }} direction="row">
<Grid item sx={{ height: "100vh" }} xs={10}>
<TicketDetail ticket={ticket} articles={articles} />
</Grid>
<Grid item xs={2} sx={{ height: "100vh" }}>
<TicketEdit ticket={ticket} />
</Grid>
</Grid>
</Layout>
);
export const getServerSideProps: GetServerSideProps = async (
context: GetServerSidePropsContext
) => {
const {
params: { id },
} = context;
const baseURL = `${process.env.ZAMMAD_URL}/api/v1`;
const token = process.env.ZAMMAD_API_TOKEN;
const headers = { Authorization: `Token ${token}` };
const rawTicket = await fetch(`${baseURL}/tickets/${id}`, {
headers,
});
const ticket = await rawTicket.json();
const rawArticles = await fetch(
`${baseURL}/ticket_articles/by_ticket/${id}`,
{
headers,
}
);
const articles = await rawArticles.json();
console.log({ ticket, articles });
return {
props: {
ticket,
articles,
},
};
};
export default Link;

View file

@ -0,0 +1,30 @@
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
<Layout>
<Head>
<title>Link Shell</title>
</Head>
<Grid
container
spacing={0}
sx={{ height: "100%", width: "100%" }}
direction="column"
>
<Grid
item
sx={{
height: "100%",
width: "100%",
}}
>
<ZammadWrapper url="http://localhost:8003/zammad/#ticket/view/my_tickets" />
</Grid>
</Grid>
</Layout>
);
export default Link;

View file

@ -0,0 +1,30 @@
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
<Layout>
<Head>
<title>Link Shell</title>
</Head>
<Grid
container
spacing={0}
sx={{ height: "100%", width: "100%" }}
direction="column"
>
<Grid
item
sx={{
height: "100%",
width: "100%",
}}
>
<ZammadWrapper url="http://localhost:3000/zammad/#ticket/view/my_pending_reached" />
</Grid>
</Grid>
</Layout>
);
export default Link;

View file

@ -0,0 +1,30 @@
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
<Layout>
<Head>
<title>Link Shell</title>
</Head>
<Grid
container
spacing={0}
sx={{ height: "100%", width: "100%" }}
direction="column"
>
<Grid
item
sx={{
height: "100%",
width: "100%",
}}
>
<ZammadWrapper url="http://localhost:3000/zammad/#ticket/view/all_unassigned" />
</Grid>
</Grid>
</Layout>
);
export default Link;

View file

@ -0,0 +1,30 @@
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
<Layout>
<Head>
<title>Link Shell</title>
</Head>
<Grid
container
spacing={0}
sx={{ height: "100%", width: "100%" }}
direction="column"
>
<Grid
item
sx={{
height: "100%",
width: "100%",
}}
>
<ZammadWrapper url="http://localhost:3000/zammad/#ticket/view/all_escalated" />
</Grid>
</Grid>
</Layout>
);
export default Link;