Skip to content

Commit 32e797f

Browse files
authored
Linkify error text and step headers (#864)
1 parent 28010a9 commit 32e797f

File tree

4 files changed

+45
-4
lines changed

4 files changed

+45
-4
lines changed

package-lock.json

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
"dependencies": {
3434
"@formatjs/intl-durationformat": "^0.7.4",
3535
"@tippyjs/react": "^4.2.6",
36+
"linkify-html": "^4.3.1",
37+
"linkify-react": "^4.3.1",
38+
"linkifyjs": "^4.3.1",
3639
"react": "^19.1.0",
3740
"react-dom": "^19.1.0",
3841
"react-zoom-pan-pinch": "3.7.0"

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLine.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import linkifyHtml from "linkify-html";
12
import { memo, useEffect, useRef } from "react";
23

34
import { makeReactChildren, tokenizeANSIString } from "./Ansi.tsx";
@@ -55,7 +56,7 @@ export const ConsoleLine = memo(function ConsoleLine(props: ConsoleLineProps) {
5556
className="console-text"
5657
>
5758
{makeReactChildren(
58-
tokenizeANSIString(props.content),
59+
tokenizeANSIString(linkifyHtml(props.content)),
5960
`${props.stepId}-${props.lineNumber}`,
6061
)}
6162
</div>

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLogCard.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import "./console-log-card.scss";
22

3+
import Linkify from "linkify-react";
34
import {
45
lazy,
56
MouseEvent as ReactMouseEvent,
@@ -93,9 +94,17 @@ export default function ConsoleLogCard(props: ConsoleLogCardProps) {
9394
percentage={props.step.completePercent}
9495
/>
9596

96-
{props.step.title !== "" && <span>{props.step.title}</span>}
97-
98-
{props.step.name !== "" && <span>{props.step.name}</span>}
97+
{props.step.title !== "" && (
98+
<span>
99+
<Linkify>{props.step.title}</Linkify>
100+
</span>
101+
)}
102+
103+
{props.step.name !== "" && (
104+
<span>
105+
<Linkify>{props.step.name}</Linkify>
106+
</span>
107+
)}
99108

100109
<svg
101110
xmlns="http://www.w3.org/2000/svg"

0 commit comments

Comments
 (0)