Skip to content

Commit

Permalink
fix(Rest): License overview is not updating in summary page.
Browse files Browse the repository at this point in the history
Signed-off-by: Rudra Chopra <[email protected]>
  • Loading branch information
rudra-superrr committed Jan 6, 2025
1 parent c8b2756 commit aa11baf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1264,12 +1264,14 @@ public ResponseEntity writeSpdxLicenseInfoIntoRelease(
Set<String> otherLicenseIds = licensesInfoInRequestBody.get("otherLicenseIds");

if (!CommonUtils.isNullOrEmptyCollection(licenseIds)) {
sw360Release.getMainLicenseIds().clear();
for (String licenseId : licenseIds) {
sw360Release.addToMainLicenseIds(licenseId);
}
}

if (!CommonUtils.isNullOrEmptyCollection(otherLicenseIds)) {
sw360Release.getOtherLicenseIds().clear();
for (String licenseId : otherLicenseIds) {
sw360Release.addToOtherLicenseIds(licenseId);
}
Expand Down Expand Up @@ -1686,7 +1688,6 @@ private HalResource<Release> createHalReleaseResource(Release release, boolean v
}
if (release.getMainLicenseIds() != null) {
restControllerHelper.addEmbeddedLicenses(halRelease, release.getMainLicenseIds());
release.setMainLicenseIds(null);
}
if (release.getOtherLicenseIds() != null) {
restControllerHelper.addEmbeddedOtherLicenses(halRelease, release.getOtherLicenseIds());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ public void should_document_get_release() throws Exception {
fieldWithPath("version").description("The version of the release"),
fieldWithPath("createdBy").description("Email of the release creator"),
fieldWithPath("cpeid").description("CpeId of the release"),
fieldWithPath("mainLicenseIds").description("An array of all main licenses"),
fieldWithPath("clearingState").description("The clearing of the release, possible values are " + Arrays.asList(ClearingState.values())),
fieldWithPath("releaseDate").description("The date of this release"),
fieldWithPath("createdOn").description("The creation date of the internal sw360 release"),
Expand Down Expand Up @@ -1400,6 +1401,7 @@ private RestDocumentationResultHandler documentReleaseProperties() {
fieldWithPath("version").description("The version of the release"),
fieldWithPath("createdBy").description("Email of the release creator"),
fieldWithPath("cpeid").description("CpeId of the release"),
fieldWithPath("mainLicenseIds").description("An array of all main licenses"),
fieldWithPath("clearingState").description("The clearing of the release, possible values are " + Arrays.asList(ClearingState.values())),
fieldWithPath("releaseDate").description("The date of this release"),
fieldWithPath("componentType").description("The componentType of the release, possible values are " + Arrays.asList(ComponentType.values())),
Expand Down Expand Up @@ -1537,6 +1539,7 @@ public void should_document_write_spdx_licenses_info_into_release() throws Excep
fieldWithPath("version").description("The version of the release"),
fieldWithPath("createdBy").description("Email of the release creator"),
fieldWithPath("cpeid").description("CpeId of the release"),
fieldWithPath("mainLicenseIds").description("An array of all main licenses"),
fieldWithPath("id").description("Id of the release"),
fieldWithPath("clearingState").description("The clearing of the release, possible values are " + Arrays.asList(ClearingState.values())),
fieldWithPath("releaseDate").description("The date of this release"),
Expand Down

0 comments on commit aa11baf

Please sign in to comment.