Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix name of proxy variable #89

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<url>https://github.com/jenkinsci/coverage-plugin</url>

<properties>
<revision>1.12.0</revision>
<revision>1.11.1</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/coverage-plugin</gitHubRepo>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* global jQuery3, proxy, echartsJenkinsApi, bootstrap5 */

(function () {
proxy.getJenkinsColorIDs(function (colors) {
const jenkinsColors = getJenkinsColors(colors.responseObject());
const colorJson = JSON.stringify(Object.fromEntries(jenkinsColors));
proxy.setJenkinsColors(colorJson);
new CoverageChartGenerator(jQuery3).populateDetailsCharts(jenkinsColors);
new CoverageChartGenerator(jQuery3, proxy).populateDetailsCharts(jenkinsColors);
});
})();
16 changes: 8 additions & 8 deletions plugin/src/main/webapp/js/view-model.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global jQuery3, viewProxy, echartsJenkinsApi, bootstrap5 */
/* global jQuery3, proxy, echartsJenkinsApi, bootstrap5 */

getJenkinsColors = function (colors) {
// TODO: also handle HSL colors and parse them to hex in order to use dark mode colors
Expand All @@ -12,15 +12,15 @@ getJenkinsColors = function (colors) {
return colorHexMapping;
};

const CoverageChartGenerator = function ($) {
const CoverageChartGenerator = function ($, proxy) {
var selectedTreeNode;

function printPercentage(value, minimumFractionDigits = 2) {
return Number(value / 100.0).toLocaleString(undefined, {style: 'percent', minimumFractionDigits: minimumFractionDigits});
}

const openBuild = function (build) {
viewProxy.getUrlForBuild(build, window.location.href, function (buildUrl) {
proxy.getUrlForBuild(build, window.location.href, function (buildUrl) {
if (buildUrl.responseJSON.startsWith('http')) {
window.location.assign(buildUrl.responseJSON);
}
Expand Down Expand Up @@ -350,14 +350,14 @@ const CoverageChartGenerator = function ($) {
function initializeCharts() {
renderTrendChart();

viewProxy.getOverview(function (t) {
proxy.getOverview(function (t) {
createOverview(t.responseObject(), 'coverage-overview');
});

$('.tree-chart').each(function () {
const id = $(this).attr('id');
const name = $(this).attr('data-item-name');
viewProxy.getCoverageTree(id, function (t) {
proxy.getCoverageTree(id, function (t) {
createFilesTreeMap(t.responseObject(), id, name);
});
});
Expand All @@ -369,7 +369,7 @@ const CoverageChartGenerator = function ($) {

function renderTrendChart() {
const configuration = JSON.stringify(echartsJenkinsApi.readFromLocalStorage('jenkins-echarts-chart-configuration-coverage-history'));
viewProxy.getTrendChart(configuration, function (t) {
proxy.getTrendChart(configuration, function (t) {
echartsJenkinsApi.renderConfigurableZoomableTrendChart('coverage-trend', t.responseJSON, 'chart-configuration-coverage-history', openBuild);
resizeChartOf('#coverage-trend');
});
Expand Down Expand Up @@ -430,7 +430,7 @@ const CoverageChartGenerator = function ($) {
showSourceCode();
sourceView.html('Loading...');
const rowData = datatable.rows(indexes).data().toArray();
viewProxy.getSourceCode(rowData[0].fileHash, tableId + '-table', function (t) {
proxy.getSourceCode(rowData[0].fileHash, tableId + '-table', function (t) {
const sourceCode = t.responseObject();
if (sourceCode === "n/a") {
showNoSourceCode();
Expand Down Expand Up @@ -462,7 +462,7 @@ const CoverageChartGenerator = function ($) {
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
redrawCharts();

viewProxy.getOverview(function (t) {
proxy.getOverview(function (t) {
createOverview(t.responseObject(), 'coverage-overview');
});
});
Expand Down
Loading