Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit fa48c6e

Browse files
committed
remove code and file columns from alerts table
1 parent 70ceabb commit fa48c6e

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

src/components/AlertsTable.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ export function AlertsTable() {
168168
Type
169169
</Column>
170170
<Column width={300}>Trigger Token</Column>
171-
<Column width={150}>File</Column>
172-
<Column width={250}>Code</Column>
173171
</Row>
174172
</TableHeader>
175173
<TableBody>
@@ -185,18 +183,6 @@ export function AlertsTable() {
185183
<Cell className="overflow-auto whitespace-nowrap max-w-80">
186184
{wrapObjectOutput(alert.trigger_string)}
187185
</Cell>
188-
<Cell className="truncate">
189-
{alert.code_snippet?.filepath || "N/A"}
190-
</Cell>
191-
<Cell className="overflow-auto whitespace-nowrap max-w-80">
192-
{alert.code_snippet?.code ? (
193-
<pre className="max-h-40 overflow-auto bg-gray-100 p-2 whitespace-pre-wrap">
194-
<code>{alert.code_snippet.code}</code>
195-
</pre>
196-
) : (
197-
"N/A"
198-
)}
199-
</Cell>
200186
</Row>
201187
))}
202188
</TableBody>

src/routes/__tests__/route-dashboard.test.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,6 @@ describe("Dashboard", () => {
150150
}),
151151
).toBeVisible();
152152

153-
expect(
154-
screen.getByRole("columnheader", {
155-
name: /file/i,
156-
}),
157-
).toBeVisible();
158-
expect(
159-
screen.getByRole("columnheader", {
160-
name: /code/i,
161-
}),
162-
).toBeVisible();
163153
expect(
164154
screen.getByRole("columnheader", {
165155
name: /time/i,
@@ -176,17 +166,9 @@ describe("Dashboard", () => {
176166
const firstRow = within(screen.getByTestId("alerts-table")).getAllByRole(
177167
"row",
178168
)[1] as HTMLElement;
179-
const secondRow = within(screen.getByTestId("alerts-table")).getAllByRole(
180-
"row",
181-
)[2] as HTMLElement;
182169

183-
expect(within(firstRow).getByText(/ghp_token/i)).toBeVisible();
184170
expect(within(firstRow).getByText(/codegate-secrets/i)).toBeVisible();
185-
expect(within(firstRow).getAllByText(/n\/a/i).length).toEqual(2);
186171
expect(within(firstRow).getByText(/[0-9]+.*ago/i)).toBeVisible();
187-
188-
// check trigger_string null
189-
expect(within(secondRow).getAllByText(/n\/a/i).length).toEqual(3);
190172
});
191173

192174
it("should render malicious pkg", async () => {
@@ -294,7 +276,6 @@ describe("Dashboard", () => {
294276
const row = within(screen.getByTestId("alerts-table")).getAllByRole(
295277
"row",
296278
)[1] as HTMLElement;
297-
expect(within(row).getByText(/ghp_token/i)).toBeVisible();
298279
expect(within(row).getByText(/codegate-secrets/i)).toBeVisible();
299280
});
300281

0 commit comments

Comments
 (0)