From d34f6af8308a46d0b3368c5fdf08f2dd5b0bf707 Mon Sep 17 00:00:00 2001 From: "Keith J. Grant" Date: Fri, 11 Nov 2022 14:55:36 -0800 Subject: [PATCH] fix traceback offset/counter # in UI --- awx/ui/src/screens/Job/JobOutput/JobEvent.js | 4 ++-- awx/ui/src/screens/Job/JobOutput/loadJobEvents.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/awx/ui/src/screens/Job/JobOutput/JobEvent.js b/awx/ui/src/screens/Job/JobOutput/JobEvent.js index 8f3dd81f8e..87f6f54fbf 100644 --- a/awx/ui/src/screens/Job/JobOutput/JobEvent.js +++ b/awx/ui/src/screens/Job/JobOutput/JobEvent.js @@ -41,7 +41,7 @@ function JobEvent({ if (lineNumber < 0) { return null; } - const canToggle = index === toggleLineIndex; + const canToggle = index === toggleLineIndex && !event.isTracebackOnly; return ( - {lineNumber} + {!event.isTracebackOnly ? lineNumber : ''} jobEvent.counter === 1); - if (firstIndex && events[firstIndex]?.stdout) { - const stdoutLines = events[firstIndex].stdout.split('\r\n'); + if (firstIndex > -1) { + if (!events[firstIndex].stdout) { + events[firstIndex].isTracebackOnly = true; + } + const stdoutLines = events[firstIndex].stdout?.split('\r\n') || []; stdoutLines[0] = tracebackEvent.stdout; events[firstIndex].stdout = stdoutLines.join('\r\n'); } else {