Skip to content

Commit

Permalink
improve branch and pullrequest handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpopan authored and derkoe committed Aug 8, 2022
1 parent 1d34570 commit d816fc8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/web/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@ window.registerExtension('licensecheck/dashboard', function (options) {
}
},
created() {
let uri = window.location.search.substring(1);
let params = new URLSearchParams(uri);
let request = request = {
component : options.component.key,
metricKeys : "licensecheck.license,licensecheck.dependency"
};
if (params.has("branch")){
request.branch = params.get("branch");
} else if (params.has("pullRequest")) {
request.pullRequest = params.get("pullRequest");
}
window.SonarRequest
.getJSON(`/api/measures/component?component=${this.component.key}&branch=${options.branchLike.name}&metricKeys=licensecheck.license,licensecheck.dependency`)
.getJSON("/api/measures/component", request)
.then(response => {
response.component.measures.forEach(measure => {
if (measure.metric === 'licensecheck.license') {
Expand Down

0 comments on commit d816fc8

Please sign in to comment.