From 51859b148b4ad7b817130d153b912019e44557dc Mon Sep 17 00:00:00 2001 From: sara-pervana Date: Tue, 16 Jan 2024 22:05:09 +0100 Subject: [PATCH] final changes and fixes added --- .../src/components/sequence_diagram/index.tsx | 4 +- pkgs/ui/src/config/access_point/index.tsx | 33 +++++---- pkgs/ui/src/config/client_1/index.tsx | 72 ++++++++++++++----- 3 files changed, 79 insertions(+), 30 deletions(-) diff --git a/pkgs/ui/src/components/sequence_diagram/index.tsx b/pkgs/ui/src/components/sequence_diagram/index.tsx index 6b4500d..43d29f3 100644 --- a/pkgs/ui/src/components/sequence_diagram/index.tsx +++ b/pkgs/ui/src/components/sequence_diagram/index.tsx @@ -133,7 +133,7 @@ const SequenceDiagram = () => {
{hasData ? ( <> -
+
@@ -170,7 +170,7 @@ const SequenceDiagram = () => {
) : ( -
+
)} diff --git a/pkgs/ui/src/config/access_point/index.tsx b/pkgs/ui/src/config/access_point/index.tsx index 2d8575a..98405b6 100644 --- a/pkgs/ui/src/config/access_point/index.tsx +++ b/pkgs/ui/src/config/access_point/index.tsx @@ -59,22 +59,31 @@ export const APServiceRepositoryTableConfig = [ { key: "status", label: "Status", - }, - { - key: "other", - label: "Type", render: (value: any) => { let renderedValue: any = ""; - if (typeof value === "object") { - const label = Object.keys(value)[0]; - const info = value[label]; - renderedValue = ( - - {label} {info} - - ); + if (Array.isArray(value.data)) { + renderedValue = value.data.join(", "); + } else { + console.error("Status is not an array", value); } return renderedValue; }, }, + // { + // key: "other", + // label: "Type", + // render: (value: any) => { + // let renderedValue: any = ""; + // if (typeof value === "object") { + // const label = Object.keys(value)[0]; + // const info = value[label]; + // renderedValue = ( + // + // {label} {info} + // + // ); + // } + // return renderedValue; + // }, + // }, ]; diff --git a/pkgs/ui/src/config/client_1/index.tsx b/pkgs/ui/src/config/client_1/index.tsx index d467d38..e1ad33e 100644 --- a/pkgs/ui/src/config/client_1/index.tsx +++ b/pkgs/ui/src/config/client_1/index.tsx @@ -1,4 +1,7 @@ -import { Button } from "@mui/material"; +import { Button, IconButton, 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 = [ { @@ -51,6 +54,24 @@ export const ServiceTableConfig = [ key: "entity_did", label: "Entity DID", }, + { + key: "usage", + label: "Usage", + render: (value: any) => { + let renderedValue = ""; + + if (value.length > 0) { + renderedValue = value.map((item: any, index: number) => { + return ( +
+ {item.consumer_entity_did} ({item.times_consumed}) +
+ ); + }); + } + return renderedValue; + }, + }, { key: "status", label: "Status", @@ -66,21 +87,40 @@ export const ServiceTableConfig = [ }, { key: "action", - label: "Action", - render: (value: any) => { - let renderedValue: any = ""; - console.log("value", value.data); - if (typeof value === "object") - renderedValue = ( - <> - {value.data.map((actionType: any) => ( - <> - - - ))} - - ); - return renderedValue; + label: "Actions", + render: () => { + return ( + <> + + + + + + + + + + + + + + + + + + ); + // let renderedValue: any = ""; + // if (typeof value === "object") + // renderedValue = ( + // <> + // {[...value.data, { name: 'Delete', endpoint: '' }].map((actionType: any) => ( + // <> + // + // + // ))} + // + // ); + // return renderedValue; }, }, ];