Skip to content

Commit

Permalink
make row columns clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilShahi committed Aug 10, 2022
1 parent b5a8f52 commit e24883a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions frontend/src/components/AlertList/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const List: React.FC<AlertTablesProps> = React.memo(
selector: (row: Alert) => row.riskScore || "",
cell: (row: Alert) => (
<Badge
data-tag="allowRowEvents"
p="1"
fontSize="sm"
colorScheme={RISK_TO_COLOR[row.riskScore]}
Expand All @@ -141,7 +142,7 @@ const List: React.FC<AlertTablesProps> = React.memo(
sortable: true,
selector: (row: Alert) => `${row.apiEndpoint.method}_${row.apiEndpoint.path}`,
cell: (row: Alert) => (
<HStack>
<HStack data-tag="allowRowEvents">
<Badge
fontSize="sm"
px="2"
Expand All @@ -163,7 +164,7 @@ const List: React.FC<AlertTablesProps> = React.memo(
sortable: true,
selector: (row: Alert) => row.type || "",
cell: (row: Alert) => (
<Text fontSize="sm" fontWeight="semibold">
<Text data-tag="allowRowEvents" fontSize="sm" fontWeight="semibold">
{row.type}
</Text>
),
Expand All @@ -175,7 +176,7 @@ const List: React.FC<AlertTablesProps> = React.memo(
sortable: true,
selector: (row: Alert) => row.description || "",
cell: (row: Alert) => (
<Text fontSize="sm" fontWeight="semibold">
<Text data-tag="allowRowEvents" fontSize="sm" fontWeight="semibold">
{row.description}
</Text>
),
Expand All @@ -187,7 +188,7 @@ const List: React.FC<AlertTablesProps> = React.memo(
sortable: true,
selector: (row: Alert) => row.createdAt.toISOString(),
cell: (row: Alert) => (
<Text fontSize="sm" fontWeight="semibold">
<Text data-tag="allowRowEvents" fontSize="sm" fontWeight="semibold">
{getDateTimeString(row.createdAt)}
</Text>
),
Expand All @@ -199,7 +200,7 @@ const List: React.FC<AlertTablesProps> = React.memo(
sortable: true,
selector: (row: Alert) => row.resolved,
cell: (row: Alert) => (
<Box alignItems={"end"}>
<Box data-tag="allowRowEvents" alignItems={"end"}>
{row.resolved ? <ImCheckmark color="#93DCAC" /> : <ImCross color="#FDB2B2" />}
</Box>
),
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/components/Endpoint/AlertList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const AlertList: React.FC<AlertListProps> = React.memo(
selector: (row: Alert) => row.riskScore || "",
cell: (row: Alert) => (
<Badge
data-tag="allowRowEvents"
p="1"
fontSize="sm"
colorScheme={RISK_TO_COLOR[row.riskScore]}
Expand All @@ -67,7 +68,7 @@ const AlertList: React.FC<AlertListProps> = React.memo(
sortable: true,
selector: (row: Alert) => `${row.apiEndpoint.method}_${row.apiEndpoint.path}`,
cell: (row: Alert) => (
<HStack>
<HStack data-tag="allowRowEvents">
<Badge
fontSize="sm"
px="2"
Expand All @@ -91,7 +92,7 @@ const AlertList: React.FC<AlertListProps> = React.memo(
sortable: true,
selector: (row: Alert) => row.type || "",
cell: (row: Alert) => (
<Text fontSize="sm" fontWeight="semibold">
<Text data-tag="allowRowEvents" fontSize="sm" fontWeight="semibold">
{row.type}
</Text>
),
Expand All @@ -103,7 +104,7 @@ const AlertList: React.FC<AlertListProps> = React.memo(
sortable: true,
selector: (row: Alert) => row.description || "",
cell: (row: Alert) => (
<Text fontSize="sm" fontWeight="semibold">
<Text data-tag="allowRowEvents" fontSize="sm" fontWeight="semibold">
{row.description}
</Text>
),
Expand All @@ -115,7 +116,7 @@ const AlertList: React.FC<AlertListProps> = React.memo(
sortable: true,
selector: (row: Alert) => row.createdAt.toISOString(),
cell: (row: Alert) => (
<Text fontSize="sm" fontWeight="semibold">
<Text data-tag="allowRowEvents" fontSize="sm" fontWeight="semibold">
{getDateTimeString(row.createdAt)}
</Text>
),
Expand All @@ -129,7 +130,7 @@ const AlertList: React.FC<AlertListProps> = React.memo(
sortable: true,
selector: (row: Alert) => row.resolved,
cell: (row: Alert) => (
<Box alignItems={"end"}>
<Box data-tag="allowRowEvents" alignItems={"end"}>
{row.resolved ? <ImCheckmark color="#93DCAC" /> : <ImCross color="#FDB2B2" />}
</Box>
),
Expand Down

0 comments on commit e24883a

Please sign in to comment.