Skip to content

Commit

Permalink
Fix 1x1 widget error
Browse files Browse the repository at this point in the history
  • Loading branch information
rajbos committed Sep 17, 2023
1 parent a88c33b commit eeb56a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion vss-extension-dev.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifestVersion": 1,
"id": "GHAzDoWidget-DEV",
"version": "0.0.1.66",
"version": "0.0.1.67",
"public": false,
"name": "Advanced Security dashboard Widgets [DEV]",
"description": "[DEV] GitHub Advanced Security for Azure DevOps dashboard widgets",
Expand Down
25 changes: 10 additions & 15 deletions widget_1x1/widget_1x1.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,16 @@
{
WidgetHelpers.IncludeWidgetStyles();
VSS.register("GHAzDoWidget.1x1", function () {
try {
const webContext = VSS.getWebContext();
const project = webContext.project;
const organization = webContext.account.name;
const projectId = project.id;
// convert project.name to url encoding
const projectName = project.name.replace(/ /g, "%20").replace(/&/g, "%26");

consoleLog('project id: ' + projectId);
consoleLog('project name: ' + projectName);
consoleLog('organization name: ' + organization);
}
catch (err) {
consoleLog(`Error getting the web context: ${err}`);
}
const webContext = VSS.getWebContext();
const project = webContext.project;
const organization = webContext.account.name;
const projectId = project.id;
// convert project.name to url encoding
const projectName = project.name.replace(/ /g, "%20").replace(/&/g, "%26");

consoleLog('project id: ' + projectId);
consoleLog('project name: ' + projectName);
consoleLog('organization name: ' + organization);

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

0 comments on commit eeb56a8

Please sign in to comment.