fix linting

This commit is contained in:
Arslan, Erdem
2023-11-24 01:05:54 +01:00
parent 0cea4644c3
commit 3075144244
5 changed files with 359 additions and 350 deletions

View File

@@ -6,7 +6,7 @@ import {
Client1ConsumerData,
Client1ConsumerTableConfig,
Client1ProducerTableConfig,
Client1ProducerData
Client1ProducerData,
} from "@/mock/client_1";
import CustomTable from "@/components/table";

View File

@@ -6,7 +6,7 @@ import {
Client2ConsumerTableConfig,
Client2ProducerData,
Client2ProducerTableConfig,
Client2SummaryDetails
Client2SummaryDetails,
} from "@/mock/client_2";
import CustomTable from "@/components/table";

View File

@@ -8,10 +8,10 @@ import {
ListItemText,
} from "@mui/material";
import Image from "next/image";
import React, {ReactNode} from "react";
import React, { ReactNode } from "react";
import {tw} from "@/utils/tailwind";
import Collapse from '@mui/material/Collapse';
import { tw } from "@/utils/tailwind";
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;
@@ -33,40 +33,40 @@ type MenuEntry = {
const menuEntityEntries: MenuEntry[] = [
{
icon: <PersonIcon/>,
icon: <PersonIcon />,
label: "C1",
to: "/client-1",
disabled: false,
},
{
icon: <PersonIcon/>,
icon: <PersonIcon />,
label: "C2",
to: "/client-2",
disabled: false,
}
},
];
const menuEntries: MenuEntry[] = [
{
icon: <HomeIcon/>,
icon: <HomeIcon />,
label: "Home",
to: "/",
disabled: false,
},
{
icon: <HubIcon/>,
icon: <HubIcon />,
label: "Entities",
to: "/entities",
disabled: false,
},
{
icon: <RouterIcon/>,
icon: <RouterIcon />,
label: "AP",
to: "/access-point",
disabled: false,
},
{
icon: <StorageIcon/>,
icon: <StorageIcon />,
label: "DLG",
to: "/distributed-ledger-gateway",
disabled: false,
@@ -82,8 +82,10 @@ interface SidebarProps {
}
export function Sidebar(props: SidebarProps) {
const {show, onClose} = props;
const [activeMenuItem, setActiveMenuItem] = React.useState(typeof window !== "undefined" ? window.location.pathname : "");
const { show, onClose } = props;
const [activeMenuItem, setActiveMenuItem] = React.useState(
typeof window !== "undefined" ? window.location.pathname : "",
);
const [collapseMenuOpen, setCollapseMenuOpen] = React.useState(true);
const handleCollapseClick = () => {
@@ -96,7 +98,7 @@ export function Sidebar(props: SidebarProps) {
return (
<aside
style={{backgroundColor: "#00497c"}}
style={{ backgroundColor: "#00497c" }}
className={tw`${
show ? showSidebar : hideSidebar
} z-9999 static left-0 top-0 flex h-screen w-14 flex-col overflow-x-hidden overflow-y-hidden bg-neutral-10 transition duration-150 ease-in-out dark:bg-neutral-2 lg:w-64`}
@@ -118,7 +120,7 @@ export function Sidebar(props: SidebarProps) {
/>
<div className="flex w-full justify-center">
<IconButton size="large" className="text-white" onClick={onClose}>
<ChevronLeftIcon fontSize="inherit"/>
<ChevronLeftIcon fontSize="inherit" />
</IconButton>
</div>
<div className="flex flex-col overflow-hidden overflow-y-auto">
@@ -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"
@@ -173,12 +176,18 @@ export function Sidebar(props: SidebarProps) {
}}
className="hidden lg:block"
/>
{collapseMenuOpen ? <ExpandLess/> : <ExpandMore/>}
{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>
);
})}

View File

@@ -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",
},
];

View File

@@ -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",
},
];