Repository: nifi
Updated Branches:
  refs/heads/master 4d17504a0 -> 372a316de


NIFI-2401:
 - Returning the enabled state of play and stop buttons in the palette. 
Allowing the user to always press if they have permissions to modify the 
selection.
 - Only attempting to schedule components that are not running, not disabled, 
and valid.

This closes #745

Signed-off-by: jpercivall <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/372a316d
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/372a316d
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/372a316d

Branch: refs/heads/master
Commit: 372a316debcf271ff959d09b57e3b25f05c68cb6
Parents: 4d17504
Author: Matt Gilman <[email protected]>
Authored: Fri Jul 29 10:36:25 2016 -0400
Committer: jpercivall <[email protected]>
Committed: Mon Aug 1 11:39:55 2016 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/nifi/groups/ProcessGroup.java     | 6 +++---
 .../src/main/webapp/WEB-INF/partials/canvas/navigation.jsp     | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/372a316d/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroup.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroup.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroup.java
index e989c84..d06d49c 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroup.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroup.java
@@ -50,7 +50,7 @@ public interface ProcessGroup extends Authorizable, 
Positionable {
     /**
      * Predicate for filtering schedulable Processors.
      */
-    Predicate<ProcessorNode> SCHEDULABLE_PROCESSORS = node -> 
!node.isRunning() && node.getScheduledState() != ScheduledState.DISABLED;
+    Predicate<ProcessorNode> SCHEDULABLE_PROCESSORS = node -> 
!node.isRunning() && !ScheduledState.DISABLED.equals(node.getScheduledState()) 
&& node.isValid();
 
     /**
      * Predicate for filtering unschedulable Processors.
@@ -60,12 +60,12 @@ public interface ProcessGroup extends Authorizable, 
Positionable {
     /**
      * Predicate for filtering schedulable Ports
      */
-    Predicate<Port> SCHEDULABLE_PORTS = port -> port.getScheduledState() != 
ScheduledState.DISABLED;
+    Predicate<Port> SCHEDULABLE_PORTS = port -> !port.isRunning() && 
!ScheduledState.DISABLED.equals(port.getScheduledState()) && port.isValid();
 
     /**
      * Predicate for filtering schedulable Ports
      */
-    Predicate<Port> UNSCHEDULABLE_PORTS = port -> port.getScheduledState() == 
ScheduledState.RUNNING;
+    Predicate<Port> UNSCHEDULABLE_PORTS = port -> 
ScheduledState.RUNNING.equals(port.getScheduledState());
 
     /**
      * @return a reference to this ProcessGroup's parent. This will be

http://git-wip-us.apache.org/repos/asf/nifi/blob/372a316d/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/navigation.jsp
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/navigation.jsp
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/navigation.jsp
index 7babfa0..b09382f 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/navigation.jsp
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/navigation.jsp
@@ -120,13 +120,13 @@
                     <div class="button-spacer-large">&nbsp;</div>
                     <div id="operate-start" class="action-button" 
title="Start">
                         <button 
ng-click="appCtrl.nf.Actions['start'](appCtrl.nf.CanvasUtils.getSelection());"
-                                
ng-disabled="!appCtrl.nf.CanvasUtils.areRunnable(appCtrl.nf.CanvasUtils.getSelection());">
+                                
ng-disabled="!appCtrl.nf.CanvasUtils.getSelection().empty() && 
!appCtrl.nf.CanvasUtils.canModify(appCtrl.nf.CanvasUtils.getSelection());">
                             <div class="graph-control-action-icon fa 
fa-play"></div></button>
                     </div>
                     <div class="button-spacer-small">&nbsp;</div>
                     <div id="operate-stop" class="action-button" title="Stop">
                         <button 
ng-click="appCtrl.nf.Actions['stop'](appCtrl.nf.CanvasUtils.getSelection());"
-                                
ng-disabled="!appCtrl.nf.CanvasUtils.areStoppable(appCtrl.nf.CanvasUtils.getSelection());">
+                                
ng-disabled="!appCtrl.nf.CanvasUtils.getSelection().empty() && 
!appCtrl.nf.CanvasUtils.canModify(appCtrl.nf.CanvasUtils.getSelection());">
                             <div class="graph-control-action-icon fa 
fa-stop"></div></button>
                     </div>
                     <div class="button-spacer-large">&nbsp;</div>

Reply via email to