Skip to content

Commit

Permalink
NIFI-13248: Add Flow Analysis report menu to new ui (apache#8974)
Browse files Browse the repository at this point in the history
* NIFI-13248: Add Flow Analysis report menu to new ui

* NIFI-13248: use ngrx to manage state for flow analysis component

* NIFI-13248: update types used in flow analysis drawer

* NIFI-13248: add violation details dialog

* NIFI-13248: add go to component functionality

* NIFI-13248: use Tailwind classes

* NIFI-13248: update analysis status icon based on response

* NIFI-13248: fix broken unit tests

* NIFI-13248: add missing license headers

* NIFI-13248: refactor styling

patch provided by @scottyaslan

* NIFI-13248: fix broken styling

* NIFI-13248: further style refactoring

patch provided by @scottyaslan

* NIFI-13248: binding and spacing fixes

* NIFI-13248: wire up pg name and id

* NIFI-13248: use breadcrumb selector to obtain process group name

* NIFI-13248: remove border color classes

* NIFI-13248: update drawer button icon
  • Loading branch information
sardell authored Aug 19, 2024
1 parent 9fbe6aa commit 8e0c4ae
Show file tree
Hide file tree
Showing 50 changed files with 1,409 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { ControllerServicesEffects } from '../state/controller-services/controll
import { ParameterEffects } from '../state/parameter/parameter.effects';
import { QueueEffects } from '../state/queue/queue.effects';
import { BannerText } from '../../../ui/common/banner-text/banner-text.component';
import { FlowAnalysisEffects } from '../state/flow-analysis/flow-analysis.effects';

@NgModule({
declarations: [FlowDesigner, VersionControlTip],
Expand All @@ -43,7 +44,8 @@ import { BannerText } from '../../../ui/common/banner-text/banner-text.component
TransformEffects,
ControllerServicesEffects,
ParameterEffects,
QueueEffects
QueueEffects,
FlowAnalysisEffects
),
NgOptimizedImage,
MatDialogModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('ConnectableBehavior', () => {
let service: ConnectableBehavior;
Expand All @@ -45,7 +47,8 @@ describe('ConnectableBehavior', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('DraggableBehavior', () => {
let service: DraggableBehavior;
Expand All @@ -46,7 +48,8 @@ describe('DraggableBehavior', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('EditableBehaviorService', () => {
let service: EditableBehavior;
Expand All @@ -45,7 +47,8 @@ describe('EditableBehaviorService', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('QuickSelectBehavior', () => {
let service: QuickSelectBehavior;
Expand All @@ -45,7 +47,8 @@ describe('QuickSelectBehavior', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('SelectableBehavior', () => {
let service: SelectableBehavior;
Expand All @@ -44,7 +46,8 @@ describe('SelectableBehavior', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../state/flow-configuration/flow-
import * as fromFlowConfiguration from '../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../queue/state';
import * as fromQueue from '../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../state/flow-analysis';
import * as fromFlowAnalysis from '../state/flow-analysis/flow-analysis.reducer';

describe('BirdseyeView', () => {
let service: BirdseyeView;
Expand All @@ -46,7 +48,8 @@ describe('BirdseyeView', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import { selectFlowConfiguration } from '../../../state/flow-configuration/flow-
import * as fromFlowConfiguration from '../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../queue/state';
import * as fromQueue from '../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../state/flow-analysis';
import * as fromFlowAnalysis from '../state/flow-analysis/flow-analysis.reducer';

describe('CanvasUtils', () => {
let service: CanvasUtils;
Expand All @@ -45,7 +47,8 @@ describe('CanvasUtils', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../state/flow-configuration/flow-
import * as fromFlowConfiguration from '../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../queue/state';
import * as fromQueue from '../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../state/flow-analysis';
import * as fromFlowAnalysis from '../state/flow-analysis/flow-analysis.reducer';

describe('CanvasView', () => {
let service: CanvasView;
Expand All @@ -46,7 +48,8 @@ describe('CanvasView', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 { TestBed } from '@angular/core/testing';

import { FlowAnalysisService } from './flow-analysis.service';
import { provideMockStore } from '@ngrx/store/testing';
import { HttpClient } from '@angular/common/http';

describe('FlowAnalysisService', () => {
let service: FlowAnalysisService;

beforeEach(() => {
TestBed.configureTestingModule({
providers: [
provideMockStore({}),
{
provide: HttpClient,
useValue: {}
}
]
});
service = TestBed.inject(FlowAnalysisService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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 { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class FlowAnalysisService {
private static readonly API: string = '../nifi-api';

constructor(private httpClient: HttpClient) {}

getResults(processGroupId: string): Observable<any> {
return this.httpClient.get(`${FlowAnalysisService.API}/flow/flow-analysis/results/${processGroupId}`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import * as fromFlowConfiguration from '../../../../state/flow-configuration/flo
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { ClusterConnectionService } from '../../../../service/cluster-connection.service';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('ConnectionManager', () => {
let service: ConnectionManager;
Expand All @@ -47,7 +49,8 @@ describe('ConnectionManager', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('FunnelManager', () => {
let service: FunnelManager;
Expand All @@ -46,7 +48,8 @@ describe('FunnelManager', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import * as fromFlowConfiguration from '../../../../state/flow-configuration/flo
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { ClusterConnectionService } from '../../../../service/cluster-connection.service';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('LabelManager', () => {
let service: LabelManager;
Expand All @@ -47,7 +49,8 @@ describe('LabelManager', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('PortManager', () => {
let service: PortManager;
Expand All @@ -46,7 +48,8 @@ describe('PortManager', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('ProcessGroupManager', () => {
let service: ProcessGroupManager;
Expand All @@ -46,7 +48,8 @@ describe('ProcessGroupManager', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('ProcessorManager', () => {
let service: ProcessorManager;
Expand All @@ -46,7 +48,8 @@ describe('ProcessorManager', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
import * as fromFlowConfiguration from '../../../../state/flow-configuration/flow-configuration.reducer';
import { queueFeatureKey } from '../../../queue/state';
import * as fromQueue from '../../state/queue/queue.reducer';
import { flowAnalysisFeatureKey } from '../../state/flow-analysis';
import * as fromFlowAnalysis from '../../state/flow-analysis/flow-analysis.reducer';

describe('RemoteProcessGroupManager', () => {
let service: RemoteProcessGroupManager;
Expand All @@ -46,7 +48,8 @@ describe('RemoteProcessGroupManager', () => {
[transformFeatureKey]: fromTransform.initialState,
[controllerServicesFeatureKey]: fromControllerServices.initialState,
[parameterFeatureKey]: fromParameter.initialState,
[queueFeatureKey]: fromQueue.initialState
[queueFeatureKey]: fromQueue.initialState,
[flowAnalysisFeatureKey]: fromFlowAnalysis.initialState
};

TestBed.configureTestingModule({
Expand Down
Loading

0 comments on commit 8e0c4ae

Please sign in to comment.