rfellows commented on code in PR #11678:
URL: https://github.com/apache/nifi/pull/11678#discussion_r4018215052
##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts:
##########
@@ -3656,6 +3656,64 @@ export class FlowEffects {
)
);
+ stopSources$ = createEffect(() =>
+ this.actions$.pipe(
+ ofType(FlowActions.stopSources),
+ map((action) => action.request),
+ switchMap((request) =>
Review Comment:
`stopComponent$` uses `mergeMap` for this same kind of scheduling request.
`switchMap` here will unsubscribe and cancel the in-flight HTTP call if
`stopSources` is dispatched again (double-click, or stopping a child group
while a current-group request is still outstanding), while the coordinator may
still apply the first request.
`concatMap` would serialize them; `mergeMap` would match the stop-component
effect. Either is safer than cancelling.
##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/service/canvas-context-menu.service.ts:
##########
@@ -773,6 +774,36 @@ export class CanvasContextMenu implements
ContextMenuDefinitionProvider {
text: 'Stop',
action: this.canvasActionsService.getActionFunction('stop')
},
+ {
+ condition: (selection: any) => {
+ if (!(selection.empty() ||
this.canvasUtils.isProcessGroup(selection))) {
+ return false;
+ }
+ const resolved = selection.empty()
+ ? this.canvasUtils.getResolvedExecutionEngine()
+ : selection.datum().resolvedExecutionEngine;
+ return resolved === 'STANDARD';
+ },
+ clazz: 'fa fa-stop-circle-o',
+ text: 'Stop sources',
Review Comment:
Sibling items are Title Case (`Stop`, `Empty All Queues`, `Disable All
Controller Services`). Would you mind using `Stop Sources` here so it matches?
The new context-menu spec currently asserts the lowercase `s`, so those strings
would need to move with it.
--
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]