From 677f4cf351018c296d8356266ed3a5fb2948e2ab Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 3 Dec 2023 21:23:45 +0100 Subject: [PATCH] Update other widgets to new function results --- vss-extension-dev.json | 2 +- widgets/widgets/widget_1x1/widget_1x1.js | 8 ++++---- widgets/widgets/widget_2x1/widget_2x1.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vss-extension-dev.json b/vss-extension-dev.json index bcf4d36..99594bf 100644 --- a/vss-extension-dev.json +++ b/vss-extension-dev.json @@ -1,7 +1,7 @@ { "manifestVersion": 1, "id": "GHAzDoWidget-DEV", - "version": "0.2.299", + "version": "0.2.300", "public": false, "name": "Advanced Security dashboard Widgets [DEV]", "description": "[DEV] GitHub Advanced Security for Azure DevOps dashboard widgets", diff --git a/widgets/widgets/widget_1x1/widget_1x1.js b/widgets/widgets/widget_1x1/widget_1x1.js index abe92ec..a8f0be3 100644 --- a/widgets/widgets/widget_1x1/widget_1x1.js +++ b/widgets/widgets/widget_1x1/widget_1x1.js @@ -21,7 +21,7 @@ async function loadWidget(widgetSettings, organization, projectName, VSS, Servic repoName = data.repo consoleLog(`loaded repoName from widgetSettings_1x1: [${repoName}] and id [${repoId}]`); - alerts = await getAlerts(organization, projectName, repoId); + alerts = (await getAlerts(organization, projectName, repoId)).values; } else { // load alerts for ALL repos in the project @@ -36,9 +36,9 @@ async function loadWidget(widgetSettings, organization, projectName, VSS, Servic // call and let the promise handle the rest const repoAlerts = await getAlerts(organization, projectName, repo.id) - alerts.codeAlerts += repoAlerts.codeAlerts; - alerts.dependencyAlerts += repoAlerts.dependencyAlerts; - alerts.secretAlerts += repoAlerts.secretAlerts; + alerts.codeAlerts += repoAlerts.values.codeAlerts; + alerts.dependencyAlerts += repoAlerts.values.dependencyAlerts; + alerts.secretAlerts += repoAlerts.values.secretAlerts; } } consoleLog('alerts: ' + JSON.stringify(alerts)); diff --git a/widgets/widgets/widget_2x1/widget_2x1.js b/widgets/widgets/widget_2x1/widget_2x1.js index 01ce0da..4d901a9 100644 --- a/widgets/widgets/widget_2x1/widget_2x1.js +++ b/widgets/widgets/widget_2x1/widget_2x1.js @@ -22,7 +22,7 @@ async function loadWidget(widgetSettings, organization, projectName) { var title = $('h2.ghazdo-title'); title.text(`Security Alerts for ${repoName}`); title.attr('title', repoName); - alerts = await getAlerts(organization, projectName, repoId); + alerts = (await getAlerts(organization, projectName, repoId)).values; consoleLog('alerts: ' + JSON.stringify(alerts)); // GHAS is only available on the SaaS version, so we can hardcode the domain