Skip to content

Commit 7a0e61c

Browse files
authoredJan 16, 2025··
fix(alerts-table): trigger token box and copy to clipboard icon (#85)
* fix(alter): trigger token cell spacing * fix(markdown): show copy to clipboard when lang is detected * fix(dashbaord): trigger_string cell spacing * fix(CopyToClipboard): position * test: fix flaky dashboard it
1 parent 48e7103 commit 7a0e61c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
 

‎src/components/Dashboard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const wrapObjectOutput = (input: AlertConversation["trigger_string"]) => {
3131
if (data === null) return "N/A";
3232
if (typeof data === "string") {
3333
return (
34-
<div className="bg-gray-25 rounded-lg overflow-auto w-fit p-1">
34+
<div className="bg-gray-25 rounded-lg overflow-auto p-4">
3535
<Markdown>{data}</Markdown>
3636
</div>
3737
);

‎src/components/Markdown.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function Markdown({ children, isInverted = false }: Props) {
6666
const language = match ? match[1] : detectedLanguage;
6767
return (
6868
<div
69-
className="relative group w-full ml-0 my-4"
69+
className="relative group w-full ml-0"
7070
data-testid="syntax-highlighter"
7171
>
7272
<SyntaxHighlighter
@@ -79,10 +79,10 @@ export function Markdown({ children, isInverted = false }: Props) {
7979
>
8080
{String(children).replace(/\n$/, "")}
8181
</SyntaxHighlighter>
82-
{match && (
82+
{language && (
8383
<CopyToClipboard
8484
text={String(children).replace(/\n$/, "")}
85-
className="absolute top-4 right-8"
85+
className="absolute top-1 right-1"
8686
/>
8787
)}
8888
</div>

‎src/components/__tests__/Dashboard.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ describe("Dashboard", () => {
268268
}),
269269
).toBeVisible();
270270

271-
userEvent.type(screen.getByRole("searchbox"), "codegate-secrets");
271+
await userEvent.type(screen.getByRole("searchbox"), "codegate-secrets");
272272

273-
await waitFor(() =>
273+
waitFor(() =>
274274
expect(screen.getByTestId(/alerts-count/i)).toHaveTextContent("1"),
275275
);
276276
const row = within(screen.getByTestId("alerts-table")).getAllByRole(

0 commit comments

Comments
 (0)
Please sign in to comment.