ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1302903 - /ace/trunk/ace-target-mgmt-ui/src/main/java/org/apache/ace/target/management/ui/TargetManagementExtension.java
Date Tue, 20 Mar 2012 14:04:47 GMT
Author: marrs
Date: Tue Mar 20 14:04:47 2012
New Revision: 1302903

URL: http://svn.apache.org/viewvc?rev=1302903&view=rev
Log:
ACE-234 fixed the bug

Modified:
    ace/trunk/ace-target-mgmt-ui/src/main/java/org/apache/ace/target/management/ui/TargetManagementExtension.java

Modified: ace/trunk/ace-target-mgmt-ui/src/main/java/org/apache/ace/target/management/ui/TargetManagementExtension.java
URL: http://svn.apache.org/viewvc/ace/trunk/ace-target-mgmt-ui/src/main/java/org/apache/ace/target/management/ui/TargetManagementExtension.java?rev=1302903&r1=1302902&r2=1302903&view=diff
==============================================================================
--- ace/trunk/ace-target-mgmt-ui/src/main/java/org/apache/ace/target/management/ui/TargetManagementExtension.java
(original)
+++ ace/trunk/ace-target-mgmt-ui/src/main/java/org/apache/ace/target/management/ui/TargetManagementExtension.java
Tue Mar 20 14:04:47 2012
@@ -85,12 +85,13 @@ public class TargetManagementExtension i
         result.addComponent(autoApproveCB);
 
 
-        Button approveButton = new Button("Approve changes");
+        final Button approveButton = new Button("Approve changes");
         approveButton.setImmediate(true);
-        approveButton.setEnabled(!target.getAutoApprove() && target.isRegistered()
&& hasUnapprovedChanges(target));
+        approveButton.setEnabled(hasUnapprovedChanges(target));
         approveButton.addListener(new Button.ClickListener() {
             public void buttonClick(ClickEvent event) {
                 target.approve();
+                approveButton.setEnabled(hasUnapprovedChanges(target));
             }
         });
 
@@ -108,9 +109,7 @@ public class TargetManagementExtension i
      * @return
      */
     private boolean hasUnapprovedChanges(StatefulTargetObject target) {
-        String availableVersion = target.getCurrentVersion();
-        String currentVersion = target.getLastInstallVersion();
-        return (availableVersion != null) && !availableVersion.equals(currentVersion);
+    	return target.needsApprove();
     }
 
     private RepositoryObject getRepositoryObjectFromContext(Map<String, Object> context)
{



Mime
View raw message