From 66ea8697483b9524f8087ff0561e6a790aa41b4e Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 8 Nov 2021 17:11:31 +1000 Subject: [PATCH] [JENKINS-67080] fix malformed json Signed-off-by: Olivier Lamy --- src/main/java/hudson/tasks/junit/History.java | 8 ++++---- src/main/webapp/history/history.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/hudson/tasks/junit/History.java b/src/main/java/hudson/tasks/junit/History.java index b6aaece38..629810214 100644 --- a/src/main/java/hudson/tasks/junit/History.java +++ b/src/main/java/hudson/tasks/junit/History.java @@ -73,8 +73,8 @@ public boolean historyAvailable() { @JavaScriptMethod @SuppressWarnings("unused") // Called by jelly view - public String getTestResultTrend() { - return JACKSON_FACADE.toJson(createTestResultTrend()); + public LinesChartModel getTestResultTrend() { + return createTestResultTrend(); } private LinesChartModel createTestResultTrend() { @@ -88,8 +88,8 @@ private LinesChartModel createTestResultTrend() { @JavaScriptMethod @SuppressWarnings("unused") // Called by jelly view - public String getTestDurationTrend() { - return JACKSON_FACADE.toJson(createTestDurationResultTrend()); + public LinesChartModel getTestDurationTrend() { + return createTestDurationResultTrend(); } private LinesChartModel createTestDurationResultTrend() { diff --git a/src/main/webapp/history/history.js b/src/main/webapp/history/history.js index 10f75e16d..4d4b68b02 100644 --- a/src/main/webapp/history/history.js +++ b/src/main/webapp/history/history.js @@ -14,7 +14,7 @@ document.addEventListener('DOMContentLoaded', function () { * Requires that a DOM
element exists with the ID '#test-duration-trend-chart'. */ view.getTestDurationTrend(function (lineModel) { - echartsJenkinsApi.renderZoomableTrendChart('test-duration-trend-chart', lineModel.responseJSON, redrawTrendCharts); + echartsJenkinsApi.renderZoomableTrendChart('test-duration-trend-chart', lineModel.responseText, redrawTrendCharts); }); /** @@ -22,7 +22,7 @@ document.addEventListener('DOMContentLoaded', function () { * Requires that a DOM
element exists with the ID '#test-result-trend-chart'. */ view.getTestResultTrend(function (lineModel) { - echartsJenkinsApi.renderZoomableTrendChart('test-result-trend-chart', lineModel.responseJSON, redrawTrendCharts); + echartsJenkinsApi.renderZoomableTrendChart('test-result-trend-chart', lineModel.responseText, redrawTrendCharts); }); }