Re: [PR] NIFI-12485: Lineage Graph [nifi]

2023-12-21 Thread via GitHub


rfellows merged PR #8173:
URL: https://github.com/apache/nifi/pull/8173


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12485: Lineage Graph [nifi]

2023-12-21 Thread via GitHub


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


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/provenance/ui/provenance-event-listing/provenance-event-table/provenance-event-table.component.html:
##
@@ -18,7 +18,9 @@
 
 
 
-Displaying {{ filteredCount }} of {{ 
totalCount }}
+
+Displaying {{ filteredCount }} of {{ totalCount }}

Review Comment:
   This is still not very intuitive IMO. Maybe something like
   
   "Filter matched {{filterCount}} of {{totalCount}}"
   
   Since we still aren't displaying all of the matches if they span more than 1 
page.



##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/provenance/ui/provenance-event-listing/provenance-event-table/lineage/lineage.component.ts:
##
@@ -46,11 +46,13 @@ export class LineageComponent implements OnInit {
 this.addLineage(lineage.results.nodes, lineage.results.links);
 }
 }
+
 @Input() eventId: string | null = null;
+
 @Input() set eventTimestampThreshold(eventTimestampThreshold: number) {
 if (this.previousEventTimestampThreshold >= 0) {
-let nodes: any = this.lineageContainerElement.selectAll('g.node');
-let links: any = 
this.lineageContainerElement.selectAll('path.link');
+let nodes: any = 
this.lineageContainerElement.selectAll('g.node.rendered');
+let links: any = 
this.lineageContainerElement.selectAll('path.link.rendered');

Review Comment:
   when showing/hiding these items we should also turn on/of pointer-events. 
Otherwise, you can still get to the context menus for the hidden items if you 
mouse over them



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12485: Lineage Graph [nifi]

2023-12-20 Thread via GitHub


mcgilman commented on PR #8173:
URL: https://github.com/apache/nifi/pull/8173#issuecomment-1865420475

   Thanks for the review @rfellows! I've addressed the items you've mentioned 
and fixed the rendering issues as well. Please have a look at the latest commit.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12485: Lineage Graph [nifi]

2023-12-20 Thread via GitHub


mcgilman commented on code in PR #8173:
URL: https://github.com/apache/nifi/pull/8173#discussion_r1433243825


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/provenance/ui/provenance-event-listing/provenance-event-table/provenance-event-table.component.html:
##
@@ -15,142 +15,184 @@
   ~ limitations under the License.
   -->
 
-
-
-Displaying {{ filteredCount }} of {{ 
totalCount }}
-
-
-Oldest event available: {{ 
oldestEventAvailable }}
-
-
-{{ resultsMessage }}
-Clear 
Search
+
+
+
+Displaying {{ filteredCount }} of {{ 
totalCount }}

Review Comment:
   Good call. Will update.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12485: Lineage Graph [nifi]

2023-12-20 Thread via GitHub


mcgilman commented on code in PR #8173:
URL: https://github.com/apache/nifi/pull/8173#discussion_r1433235981


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/provenance/ui/provenance-event-listing/provenance-event-table/provenance-event-table.component.ts:
##
@@ -77,16 +86,69 @@ export class ProvenanceEventTable implements AfterViewInit {
 if (filterTerm?.length > 0) {
 const filterColumn = 
this.filterForm.get('filterColumn')?.value;
 this.applyFilter(filterTerm, filterColumn);
+} else {
+this.resetPaginator();
 }
 }
 }
 @Input() oldestEventAvailable!: string;
+@Input() timeOffset!: number;
 @Input() resultsMessage!: string;
 @Input() hasRequest!: boolean;
+@Input() loading!: boolean;
+@Input() loadedTimestamp!: string;
+@Input() set lineage$(lineage$: Observable) {
+this.provenanceLineage$ = lineage$.pipe(
+tap((lineage) => {
+let minMillis: number = -1;
+let maxMillis: number = -1;
+
+lineage?.results.nodes.forEach((node) => {
+// ensure this event has an event time
+if (minMillis < 0 || minMillis > node.millis) {
+minMillis = node.millis;
+// minTimestamp = node.timestamp;

Review Comment:
   Yup!



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12485: Lineage Graph [nifi]

2023-12-20 Thread via GitHub


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


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/provenance/state/lineage/lineage.effects.ts:
##
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Injectable } from '@angular/core';
+import { Actions, createEffect, ofType } from '@ngrx/effects';
+import * as LineageActions from './lineage.actions';
+import * as ProvenanceActions from 
'../provenance-event-listing/provenance-event-listing.actions';
+import {
+asyncScheduler,
+catchError,
+from,
+interval,
+map,
+NEVER,
+of,
+switchMap,
+take,
+takeUntil,
+tap,
+withLatestFrom
+} from 'rxjs';
+import { MatDialog } from '@angular/material/dialog';
+import { Store } from '@ngrx/store';
+import { NiFiState } from '../../../../state';
+import { ProvenanceService } from '../../service/provenance.service';
+import { Lineage } from './index';
+import { selectClusterNodeId } from 
'../provenance-event-listing/provenance-event-listing.selectors';
+import { selectLineageId } from './lineage.selectors';
+
+@Injectable()
+export class LineageEffects {
+constructor(
+private actions$: Actions,
+private store: Store,
+private provenanceService: ProvenanceService,
+private dialog: MatDialog
+) {}
+
+submitProvenanceQuery$ = createEffect(() =>
+this.actions$.pipe(
+ofType(LineageActions.submitLineageQuery),
+map((action) => action.request),
+switchMap((request) =>
+from(this.provenanceService.submitLineageQuery(request)).pipe(
+map((response) =>
+LineageActions.submitLineageQuerySuccess({
+response: {
+lineage: response.lineage
+}
+})
+),
+catchError((error) => {
+this.store.dispatch(
+ProvenanceActions.showOkDialog({
+title: 'Error',
+message: error.error
+})
+);
+
+return of(
+LineageActions.lineageApiError({
+error: error.error
+})
+);
+})
+)
+)
+)
+);
+
+submitProvenanceQuerySuccess$ = createEffect(() =>
+this.actions$.pipe(
+ofType(LineageActions.submitLineageQuerySuccess),
+map((action) => action.response),
+switchMap((response) => {
+const query: Lineage = response.lineage;
+if (query.finished) {
+this.dialog.closeAll();
+return of(LineageActions.deleteLineageQuery());
+} else {
+return of(LineageActions.startPollingLineageQuery());
+}
+})
+)
+);
+
+startPollingProvenanceQuery$ = createEffect(() =>

Review Comment:
   rename to be more contextual
   ```suggestion
   startPollingLineageQuery$ = createEffect(() =>
   ```



##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/provenance/state/lineage/lineage.effects.ts:
##
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is 

Re: [PR] NIFI-12485: Lineage Graph [nifi]

2023-12-20 Thread via GitHub


rfellows commented on PR #8173:
URL: https://github.com/apache/nifi/pull/8173#issuecomment-1864724892

   Will review.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org