Skip to content

Commit eeb56a8

Browse files
committed
Fix 1x1 widget error
1 parent a88c33b commit eeb56a8

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

vss-extension-dev.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifestVersion": 1,
33
"id": "GHAzDoWidget-DEV",
4-
"version": "0.0.1.66",
4+
"version": "0.0.1.67",
55
"public": false,
66
"name": "Advanced Security dashboard Widgets [DEV]",
77
"description": "[DEV] GitHub Advanced Security for Azure DevOps dashboard widgets",

widget_1x1/widget_1x1.html

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,16 @@
1717
{
1818
WidgetHelpers.IncludeWidgetStyles();
1919
VSS.register("GHAzDoWidget.1x1", function () {
20-
try {
21-
const webContext = VSS.getWebContext();
22-
const project = webContext.project;
23-
const organization = webContext.account.name;
24-
const projectId = project.id;
25-
// convert project.name to url encoding
26-
const projectName = project.name.replace(/ /g, "%20").replace(/&/g, "%26");
27-
28-
consoleLog('project id: ' + projectId);
29-
consoleLog('project name: ' + projectName);
30-
consoleLog('organization name: ' + organization);
31-
}
32-
catch (err) {
33-
consoleLog(`Error getting the web context: ${err}`);
34-
}
20+
const webContext = VSS.getWebContext();
21+
const project = webContext.project;
22+
const organization = webContext.account.name;
23+
const projectId = project.id;
24+
// convert project.name to url encoding
25+
const projectName = project.name.replace(/ /g, "%20").replace(/&/g, "%26");
26+
27+
consoleLog('project id: ' + projectId);
28+
consoleLog('project name: ' + projectName);
29+
consoleLog('organization name: ' + organization);
3530

3631
async function loadWidget(widgetSettings) {
3732
consoleLog(`WidgetSettings inside loadWidget_1x1: ${JSON.stringify(widgetSettings)}`);

0 commit comments

Comments
 (0)