Metamigo -> Bridge

This commit is contained in:
Darren Clarke 2024-04-21 09:44:30 +02:00
parent 242f3cf6b8
commit a445762a37
145 changed files with 396 additions and 16668 deletions

View file

@ -53,114 +53,115 @@ const MenuItem = ({
}: any) => {
const { roboto } = fonts;
return (<Link href={href} target={target}>
<ListItemButton
sx={{
p: 0,
mb: 1,
bl: iconSize === 0 ? "1px solid white" : "inherit",
}}
selected={selected}
>
{iconSize > 0 ? (
<ListItemIcon
sx={{
color: `white`,
minWidth: 0,
mr: 2,
textAlign: "center",
margin: open ? "0 8 0 0" : "0 auto",
}}
>
<Box
return (
<Link href={href} target={target}>
<ListItemButton
sx={{
p: 0,
mb: 1,
bl: iconSize === 0 ? "1px solid white" : "inherit",
}}
selected={selected}
>
{iconSize > 0 ? (
<ListItemIcon
sx={{
width: iconSize,
height: iconSize,
mr: 0.5,
mt: "-4px",
color: `white`,
minWidth: 0,
mr: 2,
textAlign: "center",
margin: open ? "0 8 0 0" : "0 auto",
}}
>
<Icon />
</Box>
</ListItemIcon>
) : (
<Box
sx={{
width: 30,
height: "28px",
position: "relative",
ml: "9px",
mr: "1px",
}}
>
<Box
sx={{
width: "1px",
height: "56px",
backgroundColor: "white",
position: "absolute",
left: "3px",
top: "-10px",
}}
/>
<Box
sx={{
width: "42px",
height: "42px",
position: "absolute",
top: "-27px",
left: "3px",
border: "solid 1px #fff",
borderColor: "transparent transparent transparent #fff",
borderRadius: "60px",
rotate: "-35deg",
}}
/>
</Box>
)}
{open && (
<ListItemText
inset={inset}
primary={
<Typography
variant="body1"
<Box
sx={{
fontSize: 16,
fontFamily: roboto.style.fontFamily,
fontWeight: "bold",
border: 0,
textAlign: "left",
color: "white",
width: iconSize,
height: iconSize,
mr: 0.5,
mt: "-4px",
}}
>
{name}
</Typography>
}
/>
)}
{badge && badge > 0 ? (
<ListItemSecondaryAction>
<Typography
color="textSecondary"
variant="body1"
className="badge"
<Icon />
</Box>
</ListItemIcon>
) : (
<Box
sx={{
backgroundColor: "#FFB620",
color: "black !important",
borderRadius: 10,
px: 1,
fontSize: 12,
fontWeight: "bold",
width: 30,
height: "28px",
position: "relative",
ml: "9px",
mr: "1px",
}}
>
{badge}
</Typography>
</ListItemSecondaryAction>
) : null}
</ListItemButton>
</Link>
);
}
<Box
sx={{
width: "1px",
height: "56px",
backgroundColor: "white",
position: "absolute",
left: "3px",
top: "-10px",
}}
/>
<Box
sx={{
width: "42px",
height: "42px",
position: "absolute",
top: "-27px",
left: "3px",
border: "solid 1px #fff",
borderColor: "transparent transparent transparent #fff",
borderRadius: "60px",
rotate: "-35deg",
}}
/>
</Box>
)}
{open && (
<ListItemText
inset={inset}
primary={
<Typography
variant="body1"
sx={{
fontSize: 16,
fontFamily: roboto.style.fontFamily,
fontWeight: "bold",
border: 0,
textAlign: "left",
color: "white",
}}
>
{name}
</Typography>
}
/>
)}
{badge && badge > 0 ? (
<ListItemSecondaryAction>
<Typography
color="textSecondary"
variant="body1"
className="badge"
sx={{
backgroundColor: "#FFB620",
color: "black !important",
borderRadius: 10,
px: 1,
fontSize: 12,
fontWeight: "bold",
}}
>
{badge}
</Typography>
</ListItemSecondaryAction>
) : null}
</ListItemButton>
</Link>
);
};
interface SidebarProps {
open: boolean;
@ -577,13 +578,13 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
selected={pathname.endsWith("/admin/zammad")}
open={open}
/>
{false && roles.includes("metamigo") && (
{false && roles.includes("bridge") && (
<MenuItem
name="Metamigo"
href="/admin/metamigo"
name="Bridge"
href="/admin/bridge"
Icon={FeaturedPlayListIcon}
iconSize={0}
selected={pathname.endsWith("/admin/metamigo")}
selected={pathname.endsWith("/admin/bridge")}
open={open}
/>
)}

View file

@ -4,10 +4,10 @@ const nextConfig = {
experimental: {
missingSuspenseWithCSRBailout: false,
},
transpilePackages: ["leafcutter-ui", "metamigo-ui", "opensearch-common", "ui"],
transpilePackages: ["leafcutter-ui", "bridge-ui", "opensearch-common", "ui"],
publicRuntimeConfig: {
linkURL: process.env.LINK_URL ?? "http://localhost:3000",
metamigoURL: process.env.METAMIGO_URL ?? "http://localhost:8002",
bridgeURL: process.env.BRIDGE_URL ?? "http://localhost:8002",
labelStudioURL: process.env.LABEL_STUDIO_URL ?? "http://localhost:8006",
muiLicenseKey: process.env.MUI_LICENSE_KEY ?? "",
},

View file

@ -18,15 +18,15 @@
"@mui/icons-material": "^5",
"@mui/lab": "^5.0.0-alpha.170",
"@mui/material": "^5",
"@mui/x-data-grid-pro": "^7.1.1",
"@mui/x-date-pickers-pro": "^7.1.1",
"@mui/x-data-grid-pro": "^7.3.0",
"@mui/x-date-pickers-pro": "^7.2.0",
"date-fns": "^3.6.0",
"graphql-request": "^6.1.0",
"leafcutter-ui": "*",
"material-ui-popup-state": "^5.1.0",
"metamigo-ui": "*",
"bridge-ui": "*",
"mui-chips-input": "^2.1.4",
"next": "14.1.4",
"next": "14.2.2",
"next-auth": "^4.24.7",
"opensearch-common": "*",
"react": "18.2.0",
@ -42,17 +42,17 @@
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@types/node": "^20.12.6",
"@types/react": "18.2.75",
"@types/node": "^20.12.7",
"@types/react": "18.2.79",
"@types/uuid": "^9.0.8",
"babel-loader": "^9.1.3",
"eslint": "^9.0.0",
"eslint-config-next": "^14.1.4",
"eslint": "^8.0.0",
"eslint-config-next": "^14.2.2",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"typescript": "5.4.4"
"typescript": "5.4.5"
}
}