continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1674176 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/util/StateGenerator.java java/org/apache/maven/continuum/web/view/StateCell.java webapp/images/icon_new_sml.png
Date Fri, 17 Apr 2015 00:54:26 GMT
Author: batkinson
Date: Fri Apr 17 00:54:25 2015
New Revision: 1674176

URL: http://svn.apache.org/r1674176
Log:
Added a distinct 'new' icon for use with new and checked out builds

Added:
    continuum/trunk/continuum-webapp/src/main/webapp/images/icon_new_sml.png
Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/StateGenerator.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/StateGenerator.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/StateGenerator.java?rev=1674176&r1=1674175&r2=1674176&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/StateGenerator.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/StateGenerator.java
Fri Apr 17 00:54:25 2015
@@ -57,6 +57,7 @@ public class StateGenerator
 
     static
     {
+        stateIconArgs.put( ContinuumProjectState.NEW, new String[] { "/images/icon_new_sml.png",
NEW } );
         stateIconArgs.put( ContinuumProjectState.OK, new String[] { "/images/icon_success_sml.gif",
SUCCESS } );
         stateIconArgs.put( ContinuumProjectState.UPDATED, new String[] { "/images/icon_success_sml.gif",
UPDATED } );
         stateIconArgs.put( ContinuumProjectState.FAILED, new String[] { "/images/icon_warning_sml.gif",
FAILED } );
@@ -66,7 +67,7 @@ public class StateGenerator
         stateIconArgs.put( ContinuumProjectState.CHECKING_OUT,
                            new String[] { "/images/checkingout.gif", CHECKING_OUT } );
         stateIconArgs.put( ContinuumProjectState.CHECKEDOUT,
-                           new String[] { "/images/icon_success_sml.gif", CHECKED_OUT } );
+                           new String[] { "/images/icon_new_sml.png", CHECKED_OUT } );
         stateIconArgs.put( ContinuumProjectState.CANCELLED,
                            new String[] { "/images/icon_unknown_sml.gif", CANCELLED } );
     }
@@ -75,11 +76,6 @@ public class StateGenerator
     {
         String iconFmt = "<img src=\"" + contextPath + "%s\" alt=\"%2$s\" title=\"%2$s\"
border=\"0\" />";
 
-        if ( state == ContinuumProjectState.NEW )
-        {
-            return NEW;
-        }
-
         if ( stateIconArgs.containsKey( state ) )
         {
             return String.format( iconFmt, stateIconArgs.get( state ) );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java?rev=1674176&r1=1674175&r2=1674176&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
Fri Apr 17 00:54:25 2015
@@ -45,7 +45,7 @@ import java.util.HashMap;
  *
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @deprecated use of cells is discouraged due to lack of i18n and design in java code.
- *             Use jsp:include instead.
+ * Use jsp:include instead.
  */
 public class StateCell
     extends DisplayCell
@@ -58,7 +58,8 @@ public class StateCell
         {
             ProjectSummary project = (ProjectSummary) tableModel.getCurrentRowBean();
             String state = StateGenerator.generate( project.getState(), contextPath );
-            if ( project.getLatestBuildId() != -1 && !StateGenerator.NEW.equals(
state ) &&
+
+            if ( project.getLatestBuildId() != -1 && project.getState() != ContinuumProjectState.NEW
&&
                 project.getState() != ContinuumProjectState.UPDATING && isAuthorized(
project.getProjectGroupName() ) )
             {
                 return createActionLink( "buildResult", project, state );
@@ -70,8 +71,9 @@ public class StateCell
         {
             ProjectScmRoot projectScmRoot = (ProjectScmRoot) tableModel.getCurrentRowBean();
             String state = StateGenerator.generate( projectScmRoot.getState(), contextPath
);
-            if ( !StateGenerator.NEW.equals( state ) && isAuthorized( projectScmRoot.getProjectGroup().getName()
) &&
-                projectScmRoot.getState() == ContinuumProjectState.ERROR )
+            if ( projectScmRoot.getState() != ContinuumProjectState.NEW
+                && isAuthorized( projectScmRoot.getProjectGroup().getName() )
+                && projectScmRoot.getState() == ContinuumProjectState.ERROR )
             {
                 return createActionLink( "scmResult", projectScmRoot, state );
             }
@@ -93,8 +95,9 @@ public class StateCell
 
         params.put( "projectGroupId", project.getProjectGroupId() );
 
-        String url = UrlHelperFactory.getInstance().buildUrl( "/" + action + ".action", ServletActionContext.getRequest(),
-                                         ServletActionContext.getResponse(), params );
+        String url =
+            UrlHelperFactory.getInstance().buildUrl( "/" + action + ".action", ServletActionContext.getRequest(),
+                                                     ServletActionContext.getResponse(),
params );
 
         return "<a href=\"" + url + "\">" + state + "</a>";
     }
@@ -107,8 +110,9 @@ public class StateCell
 
         params.put( "projectScmRootId", scmRoot.getId() );
 
-        String url = UrlHelperFactory.getInstance().buildUrl( "/" + action + ".action", ServletActionContext.getRequest(),
-                                         ServletActionContext.getResponse(), params );
+        String url =
+            UrlHelperFactory.getInstance().buildUrl( "/" + action + ".action", ServletActionContext.getRequest(),
+                                                     ServletActionContext.getResponse(),
params );
 
         return "<a href=\"" + url + "\">" + state + "</a>";
     }

Added: continuum/trunk/continuum-webapp/src/main/webapp/images/icon_new_sml.png
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/images/icon_new_sml.png?rev=1674176&view=auto
==============================================================================
Binary files continuum/trunk/continuum-webapp/src/main/webapp/images/icon_new_sml.png (added)
and continuum/trunk/continuum-webapp/src/main/webapp/images/icon_new_sml.png Fri Apr 17 00:54:25
2015 differ



Mime
View raw message