rfellows commented on code in PR #9548:
URL: https://github.com/apache/nifi/pull/9548#discussion_r1853977700


##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html:
##########
@@ -17,17 +17,60 @@
 
 <h2 mat-dialog-title>
     <div class="flex justify-between items-baseline">
-        <div>
-            {{ readonly ? 'Processor Details' : 'Edit Processor' }}
+        <div class="flex items-baseline">
+            <div class="mr-2">
+                @if (isInvalid(request.entity)) {
+                    <i
+                        class="mr-2 fa fa-warning caution-color"
+                        nifiTooltip
+                        [tooltipComponentType]="ValidationErrorsTip"
+                        
[tooltipInputData]="getValidationErrorsTipData(request.entity)"></i>

Review Comment:
   Adding the icon here looks nice, but it seems disjoint with the new 
start/stop feature since it shows the current status in the icon. Maybe if we 
hide the start/stop button if the processor is invalid. The disabled "Invalid" 
button just looks weird in this case:
   <img width="1029" alt="Screenshot 2024-11-22 at 9 12 41 AM" 
src="https://github.com/user-attachments/assets/0773eccd-b2e1-4595-93e9-d004be5784b0";>
   
   
   



##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html:
##########
@@ -17,17 +17,60 @@
 
 <h2 mat-dialog-title>
     <div class="flex justify-between items-baseline">
-        <div>
-            {{ readonly ? 'Processor Details' : 'Edit Processor' }}
+        <div class="flex items-baseline">
+            <div class="mr-2">
+                @if (isInvalid(request.entity)) {
+                    <i
+                        class="mr-2 fa fa-warning caution-color"
+                        nifiTooltip
+                        [tooltipComponentType]="ValidationErrorsTip"
+                        
[tooltipInputData]="getValidationErrorsTipData(request.entity)"></i>
+                }{{ readonly ? 'Processor Details' : 'Edit Processor' }}
+            </div>
+            |
+            <div class="ml-2 text-base">
+                {{ formatType(request.entity) }}
+            </div>
         </div>
-        <div class="text-base">
-            {{ formatType(request.entity) }}
+        <div>
+            @if (isStoppable(request.entity)) {
+                <button type="button" mat-stroked-button 
[matMenuTriggerFor]="operateMenu">
+                    <div class="flex items-center">
+                        <i class="mr-2 success-color-default fa 
fa-play"></i>Running<i
+                            class="ml-2 -mt-1 fa fa-sort-desc"></i>
+                    </div>
+                </button>
+            } @else if (isRunnable(request.entity)) {
+                <button type="button" mat-stroked-button 
[matMenuTriggerFor]="operateMenu">
+                    <div class="flex items-center">
+                        <i class="mr-2 error-color-variant fa 
fa-stop"></i>Stopped<i
+                            class="ml-2 -mt-1 fa fa-sort-desc"></i>
+                    </div>
+                </button>
+            } @else {
+                <button type="button" mat-stroked-button [disabled]="true">
+                    <div class="flex items-center">
+                        @if (!isInvalid(request.entity)) {
+                            <i class="mr-2 fa fa-circle-o-notch fa-spin 
primary-color"></i>
+                        }
+                        {{ formatRunStatus() }}
+                    </div>
+                </button>
+            }
+            <mat-menu #operateMenu="matMenu" xPosition="before">
+                @if (isStoppable(request.entity)) {
+                    <button mat-menu-item 
(click)="stop(request.entity)">Stop</button>
+                } @else if (isRunnable(request.entity)) {
+                    <button mat-menu-item [disabled]="editProcessorForm.dirty" 
(click)="start(request.entity)">
+                        Start
+                    </button>
+                }

Review Comment:
   I think we should provide the start/stop icons in the menu just as we do in 
the canvas context menu.



##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.ts:
##########
@@ -296,6 +321,21 @@ export class EditProcessor extends TabbedDialog {
         return this.nifiCommon.formatBundle(entity.component.bundle);
     }
 
+    formatRunStatus() {
+        if (this.status.runStatus === 'Stopped' && 
this.status.aggregateSnapshot.activeThreadCount > 0) {
+            return `Stopping 
(${this.status.aggregateSnapshot.activeThreadCount})`;
+        }
+
+        return `${this.status.runStatus}`;
+    }
+
+    getValidationErrorsTipData(entity: any): ValidationErrorsTipInput {
+        return {
+            isValidating: entity.status.validationStatus === 'VALIDATING',
+            validationErrors: entity.component.validationErrors
+        };
+    }

Review Comment:
   Seems like now that we have introduced validation status and tooltip that it 
quickly becomes confusing to the user if they make a change that makes it valid 
but the yield icon and tooltip are stale.
   A quick example would be to add a Generate Flow File processor. initially it 
is invalid since it does not have a connection. This is good and the tooltip 
reflects this. However, if i auto-terminate that connection the validation 
isn't reprocessed and it seems like their might still be an issue.
   
   This could be a big can of worms.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to