NIFI-13286: (#8872) - Conditionally reloading the child PG or current PG when emptying all queues based on the context of the request.

This closes #8872
This commit is contained in:
Matt Gilman 2024-05-28 09:21:31 -04:00 committed by GitHub
parent e1920dace0
commit 90dee66101
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 11 deletions

View File

@ -30,11 +30,12 @@ import { MatDialog } from '@angular/material/dialog';
import { isDefinedAndNotNull } from '../../../../state/shared'; import { isDefinedAndNotNull } from '../../../../state/shared';
import { YesNoDialog } from '../../../../ui/common/yes-no-dialog/yes-no-dialog.component'; import { YesNoDialog } from '../../../../ui/common/yes-no-dialog/yes-no-dialog.component';
import { OkDialog } from '../../../../ui/common/ok-dialog/ok-dialog.component'; import { OkDialog } from '../../../../ui/common/ok-dialog/ok-dialog.component';
import { loadConnection, loadProcessGroup } from '../flow/flow.actions'; import { loadChildProcessGroup, loadConnection, loadProcessGroup } from '../flow/flow.actions';
import { resetQueueState } from './queue.actions'; import { resetQueueState } from './queue.actions';
import { SMALL_DIALOG } from '../../../../index'; import { SMALL_DIALOG } from '../../../../index';
import { HttpErrorResponse } from '@angular/common/http'; import { HttpErrorResponse } from '@angular/common/http';
import { ErrorHelper } from '../../../../service/error-helper.service'; import { ErrorHelper } from '../../../../service/error-helper.service';
import { selectCurrentProcessGroupId } from '../flow/flow.selectors';
@Injectable() @Injectable()
export class QueueEffects { export class QueueEffects {
@ -278,9 +279,10 @@ export class QueueEffects {
map((action) => action.request), map((action) => action.request),
concatLatestFrom(() => [ concatLatestFrom(() => [
this.store.select(selectDropConnectionId), this.store.select(selectDropConnectionId),
this.store.select(selectDropProcessGroupId) this.store.select(selectDropProcessGroupId),
this.store.select(selectCurrentProcessGroupId)
]), ]),
tap(([request, connectionId, processGroupId]) => { tap(([request, connectionId, processGroupId, currentProcessGroupId]) => {
const dropRequest: DropRequest = request.dropEntity.dropRequest; const dropRequest: DropRequest = request.dropEntity.dropRequest;
const droppedTokens: string[] = dropRequest.dropped.split(/ \/ /); const droppedTokens: string[] = dropRequest.dropped.split(/ \/ /);
@ -302,6 +304,7 @@ export class QueueEffects {
} else if (processGroupId) { } else if (processGroupId) {
message = `${message} were removed from the queues.`; message = `${message} were removed from the queues.`;
if (processGroupId === currentProcessGroupId) {
this.store.dispatch( this.store.dispatch(
loadProcessGroup({ loadProcessGroup({
request: { request: {
@ -310,6 +313,15 @@ export class QueueEffects {
} }
}) })
); );
} else {
this.store.dispatch(
loadChildProcessGroup({
request: {
id: processGroupId
}
})
);
}
} }
if (dropRequest.failureReason) { if (dropRequest.failureReason) {