Bridge integration

This commit is contained in:
Darren Clarke 2024-05-09 07:42:44 +02:00
parent 42a5e09c94
commit 162390008b
56 changed files with 776 additions and 591 deletions

View file

@ -35,10 +35,10 @@ import LinkLogo from "public/link-logo-small.png";
import { useSession, signOut } from "next-auth/react";
import { getTicketOverviewCountsQuery } from "app/_graphql/getTicketOverviewCountsQuery";
import { SearchBox } from "./SearchBox";
import { fonts } from "app/_styles/theme";
import { fonts } from "ui";
const openWidth = 270;
const closedWidth = 100;
const closedWidth = 70;
const MenuItem = ({
name,
@ -49,6 +49,7 @@ const MenuItem = ({
selected = false,
open = true,
badge,
depth = 0,
target = "_self",
}: any) => {
const { roboto } = fonts;
@ -90,8 +91,8 @@ const MenuItem = ({
width: 30,
height: "28px",
position: "relative",
ml: "9px",
mr: "1px",
ml: "8px",
mr: "2px",
}}
>
<Box
@ -114,9 +115,21 @@ const MenuItem = ({
border: "solid 1px #fff",
borderColor: "transparent transparent transparent #fff",
borderRadius: "60px",
rotate: "-35deg",
rotate: "-50deg",
}}
/>
{depth > 0 && (
<Box
sx={{
width: depth * 22,
height: "1px",
backgroundColor: "white",
position: "absolute",
left: "26px",
top: "14px",
}}
/>
)}
</Box>
)}
{open && (
@ -132,6 +145,7 @@ const MenuItem = ({
border: 0,
textAlign: "left",
color: "white",
ml: depth * 3,
}}
>
{name}
@ -220,7 +234,7 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
<Box
sx={{
position: "absolute",
top: 20,
top: 24,
right: open ? -8 : -16,
color: "#1C75FD",
rotate: open ? "90deg" : "-90deg",
@ -231,8 +245,8 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
>
<ExpandCircleDownIcon
sx={{
width: 30,
height: 30,
width: 24,
height: 24,
background: "white",
borderRadius: 500,
}}
@ -338,9 +352,7 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
}}
/>
</Grid>
<Grid item>
<SearchBox />
</Grid>
<Grid item>{open && <SearchBox />}</Grid>
<Grid
item
container
@ -558,7 +570,7 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
<>
<MenuItem
name="Admin"
href="/admin/zammad"
href="/admin/bridge"
Icon={SettingsIcon}
iconSize={20}
open={open}
@ -570,6 +582,56 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
onClick={undefined}
>
<List component="div" disablePadding>
<MenuItem
name="CDR Bridge"
href="/admin/bridge"
selected={pathname.endsWith("/admin/bridge")}
open={open}
/>
<Collapse
in={pathname.startsWith("/admin/bridge")}
timeout="auto"
unmountOnExit
onClick={undefined}
>
<List component="div" disablePadding>
<MenuItem
name="WhatsApp"
href="/admin/bridge/whatsapp"
depth={1}
selected={pathname.endsWith("/admin/bridge/whatsapp")}
open={open}
/>
<MenuItem
name="Signal"
href="/admin/bridge/signal"
depth={1}
selected={pathname.endsWith("/admin/bridge/signal")}
open={open}
/>
<MenuItem
name="Facebook"
href="/admin/bridge/facebook"
depth={1}
selected={pathname.endsWith("/admin/bridge/facebook")}
open={open}
/>
<MenuItem
name="Voice"
href="/admin/bridge/voice"
depth={1}
selected={pathname.endsWith("/admin/bridge/voice")}
open={open}
/>
<MenuItem
name="Webhooks"
href="/admin/bridge/webhooks"
depth={1}
selected={pathname.endsWith("/admin/bridge/webhooks")}
open={open}
/>
</List>
</Collapse>
<MenuItem
name="Zammad Settings"
href="/admin/zammad"
@ -578,16 +640,6 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
selected={pathname.endsWith("/admin/zammad")}
open={open}
/>
{false && roles.includes("bridge") && (
<MenuItem
name="Bridge"
href="/admin/bridge"
Icon={FeaturedPlayListIcon}
iconSize={0}
selected={pathname.endsWith("/admin/bridge")}
open={open}
/>
)}
{roles.includes("label_studio") && (
<MenuItem
name="Label Studio"