Skip to content

Commit

Permalink
Rename dependency network tab, re-define error message
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangnt2 committed Jun 7, 2023
1 parent fe63f8c commit 71c519c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,7 @@
<a class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-Summary'}">active</core_rt:if>" href="#tab-Summary" data-toggle="list" role="tab"><liferay-ui:message key="summary" /></a>
<a class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-Administration'}">active</core_rt:if>" href="#tab-Administration" data-toggle="list" role="tab"><liferay-ui:message key="administration" /></a>
<a class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-linkedProjects'}">active</core_rt:if>" href="#tab-linkedProjects" data-toggle="list" role="tab">
<core_rt:if test="${not isFlexibleProjectReleaseRelationshipEnabled}">
<liferay-ui:message key="linked.releases.and.projects" />
</core_rt:if>
<core_rt:if test="${isFlexibleProjectReleaseRelationshipEnabled}">
<liferay-ui:message key="dependency.network" />
</core_rt:if>
<liferay-ui:message key="linked.releases.and.projects" />
</a>
<core_rt:if test="${not addMode}" >
<a class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-Attachments'}">active</core_rt:if>" href="#tab-Attachments" data-toggle="list" role="tab"><liferay-ui:message key="attachments" /></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<core_rt:if test="${not isFlexibleProjectReleaseRelationshipEnabled}">
<a class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-licenseClearing'}">active</core_rt:if>" href="#tab-licenseClearing" data-toggle="list" role="tab"><liferay-ui:message key="license.clearing" /></a>
</core_rt:if>
<core_rt:if test="${isFlexibleProjectReleaseRelationshipEnabled}">
<a id="dependencyNetwork" class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-dependencyNetwork'}">active</core_rt:if>" href="#tab-dependencyNetwork" data-toggle="list" role="tab"><liferay-ui:message key="license.clearing" /></a>
</core_rt:if>
<core_rt:if test="${isProjectObligationsEnabled}">
<a id="obligationCountBadge" class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-Obligations'}">active</core_rt:if>" href="#tab-Obligations" data-toggle="list" role="tab"><liferay-ui:message key="obligations" />
</a>
Expand Down Expand Up @@ -71,9 +74,6 @@
</a>
</core_rt:if>
<a class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-ChangeLogs'}">active</core_rt:if>" href="#tab-ChangeLogs" data-toggle="list" role="tab"><liferay-ui:message key="change.log" /></a>
<core_rt:if test="${isFlexibleProjectReleaseRelationshipEnabled}">
<a id="dependencyNetwork" class="list-group-item list-group-item-action <core_rt:if test="${selectedTab == 'tab-dependencyNetwork'}">active</core_rt:if>" href="#tab-dependencyNetwork" data-toggle="list" role="tab"><liferay-ui:message key="dependency.network" /></a>
</core_rt:if>
</div>
</div>
<div class="col">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,12 @@ public ResponseEntity<?> importSBOM(@RequestParam(value = "type", required = tru
}

@RequestMapping(value = PROJECTS_URL + "/network/{id}", method = RequestMethod.GET)
public ResponseEntity<EntityModel<ProjectDTO>> getProjectWithNetwork(
public ResponseEntity<?> getProjectWithNetwork(
@PathVariable("id") String id) throws TException {
if (!SW360Constants.ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP) {
return new ResponseEntity<>(SW360Constants.PLEASE_ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP, HttpStatus.INTERNAL_SERVER_ERROR);
}

User sw360User = restControllerHelper.getSw360UserFromAuthentication();
Project sw360Project = projectService.getProjectForUserById(id, sw360User);
HalResource<ProjectDTO> projectDTOHalResource = createHalProjectDTO(sw360Project, sw360User);
Expand All @@ -1097,7 +1101,7 @@ public ResponseEntity<EntityModel<ProjectDTO>> getProjectWithNetwork(
@RequestMapping(value = PROJECTS_URL+ "/network", method = RequestMethod.POST)
public ResponseEntity createProjectWithNetwork(@RequestBody Map<String, Object> reqBodyMap) throws TException {
if (!SW360Constants.ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP) {
return new ResponseEntity<>("Method does not support", HttpStatus.INTERNAL_SERVER_ERROR);
return new ResponseEntity<>(SW360Constants.PLEASE_ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP, HttpStatus.INTERNAL_SERVER_ERROR);
}

User sw360User = restControllerHelper.getSw360UserFromAuthentication();
Expand Down Expand Up @@ -1128,7 +1132,7 @@ public ResponseEntity<?> patchProjectWithNetwork(
@PathVariable("id") String id,
@RequestBody Map<String, Object> reqBodyMap) throws TException {
if (!SW360Constants.ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP) {
return new ResponseEntity<>("Method does not support", HttpStatus.INTERNAL_SERVER_ERROR);
return new ResponseEntity<>(SW360Constants.PLEASE_ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP, HttpStatus.INTERNAL_SERVER_ERROR);
}

User user = restControllerHelper.getSw360UserFromAuthentication();
Expand Down

0 comments on commit 71c519c

Please sign in to comment.