Skip to content

Commit 7c20134

Browse files
authored
Make input proceed and abort buttons work (#597)
1 parent f658f29 commit 7c20134

File tree

2 files changed

+17
-1
lines changed
  • src/main
    • frontend/pipeline-console-view/pipeline-console/main
    • resources/io/jenkins/plugins/pipelinegraphview/consoleview/PipelineConsoleViewAction

2 files changed

+17
-1
lines changed

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

+15-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,23 @@ export interface ConsoleLineProps {
1010
heightCallback: (height: number) => void;
1111
}
1212

13+
declare global {
14+
interface Window {
15+
Behaviour: any;
16+
}
17+
}
18+
1319
// Console output line
1420
export const ConsoleLine = (props: ConsoleLineProps) => {
1521
const ref = useRef<HTMLDivElement>(null);
1622
useEffect(() => {
1723
const height = ref.current ? ref.current.getBoundingClientRect().height : 0;
1824
props.heightCallback(height);
25+
26+
// apply any behaviour selectors to the new content, e.g. for input step
27+
window.Behaviour.applySubtree(
28+
document.getElementById(`${props.stepId}-${props.lineNumber}`),
29+
);
1930
}, []);
2031

2132
return (
@@ -39,7 +50,10 @@ export const ConsoleLine = (props: ConsoleLineProps) => {
3950
>
4051
{props.lineNumber}
4152
</a>
42-
<div className="console-text">
53+
<div
54+
id={`${props.stepId}-${props.lineNumber}`}
55+
className="console-text"
56+
>
4357
{makeReactChildren(
4458
tokenizeANSIString(props.content),
4559
`${props.stepId}-${props.lineNumber}`,

src/main/resources/io/jenkins/plugins/pipelinegraphview/consoleview/PipelineConsoleViewAction/index.jelly

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<l:main-panel>
77
<p:symbols />
88

9+
<j:out value="${h.generateConsoleAnnotationScriptAndStylesheet()}"/>
10+
911
<div class="jenkins-app-bar">
1012
<div class="jenkins-app-bar__content">
1113
<h1>

0 commit comments

Comments
 (0)