mirror of https://github.com/apache/nifi.git
NIFI-13552 - Ensure errors from Provenance and Lineage queries are shown. (#9088)
This closes #9088
This commit is contained in:
parent
8e5cf99cd7
commit
ca227c7cd0
|
@ -29,7 +29,7 @@ import { selectActiveLineageId, selectClusterNodeIdFromActiveLineage } from './l
|
|||
import * as ErrorActions from '../../../../state/error/error.actions';
|
||||
import { ErrorHelper } from '../../../../service/error-helper.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { isDefinedAndNotNull } from 'libs/shared/src';
|
||||
import { isDefinedAndNotNull, NiFiCommon } from 'libs/shared/src';
|
||||
|
||||
@Injectable()
|
||||
export class LineageEffects {
|
||||
|
@ -38,6 +38,7 @@ export class LineageEffects {
|
|||
private store: Store<NiFiState>,
|
||||
private provenanceService: ProvenanceService,
|
||||
private errorHelper: ErrorHelper,
|
||||
private nifiCommon: NiFiCommon,
|
||||
private dialog: MatDialog
|
||||
) {}
|
||||
|
||||
|
@ -78,8 +79,11 @@ export class LineageEffects {
|
|||
map((action) => action.response),
|
||||
switchMap((response) => {
|
||||
const query: Lineage = response.lineage;
|
||||
if (query.finished) {
|
||||
this.dialog.closeAll();
|
||||
if (query.finished || !this.nifiCommon.isEmpty(query.results.errors)) {
|
||||
response.lineage.results.errors?.forEach((error) => {
|
||||
this.store.dispatch(ErrorActions.addBannerError({ error }));
|
||||
});
|
||||
|
||||
return of(LineageActions.deleteLineageQuery());
|
||||
} else {
|
||||
return of(LineageActions.startPollingLineageQuery());
|
||||
|
@ -138,8 +142,16 @@ export class LineageEffects {
|
|||
this.actions$.pipe(
|
||||
ofType(LineageActions.pollLineageQuerySuccess),
|
||||
map((action) => action.response),
|
||||
filter((response) => response.lineage.finished),
|
||||
switchMap(() => of(LineageActions.stopPollingLineageQuery()))
|
||||
filter(
|
||||
(response) => response.lineage.finished || !this.nifiCommon.isEmpty(response.lineage.results.errors)
|
||||
),
|
||||
switchMap((response) => {
|
||||
response.lineage.results.errors?.forEach((error) => {
|
||||
this.store.dispatch(ErrorActions.addBannerError({ error }));
|
||||
});
|
||||
|
||||
return of(LineageActions.stopPollingLineageQuery());
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -158,6 +170,8 @@ export class LineageEffects {
|
|||
this.store.select(selectClusterNodeIdFromActiveLineage)
|
||||
]),
|
||||
tap(([, id, clusterNodeId]) => {
|
||||
this.dialog.closeAll();
|
||||
|
||||
if (id) {
|
||||
this.provenanceService.deleteLineageQuery(id, clusterNodeId).subscribe();
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ import { CancelDialog } from '../../../../ui/common/cancel-dialog/cancel-dialog.
|
|||
import * as ErrorActions from '../../../../state/error/error.actions';
|
||||
import { ErrorHelper } from '../../../../service/error-helper.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { isDefinedAndNotNull } from 'libs/shared/src';
|
||||
import { isDefinedAndNotNull, NiFiCommon } from 'libs/shared/src';
|
||||
import { selectClusterSummary } from '../../../../state/cluster-summary/cluster-summary.selectors';
|
||||
import { ClusterService } from '../../../../service/cluster.service';
|
||||
import { LARGE_DIALOG, MEDIUM_DIALOG } from 'libs/shared/src';
|
||||
|
@ -54,6 +54,7 @@ export class ProvenanceEventListingEffects {
|
|||
private provenanceService: ProvenanceService,
|
||||
private errorHelper: ErrorHelper,
|
||||
private clusterService: ClusterService,
|
||||
private nifiCommon: NiFiCommon,
|
||||
private dialog: MatDialog,
|
||||
private router: Router
|
||||
) {}
|
||||
|
@ -143,8 +144,11 @@ export class ProvenanceEventListingEffects {
|
|||
map((action) => action.response),
|
||||
switchMap((response) => {
|
||||
const query: Provenance = response.provenance;
|
||||
if (query.finished) {
|
||||
this.dialog.closeAll();
|
||||
if (query.finished || !this.nifiCommon.isEmpty(query.results.errors)) {
|
||||
response.provenance.results.errors?.forEach((error) => {
|
||||
this.store.dispatch(ErrorActions.addBannerError({ error }));
|
||||
});
|
||||
|
||||
return of(ProvenanceEventListingActions.deleteProvenanceQuery());
|
||||
} else {
|
||||
return of(ProvenanceEventListingActions.startPollingProvenanceQuery());
|
||||
|
@ -203,8 +207,17 @@ export class ProvenanceEventListingEffects {
|
|||
this.actions$.pipe(
|
||||
ofType(ProvenanceEventListingActions.pollProvenanceQuerySuccess),
|
||||
map((action) => action.response),
|
||||
filter((response) => response.provenance.finished),
|
||||
switchMap(() => of(ProvenanceEventListingActions.stopPollingProvenanceQuery()))
|
||||
filter(
|
||||
(response) =>
|
||||
response.provenance.finished || !this.nifiCommon.isEmpty(response.provenance.results.errors)
|
||||
),
|
||||
switchMap((response) => {
|
||||
response.provenance.results.errors?.forEach((error) => {
|
||||
this.store.dispatch(ErrorActions.addBannerError({ error }));
|
||||
});
|
||||
|
||||
return of(ProvenanceEventListingActions.stopPollingProvenanceQuery());
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue