Added a lot of fixes #73

Merged
Ghost merged 12 commits from more-fixes into main 2024-01-26 00:25:58 +00:00
2 changed files with 38 additions and 49 deletions
Showing only changes of commit 59e33f3ead - Show all commits

View File

@@ -14,7 +14,7 @@ import { NoDataOverlay } from "../noDataOverlay";
import { useGetAllEventmessages } from "@/api/eventmessages/eventmessages"; import { useGetAllEventmessages } from "@/api/eventmessages/eventmessages";
import { mutate } from "swr"; import { mutate } from "swr";
import { LoadingOverlay } from "../join/loadingOverlay"; import { LoadingOverlay } from "../join/loadingOverlay";
import { generateMermaidString } from "./helpers"; import { dataFromBE, generateMermaidString } from "./helpers";
const SequenceDiagram = () => { const SequenceDiagram = () => {
const { const {
@@ -25,9 +25,10 @@ const SequenceDiagram = () => {
const mermaidRef: any = useRef(null); const mermaidRef: any = useRef(null);
const [scale, setScale] = useState(1); const [scale, setScale] = useState(1);
const hasData = eventMessagesData?.data && eventMessagesData?.data.length > 0; // const hasData = eventMessagesData?.data && eventMessagesData?.data.length > 0;
const hasData = true;
const mermaidString = generateMermaidString(eventMessagesData?.data); const mermaidString = generateMermaidString(dataFromBE);
useEffect(() => { useEffect(() => {
if (!loadingEventMessages && hasData) if (!loadingEventMessages && hasData)

View File

@@ -1,7 +1,4 @@
import { Button, IconButton, Tooltip } from "@mui/material"; import { Button, Tooltip } from "@mui/material";
import AddCircleIcon from "@mui/icons-material/AddCircle";
import RemoveCircleIcon from "@mui/icons-material/RemoveCircle";
import DeleteIcon from "@mui/icons-material/Delete";
export const ClientTableConfig = [ export const ClientTableConfig = [
{ {
@@ -15,26 +12,21 @@ export const ClientTableConfig = [
{ {
key: "endpoint_url", key: "endpoint_url",
label: "End Point", label: "End Point",
render: () => { render: (value: any) => {
const onConsume = () => {
// fetch(value).then(() => { }).catch(() => { })
};
return ( return (
<Button disabled variant="outlined"> <Button onClick={onConsume} disabled variant="outlined">
Consume Consume
</Button> </Button>
); );
}, },
}, },
// {
// key: "entity",
// label: "Entity",
// },
{ {
key: "entity_did", key: "entity_did",
label: "Entity DID", label: "Entity DID",
}, },
// {
// key: "network",
// label: "Network",
// },
]; ];
export const ServiceTableConfig = [ export const ServiceTableConfig = [
@@ -88,39 +80,35 @@ export const ServiceTableConfig = [
{ {
key: "action", key: "action",
label: "Actions", label: "Actions",
render: () => { render: (value: any) => {
return ( const { data } = value;
<>
<Tooltip title="Register" placement="top">
<IconButton disabled size="small">
<AddCircleIcon />
</IconButton>
</Tooltip>
<Tooltip title="De-register" placement="top"> const onButtonClick = (endpoint: string) => {
<IconButton disabled size="small"> console.log("which endpoint comes here?", endpoint);
<RemoveCircleIcon /> // fetch(endpoint).then(() => { }).catch(() => { })
</IconButton> };
</Tooltip>
<Tooltip title="Delete" placement="top"> if (!data) return <div>N/A</div>;
<IconButton disabled size="small" color="secondary">
<DeleteIcon /> if (data && data.length)
</IconButton> return data.map((item: any, index: number) => {
</Tooltip> const buttonLabel = item.name;
</> const buttonEndpoint = item.endpoint;
);
// let renderedValue: any = ""; return (
// if (typeof value === "object") <Tooltip placement="top" title={buttonLabel}>
// renderedValue = ( <Button
// <> style={{ marginRight: 8 }}
// {[...value.data, { name: 'Delete', endpoint: '' }].map((actionType: any) => ( key={index}
// <> onClick={() => onButtonClick(buttonEndpoint)}
// <Button disabled style={{ marginRight: 8 }} variant="outlined" size="small">{actionType.name}</Button> size="small"
// </> variant="outlined"
// ))} >
// </> {buttonLabel}
// ); </Button>
// return renderedValue; </Tooltip>
);
});
}, },
}, },
]; ];