This repository has been archived by the owner on Jul 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #521 from ChristophNiehoff/feat/455-provide-more-i…
…nformation-when-linking-releases feat(ui): More information for releases search tested-by: [email protected] reviewed-by: [email protected], [email protected]
- Loading branch information
Showing
22 changed files
with
349 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/tags/DisplayStateBoxes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright Siemens AG, 2017. | ||
* Part of the SW360 Portal Project. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.sw360.portal.tags; | ||
|
||
import org.eclipse.sw360.datahandler.common.ThriftEnumUtils; | ||
import org.eclipse.sw360.datahandler.thrift.projects.Project; | ||
import org.eclipse.sw360.datahandler.thrift.projects.ProjectState; | ||
import org.eclipse.sw360.portal.common.PortalConstants; | ||
|
||
|
||
import javax.servlet.jsp.JspException; | ||
import javax.servlet.jsp.tagext.JspTag; | ||
import javax.servlet.jsp.tagext.SimpleTagSupport; | ||
import java.io.IOException; | ||
|
||
import static org.eclipse.sw360.datahandler.thrift.projects.ProjectClearingState.*; | ||
|
||
public class DisplayStateBoxes extends SimpleTagSupport { | ||
|
||
private Project project; | ||
|
||
public void setProject(Project project) { | ||
this.project = project; | ||
} | ||
|
||
public String makeBoxes() { | ||
// The hardcoded strings correspond to CSS classes defined in sw360.css | ||
|
||
// Add project state color to boxes if the project is active | ||
// (default color is grey) | ||
String projectStateBackgroundColour = PortalConstants.PROJECT_STATE_INACTIVE__CSS; | ||
if( project.isSetState() && project.state == ProjectState.ACTIVE ) { // -> green | ||
projectStateBackgroundColour = PortalConstants.PROJECT_STATE_ACTIVE__CSS; | ||
} | ||
|
||
// Add clearingstate color to boxes in projects list | ||
// (default color is grey) | ||
String clearingStateBackgroundColour = PortalConstants.CLEARING_STATE_UNKNOWN__CSS; | ||
|
||
if(project.isSetClearingState()) { | ||
switch(project.clearingState) { | ||
case CLOSED: // -> green | ||
clearingStateBackgroundColour = PortalConstants.CLEARING_STATE_CLOSED__CSS; | ||
break; | ||
case IN_PROGRESS: // -> yellow | ||
clearingStateBackgroundColour = PortalConstants.CLEARING_STATE_INPROGRESS__CSS; | ||
break; | ||
case OPEN: // -> red | ||
clearingStateBackgroundColour = PortalConstants.CLEARING_STATE_OPEN__CSS; | ||
break; | ||
} | ||
} | ||
|
||
String box_PS = "<div class=\"stateBox " + projectStateBackgroundColour + " capsuleLeft \" title=\"Project state: " + ThriftEnumUtils.enumToString(project.state) + "\"> PS </div>"; | ||
String box_CS = "<div class=\"stateBox capsuleRight " + clearingStateBackgroundColour + "\" title=\"Project clearing state: " + ThriftEnumUtils.enumToString(project.clearingState) + "\"> CS </div>"; | ||
|
||
return box_PS+box_CS; | ||
} | ||
|
||
|
||
public void doTag() throws JspException, IOException { | ||
getJspContext().getOut().print( makeBoxes() ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.