Skip to content

Commit

Permalink
fix pii fields and traces tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilShahi committed Aug 8, 2022
1 parent ff00149 commit b2d5524
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export interface PIIField {
dataClass: string;
dataPath: string;
risk: RiskScore;
createdAt: string;
updatedAt: string;
createdAt: Date;
updatedAt: Date;
matches: string[];
isRisk: boolean;
}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Endpoint/PIIDataList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { PIIField } from "@common/types";
import DataTable, { TableColumn } from "react-data-table-component";
import { getCustomStyles, rowStyles } from "../utils/TableUtils";
import { RISK_TO_COLOR, DATA_CLASS_TO_RISK_SCORE } from "../../constants";
import { getDateTimeString } from "../../utils";

interface PIIDataListProps {
PIIFields: PIIField[];
Expand Down Expand Up @@ -51,7 +52,7 @@ const PIIDataList: React.FC<PIIDataListProps> = React.memo(({ PIIFields }) => {
{
name: "Date Identified",
sortable: true,
selector: (row: PIIField) => row.createdAt || "",
selector: (row: PIIField) => getDateTimeString(row.createdAt) || "",
id: "dateIdentified",
grow: 2,
},
Expand Down
21 changes: 16 additions & 5 deletions frontend/src/components/Endpoint/TraceDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react";
import dynamic from "next/dynamic";
import { Badge, Box, Code, ColorMode, Grid, GridItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalHeader, ModalOverlay, Text, useColorMode, VStack } from "@chakra-ui/react";
import { Badge, Box, Code, ColorMode, Grid, GridItem, HStack, Modal, ModalBody, ModalCloseButton, ModalContent, ModalHeader, ModalOverlay, Text, useColorMode, VStack } from "@chakra-ui/react";
import { ApiTrace } from "@common/types";
import { getDateTimeString } from "../../utils";
import { METHOD_TO_COLOR } from "../../constants";
import { statusCodeToColor } from "../utils/StatusCode";
const ReactJson = dynamic(() => import("react-json-view"), { ssr: false })

Expand Down Expand Up @@ -70,14 +71,24 @@ const TraceDetail: React.FC<TraceDetailProps> = React.memo(({ trace, isOpen, onC
<GridItem>
<VStack alignItems="flex-start">
<Text fontWeight="semibold">Path</Text>
<Code p="1" rounded="md" fontSize="sm">
{trace.path}
</Code>
<HStack>
<Badge
fontSize="sm"
px="2"
py="1"
colorScheme={METHOD_TO_COLOR[trace.method] || "gray"}
>
{trace.method.toUpperCase()}
</Badge>
<Code p="1" rounded="md" fontSize="sm">
{trace.path}
</Code>
</HStack>
</VStack>
</GridItem>
<GridItem>
<VStack alignItems="flex-start">
<Text fontWeight="semibold">Method</Text>
<Text fontWeight="semibold">Response Status</Text>
<Badge
fontSize="sm"
px="2"
Expand Down

0 comments on commit b2d5524

Please sign in to comment.