Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Commit

Permalink
Changed navigation to use navigation service to avoid unauthorized ex…
Browse files Browse the repository at this point in the history
…ceptions on TFS on-premises.
  • Loading branch information
WouterDeKort committed Jan 15, 2018
1 parent 9a2ad5c commit c954898
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 20 deletions.
3 changes: 2 additions & 1 deletion TPHealth/TPHealth/TPHealth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
<AssemblyName>TPHealth</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TypeScriptToolsVersion>2.2</TypeScriptToolsVersion>
<TypeScriptToolsVersion>2.5</TypeScriptToolsVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort>44300</IISExpressSSLPort>
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<Use64BitIISExpress />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
10 changes: 0 additions & 10 deletions TPHealth/TPHealth/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
<title>TPHealth - Details</title>
<link rel="stylesheet" href="css/app.css" type="text/css" />
<script src="scripts/lib/VSS.SDK.js"></script>
<!--<script type="text/javascript">
var appInsights = window.appInsights || function (config) {
function r(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i) }) } } var t = { config: config }, u = document, e = window, o = "script", s = u.createElement(o), i, f; for (s.src = config.url || "//az416426.vo.msecnd.net/scripts/a/ai.0.js", u.getElementsByTagName(o)[0].parentNode.appendChild(s), t.cookie = u.cookie, t.queue = [], i = ["Event", "Exception", "Metric", "PageView", "Trace"]; i.length;) r("track" + i.pop()); return r("setAuthenticatedUserContext"), r("clearAuthenticatedUserContext"), config.disableExceptionTracking || (i = "onerror", r("_" + i), f = e[i], e[i] = function (config, r, u, e, o) { var s = f && f(config, r, u, e, o); return s !== !0 && t["_" + i](config, r, u, e, o), s }), t
}({
instrumentationKey: "<<YOUR AI KEY>>"
});
window.appInsights = appInsights;
appInsights.trackPageView();
</script>-->
<script src="scripts/lib/ai.0.22.19-build00125.min.js"></script>
</head>
<body id="root" class="widget clickable">
Expand Down
6 changes: 3 additions & 3 deletions TPHealth/TPHealth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"grunt-exec": "^2.0.0",
"grunt-typings": "^0.1.5",
"rimraf": "^2.6.1",
"tfx-cli": "^0.3.49",
"typescript": "^2.4.0"
"tfx-cli": "^0.5.3",
"typescript": "2.6.2"
},
"dependencies": {
"@types/jquery": "^2.0.34",
"@types/q": "0.0.32",
"vss-web-extension-sdk": "^2.113.0"
"vss-web-extension-sdk": "5.127.0"
},
"name": "tphealth",
"private": true,
Expand Down
18 changes: 14 additions & 4 deletions TPHealth/TPHealth/scripts/details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,24 @@ export class DetailsWidget {

setNavigateUrl(build: TFS_Build_Contracts.Build) {
if (build && build._links && build._links.web) {
$("#buildDefinitionNavigateUrl").attr("href", build._links.web.href);
}
VSS.getService(VSS.ServiceIds.Navigation).then((navigationService: any) => {
$("#buildDefinitionNavigateUrl").on("click", (e) => {
e.preventDefault();
navigationService.openNewWindow(build._links.web.href, "");
});
});
}
}

setNavigateUrlFromDefinition(definition: TFS_Build_Contracts.BuildDefinition) {
if (definition && definition._links && definition._links.web) {
$("#buildDefinitionNavigateUrl").attr("href", definition._links.web.href);
}
VSS.getService(VSS.ServiceIds.Navigation).then((navigationService: any) => {
$("#buildDefinitionNavigateUrl").on("click", (e) => {
e.preventDefault();
navigationService.openNewWindow(definition._links.web.href, "");
});
});
}
}

setStatusColor(build: TFS_Build_Contracts.Build) {
Expand Down
10 changes: 8 additions & 2 deletions TPHealth/TPHealth/scripts/release-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@ export class ReleaseDetailsWidget {
}
setNavigateUrl(release: TFS_RM_Contracts.Release) {
if (release && release._links && release._links.web) {
$("#definitionNavigateUrl").attr("href", release._links.web.href);
}
VSS.getService(VSS.ServiceIds.Navigation).then((navigationService: any) => {
$("#definitionNavigateUrl").on("click", (e) => {
e.preventDefault();
navigationService.openNewWindow(release._links.web.href, "");
});
});

}
}

setStatus(release: TFS_RM_Contracts.Release, showRejectedAsFailed: boolean) {
Expand Down

0 comments on commit c954898

Please sign in to comment.