generated from Luis/nextjs-python-web-template
fix linting
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
Client1ConsumerData,
|
||||
Client1ConsumerTableConfig,
|
||||
Client1ProducerTableConfig,
|
||||
Client1ProducerData
|
||||
Client1ProducerData,
|
||||
} from "@/mock/client_1";
|
||||
import CustomTable from "@/components/table";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
Client2ConsumerTableConfig,
|
||||
Client2ProducerData,
|
||||
Client2ProducerTableConfig,
|
||||
Client2SummaryDetails
|
||||
Client2SummaryDetails,
|
||||
} from "@/mock/client_2";
|
||||
import CustomTable from "@/components/table";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import Image from "next/image";
|
||||
import React, { ReactNode } from "react";
|
||||
|
||||
import { tw } from "@/utils/tailwind";
|
||||
import Collapse from '@mui/material/Collapse';
|
||||
import Collapse from "@mui/material/Collapse";
|
||||
import Link from "next/link";
|
||||
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
||||
import HomeIcon from "@mui/icons-material/Home";
|
||||
@@ -19,8 +19,8 @@ import HubIcon from "@mui/icons-material/Hub";
|
||||
import PersonIcon from "@mui/icons-material/Person";
|
||||
import RouterIcon from "@mui/icons-material/Router";
|
||||
import StorageIcon from "@mui/icons-material/Storage";
|
||||
import ExpandLess from '@mui/icons-material/ExpandLess';
|
||||
import ExpandMore from '@mui/icons-material/ExpandMore';
|
||||
import ExpandLess from "@mui/icons-material/ExpandLess";
|
||||
import ExpandMore from "@mui/icons-material/ExpandMore";
|
||||
|
||||
type MenuEntry = {
|
||||
icon: ReactNode;
|
||||
@@ -43,7 +43,7 @@ const menuEntityEntries: MenuEntry[] = [
|
||||
label: "C2",
|
||||
to: "/client-2",
|
||||
disabled: false,
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
const menuEntries: MenuEntry[] = [
|
||||
@@ -83,7 +83,9 @@ interface SidebarProps {
|
||||
|
||||
export function Sidebar(props: SidebarProps) {
|
||||
const { show, onClose } = props;
|
||||
const [activeMenuItem, setActiveMenuItem] = React.useState(typeof window !== "undefined" ? window.location.pathname : "");
|
||||
const [activeMenuItem, setActiveMenuItem] = React.useState(
|
||||
typeof window !== "undefined" ? window.location.pathname : "",
|
||||
);
|
||||
const [collapseMenuOpen, setCollapseMenuOpen] = React.useState(true);
|
||||
|
||||
const handleCollapseClick = () => {
|
||||
@@ -130,7 +132,7 @@ export function Sidebar(props: SidebarProps) {
|
||||
disablePadding
|
||||
className="!overflow-hidden py-2"
|
||||
>
|
||||
{menuEntry.label !== "Entities" ?
|
||||
{menuEntry.label !== "Entities" ? (
|
||||
<ListItemButton
|
||||
className="justify-center lg:justify-normal"
|
||||
LinkComponent={Link}
|
||||
@@ -153,13 +155,14 @@ export function Sidebar(props: SidebarProps) {
|
||||
className="hidden lg:block"
|
||||
/>
|
||||
</ListItemButton>
|
||||
:
|
||||
) : (
|
||||
<div>
|
||||
<ListItemButton
|
||||
className="justify-center lg:justify-normal"
|
||||
disabled={menuEntry.disabled}
|
||||
selected={activeMenuItem === menuEntry.to}
|
||||
onClick={handleCollapseClick}>
|
||||
onClick={handleCollapseClick}
|
||||
>
|
||||
<ListItemIcon
|
||||
color="inherit"
|
||||
className="justify-center overflow-hidden text-white lg:justify-normal"
|
||||
@@ -175,10 +178,16 @@ export function Sidebar(props: SidebarProps) {
|
||||
/>
|
||||
{collapseMenuOpen ? <ExpandLess /> : <ExpandMore />}
|
||||
</ListItemButton>
|
||||
<Collapse in={collapseMenuOpen} timeout="auto" unmountOnExit>
|
||||
<Collapse
|
||||
in={collapseMenuOpen}
|
||||
timeout="auto"
|
||||
unmountOnExit
|
||||
>
|
||||
<List component="div" disablePadding>
|
||||
{menuEntityEntries.map((menuEntry, idx) => (
|
||||
<ListItemButton key={idx} sx={{pl: 4}}
|
||||
<ListItemButton
|
||||
key={idx}
|
||||
sx={{ pl: 4 }}
|
||||
className="justify-center lg:justify-normal"
|
||||
LinkComponent={Link}
|
||||
href={menuEntry.to}
|
||||
@@ -204,7 +213,7 @@ export function Sidebar(props: SidebarProps) {
|
||||
</List>
|
||||
</Collapse>
|
||||
</div>
|
||||
}
|
||||
)}
|
||||
</ListItem>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -17,124 +17,124 @@ export const Client1SummaryDetails = [
|
||||
|
||||
export const Client1ConsumerData = [
|
||||
{
|
||||
"service_name": "Carlo's Printing",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "Consume",
|
||||
"producer": "C2",
|
||||
"producer_did": "did:sov:test:1223",
|
||||
"network": "Carlo's Home Network",
|
||||
service_name: "Carlo's Printing",
|
||||
service_type: "3D Printing",
|
||||
end_point: "Consume",
|
||||
producer: "C2",
|
||||
producer_did: "did:sov:test:1223",
|
||||
network: "Carlo's Home Network",
|
||||
},
|
||||
{
|
||||
"service_name": "Steve's Printing",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "Consume",
|
||||
"producer": "C2",
|
||||
"producer_did": "did:sov:test:1234",
|
||||
"network": "Steve's Home Network",
|
||||
service_name: "Steve's Printing",
|
||||
service_type: "3D Printing",
|
||||
end_point: "Consume",
|
||||
producer: "C2",
|
||||
producer_did: "did:sov:test:1234",
|
||||
network: "Steve's Home Network",
|
||||
},
|
||||
{
|
||||
"service_name": "Test A",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "Consume",
|
||||
"producer": "C2",
|
||||
"producer_did": "did:sov:test:4567",
|
||||
"network": "Test Network A",
|
||||
service_name: "Test A",
|
||||
service_type: "3D Printing",
|
||||
end_point: "Consume",
|
||||
producer: "C2",
|
||||
producer_did: "did:sov:test:4567",
|
||||
network: "Test Network A",
|
||||
},
|
||||
{
|
||||
"service_name": "Test B",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "Consume",
|
||||
"producer": "C2",
|
||||
"producer_did": "did:sov:test:0062",
|
||||
"network": "Test Network B",
|
||||
service_name: "Test B",
|
||||
service_type: "3D Printing",
|
||||
end_point: "Consume",
|
||||
producer: "C2",
|
||||
producer_did: "did:sov:test:0062",
|
||||
network: "Test Network B",
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
export const Client1ConsumerTableConfig = [
|
||||
{
|
||||
key: "service_name",
|
||||
label: "Service name"
|
||||
label: "Service name",
|
||||
},
|
||||
{
|
||||
key: "service_type",
|
||||
label: "Service Type"
|
||||
label: "Service Type",
|
||||
},
|
||||
{
|
||||
key: "end_point",
|
||||
label: "End Point"
|
||||
label: "End Point",
|
||||
},
|
||||
{
|
||||
key: "producer",
|
||||
label: "Producer"
|
||||
label: "Producer",
|
||||
},
|
||||
{
|
||||
key: "producer_did",
|
||||
label: "Producer DID"
|
||||
label: "Producer DID",
|
||||
},
|
||||
{
|
||||
key: "network",
|
||||
label: "Network"
|
||||
}
|
||||
]
|
||||
label: "Network",
|
||||
},
|
||||
];
|
||||
|
||||
export const Client1ProducerData = [
|
||||
{
|
||||
"service_name": "Carlo's Printing",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "URL",
|
||||
"usage": "C1(3), C3(4)",
|
||||
"status": "DRAFT, REGISTERED",
|
||||
"action": "Register, Deregister, Delete",
|
||||
service_name: "Carlo's Printing",
|
||||
service_type: "3D Printing",
|
||||
end_point: "URL",
|
||||
usage: "C1(3), C3(4)",
|
||||
status: "DRAFT, REGISTERED",
|
||||
action: "Register, Deregister, Delete",
|
||||
},
|
||||
{
|
||||
"service_name": "Steve's Printing",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "URL",
|
||||
"usage": "C1(3), C3(4)",
|
||||
"status": "REGISTERED",
|
||||
"action": "Create",
|
||||
service_name: "Steve's Printing",
|
||||
service_type: "3D Printing",
|
||||
end_point: "URL",
|
||||
usage: "C1(3), C3(4)",
|
||||
status: "REGISTERED",
|
||||
action: "Create",
|
||||
},
|
||||
{
|
||||
"service_name": "Test Printing A",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "URL",
|
||||
"usage": "C1(3), C3(4)",
|
||||
"status": "DRAFT",
|
||||
"action": "Register, Deregister",
|
||||
service_name: "Test Printing A",
|
||||
service_type: "3D Printing",
|
||||
end_point: "URL",
|
||||
usage: "C1(3), C3(4)",
|
||||
status: "DRAFT",
|
||||
action: "Register, Deregister",
|
||||
},
|
||||
{
|
||||
"service_name": "Test Printing B",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "URL",
|
||||
"usage": "C1(3), C3(4)",
|
||||
"status": "DRAFT, REGISTERED",
|
||||
"action": "Delete, Create",
|
||||
service_name: "Test Printing B",
|
||||
service_type: "3D Printing",
|
||||
end_point: "URL",
|
||||
usage: "C1(3), C3(4)",
|
||||
status: "DRAFT, REGISTERED",
|
||||
action: "Delete, Create",
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
export const Client1ProducerTableConfig = [
|
||||
{
|
||||
key: "service_name",
|
||||
label: "Service name"
|
||||
label: "Service name",
|
||||
},
|
||||
{
|
||||
key: "service_type",
|
||||
label: "Service Type"
|
||||
label: "Service Type",
|
||||
},
|
||||
{
|
||||
key: "end_point",
|
||||
label: "End Point"
|
||||
label: "End Point",
|
||||
},
|
||||
{
|
||||
key: "usage",
|
||||
label: "Usage"
|
||||
label: "Usage",
|
||||
},
|
||||
{
|
||||
key: "status",
|
||||
label: "Status"
|
||||
label: "Status",
|
||||
},
|
||||
{
|
||||
key: "action",
|
||||
label: "Action"
|
||||
}
|
||||
]
|
||||
label: "Action",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -17,124 +17,124 @@ export const Client2SummaryDetails = [
|
||||
|
||||
export const Client2ConsumerData = [
|
||||
{
|
||||
"service_name": "Carlo's Printing",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "Consume",
|
||||
"producer": "C2",
|
||||
"producer_did": "did:sov:test:1223",
|
||||
"network": "Carlo's Home Network",
|
||||
service_name: "Carlo's Printing",
|
||||
service_type: "3D Printing",
|
||||
end_point: "Consume",
|
||||
producer: "C2",
|
||||
producer_did: "did:sov:test:1223",
|
||||
network: "Carlo's Home Network",
|
||||
},
|
||||
{
|
||||
"service_name": "Steve's Printing",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "Consume",
|
||||
"producer": "C2",
|
||||
"producer_did": "did:sov:test:1234",
|
||||
"network": "Steve's Home Network",
|
||||
service_name: "Steve's Printing",
|
||||
service_type: "3D Printing",
|
||||
end_point: "Consume",
|
||||
producer: "C2",
|
||||
producer_did: "did:sov:test:1234",
|
||||
network: "Steve's Home Network",
|
||||
},
|
||||
{
|
||||
"service_name": "Test A",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "Consume",
|
||||
"producer": "C2",
|
||||
"producer_did": "did:sov:test:4567",
|
||||
"network": "Test Network A",
|
||||
service_name: "Test A",
|
||||
service_type: "3D Printing",
|
||||
end_point: "Consume",
|
||||
producer: "C2",
|
||||
producer_did: "did:sov:test:4567",
|
||||
network: "Test Network A",
|
||||
},
|
||||
{
|
||||
"service_name": "Test B",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "Consume",
|
||||
"producer": "C2",
|
||||
"producer_did": "did:sov:test:0062",
|
||||
"network": "Test Network B",
|
||||
service_name: "Test B",
|
||||
service_type: "3D Printing",
|
||||
end_point: "Consume",
|
||||
producer: "C2",
|
||||
producer_did: "did:sov:test:0062",
|
||||
network: "Test Network B",
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
export const Client2ConsumerTableConfig = [
|
||||
{
|
||||
key: "service_name",
|
||||
label: "Service name"
|
||||
label: "Service name",
|
||||
},
|
||||
{
|
||||
key: "service_type",
|
||||
label: "Service Type"
|
||||
label: "Service Type",
|
||||
},
|
||||
{
|
||||
key: "end_point",
|
||||
label: "End Point"
|
||||
label: "End Point",
|
||||
},
|
||||
{
|
||||
key: "producer",
|
||||
label: "Producer"
|
||||
label: "Producer",
|
||||
},
|
||||
{
|
||||
key: "producer_did",
|
||||
label: "Producer DID"
|
||||
label: "Producer DID",
|
||||
},
|
||||
{
|
||||
key: "network",
|
||||
label: "Network"
|
||||
}
|
||||
]
|
||||
label: "Network",
|
||||
},
|
||||
];
|
||||
|
||||
export const Client2ProducerData = [
|
||||
{
|
||||
"service_name": "Carlo's Printing",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "URL",
|
||||
"usage": "C1(3), C3(4)",
|
||||
"status": "DRAFT, REGISTERED",
|
||||
"action": "Register, Deregister, Delete",
|
||||
service_name: "Carlo's Printing",
|
||||
service_type: "3D Printing",
|
||||
end_point: "URL",
|
||||
usage: "C1(3), C3(4)",
|
||||
status: "DRAFT, REGISTERED",
|
||||
action: "Register, Deregister, Delete",
|
||||
},
|
||||
{
|
||||
"service_name": "Steve's Printing",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "URL",
|
||||
"usage": "C1(3), C3(4)",
|
||||
"status": "REGISTERED",
|
||||
"action": "Create",
|
||||
service_name: "Steve's Printing",
|
||||
service_type: "3D Printing",
|
||||
end_point: "URL",
|
||||
usage: "C1(3), C3(4)",
|
||||
status: "REGISTERED",
|
||||
action: "Create",
|
||||
},
|
||||
{
|
||||
"service_name": "Test Printing A",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "URL",
|
||||
"usage": "C1(3), C3(4)",
|
||||
"status": "DRAFT",
|
||||
"action": "Register, Deregister",
|
||||
service_name: "Test Printing A",
|
||||
service_type: "3D Printing",
|
||||
end_point: "URL",
|
||||
usage: "C1(3), C3(4)",
|
||||
status: "DRAFT",
|
||||
action: "Register, Deregister",
|
||||
},
|
||||
{
|
||||
"service_name": "Test Printing B",
|
||||
"service_type": "3D Printing",
|
||||
"end_point": "URL",
|
||||
"usage": "C1(3), C3(4)",
|
||||
"status": "DRAFT, REGISTERED",
|
||||
"action": "Delete, Create",
|
||||
service_name: "Test Printing B",
|
||||
service_type: "3D Printing",
|
||||
end_point: "URL",
|
||||
usage: "C1(3), C3(4)",
|
||||
status: "DRAFT, REGISTERED",
|
||||
action: "Delete, Create",
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
export const Client2ProducerTableConfig = [
|
||||
{
|
||||
key: "service_name",
|
||||
label: "Service name"
|
||||
label: "Service name",
|
||||
},
|
||||
{
|
||||
key: "service_type",
|
||||
label: "Service Type"
|
||||
label: "Service Type",
|
||||
},
|
||||
{
|
||||
key: "end_point",
|
||||
label: "End Point"
|
||||
label: "End Point",
|
||||
},
|
||||
{
|
||||
key: "usage",
|
||||
label: "Usage"
|
||||
label: "Usage",
|
||||
},
|
||||
{
|
||||
key: "status",
|
||||
label: "Status"
|
||||
label: "Status",
|
||||
},
|
||||
{
|
||||
key: "action",
|
||||
label: "Action"
|
||||
}
|
||||
]
|
||||
label: "Action",
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user