continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmora...@apache.org
Subject svn commit: r767170 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
Date Tue, 21 Apr 2009 14:59:40 GMT
Author: jmorales
Date: Tue Apr 21 14:59:40 2009
New Revision: 767170

URL: http://svn.apache.org/viewvc?rev=767170&view=rev
Log:
Related to issue CONTINUUM-2075. 

Don't allow delete default project group build definition in 'Project Information' tab. Disable
delete for default project group build defintition.


Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java?rev=767170&r1=767169&r2=767170&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
Tue Apr 21 14:59:40 2009
@@ -49,6 +49,9 @@
     private String projectGroupName;
 
     private int projectId;
+    
+    // Allow dont remove default group build definition in project list 
+    private int defaultGroupDefinitionId;
 
     private ProjectGroup projectGroup;
 
@@ -141,6 +144,9 @@
         {
             for ( BuildDefinitionSummary bds : groupBuildDefinitionSummaries )
             {
+                if (bds.isIsDefault()){
+                    defaultGroupDefinitionId = bds.getId();
+                }
                 bds.setIsDefault( false );
             }
         }
@@ -254,4 +260,9 @@
     {
         this.projectGroup = projectGroup;
     }
+
+    public int getDefaultGroupDefinitionId()
+    {
+        return defaultGroupDefinitionId;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp?rev=767170&r1=767169&r2=767170&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
Tue Apr 21 14:59:40 2009
@@ -113,13 +113,20 @@
           </c:when>
           <c:otherwise>
             <redback:ifAuthorized permission="continuum-remove-group-build-definition"
resource="${projectGroupName}">
-              <s:url id="removeUrl" action="removeGroupBuildDefinition" namespace="/">
-                <s:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</s:param>
-                <s:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</s:param>
-                <s:param name="groupBuildDefinition">true</s:param>
-                <s:param name="confirmed" value="false"/>
-              </s:url>
-              <s:a href="%{removeUrl}"><img src="<s:url value='/images/delete.gif'
includeParams="none"/>" alt="<s:text name='delete'/>" title="<s:text name='delete'/>"
border="0"></s:a>
+              <c:choose>              
+                <c:when test="${buildDefinitionSummary.id == defaultGroupDefinitionId
|| buildDefinitionSummary.isDefault}">                
+                  <img src="<s:url value='/images/delete_disabled.gif' includeParams="none"/>"
alt="<s:text name='delete'/>" title="<s:text name='delete'/>" border="0" />
+                </c:when>
+                <c:otherwise>
+                  <s:url id="removeUrl" action="removeGroupBuildDefinition" namespace="/">
+                    <s:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</s:param>
+                    <s:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</s:param>
+                    <s:param name="groupBuildDefinition">true</s:param>
+                    <s:param name="confirmed" value="false"/>
+                  </s:url>
+                  <s:a href="%{removeUrl}"><img src="<s:url value='/images/delete.gif'
includeParams="none"/>" alt="<s:text name='delete'/>" title="<s:text name='delete'/>"
border="0"></s:a>
+                </c:otherwise>
+              </c:choose>
             </redback:ifAuthorized>
             <redback:elseAuthorized>
               <img src="<s:url value='/images/delete_disabled.gif' includeParams="none"/>"
alt="<s:text name='delete'/>" title="<s:text name='delete'/>" border="0" />



Mime
View raw message