Skip to content

Commit

Permalink
Merge branch 'master' into releases/feature-spdx_information_management
Browse files Browse the repository at this point in the history
  • Loading branch information
tuannn2 authored Apr 25, 2022
2 parents 9fdd997 + a1d3f5c commit 4155696
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
Expand Down Expand Up @@ -705,6 +706,7 @@ private void loadSpdxLicenseInfo(ResourceRequest request, ResourceResponse respo
attachmentContentId, includeConcludedLicense, user);
attachmentType = release.getAttachments().stream().filter(att -> attachmentContentId.equals(att.getAttachmentContentId())).map(Attachment::getAttachmentType).findFirst().orElse(null);
List<LicenseNameWithText> licenseWithTexts = licenseInfoResult.stream()
.filter(filterLicenseResult)
.flatMap(result -> result.getLicenseInfo().getLicenseNamesWithTexts().stream())
.filter(license -> !license.getLicenseName().equalsIgnoreCase(SW360Constants.LICENSE_NAME_UNKNOWN)
&& !license.getLicenseName().equalsIgnoreCase(SW360Constants.NA)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
});

function displayLicenseToSrcMapping(attId, attName, licenseName) {
let data,
let data,
list = $('<ul/>');
if (releaseToLicenseDetailsMap.has(attId)) {
data = releaseToLicenseDetailsMap.get(attId);
Expand All @@ -253,11 +253,10 @@
list.append('<li>' + file + '</li>');
});
} else {
list.append('<li><liferay-ui:message key="source.file.information.not.found.in.isr"/></li>');
list.append('<li><liferay-ui:message key="source.file.information.not.found.in.isr"/></li>');
}
dialog.info(attName, '<br>Source File List: <br>' + $(list)[0].outerHTML);
}

function handleShowSpdxContentClick($btn) {
var tableData = $('#spdxAttachments').data(),
rawUrl = tableData.loadSpdxLicenseInfoUrl,
Expand Down Expand Up @@ -285,7 +284,7 @@
if (!result || result.length == 0 || Object.getOwnPropertyNames(result).length == 0) {
replaceContentWithWarning($resultCell, 'No license information found in file.');
} else {
releaseToLicenseDetailsMap.set(attachmentId, result);
releaseToLicenseDetailsMap.set(attachmentId, result);
printResult($row, result, attachmentId, isISR);
addTakeOverBtn($btnCell, releaseId, attachmentId, result, attachmentType, isISR);
}
Expand Down Expand Up @@ -354,7 +353,7 @@
if (!isISR) {
var $newBtn = $('<button>', { 'class': 'btn btn-primary spdxTakeOverBtn', 'data-release-id': releaseId, 'data-attachment-id': attachmentId, text: '<liferay-ui:message key="add.data.to.this.release" />' });
$newBtn.data('result', data);
$parent.append($newBtn);
$parent.append($newBtn);
$newBtn.on('click', function(event) {
handleTakeOverClick($(event.currentTarget));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AUI().use('liferay-portlet-url', function () {
"<portlet:namespace/><%=PortalConstants.RELEASE_ID%>": releaseId
},
success: function (response) {
response = JSON.parse(response);
response = JSON.parse(response);
if (response.status == 'success') {
releaseIdToScannerFindingsMap.set(releaseId, response);
let scannerFindings = response.data;
Expand Down Expand Up @@ -73,7 +73,7 @@ AUI().use('liferay-portlet-url', function () {

if (data.otherLicenseIds) {
data.otherLicenseIds.forEach(function(id) {
list.append($('<li>', { text: id }));
list.append($('<li>', { text: id }));
});
}
dialog.info(relName,'<span class="alert alert-warning"> <liferay-ui:message key="this.is.only.an.initial.scanner.isr.finding.of.the.contained.licenses.in.the.uploaded.source.file" /><br>' +
Expand Down

0 comments on commit 4155696

Please sign in to comment.