Skip to content

Commit f1ecc63

Browse files
committed
Replace VsCodeLink with Link
1 parent ec66435 commit f1ecc63

File tree

5 files changed

+18
-25
lines changed

5 files changed

+18
-25
lines changed

extensions/ql-vscode/src/stories/common/Alert.stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type { Meta, StoryFn } from "@storybook/react";
2-
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react";
2+
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react";
33

44
import { VariantAnalysisContainer } from "../../view/variant-analysis/VariantAnalysisContainer";
55
import { Alert } from "../../view/common";
6+
import { Link } from "../../view/common/Link";
67

78
export default {
89
title: "Alert",
@@ -24,7 +25,7 @@ Warning.args = {
2425
title: "This query found a warning",
2526
message: (
2627
<>
27-
Warning content with <VSCodeLink>links</VSCodeLink>
28+
Warning content with <Link>links</Link>
2829
</>
2930
),
3031
};
@@ -50,7 +51,7 @@ Error.args = {
5051
title: "This query found an error",
5152
message: (
5253
<>
53-
Error content with <VSCodeLink>links</VSCodeLink>
54+
Error content with <Link>links</Link>
5455
</>
5556
),
5657
};
@@ -70,8 +71,7 @@ ErrorExample.args = {
7071
<>
7172
Request to
7273
https://api.github.com/repos/octodemo/Hello-World/code-scanning/codeql/queries
73-
failed. <VSCodeLink>View actions logs</VSCodeLink> and try running this
74-
query again.
74+
failed. <Link>View actions logs</Link> and try running this query again.
7575
</>
7676
),
7777
};

extensions/ql-vscode/src/view/common/FileCodeSnippet/FileCodeSnippet.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { styled } from "styled-components";
2-
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react";
32

43
import type {
54
AnalysisMessage,
@@ -12,6 +11,7 @@ import { createRemoteFileRef } from "../../../common/location-link-utils";
1211
import { CodeSnippetMessage } from "./CodeSnippetMessage";
1312
import { CodeSnippetLine } from "./CodeSnippetLine";
1413
import { sendTelemetry } from "../telemetry";
14+
import { Link } from "../Link";
1515

1616
const borderColor = "var(--vscode-editor-snippetFinalTabstopHighlightBorder)";
1717

@@ -72,12 +72,9 @@ export const FileCodeSnippet = ({
7272
return (
7373
<Container>
7474
<TitleContainer>
75-
<VSCodeLink
76-
onClick={sendCodeSnippetTitleLinkTelemetry}
77-
href={titleFileUri}
78-
>
75+
<Link onClick={sendCodeSnippetTitleLinkTelemetry} href={titleFileUri}>
7976
{fileLink.filePath}
80-
</VSCodeLink>
77+
</Link>
8178
</TitleContainer>
8279
{message && severity && (
8380
<CodeSnippetMessage message={message} severity={severity}>
@@ -93,12 +90,9 @@ export const FileCodeSnippet = ({
9390
return (
9491
<Container>
9592
<TitleContainer>
96-
<VSCodeLink
97-
onClick={sendCodeSnippetTitleLinkTelemetry}
98-
href={titleFileUri}
99-
>
93+
<Link onClick={sendCodeSnippetTitleLinkTelemetry} href={titleFileUri}>
10094
{fileLink.filePath}
101-
</VSCodeLink>
95+
</Link>
10296
</TitleContainer>
10397
<CodeContainer>
10498
{code.map((line, index) => (

extensions/ql-vscode/src/view/variant-analysis/FailureReasonAlert.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { ReactNode } from "react";
2-
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react";
32
import { Alert } from "../common";
43
import { vscode } from "../vscode-api";
54
import { VariantAnalysisFailureReason } from "../../variant-analysis/shared/variant-analysis";
5+
import { Link } from "../common/Link";
66

77
type Props = {
88
failureReason: VariantAnalysisFailureReason;
@@ -33,8 +33,8 @@ const getMessage = (failureReason: VariantAnalysisFailureReason): ReactNode => {
3333
return (
3434
<>
3535
The GitHub Actions workflow run has failed.{" "}
36-
<VSCodeLink onClick={openLogs}>View actions logs</VSCodeLink> and try
37-
running this query again.
36+
<Link onClick={openLogs}>View actions logs</Link> and try running this
37+
query again.
3838
</>
3939
);
4040
case VariantAnalysisFailureReason.InternalError:

extensions/ql-vscode/src/view/variant-analysis/RawResultCell.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react";
2-
31
import type { CellValue } from "../../common/raw-result-types";
42
import { sendTelemetry } from "../common/telemetry";
53
import { convertNonPrintableChars } from "../../common/text-utils";
64
import { tryGetRemoteLocation } from "../../common/bqrs-utils";
75
import { RawNumberValue } from "../common/RawNumberValue";
6+
import { Link } from "../common/Link";
87

98
type CellProps = {
109
value: CellValue;
@@ -35,9 +34,9 @@ export const RawResultCell = ({
3534
const safeLabel = convertNonPrintableChars(value.value.label);
3635
if (url) {
3736
return (
38-
<VSCodeLink onClick={sendRawResultsLinkTelemetry} href={url}>
37+
<Link onClick={sendRawResultsLinkTelemetry} href={url}>
3938
{safeLabel}
40-
</VSCodeLink>
39+
</Link>
4140
);
4241
} else {
4342
return <span>{safeLabel}</span>;

extensions/ql-vscode/src/view/variant-analysis/VariantAnalysisStatusStats.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { styled } from "styled-components";
2-
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react";
32
import { formatDate } from "../../common/date";
43
import { VariantAnalysisStatus } from "../../variant-analysis/shared/variant-analysis";
4+
import { Link } from "../common/Link";
55

66
export type VariantAnalysisStatusStatsProps = {
77
variantAnalysisStatus: VariantAnalysisStatus;
@@ -37,7 +37,7 @@ export const VariantAnalysisStatusStats = ({
3737
<span>{completedAt !== undefined ? formatDate(completedAt) : "-"}</span>
3838
)}
3939
{onViewLogsClick && (
40-
<VSCodeLink onClick={onViewLogsClick}>View actions logs</VSCodeLink>
40+
<Link onClick={onViewLogsClick}>View actions logs</Link>
4141
)}
4242
</Container>
4343
);

0 commit comments

Comments
 (0)