[NIFI-12686] eslint configuration (#8313)

* [NIFI-12686] eslint configuration for ts files
* add linting to the default maven build

* updates for RAT plugin

* remove .eslitrc as it wasn't needed. updated RAT config

This closes #8313
This commit is contained in:
Rob Fellows 2024-01-30 12:26:18 -05:00 committed by GitHub
parent 8b2758cd18
commit d901253974
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
206 changed files with 1978 additions and 732 deletions

View File

@ -147,6 +147,22 @@
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
<!--
Run the code linter
-->
<execution>
<id>lint</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run lint</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
<!--
Bundle, minify, and gzip compress all the javascript.
-->
@ -176,7 +192,8 @@
<exclude>src/main/nifi/README.md</exclude>
<exclude>src/main/nifi/proxy.config.mjs</exclude>
<exclude>src/main/nifi/.prettierrc</exclude>
<exclude>src/main/nifi/src/.eslintrc</exclude>
<exclude>src/main/nifi/.prettierignore</exclude>
<exclude>src/main/nifi/dist/**/*</exclude>
</excludes>
</configuration>
</plugin>

View File

@ -0,0 +1,40 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:prettier/recommended"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "",
"style": "kebab-case"
}
],
"@angular-eslint/component-class-suffix": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-this-alias": "warn",
"no-useless-escape": "off"
}
}
]
}

View File

@ -0,0 +1,36 @@
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
# System files
.DS_Store
Thumbs.db

View File

@ -86,8 +86,17 @@
"scripts": [],
"karmaConfig": "karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts"]
}
}
}
}
},
"cli": {
"schematicCollections": ["@angular-eslint/schematics"]
}
}

View File

@ -10,7 +10,9 @@
"test:dev": "ng test --karma-config=karma.conf.js --watch=true --browsers=Chrome",
"prettier": "prettier --config .prettierrc . --check",
"prettier-format": "prettier --config .prettierrc . --write",
"ci": "npm ci --ignore-scripts"
"ci": "npm ci --ignore-scripts",
"lint": "ng lint --eslint-config .eslintrc.json",
"lint:fix": "ng lint --eslint-config .eslintrc.json --fix"
},
"private": true,
"dependencies": {
@ -43,6 +45,11 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.2.10",
"@angular-eslint/builder": "16.3.0",
"@angular-eslint/eslint-plugin": "16.3.0",
"@angular-eslint/eslint-plugin-template": "16.3.0",
"@angular-eslint/schematics": "16.3.0",
"@angular-eslint/template-parser": "16.3.0",
"@angular/cli": "~16.2.10",
"@angular/compiler-cli": "^16.2.12",
"@types/codemirror": "^5.60.15",
@ -50,7 +57,10 @@
"@types/humanize-duration": "^3.27.3",
"@types/jasmine": "~4.6.4",
"@types/webfontloader": "^1.6.38",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1",
"jasmine-core": "~4.6.0",

View File

@ -1,15 +0,0 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-console": 1, // Means warning
"prettier/prettier": 2 // Means error
}
}

View File

@ -26,7 +26,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
})
export class AppComponent {
title = 'nifi';
guardLoading: boolean = true;
guardLoading = true;
constructor(private router: Router) {
this.router.events.pipe(takeUntilDestroyed()).subscribe((event) => {

View File

@ -43,7 +43,7 @@ export class AccessPolicyService {
users?: TenantEntity[];
} = {}
): Observable<any> {
let resource: string = `/${resourceAction.resource}`;
let resource = `/${resourceAction.resource}`;
if (resourceAction.resourceIdentifier) {
resource += `/${resourceAction.resourceIdentifier}`;
}

View File

@ -28,7 +28,7 @@ import {
SelectComponentAccessPolicyRequest
} from './index';
const ACCESS_POLICY_PREFIX: string = '[Access Policy]';
const ACCESS_POLICY_PREFIX = '[Access Policy]';
export const selectGlobalAccessPolicy = createAction(
`${ACCESS_POLICY_PREFIX} Select Global Access Policy`,

View File

@ -63,7 +63,7 @@ export class AccessPolicyEffects {
this.actions$.pipe(
ofType(AccessPolicyActions.reloadAccessPolicy),
concatLatestFrom(() => this.store.select(selectResourceAction).pipe(isDefinedAndNotNull())),
switchMap(([action, resourceAction]) => {
switchMap(([, resourceAction]) => {
return of(
AccessPolicyActions.loadAccessPolicy({
request: {
@ -84,7 +84,7 @@ export class AccessPolicyEffects {
map((response) => {
const accessPolicy: AccessPolicyEntity = response;
let requestedResource: string = `/${request.resourceAction.resource}`;
let requestedResource = `/${request.resourceAction.resource}`;
if (request.resourceAction.resourceIdentifier) {
requestedResource += `/${request.resourceAction.resourceIdentifier}`;
}
@ -138,7 +138,7 @@ export class AccessPolicyEffects {
this.actions$.pipe(
ofType(AccessPolicyActions.createAccessPolicy),
concatLatestFrom(() => this.store.select(selectResourceAction).pipe(isDefinedAndNotNull())),
switchMap(([action, resourceAction]) =>
switchMap(([, resourceAction]) =>
from(this.accessPoliciesService.createAccessPolicy(resourceAction)).pipe(
map((response) => {
const accessPolicy: AccessPolicyEntity = response;
@ -170,7 +170,7 @@ export class AccessPolicyEffects {
this.actions$.pipe(
ofType(AccessPolicyActions.promptOverrideAccessPolicy),
concatLatestFrom(() => this.store.select(selectAccessPolicy).pipe(isDefinedAndNotNull())),
tap(([action, accessPolicy]) => {
tap(([, accessPolicy]) => {
const dialogReference = this.dialog.open(OverridePolicyDialog, {
panelClass: 'small-dialog'
});
@ -287,7 +287,7 @@ export class AccessPolicyEffects {
this.actions$.pipe(
ofType(AccessPolicyActions.openAddTenantToPolicyDialog),
concatLatestFrom(() => this.store.select(selectAccessPolicy)),
tap(([action, accessPolicy]) => {
tap(([, accessPolicy]) => {
const dialogReference = this.dialog.open(AddTenantToPolicyDialog, {
data: {
accessPolicy
@ -417,7 +417,7 @@ export class AccessPolicyEffects {
() =>
this.actions$.pipe(
ofType(AccessPolicyActions.promptDeleteAccessPolicy),
tap((request) => {
tap(() => {
const dialogReference = this.dialog.open(YesNoDialog, {
data: {
title: 'Delete Policy',
@ -442,9 +442,9 @@ export class AccessPolicyEffects {
this.store.select(selectResourceAction).pipe(isDefinedAndNotNull()),
this.store.select(selectAccessPolicy).pipe(isDefinedAndNotNull())
]),
switchMap(([action, resourceAction, accessPolicy]) =>
switchMap(([, resourceAction, accessPolicy]) =>
from(this.accessPoliciesService.deleteAccessPolicy(accessPolicy)).pipe(
map((response) => {
map(() => {
// the policy was removed, we need to reload the policy for this resource and action to fetch
// the inherited policy or correctly when it's not found
return AccessPolicyActions.loadAccessPolicy({

View File

@ -42,7 +42,7 @@ export const accessPolicyReducer = createReducer(
...state,
resourceAction: request.resourceAction
})),
on(loadAccessPolicy, (state, { request }) => ({
on(loadAccessPolicy, (state) => ({
...state,
status: 'loading' as const
})),
@ -54,11 +54,11 @@ export const accessPolicyReducer = createReducer(
saving: false,
status: 'success' as const
})),
on(addTenantsToPolicy, (state, { request }) => ({
on(addTenantsToPolicy, (state) => ({
...state,
saving: true
})),
on(removeTenantFromPolicy, (state, { request }) => ({
on(removeTenantFromPolicy, (state) => ({
...state,
saving: true
})),
@ -76,7 +76,7 @@ export const accessPolicyReducer = createReducer(
policyStatus: undefined,
status: 'error' as const
})),
on(resetAccessPolicyState, (state) => ({
on(resetAccessPolicyState, () => ({
...initialState
}))
);

View File

@ -16,7 +16,7 @@
*/
import { AccessPolicyEntity, ComponentResourceAction, PolicyStatus, ResourceAction } from '../shared';
import { TenantEntity, UserEntity, UserGroupEntity } from '../../../../state/shared';
import { TenantEntity } from '../../../../state/shared';
export const accessPolicyFeatureKey = 'accessPolicy';

View File

@ -18,7 +18,7 @@
import { createAction, props } from '@ngrx/store';
import { LoadPolicyComponentRequest, LoadPolicyComponentSuccess } from './index';
const POLICY_COMPONENT_PREFIX: string = '[Policy Component]';
const POLICY_COMPONENT_PREFIX = '[Policy Component]';
export const loadPolicyComponent = createAction(
`${POLICY_COMPONENT_PREFIX} Load Policy Component`,

View File

@ -51,7 +51,7 @@ export const policyComponentReducer = createReducer(
error: error,
status: 'error' as const
})),
on(resetPolicyComponentState, (state) => ({
on(resetPolicyComponentState, () => ({
...initialState
}))
);

View File

@ -18,7 +18,7 @@
import { createAction, props } from '@ngrx/store';
import { LoadTenantsSuccess } from './index';
const TENANTS_PREFIX: string = '[Tenants]';
const TENANTS_PREFIX = '[Tenants]';
export const loadTenants = createAction(`${TENANTS_PREFIX} Load Tenants`);

View File

@ -44,7 +44,7 @@ export const tenantsReducer = createReducer(
error: error,
status: 'error' as const
})),
on(resetTenantsState, (state) => ({
on(resetTenantsState, () => ({
...initialState
}))
);

View File

@ -24,7 +24,6 @@ import { MatInputModule } from '@angular/material/input';
import { ReactiveFormsModule } from '@angular/forms';
import { MatSelectModule } from '@angular/material/select';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { CurrentUser } from '../../../../../state/current-user';
describe('PolicyTable', () => {
let component: PolicyTable;

View File

@ -15,12 +15,11 @@
* limitations under the License.
*/
import { AfterViewInit, Component, EventEmitter, Input, Output } from '@angular/core';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
import { MatSortModule, Sort } from '@angular/material/sort';
import { NiFiCommon } from '../../../../../service/nifi-common.service';
import { CurrentUser } from '../../../../../state/current-user';
import { TenantEntity, UserEntity } from '../../../../../state/shared';
import { TenantEntity } from '../../../../../state/shared';
import { NgIf } from '@angular/common';
import { AccessPolicyEntity } from '../../../state/shared';
import { RemoveTenantFromPolicyRequest } from '../../../state/access-policy';
@ -98,7 +97,7 @@ export class PolicyTable {
return data.sort((a, b) => {
const isAsc = sort.direction === 'asc';
let retVal: number = 0;
let retVal = 0;
switch (sort.active) {
case 'user':
retVal = this.nifiCommon.compareString(a.user, b.user);

View File

@ -35,13 +35,13 @@ import {
selectAccessPolicyState,
selectComponentResourceActionFromRoute
} from '../../state/access-policy/access-policy.selectors';
import { distinctUntilChanged, filter } from 'rxjs';
import { distinctUntilChanged } from 'rxjs';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { NiFiCommon } from '../../../../service/nifi-common.service';
import { ComponentType, isDefinedAndNotNull, SelectOption, TextTipInput } from '../../../../state/shared';
import { TextTip } from '../../../../ui/common/tooltips/text-tip/text-tip.component';
import { AccessPolicyEntity, Action, ComponentResourceAction, PolicyStatus, ResourceAction } from '../../state/shared';
import { AccessPolicyEntity, Action, PolicyStatus, ResourceAction } from '../../state/shared';
import { loadFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.actions';
import { selectFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.selectors';
import { loadTenants, resetTenantsState } from '../../state/tenants/tenants.actions';

View File

@ -35,7 +35,7 @@ import {
selectAccessPolicyState,
selectGlobalResourceActionFromRoute
} from '../../state/access-policy/access-policy.selectors';
import { distinctUntilChanged, filter } from 'rxjs';
import { distinctUntilChanged } from 'rxjs';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { NiFiCommon } from '../../../../service/nifi-common.service';
@ -47,7 +47,7 @@ import {
TextTipInput
} from '../../../../state/shared';
import { TextTip } from '../../../../ui/common/tooltips/text-tip/text-tip.component';
import { AccessPolicyEntity, Action, PolicyStatus, ResourceAction } from '../../state/shared';
import { AccessPolicyEntity, Action, PolicyStatus } from '../../state/shared';
import { loadExtensionTypesForPolicies } from '../../../../state/extension-types/extension-types.actions';
import { selectRequiredPermissions } from '../../../../state/extension-types/extension-types.selectors';
import { loadFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.actions';
@ -74,8 +74,8 @@ export class GlobalAccessPolicies implements OnInit, OnDestroy {
policyForm: FormGroup;
resourceOptions: SelectOption[];
requiredPermissionOptions!: SelectOption[];
supportsReadWriteAction: boolean = false;
supportsResourceIdentifier: boolean = false;
supportsReadWriteAction = false;
supportsResourceIdentifier = false;
@ViewChild('inheritedFromPolicies') inheritedFromPolicies!: TemplateRef<any>;
@ViewChild('inheritedFromController') inheritedFromController!: TemplateRef<any>;
@ -97,7 +97,7 @@ export class GlobalAccessPolicies implements OnInit, OnDestroy {
.select(selectRequiredPermissions)
.pipe(takeUntilDestroyed())
.subscribe((requiredPermissions: RequiredPermission[]) => {
const regardlessOfRestrictions: string = 'regardless of restrictions';
const regardlessOfRestrictions = 'regardless of restrictions';
const options: SelectOption[] = [
{

View File

@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Client } from '../../../service/client.service';
import { Observable } from 'rxjs';
import { CounterEntity, ResetCounterRequest } from '../state/counter-listing';
import { ResetCounterRequest } from '../state/counter-listing';
@Injectable({ providedIn: 'root' })
export class CountersService {

View File

@ -18,7 +18,7 @@
import { createAction, props } from '@ngrx/store';
import { LoadCounterListingResponse, ResetCounterRequest, ResetCounterSuccess } from './index';
const COUNTER_PREFIX: string = '[Counter Listing]';
const COUNTER_PREFIX = '[Counter Listing]';
export const loadCounters = createAction(`${COUNTER_PREFIX} Load Counter Listing`);

View File

@ -63,7 +63,7 @@ export const counterListingReducer = createReducer(
}
});
}),
on(resetCounterState, (state) => ({
on(resetCounterState, () => ({
...initialState
}))
);

View File

@ -29,11 +29,11 @@ import { NiFiCommon } from '../../../../../service/nifi-common.service';
styleUrls: ['./counter-table.component.scss']
})
export class CounterTable implements AfterViewInit {
private _canModifyCounters: boolean = false;
filterTerm: string = '';
private _canModifyCounters = false;
filterTerm = '';
filterColumn: 'context' | 'name' = 'name';
totalCount: number = 0;
filteredCount: number = 0;
totalCount = 0;
filteredCount = 0;
displayedColumns: string[] = ['context', 'name', 'value'];
dataSource: MatTableDataSource<CounterEntity> = new MatTableDataSource<CounterEntity>();

View File

@ -20,8 +20,6 @@ import { RouterModule, Routes } from '@angular/router';
import { FlowDesigner } from './flow-designer.component';
import { RootGroupRedirector } from '../ui/root/redirector/root-group-redirector.component';
import { rootGroupGuard } from '../ui/root/guard/root-group.guard';
import { Canvas } from '../ui/canvas/canvas.component';
import { ControllerServices } from '../ui/controller-service/controller-services.component';
const routes: Routes = [
{

View File

@ -34,12 +34,12 @@ import { ComponentType } from '../../../../state/shared';
})
export class DraggableBehavior {
private readonly drag: any;
private snapEnabled: boolean = false;
private snapAlignmentPixels: number = 8;
private snapEnabled = false;
private snapAlignmentPixels = 8;
private scale: number = INITIAL_SCALE;
private updateConnectionRequestId: number = 0;
private updateConnectionRequestId = 0;
constructor(
private store: Store<CanvasState>,
@ -84,8 +84,8 @@ export class DraggableBehavior {
if (minY === null || d.position.y < minY) {
minY = d.position.y;
}
var componentMaxX = d.position.x + d.dimensions.width;
var componentMaxY = d.position.y + d.dimensions.height;
const componentMaxX = d.position.x + d.dimensions.width;
const componentMaxY = d.position.y + d.dimensions.height;
if (maxX === null || componentMaxX > maxX) {
maxX = componentMaxX;
}

View File

@ -18,9 +18,6 @@
import { TestBed } from '@angular/core/testing';
import { PositionBehavior } from './position-behavior.service';
import { provideMockStore } from '@ngrx/store/testing';
import { initialState } from '../../state/flow/flow.reducer';
import { selectFlowState } from '../../state/flow/flow.selectors';
describe('PositionBehavior', () => {
let service: PositionBehavior;

View File

@ -208,8 +208,8 @@ export class BirdseyeView {
}
// offset in case the graph has positive/negative coordinates and panning appropriately
let offsetX: number = 0;
let left: number = -graphLeft;
let offsetX = 0;
const left: number = -graphLeft;
if (translate[0] < 0) {
if (translate[0] < left) {
offsetX = left;
@ -221,8 +221,8 @@ export class BirdseyeView {
offsetX = left - translate[0];
}
}
let offsetY: number = 0;
let top: number = -graphTop;
let offsetY = 0;
const top: number = -graphTop;
if (translate[1] < 0) {
if (translate[1] < top) {
offsetY = top;
@ -274,7 +274,7 @@ export class BirdseyeView {
// labels
this.labelManager.selectAll().each(function (d: any) {
// default color
let color: string = '#fff7d7';
let color = '#fff7d7';
if (d.permissions.canRead) {
// use the specified color if appropriate
@ -313,7 +313,7 @@ export class BirdseyeView {
// processors
this.processorManager.selectAll().each(function (d: any) {
// default color
let color: string = '#dde4eb';
let color = '#dde4eb';
if (d.permissions.canRead) {
// use the specified color if appropriate

View File

@ -778,7 +778,7 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
const selectionData = selection.datum();
const componentType: ComponentType = selectionData.type;
let resource: string = 'process-groups';
let resource = 'process-groups';
switch (componentType) {
case ComponentType.Processor:
resource = 'processors';

View File

@ -753,7 +753,7 @@ export class CanvasUtils {
if (isDisconnected) {
// go through each connection to ensure its source and destination are included
connections.forEach(function (connection, id) {
connections.forEach((connection) => {
if (isDisconnected) {
// determine whether this connection and its components are included within the selection
isDisconnected =
@ -949,7 +949,7 @@ export class CanvasUtils {
return false;
}
private binarySearch(length: number, comparator: Function): number {
private binarySearch(length: number, comparator: (data: number) => number): number {
let low = 0;
let high = length - 1;
let mid = 0;

View File

@ -50,7 +50,7 @@ export class CanvasView {
private behavior: any;
private birdseyeTranslateInProgress: boolean = false;
private birdseyeTranslateInProgress = false;
constructor(
private store: Store<CanvasState>,
@ -95,7 +95,7 @@ export class CanvasView {
const self: CanvasView = this;
let refreshed: Promise<void> | null;
let panning: boolean = false;
let panning = false;
// define the behavior
this.behavior = d3
@ -123,7 +123,7 @@ export class CanvasView {
refreshBirdseye: false
});
})
.on('end', function (event) {
.on('end', function () {
if (!self.isBirdseyeEvent()) {
// ensure the canvas was actually refreshed
if (refreshed) {
@ -244,7 +244,7 @@ export class CanvasView {
};
// marks the specific component as visible and determines if its entering or leaving visibility
const updateVisibility = function (selection: any, d: any, isVisible: Function) {
const updateVisibility = function (selection: any, d: any, isVisible: (d: any) => boolean) {
const visible: boolean = isVisible(d);
const wasVisible: boolean = selection.classed('visible');
@ -307,11 +307,11 @@ export class CanvasView {
let box;
if (this.canvasUtils.isConnection(selection)) {
let x, y;
let d = selection.datum();
const d = selection.datum();
// get the position of the connection label
if (d.bends.length > 0) {
let i: number = Math.min(Math.max(0, d.labelIndex), d.bends.length - 1);
const i: number = Math.min(Math.max(0, d.labelIndex), d.bends.length - 1);
x = d.bends[i].x;
y = d.bends[i].y;
} else {

View File

@ -77,7 +77,7 @@ export class ConnectionManager {
private connections: [] = [];
private connectionContainer: any;
private transitionRequired: boolean = false;
private transitionRequired = false;
private currentProcessGroupId: string = initialState.id;
private scale: number = INITIAL_SCALE;
@ -87,7 +87,7 @@ export class ConnectionManager {
private endpointDrag: any;
private labelDrag: any;
private snapEnabled: boolean = true;
private snapEnabled = true;
private viewContainerRef: ViewContainerRef | undefined;
@ -190,7 +190,7 @@ export class ConnectionManager {
}
let minimumDistance: number;
let index: number = 0;
let index = 0;
// line is comprised of start -> [bends] -> end
const line = [connectionData.start].concat(connectionData.bends, [connectionData.end]);
@ -567,7 +567,7 @@ export class ConnectionManager {
if (updatePath) {
updated
.classed('grouped', function (d: any) {
let grouped: boolean = false;
let grouped = false;
if (d.permissions.canRead) {
// if there are more than one selected relationship, mark this as grouped
@ -579,7 +579,7 @@ export class ConnectionManager {
return grouped;
})
.classed('ghost', function (d: any) {
let ghost: boolean = false;
let ghost = false;
if (d.permissions.canRead) {
// if the connection has a relationship that is unavailable, mark it a ghost relationship
@ -799,7 +799,7 @@ export class ConnectionManager {
}
const newBends: any[] = [];
let bendIndex: number = -1;
let bendIndex = -1;
// create a new array of bends without the selected one
connectionData.component.bends.forEach((bend: any, i: number) => {
@ -890,8 +890,8 @@ export class ConnectionManager {
.attr('stroke', 'transparent');
}
let labelCount: number = 0;
const rowHeight: number = 19;
let labelCount = 0;
const rowHeight = 19;
const backgrounds: any[] = [];
const borders: any[] = [];
@ -964,7 +964,7 @@ export class ConnectionManager {
connectionFrom
.select('text.connection-from')
.each(function (this: any) {
let connectionFromLabel = d3.select(this);
const connectionFromLabel = d3.select(this);
// reset the label name to handle any previous state
connectionFromLabel.text(null).selectAll('title').remove();
@ -1079,7 +1079,7 @@ export class ConnectionManager {
connectionTo
.select('text.connection-to')
.each(function (this: any, d: any) {
let connectionToLabel = d3.select(this);
const connectionToLabel = d3.select(this);
// reset the label name to handle any previous state
connectionToLabel.text(null).selectAll('title').remove();
@ -1191,7 +1191,7 @@ export class ConnectionManager {
connectionName
.select('text.connection-name')
.each(function (this: any) {
let connectionToLabel = d3.select(this);
const connectionToLabel = d3.select(this);
// reset the label name to handle any previous state
connectionToLabel.text(null).selectAll('title').remove();
@ -1472,7 +1472,7 @@ export class ConnectionManager {
.select('title')
.text(function () {
if (d.permissions.canRead) {
let loadBalanceStrategyText: string = '';
let loadBalanceStrategyText = '';
const loadBalanceStrategyOption: SelectOption | undefined = loadBalanceStrategies.find(
(option) => option.value == d.component.loadBalanceStrategy
@ -1485,7 +1485,7 @@ export class ConnectionManager {
loadBalanceStrategyText += ' (' + d.component.loadBalancePartitionAttribute + ')';
}
let loadBalanceCompression: string = 'no compression';
let loadBalanceCompression = 'no compression';
switch (d.component.loadBalanceCompression) {
case 'COMPRESS_ATTRIBUTES_ONLY':
loadBalanceCompression = "'Attribute' compression";
@ -1619,7 +1619,7 @@ export class ConnectionManager {
return flowFileAvailability !== 'HEAD_OF_QUEUE_PENALIZED';
})
.attr('x', function () {
let offset: number = 0;
let offset = 0;
if (!connectionLabelContainer.select('text.expiration-icon').classed('hidden')) {
offset += 16;
}
@ -1878,8 +1878,8 @@ export class ConnectionManager {
// ensure the bend lengths are the same
if (bends.length === connectionData.component.bends.length) {
// determine if the bend points have moved
let different: boolean = false;
for (let i: number = 0; i < bends.length && !different; i++) {
let different = false;
for (let i = 0; i < bends.length && !different; i++) {
if (
bends[i].x !== connectionData.component.bends[i].x ||
bends[i].y !== connectionData.component.bends[i].y
@ -2088,7 +2088,7 @@ export class ConnectionManager {
y: datum.y + datum.height / 2
};
let closestBendIndex: number = -1;
let closestBendIndex = -1;
let minDistance: number;
d.bends.forEach((bend: Position, i: number) => {
const bendPoint: Position = {

View File

@ -44,7 +44,7 @@ export class FunnelManager {
private funnels: [] = [];
private funnelContainer: any;
private transitionRequired: boolean = false;
private transitionRequired = false;
constructor(
private store: Store<CanvasState>,

View File

@ -52,10 +52,10 @@ export class LabelManager {
private labels: [] = [];
private labelContainer: any;
private transitionRequired: boolean = false;
private transitionRequired = false;
private labelPointDrag: any;
private snapEnabled: boolean = true;
private snapEnabled = true;
constructor(
private store: Store<CanvasState>,
@ -323,14 +323,14 @@ export class LabelManager {
const labelData: any = label.datum();
// determine if the width has changed
let different: boolean = false;
let widthSet: boolean = !!labelData.component.width;
let different = false;
const widthSet = !!labelData.component.width;
if (widthSet || labelData.dimensions.width !== labelData.component.width) {
different = true;
}
// determine if the height has changed
let heightSet: boolean = !!labelData.component.height;
const heightSet = !!labelData.component.height;
if ((!different && heightSet) || labelData.dimensions.height !== labelData.component.height) {
different = true;
}

View File

@ -59,7 +59,7 @@ export class PortManager {
private ports: [] = [];
private portContainer: any;
private transitionRequired: boolean = false;
private transitionRequired = false;
private viewContainerRef: ViewContainerRef | undefined;
@ -386,7 +386,7 @@ export class PortManager {
updated
.select('text.run-status-icon')
.attr('class', function (d: any) {
let clazz: string = 'primary-500';
let clazz = 'primary-500';
if (d.status.aggregateSnapshot.runStatus === 'Invalid') {
clazz = 'canvas-accent-A200';
@ -399,7 +399,7 @@ export class PortManager {
return `run-status-icon ${clazz}`;
})
.attr('font-family', function (d: any) {
let family: string = 'FontAwesome';
let family = 'FontAwesome';
if (d.status.aggregateSnapshot.runStatus === 'Disabled') {
family = 'flowfont';
}
@ -407,7 +407,7 @@ export class PortManager {
})
.attr('y', this.offsetY(25))
.text(function (d: any) {
let img: string = '';
let img = '';
if (d.status.aggregateSnapshot.runStatus === 'Disabled') {
img = '\ue802';
} else if (d.status.aggregateSnapshot.runStatus === 'Invalid') {

View File

@ -56,7 +56,7 @@ export class ProcessGroupManager {
private processGroups: [] = [];
private processGroupContainer: any;
private transitionRequired: boolean = false;
private transitionRequired = false;
private viewContainerRef: ViewContainerRef | undefined;

View File

@ -53,7 +53,7 @@ export class ProcessorManager {
private processors: [] = [];
private processorContainer: any;
private transitionRequired: boolean = false;
private transitionRequired = false;
private viewContainerRef: ViewContainerRef | undefined;
@ -670,7 +670,7 @@ export class ProcessorManager {
updated
.select('text.run-status-icon')
.attr('class', function (d: any) {
let clazz: string = 'primary-500';
let clazz = 'primary-500';
if (d.status.aggregateSnapshot.runStatus === 'Validating') {
clazz = 'warn-contrast-300';
@ -685,7 +685,7 @@ export class ProcessorManager {
return `run-status-icon ${clazz}`;
})
.attr('font-family', function (d: any) {
let family: string = 'FontAwesome';
let family = 'FontAwesome';
if (d.status.aggregateSnapshot.runStatus === 'Disabled') {
family = 'flowfont';
}
@ -695,7 +695,7 @@ export class ProcessorManager {
return d.status.aggregateSnapshot.runStatus === 'Validating';
})
.text(function (d: any) {
let img: string = '';
let img = '';
if (d.status.aggregateSnapshot.runStatus === 'Disabled') {
img = '\ue802';
} else if (d.status.aggregateSnapshot.runStatus === 'Validating') {

View File

@ -53,7 +53,7 @@ export class RemoteProcessGroupManager {
private remoteProcessGroups: [] = [];
private remoteProcessGroupContainer: any;
private transitionRequired: boolean = false;
private transitionRequired = false;
private viewContainerRef: ViewContainerRef | undefined;

View File

@ -16,7 +16,7 @@
*/
import { Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { NiFiCommon } from '../../../service/nifi-common.service';
import { ParameterContextUpdateRequest, SubmitParameterContextUpdate } from '../../../state/shared';

View File

@ -16,7 +16,7 @@
*/
import { Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
export interface SearchResultGroup {
@ -51,6 +51,7 @@ export interface SearchResults {
export interface SearchResultsEntity {
searchResultsDTO: SearchResults;
}
@Injectable({ providedIn: 'root' })
export class SearchService {
private static readonly API: string = '../nifi-api';

View File

@ -104,7 +104,7 @@ export class ControllerServicesEffects {
this.store.select(selectControllerServiceTypes),
this.store.select(selectCurrentProcessGroupId)
]),
tap(([action, controllerServiceTypes, processGroupId]) => {
tap(([, controllerServiceTypes, processGroupId]) => {
const dialogReference = this.dialog.open(CreateControllerService, {
data: {
controllerServiceTypes
@ -255,7 +255,7 @@ export class ControllerServicesEffects {
};
editDialogReference.componentInstance.parameterContext = parameterContext;
editDialogReference.componentInstance.goToParameter = (parameter: string) => {
editDialogReference.componentInstance.goToParameter = () => {
const commands: string[] = ['/parameter-contexts', parameterContext.id];
goTo(commands, 'Parameter');
};
@ -322,7 +322,7 @@ export class ControllerServicesEffects {
})
);
}),
catchError((error) => {
catchError(() => {
// TODO handle error
return NEVER;
})

View File

@ -55,7 +55,7 @@ export const initialState: ControllerServicesState = {
export const controllerServicesReducer = createReducer(
initialState,
on(resetControllerServicesState, (state) => ({
on(resetControllerServicesState, () => ({
...initialState
})),
on(loadControllerServices, (state) => ({
@ -77,7 +77,7 @@ export const controllerServicesReducer = createReducer(
error,
status: 'error' as const
})),
on(createControllerService, configureControllerService, deleteControllerService, (state, { request }) => ({
on(createControllerService, configureControllerService, deleteControllerService, (state) => ({
...state,
saving: true
})),

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Bundle, ControllerServiceEntity, Revision } from '../../../../state/shared';
import { ControllerServiceEntity } from '../../../../state/shared';
import { BreadcrumbEntity } from '../shared';
export const controllerServicesFeatureKey = 'controllerServiceListing';

View File

@ -118,7 +118,7 @@ export class FlowEffects {
this.actions$.pipe(
ofType(FlowActions.reloadFlow),
concatLatestFrom(() => this.store.select(selectCurrentProcessGroupId)),
switchMap(([action, processGroupId]) => {
switchMap(([, processGroupId]) => {
return of(
FlowActions.loadProcessGroup({
request: {
@ -193,7 +193,7 @@ export class FlowEffects {
takeUntil(this.actions$.pipe(ofType(FlowActions.stopProcessGroupPolling)))
)
),
switchMap((request) => of(FlowActions.reloadFlow()))
switchMap(() => of(FlowActions.reloadFlow()))
)
);
@ -348,7 +348,7 @@ export class FlowEffects {
ofType(FlowActions.getParameterContextsAndOpenGroupComponentsDialog),
map((action) => action.request),
concatLatestFrom(() => this.store.select(selectCurrentProcessGroupId)),
switchMap(([request, currentProcessGroupId]) =>
switchMap(([request]) =>
from(this.flowService.getParameterContexts()).pipe(
concatLatestFrom(() => this.store.select(selectCurrentParameterContext)),
map(([response, parameterContext]) => {
@ -659,7 +659,7 @@ export class FlowEffects {
this.actions$.pipe(
ofType(FlowActions.navigateToEditCurrentProcessGroup),
concatLatestFrom(() => this.store.select(selectCurrentProcessGroupId)),
tap(([action, processGroupId]) => {
tap(([, processGroupId]) => {
this.router.navigate(['/process-groups', processGroupId, 'edit']);
})
),
@ -887,7 +887,7 @@ export class FlowEffects {
};
editDialogReference.componentInstance.parameterContext = parameterContext;
editDialogReference.componentInstance.goToParameter = (parameter: string) => {
editDialogReference.componentInstance.goToParameter = () => {
const commands: string[] = ['/parameter-contexts', parameterContext.id];
goTo(commands, 'Parameter');
};
@ -954,7 +954,7 @@ export class FlowEffects {
})
);
}),
catchError((error) => {
catchError(() => {
// TODO handle error
return NEVER;
})
@ -1569,7 +1569,7 @@ export class FlowEffects {
return from(this.flowService.createSnippet(snippet)).pipe(
switchMap((response) => this.flowService.moveSnippet(response.snippet.id, request.groupId)),
map((response) => {
map(() => {
const deleteResponses: DeleteComponentResponse[] = [];
// prepare the delete responses with all requested components that are now deleted
@ -1598,7 +1598,7 @@ export class FlowEffects {
mergeMap(([requests, processGroupId]) => {
if (requests.length === 1) {
return from(this.flowService.deleteComponent(requests[0])).pipe(
map((response) => {
map(() => {
const deleteResponses: DeleteComponentResponse[] = [
{
id: requests[0].id,
@ -1670,7 +1670,7 @@ export class FlowEffects {
return from(this.flowService.createSnippet(snippet)).pipe(
switchMap((response) => this.flowService.deleteSnippet(response.snippet.id)),
map((response) => {
map(() => {
const deleteResponses: DeleteComponentResponse[] = [];
// prepare the delete responses with all requested components that are now deleted
@ -1733,8 +1733,8 @@ export class FlowEffects {
this.actions$.pipe(
ofType(FlowActions.leaveProcessGroup),
concatLatestFrom(() => this.store.select(selectParentProcessGroupId)),
filter(([action, parentProcessGroupId]) => parentProcessGroupId != null),
tap(([action, parentProcessGroupId]) => {
filter(([, parentProcessGroupId]) => parentProcessGroupId != null),
tap(([, parentProcessGroupId]) => {
this.router.navigate(['/process-groups', parentProcessGroupId]);
})
),
@ -1822,7 +1822,7 @@ export class FlowEffects {
this.actions$.pipe(
ofType(FlowActions.deselectAllComponents),
concatLatestFrom(() => this.store.select(selectCurrentProcessGroupId)),
switchMap(([action, processGroupId]) => {
switchMap(([, processGroupId]) => {
return of(FlowActions.navigateWithoutTransform({ url: ['/process-groups', processGroupId] }));
})
)

View File

@ -145,7 +145,7 @@ export const initialState: FlowState = {
export const flowReducer = createReducer(
initialState,
on(resetFlowState, (state) => ({
on(resetFlowState, () => ({
...initialState
})),
on(loadProcessGroup, (state, { request }) => ({
@ -307,7 +307,7 @@ export const flowReducer = createReducer(
...state,
skipTransform: skipTransform
})),
on(navigateWithoutTransform, (state, { url }) => ({
on(navigateWithoutTransform, (state) => ({
...state,
skipTransform: true
})),

View File

@ -89,7 +89,7 @@ export class ParameterEffects {
this.actions$.pipe(
ofType(ParameterActions.pollParameterContextUpdateRequest),
concatLatestFrom(() => this.store.select(selectUpdateRequest)),
switchMap(([action, updateRequest]) => {
switchMap(([, updateRequest]) => {
if (updateRequest) {
return from(this.parameterService.pollParameterContextUpdate(updateRequest.request)).pipe(
map((response) =>
@ -132,7 +132,7 @@ export class ParameterEffects {
stopPollingParameterContextUpdateRequest$ = createEffect(() =>
this.actions$.pipe(
ofType(ParameterActions.stopPollingParameterContextUpdateRequest),
switchMap((response) => of(ParameterActions.deleteParameterContextUpdateRequest()))
switchMap(() => of(ParameterActions.deleteParameterContextUpdateRequest()))
)
);
@ -140,7 +140,7 @@ export class ParameterEffects {
this.actions$.pipe(
ofType(ParameterActions.deleteParameterContextUpdateRequest),
concatLatestFrom(() => this.store.select(selectUpdateRequest)),
tap(([action, updateRequest]) => {
tap(([, updateRequest]) => {
if (updateRequest) {
this.parameterService.deleteParameterContextUpdate(updateRequest.request).subscribe();
}

View File

@ -31,7 +31,7 @@ export const initialState: ParameterState = {
export const parameterReducer = createReducer(
initialState,
on(submitParameterContextUpdateRequest, (state, { request }) => ({
on(submitParameterContextUpdateRequest, (state) => ({
...state,
saving: true
})),

View File

@ -203,7 +203,7 @@ export class QueueEffects {
this.actions$.pipe(
ofType(QueueActions.pollEmptyQueueRequest),
concatLatestFrom(() => this.store.select(selectDropRequestEntity).pipe(isDefinedAndNotNull())),
switchMap(([action, dropEntity]) => {
switchMap(([, dropEntity]) => {
return from(this.queueService.pollEmptyQueueRequest(dropEntity.dropRequest)).pipe(
map((response) =>
QueueActions.pollEmptyQueueRequestSuccess({
@ -229,14 +229,14 @@ export class QueueEffects {
ofType(QueueActions.pollEmptyQueueRequestSuccess),
map((action) => action.response),
filter((response) => response.dropEntity.dropRequest.finished),
switchMap((response) => of(QueueActions.stopPollingEmptyQueueRequest()))
switchMap(() => of(QueueActions.stopPollingEmptyQueueRequest()))
)
);
stopPollingEmptyQueueRequest$ = createEffect(() =>
this.actions$.pipe(
ofType(QueueActions.stopPollingEmptyQueueRequest),
switchMap((response) => of(QueueActions.deleteEmptyQueueRequest()))
switchMap(() => of(QueueActions.deleteEmptyQueueRequest()))
)
);
@ -244,7 +244,7 @@ export class QueueEffects {
this.actions$.pipe(
ofType(QueueActions.deleteEmptyQueueRequest),
concatLatestFrom(() => this.store.select(selectDropRequestEntity).pipe(isDefinedAndNotNull())),
switchMap(([action, dropEntity]) => {
switchMap(([, dropEntity]) => {
this.dialog.closeAll();
return from(this.queueService.deleteEmptyQueueRequest(dropEntity.dropRequest)).pipe(
@ -255,7 +255,7 @@ export class QueueEffects {
}
})
),
catchError((error) =>
catchError(() =>
of(
QueueActions.showEmptyQueueResults({
request: {
@ -282,7 +282,7 @@ export class QueueEffects {
const dropRequest: DropRequest = request.dropEntity.dropRequest;
const droppedTokens: string[] = dropRequest.dropped.split(/ \/ /);
let message: string = `${droppedTokens[0]} FlowFiles (${droppedTokens[1]})`;
let message = `${droppedTokens[0]} FlowFiles (${droppedTokens[1]})`;
if (dropRequest.percentCompleted < 100) {
const originalTokens: string[] = dropRequest.original.split(/ \/ /);
@ -334,7 +334,7 @@ export class QueueEffects {
() =>
this.actions$.pipe(
ofType(QueueActions.queueApiError),
tap((action) => this.dialog.closeAll())
tap(() => this.dialog.closeAll())
),
{ dispatch: false }
);

View File

@ -59,7 +59,7 @@ export const queueReducer = createReducer(
error,
status: 'error' as const
})),
on(resetQueueState, (state) => ({
on(resetQueueState, () => ({
...initialState
}))
);

View File

@ -66,7 +66,7 @@ export class TransformEffects {
this.actions$.pipe(
ofType(TransformActions.restoreViewport),
concatLatestFrom(() => this.store.select(selectCurrentProcessGroupId)),
tap(([action, processGroupId]) => {
tap(([, processGroupId]) => {
try {
// see if we can restore the view position from storage
const name: string = TransformEffects.VIEW_PREFIX + processGroupId;

View File

@ -24,7 +24,7 @@ export const INITIAL_TRANSLATE = {
y: 0
};
export const INITIAL_SCALE: number = 1;
export const INITIAL_SCALE = 1;
export const initialState: CanvasTransform = {
translate: INITIAL_TRANSLATE,

View File

@ -118,7 +118,7 @@ export class Canvas implements OnInit, OnDestroy {
concatLatestFrom(() => this.store.select(selectSkipTransform)),
takeUntilDestroyed()
)
.subscribe(([status, skipTransform]) => {
.subscribe(([, skipTransform]) => {
if (skipTransform) {
this.store.dispatch(setSkipTransform({ skipTransform: false }));
} else {
@ -136,7 +136,7 @@ export class Canvas implements OnInit, OnDestroy {
concatLatestFrom(() => this.store.select(selectSkipTransform)),
takeUntilDestroyed()
)
.subscribe(([selectedComponent, skipTransform]) => {
.subscribe(([, skipTransform]) => {
if (skipTransform) {
this.store.dispatch(setSkipTransform({ skipTransform: false }));
} else {
@ -154,7 +154,7 @@ export class Canvas implements OnInit, OnDestroy {
concatLatestFrom(() => this.store.select(selectSkipTransform)),
takeUntilDestroyed()
)
.subscribe(([ids, skipTransform]) => {
.subscribe(([, skipTransform]) => {
if (skipTransform) {
this.store.dispatch(setSkipTransform({ skipTransform: false }));
} else {
@ -350,10 +350,7 @@ export class Canvas implements OnInit, OnDestroy {
.attr('result', 'offsetBlur');
// color/opacity
componentDropShadowFilter
.append('feFlood')
.attr('flood-opacity', 0.4)
.attr('result', 'offsetColor');
componentDropShadowFilter.append('feFlood').attr('flood-opacity', 0.4).attr('result', 'offsetColor');
// combine
componentDropShadowFilter
@ -391,10 +388,7 @@ export class Canvas implements OnInit, OnDestroy {
.attr('result', 'offsetBlur');
// color/opacity
connectionFullDropShadowFilter
.append('feFlood')
.attr('flood-opacity', 1)
.attr('result', 'offsetColor');
connectionFullDropShadowFilter.append('feFlood').attr('flood-opacity', 1).attr('result', 'offsetColor');
// combine
connectionFullDropShadowFilter

View File

@ -17,7 +17,6 @@
import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { CanvasState } from '../../../state';
import {
selectBreadcrumbs,
selectNavigationCollapsed,
@ -27,10 +26,7 @@ import { NavigationControl } from './navigation-control/navigation-control.compo
import { OperationControl } from './operation-control/operation-control.component';
import { AsyncPipe } from '@angular/common';
import { NiFiState } from '../../../../../state';
import {
selectFlowConfiguration,
selectSupportsManagedAuthorizer
} from '../../../../../state/flow-configuration/flow-configuration.selectors';
import { selectSupportsManagedAuthorizer } from '../../../../../state/flow-configuration/flow-configuration.selectors';
@Component({
selector: 'graph-controls',

View File

@ -223,7 +223,7 @@ export class OperationControl {
const selectionData = selection.datum();
const componentType: ComponentType = selectionData.type;
let resource: string = 'process-groups';
let resource = 'process-groups';
switch (componentType) {
case ComponentType.Processor:
resource = 'processors';

View File

@ -37,12 +37,10 @@ export class FlowStatus {
@Input() clusterSummary: ClusterSummary = initialState.clusterSummary;
@Input() bulletins: BulletinEntity[] = initialState.controllerBulletins.bulletins;
@Input() currentProcessGroupId: string = initialState.id;
@Input() loadingStatus: boolean = false;
@Input() loadingStatus = false;
protected readonly BulletinsTip = BulletinsTip;
constructor() {}
hasTerminatedThreads(): boolean {
return this.controllerStatus.terminatedThreadCount > 0;
}

View File

@ -24,7 +24,7 @@
(mouseleave)="mouseLeave()"
cdkDrag
cdkDragBoundary="body"
(cdkDragStarted)="onDragStarted($event)"
(cdkDragStarted)="onDragStarted()"
(cdkDragEnded)="onDragEnded($event)">
<span class="h-1 absolute left-[3px] right-[3px] bottom-0.5 component-button-grip"></span>
</button>

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Component, Input, OnInit } from '@angular/core';
import { CdkDrag, CdkDragEnd, CdkDragStart } from '@angular/cdk/drag-drop';
import { Component, Input } from '@angular/core';
import { CdkDrag, CdkDragEnd } from '@angular/cdk/drag-drop';
import { Store } from '@ngrx/store';
import { CanvasState } from '../../../../state';
import { INITIAL_SCALE, INITIAL_TRANSLATE } from '../../../../state/transform/transform.reducer';
@ -35,14 +35,14 @@ import { ComponentType } from '../../../../../../state/shared';
imports: [CdkDrag],
styleUrls: ['./new-canvas-item.component.scss']
})
export class NewCanvasItem implements OnInit {
export class NewCanvasItem {
@Input() type!: ComponentType;
@Input() iconClass: string = '';
@Input() iconHoverClass: string = '';
@Input() iconClass = '';
@Input() iconHoverClass = '';
dragging: boolean = false;
dragging = false;
private hovering: boolean = false;
private hovering = false;
private scale: number = INITIAL_SCALE;
private translate: Position = INITIAL_TRANSLATE;
@ -67,8 +67,6 @@ export class NewCanvasItem implements OnInit {
});
}
ngOnInit(): void {}
mouseEnter() {
this.hovering = true;
}
@ -81,7 +79,7 @@ export class NewCanvasItem implements OnInit {
return this.hovering && !this.dragging;
}
onDragStarted(event: CdkDragStart): void {
onDragStarted(): void {
this.store.dispatch(
setDragging({
dragging: true

View File

@ -27,8 +27,6 @@ import {
OriginConnectionPosition,
OverlayConnectionPosition
} from '@angular/cdk/overlay';
import { Store } from '@ngrx/store';
import { CanvasState } from '../../../../state';
import { ComponentType } from '../../../../../../state/shared';
import { NgForOf, NgIf, NgTemplateOutlet } from '@angular/common';
import { RouterLink } from '@angular/router';
@ -58,10 +56,10 @@ export class Search implements OnInit {
public positions: ConnectionPositionPair[] = [this.position];
searchForm: FormGroup;
searchInputVisible: boolean = false;
searchInputVisible = false;
searching: boolean = false;
searchingResultsVisible: boolean = false;
searching = false;
searchingResultsVisible = false;
processorResults: ComponentSearchResult[] = [];
connectionResults: ComponentSearchResult[] = [];

View File

@ -132,8 +132,8 @@ export class CreateConnection {
childOutputPorts$!: Observable<any> | null;
childInputPorts$!: Observable<any> | null;
loadBalancePartitionAttributeRequired: boolean = false;
loadBalanceCompressionRequired: boolean = false;
loadBalancePartitionAttributeRequired = false;
loadBalanceCompressionRequired = false;
constructor(
@Inject(MAT_DIALOG_DATA) private dialogRequest: CreateConnectionDialogRequest,

View File

@ -25,6 +25,4 @@ import { Component, Input } from '@angular/core';
})
export class DestinationFunnel {
@Input() groupName!: string;
constructor() {}
}

View File

@ -83,8 +83,8 @@ export class DestinationProcessGroup implements ControlValueAccessor {
protected readonly TextTip = TextTip;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (outputPort: string) => void;
@ -92,10 +92,8 @@ export class DestinationProcessGroup implements ControlValueAccessor {
inputPortItems!: SelectOption[];
selectedInputPort!: string;
noPorts: boolean = false;
hasUnauthorizedPorts: boolean = false;
constructor() {}
noPorts = false;
hasUnauthorizedPorts = false;
registerOnChange(onChange: (selectedInputPort: string) => void): void {
this.onChange = onChange;

View File

@ -72,8 +72,8 @@ export class DestinationRemoteProcessGroup implements ControlValueAccessor {
protected readonly TextTip = TextTip;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (outputPort: string) => void;
@ -81,9 +81,7 @@ export class DestinationRemoteProcessGroup implements ControlValueAccessor {
inputPortItems!: SelectOption[];
selectedInputPort!: string;
noPorts: boolean = false;
constructor() {}
noPorts = false;
registerOnChange(onChange: (selectedInputPort: string) => void): void {
this.onChange = onChange;

View File

@ -160,9 +160,9 @@ export class EditConnectionComponent {
childOutputPorts$!: Observable<any> | null;
childInputPorts$!: Observable<any> | null;
loadBalancePartitionAttributeRequired: boolean = false;
loadBalancePartitionAttributeRequired = false;
initialPartitionAttribute: string;
loadBalanceCompressionRequired: boolean = false;
loadBalanceCompressionRequired = false;
initialCompression: string;
constructor(

View File

@ -73,8 +73,8 @@ export class Prioritizers implements ControlValueAccessor {
protected readonly TextTip = TextTip;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (selectedPrioritizers: string[]) => void;

View File

@ -25,6 +25,4 @@ import { Component, Input } from '@angular/core';
})
export class SourceFunnel {
@Input() groupName!: string;
constructor() {}
}

View File

@ -86,8 +86,8 @@ export class SourceProcessGroup implements ControlValueAccessor {
protected readonly TextTip = TextTip;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (outputPort: string) => void;
@ -95,10 +95,8 @@ export class SourceProcessGroup implements ControlValueAccessor {
outputPortItems!: SelectOption[];
selectedOutputPort!: string;
noPorts: boolean = false;
hasUnauthorizedPorts: boolean = false;
constructor() {}
noPorts = false;
hasUnauthorizedPorts = false;
registerOnChange(onChange: (selectedOutputPort: string) => void): void {
this.onChange = onChange;

View File

@ -51,8 +51,8 @@ export class SourceProcessor implements ControlValueAccessor {
}
@Input() groupName!: string;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (selectedRelationships: string[]) => void;
@ -62,8 +62,6 @@ export class SourceProcessor implements ControlValueAccessor {
relationshipItems!: RelationshipItem[];
selectedRelationships!: string[];
constructor() {}
processRelationships(): void {
if (this.relationships && this.selectedRelationships) {
this.relationshipItems = this.relationships.map((relationship) => {

View File

@ -74,8 +74,8 @@ export class SourceRemoteProcessGroup implements ControlValueAccessor {
protected readonly TextTip = TextTip;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (outputPort: string) => void;
@ -83,9 +83,7 @@ export class SourceRemoteProcessGroup implements ControlValueAccessor {
outputPortItems!: SelectOption[];
selectedOutputPort!: string;
noPorts: boolean = false;
constructor() {}
noPorts = false;
registerOnChange(onChange: (selectedOutputPort: string) => void): void {
this.onChange = onChange;

View File

@ -61,7 +61,7 @@ export class CreatePort {
protected readonly TextTip = TextTip;
createPortForm: FormGroup;
isRootProcessGroup: boolean = false;
isRootProcessGroup = false;
portTypeLabel: string;
allowRemoteAccessOptions: SelectOption[] = [

View File

@ -25,7 +25,7 @@ describe('EditProcessGroup', () => {
let component: EditProcessGroup;
let fixture: ComponentFixture<EditProcessGroup>;
const parameterContextId: string = '95d509b9-018b-1000-daff-b7957ea7934f';
const parameterContextId = '95d509b9-018b-1000-daff-b7957ea7934f';
const data: any = {
type: 'ProcessGroup',
uri: 'https://localhost:4200/nifi-api/process-groups/162380af-018c-1000-a7eb-f5d06f77168b',

View File

@ -194,7 +194,7 @@ export class EditProcessGroup {
}
submitForm() {
let updateStrategy: string = 'DIRECT_CHILDREN';
let updateStrategy = 'DIRECT_CHILDREN';
if (this.editProcessGroupForm.get('applyParameterContextRecursively')?.value) {
updateStrategy = 'ALL_DESCENDANTS';
}

View File

@ -70,8 +70,8 @@ export class RelationshipSettings implements ControlValueAccessor {
maxBackoffPeriod!: string;
retryCount!: number;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (relationshipConfiguration: RelationshipConfiguration) => void;

View File

@ -37,13 +37,11 @@ export class RunDurationSlider implements ControlValueAccessor {
runDurationValues: number[] = [0, 25, 50, 100, 250, 500, 1000, 2000];
runDurationIndex!: number;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (runDuration: number) => void;
constructor() {}
registerOnChange(onChange: (runDuration: number) => void): void {
this.onChange = onChange;
}

View File

@ -32,7 +32,7 @@ export class Breadcrumbs {
@Input() entity: BreadcrumbEntity = initialState.flow.processGroupFlow.breadcrumb;
@Input() currentProcessGroupId: string = initialState.id;
private scrolledToProcessGroupId: string = '';
private scrolledToProcessGroupId = '';
@ViewChild('currentProcessGroup') set currentProcessGroupBreadcrumb(currentProcessGroupBreadcrumb: ElementRef) {
// only auto scroll to the breadcrumb for the current pg once as the user may have manually scrolled since

View File

@ -24,8 +24,8 @@ import { VersionControlInformation, VersionControlTipInput } from '../../../../s
styleUrls: ['./version-control-tip.component.scss']
})
export class VersionControlTip {
@Input() left: number = 0;
@Input() top: number = 0;
@Input() left = 0;
@Input() top = 0;
@Input() data: VersionControlTipInput | undefined;
getTrackingMessage(): string {

View File

@ -25,7 +25,7 @@ import { FlowState } from '../../../state/flow';
import { selectCurrentProcessGroupId } from '../../../state/flow/flow.selectors';
import { initialState } from '../../../state/flow/flow.reducer';
export const rootGroupGuard: CanActivateFn = (route, state) => {
export const rootGroupGuard: CanActivateFn = () => {
const router: Router = inject(Router);
const flowService: FlowService = inject(FlowService);
const store: Store<CurrentUserState> = inject(Store<FlowState>);

View File

@ -16,7 +16,7 @@
*/
import { Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { Client } from '../../../service/client.service';
import { NiFiCommon } from '../../../service/nifi-common.service';

View File

@ -16,7 +16,6 @@
*/
import {
AffectedComponentEntity,
ParameterContextReferenceEntity,
ParameterContextUpdateRequestEntity,
ParameterEntity,

View File

@ -370,7 +370,7 @@ export class ParameterContextListingEffects {
this.actions$.pipe(
ofType(ParameterContextListingActions.pollParameterContextUpdateRequest),
concatLatestFrom(() => this.store.select(selectUpdateRequest)),
switchMap(([action, updateRequest]) => {
switchMap(([, updateRequest]) => {
if (updateRequest) {
return from(this.parameterContextService.pollParameterContextUpdate(updateRequest.request)).pipe(
map((response) =>
@ -413,7 +413,7 @@ export class ParameterContextListingEffects {
stopPollingParameterContextUpdateRequest$ = createEffect(() =>
this.actions$.pipe(
ofType(ParameterContextListingActions.stopPollingParameterContextUpdateRequest),
switchMap((response) => of(ParameterContextListingActions.deleteParameterContextUpdateRequest()))
switchMap(() => of(ParameterContextListingActions.deleteParameterContextUpdateRequest()))
)
);
@ -422,7 +422,7 @@ export class ParameterContextListingEffects {
this.actions$.pipe(
ofType(ParameterContextListingActions.deleteParameterContextUpdateRequest),
concatLatestFrom(() => this.store.select(selectUpdateRequest)),
tap(([action, updateRequest]) => {
tap(([, updateRequest]) => {
if (updateRequest) {
this.parameterContextService.deleteParameterContextUpdate(updateRequest.request).subscribe();
}

View File

@ -60,7 +60,7 @@ export const parameterContextListingReducer = createReducer(
error,
status: 'error' as const
})),
on(createParameterContext, (state, { request }) => ({
on(createParameterContext, (state) => ({
...state,
saving: true
})),
@ -70,7 +70,7 @@ export const parameterContextListingReducer = createReducer(
draftState.saving = false;
});
}),
on(submitParameterContextUpdateRequest, (state, { request }) => ({
on(submitParameterContextUpdateRequest, (state) => ({
...state,
saving: true
})),
@ -78,7 +78,7 @@ export const parameterContextListingReducer = createReducer(
...state,
updateRequestEntity: response.requestEntity
})),
on(editParameterContextComplete, (state, {}) => {
on(editParameterContextComplete, (state) => {
return produce(state, (draftState) => {
const updateRequestEntity: ParameterContextUpdateRequestEntity | null = draftState.updateRequestEntity;

View File

@ -76,8 +76,8 @@ export class ParameterContextInheritance implements ControlValueAccessor {
protected readonly TextTip = TextTip;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (inheritedParameterContexts: ParameterContextReferenceEntity[]) => void;

View File

@ -76,8 +76,8 @@ export class ParameterTable implements AfterViewInit, ControlValueAccessor {
dataSource: MatTableDataSource<ParameterItem> = new MatTableDataSource<ParameterItem>();
selectedItem: ParameterItem | null = null;
isDisabled: boolean = false;
isTouched: boolean = false;
isDisabled = false;
isTouched = false;
onTouched!: () => void;
onChange!: (parameters: ParameterEntity[]) => void;
@ -92,7 +92,7 @@ export class ParameterTable implements AfterViewInit, ControlValueAccessor {
}
initFilter(): void {
this.dataSource.filterPredicate = (data: ParameterItem, filter: string) => this.isVisible(data);
this.dataSource.filterPredicate = (data: ParameterItem) => this.isVisible(data);
this.dataSource.filter = ' ';
}

View File

@ -52,8 +52,6 @@ export class ProcessGroupReferences {
authorizedProcessGroupReferences: BoundProcessGroup[] = [];
unauthorizedProcessGroupReferences: BoundProcessGroup[] = [];
constructor() {}
private getUnauthorized(references: BoundProcessGroup[] | undefined) {
if (references) {
return references.filter((reference) => !reference.permissions.canRead);

View File

@ -22,8 +22,6 @@ import { provideMockStore } from '@ngrx/store/testing';
import { RouterModule } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { initialState } from '../state/provenance-event-listing/provenance-event-listing.reducer';
import { Navigation } from '../../../ui/common/navigation/navigation.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { Component } from '@angular/core';
describe('Provenance', () => {

View File

@ -55,7 +55,7 @@ export class ProvenanceService {
}
downloadContent(id: string, direction: string): void {
let dataUri: string = `${ProvenanceService.API}/provenance-events/${encodeURIComponent(
let dataUri = `${ProvenanceService.API}/provenance-events/${encodeURIComponent(
id
)}/content/${encodeURIComponent(direction)}`;
@ -73,9 +73,7 @@ export class ProvenanceService {
viewContent(nifiUrl: string, contentViewerUrl: string, id: string, direction: string): void {
// build the uri to the data
let dataUri: string = `${nifiUrl}provenance-events/${encodeURIComponent(id)}/content/${encodeURIComponent(
direction
)}`;
let dataUri = `${nifiUrl}provenance-events/${encodeURIComponent(id)}/content/${encodeURIComponent(direction)}`;
const dataUriParameters: any = {};

View File

@ -101,7 +101,7 @@ export class LineageEffects {
this.actions$.pipe(
ofType(LineageActions.pollLineageQuery),
concatLatestFrom(() => [this.store.select(selectLineageId), this.store.select(selectClusterNodeId)]),
switchMap(([action, id, clusterNodeId]) => {
switchMap(([, id, clusterNodeId]) => {
if (id) {
return from(this.provenanceService.getLineageQuery(id, clusterNodeId)).pipe(
map((response) =>
@ -145,7 +145,7 @@ export class LineageEffects {
stopPollingLineageQuery$ = createEffect(() =>
this.actions$.pipe(
ofType(LineageActions.stopPollingLineageQuery),
switchMap((response) => of(LineageActions.deleteLineageQuery()))
switchMap(() => of(LineageActions.deleteLineageQuery()))
)
);
@ -154,7 +154,7 @@ export class LineageEffects {
this.actions$.pipe(
ofType(LineageActions.deleteLineageQuery),
concatLatestFrom(() => [this.store.select(selectLineageId), this.store.select(selectClusterNodeId)]),
tap(([action, id, clusterNodeId]) => {
tap(([, id, clusterNodeId]) => {
if (id) {
this.provenanceService.deleteLineageQuery(id, clusterNodeId).subscribe();
}

View File

@ -33,7 +33,7 @@ export const initialState: LineageState = {
export const lineageReducer = createReducer(
initialState,
on(resetLineage, (state) => ({
on(resetLineage, () => ({
...initialState
})),
on(submitLineageQuery, (state) => ({

View File

@ -51,7 +51,7 @@ export class ProvenanceEventListingEffects {
loadProvenanceOptions$ = createEffect(() =>
this.actions$.pipe(
ofType(ProvenanceEventListingActions.loadProvenanceOptions),
switchMap((request) =>
switchMap(() =>
from(this.provenanceService.getSearchOptions()).pipe(
map((response) =>
ProvenanceEventListingActions.loadProvenanceOptionsSuccess({
@ -157,7 +157,7 @@ export class ProvenanceEventListingEffects {
this.actions$.pipe(
ofType(ProvenanceEventListingActions.pollProvenanceQuery),
concatLatestFrom(() => [this.store.select(selectProvenanceId), this.store.select(selectClusterNodeId)]),
switchMap(([action, id, clusterNodeId]) => {
switchMap(([, id, clusterNodeId]) => {
if (id) {
return from(this.provenanceService.getProvenanceQuery(id, clusterNodeId)).pipe(
map((response) =>
@ -201,7 +201,7 @@ export class ProvenanceEventListingEffects {
stopPollingProvenanceQuery$ = createEffect(() =>
this.actions$.pipe(
ofType(ProvenanceEventListingActions.stopPollingProvenanceQuery),
switchMap((response) => of(ProvenanceEventListingActions.deleteProvenanceQuery()))
switchMap(() => of(ProvenanceEventListingActions.deleteProvenanceQuery()))
)
);
@ -210,7 +210,7 @@ export class ProvenanceEventListingEffects {
this.actions$.pipe(
ofType(ProvenanceEventListingActions.deleteProvenanceQuery),
concatLatestFrom(() => [this.store.select(selectProvenanceId), this.store.select(selectClusterNodeId)]),
tap(([action, id, clusterNodeId]) => {
tap(([, id, clusterNodeId]) => {
if (id) {
this.provenanceService.deleteProvenanceQuery(id, clusterNodeId).subscribe();
}
@ -229,7 +229,7 @@ export class ProvenanceEventListingEffects {
this.store.select(selectProvenanceRequest),
this.store.select(selectAbout)
]),
tap(([request, timeOffset, options, currentRequest, about]) => {
tap(([, timeOffset, options, currentRequest, about]) => {
if (about) {
const dialogReference = this.dialog.open(ProvenanceSearchDialog, {
data: {
@ -321,7 +321,7 @@ export class ProvenanceEventListingEffects {
});
});
},
error: (error) => {
error: () => {
// TODO - handle error
}
});

View File

@ -39,7 +39,7 @@ export const initialState: ProvenanceEventListingState = {
export const provenanceEventListingReducer = createReducer(
initialState,
on(resetProvenanceState, (state) => ({
on(resetProvenanceState, () => ({
...initialState
})),
on(loadProvenanceOptionsSuccess, (state, { response }) => ({

View File

@ -44,7 +44,6 @@ import {
saveProvenanceRequest
} from '../../state/provenance-event-listing/provenance-event-listing.actions';
import { ProvenanceSearchDialog } from './provenance-search-dialog/provenance-search-dialog.component';
import { ProvenanceEventSummary } from '../../../../state/shared';
import { resetLineage, submitLineageQuery } from '../../state/lineage/lineage.actions';
import { LineageRequest } from '../../state/lineage';
import { selectLineage } from '../../state/lineage/lineage.selectors';
@ -61,7 +60,7 @@ export class ProvenanceEventListing implements OnDestroy {
lineage$ = this.store.select(selectLineage);
request!: ProvenanceRequest;
stateReset: boolean = false;
stateReset = false;
constructor(private store: Store<ProvenanceEventListingState>) {
this.store

View File

@ -18,8 +18,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LineageComponent } from './lineage.component';
import SpyObj = jasmine.SpyObj;
import createSpyObj = jasmine.createSpyObj;
describe('LineageComponent', () => {
let component: LineageComponent;

View File

@ -51,8 +51,8 @@ export class LineageComponent implements OnInit {
@Input() set eventTimestampThreshold(eventTimestampThreshold: number) {
if (this.previousEventTimestampThreshold >= 0) {
let nodes: any = this.lineageContainerElement.selectAll('g.node.rendered');
let links: any = this.lineageContainerElement.selectAll('path.link.rendered');
const nodes: any = this.lineageContainerElement.selectAll('g.node.rendered');
const links: any = this.lineageContainerElement.selectAll('path.link.rendered');
if (this.previousEventTimestampThreshold > eventTimestampThreshold) {
// the threshold is descending
@ -123,7 +123,7 @@ export class LineageComponent implements OnInit {
},
clazz: 'fa fa-long-arrow-left',
text: 'Back to events',
action: (selection: any) => {
action: () => {
this.closeLineage.next();
}
},
@ -226,7 +226,7 @@ export class LineageComponent implements OnInit {
private nodeLookup: Map<string, any> = new Map<string, any>();
private linkLookup: Map<string, any> = new Map<string, any>();
private previousEventTimestampThreshold: number = -1;
private previousEventTimestampThreshold = -1;
constructor() {
this.allMenus = new Map<string, ContextMenuDefinition>();
@ -247,7 +247,7 @@ export class LineageComponent implements OnInit {
// include if there is no condition (non conditional item, separator, sub menu, etc)
return true;
},
menuItemClicked(menuItem: ContextMenuItemDefinition, event: MouseEvent) {
menuItemClicked(menuItem: ContextMenuItemDefinition) {
if (menuItem.action) {
const selection: any = d3.select('circle.context');
return menuItem.action(selection);
@ -257,7 +257,6 @@ export class LineageComponent implements OnInit {
}
ngOnInit(): void {
const self: LineageComponent = this;
this.lineageElement = document.getElementById('lineage');
// handle zoom behavior
@ -283,9 +282,9 @@ export class LineageComponent implements OnInit {
.attr('class', 'lineage')
.attr('width', '100%')
.attr('height', '100%')
.on('mousedown', function (event, d) {
.on('mousedown', (event) => {
// hide the context menu if necessary
self.clearSelectionContext();
this.clearSelectionContext();
// prevents browser from using text cursor
event.preventDefault();
@ -385,7 +384,7 @@ export class LineageComponent implements OnInit {
let immediate: string[] = Array.from(immediateSet.values());
// attempt to identify fan in/out cases
let nodesWithTwoParents: number = 0;
let nodesWithTwoParents = 0;
immediate.forEach((nodeId) => {
const node: any = this.nodeLookup.get(nodeId);
@ -552,7 +551,7 @@ export class LineageComponent implements OnInit {
});
// mark each nodes index so subsequent recursive calls can position children accordingly
let nodesWithTwoChildren: number = 0;
let nodesWithTwoChildren = 0;
immediate.forEach((nodeId: string, i: number) => {
const node: any = this.nodeLookup.get(nodeId);
node.index = i;
@ -593,7 +592,7 @@ export class LineageComponent implements OnInit {
// add the new links
links.forEach((link) => {
const linkId: string = `${link.sourceId}-${link.targetId}`;
const linkId = `${link.sourceId}-${link.targetId}`;
// create the link object
this.linkLookup.set(linkId, {
@ -614,13 +613,13 @@ export class LineageComponent implements OnInit {
const startNodes: Set<string> = new Set(this.nodeLookup.keys());
// go through the nodes to reset their outgoing links
this.nodeLookup.forEach(function (node, id) {
this.nodeLookup.forEach((node) => {
node.outgoing = [];
node.incoming = [];
});
// go through the links in order to compute the new layout
this.linkLookup.forEach(function (link, id) {
this.linkLookup.forEach((link) => {
// updating the nodes connections
link.source.outgoing.push(link);
link.target.incoming.push(link);
@ -713,10 +712,8 @@ export class LineageComponent implements OnInit {
}
private renderFlowFile(flowfiles: any): void {
const self: LineageComponent = this;
flowfiles.classed('flowfile', true).on('mousedown', function (event: MouseEvent, d: any) {
self.clearSelectionContext();
flowfiles.classed('flowfile', true).on('mousedown', (event: MouseEvent) => {
this.clearSelectionContext();
event.stopPropagation();
});
@ -726,25 +723,25 @@ export class LineageComponent implements OnInit {
.attr('class', 'flowfile-link')
.attr('r', 16)
.attr('stroke-width', 1.0)
.on('mouseover', function (event: MouseEvent, d: any) {
self.lineageContainerElement
.on('mouseover', (event: MouseEvent, d: any) => {
this.lineageContainerElement
.selectAll('path.link')
.filter(function (linkDatum: any) {
.filter((linkDatum: any) => {
return d.id === linkDatum.flowFileUuid;
})
.classed('selected', true)
.attr('marker-end', function (d: any) {
.attr('marker-end', (d: any) => {
return `url(#${d.target.type}-SELECTED)`;
});
})
.on('mouseout', function (event: MouseEvent, d: any) {
self.lineageContainerElement
.on('mouseout', (event: MouseEvent, d: any) => {
this.lineageContainerElement
.selectAll('path.link')
.filter(function (linkDatum: any) {
.filter((linkDatum: any) => {
return d.id === linkDatum.flowFileUuid;
})
.classed('selected', false)
.attr('marker-end', function (d: any) {
.attr('marker-end', (d: any) => {
return `url(#${d.target.type})`;
});
});
@ -761,25 +758,25 @@ export class LineageComponent implements OnInit {
.attr('transform', function () {
return 'translate(0,15)';
})
.on('mouseover', function (event: MouseEvent, d: any) {
self.lineageContainerElement
.on('mouseover', (event: MouseEvent, d: any) => {
this.lineageContainerElement
.selectAll('path.link')
.filter(function (linkDatum: any) {
.filter((linkDatum: any) => {
return d.id === linkDatum.flowFileUuid;
})
.classed('selected', true)
.attr('marker-end', function (d: any) {
.attr('marker-end', (d: any) => {
return `url(#${d.target.type}-SELECTED)`;
});
})
.on('mouseout', function (event: MouseEvent, d: any) {
self.lineageContainerElement
.on('mouseout', (event: MouseEvent, d: any) => {
this.lineageContainerElement
.selectAll('path.link')
.filter(function (linkDatum: any) {
.filter((linkDatum: any) => {
return d.id === linkDatum.flowFileUuid;
})
.classed('selected', false)
.attr('marker-end', function (d: any) {
.attr('marker-end', (d: any) => {
return `url(#${d.target.type})`;
});
})
@ -789,18 +786,16 @@ export class LineageComponent implements OnInit {
}
private renderEvent(events: any): void {
const self: LineageComponent = this;
events
.on('mousedown', function (event: MouseEvent, d: any) {
self.clearSelectionContext();
.on('mousedown', (event: MouseEvent, d: any) => {
this.clearSelectionContext();
d3.select(`#event-node-${d.id}`).classed('context', true);
event.stopPropagation();
})
.on('dblclick', function (event: MouseEvent, d: any) {
.on('dblclick', (event: MouseEvent, d: any) => {
// show the event details
// TODO - cluster node id
self.openEventDialog.next({
this.openEventDialog.next({
id: d.id
});
});
@ -821,8 +816,8 @@ export class LineageComponent implements OnInit {
events
.append('circle')
.attr('class', 'event-circle')
.classed('selected', function (d: any) {
return d.id === self.eventId;
.classed('selected', (d: any) => {
return d.id === this.eventId;
})
.attr('r', 8)
.attr('stroke-width', 1.0)
@ -941,7 +936,7 @@ export class LineageComponent implements OnInit {
.remove();
// select the links
let linkSelection: any = this.lineageContainerElement
const linkSelection: any = this.lineageContainerElement
.selectAll('path.link')
.data(this.linkLookup.values(), function (d: any) {
return d.id;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { AfterViewInit, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
import { MatSortModule, Sort } from '@angular/material/sort';
import { TextTip } from '../../../../../ui/common/tooltips/text-tip/text-tip.component';
@ -89,17 +89,19 @@ export class ProvenanceEventTable implements AfterViewInit {
}
}
}
@Input() oldestEventAvailable!: string;
@Input() timeOffset!: number;
@Input() resultsMessage!: string;
@Input() hasRequest!: boolean;
@Input() loading!: boolean;
@Input() loadedTimestamp!: string;
@Input() set lineage$(lineage$: Observable<Lineage | null>) {
this.provenanceLineage$ = lineage$.pipe(
tap((lineage) => {
let minMillis: number = -1;
let maxMillis: number = -1;
let minMillis = -1;
let maxMillis = -1;
lineage?.results.nodes.forEach((node) => {
// ensure this event has an event time
@ -121,7 +123,7 @@ export class ProvenanceEventTable implements AfterViewInit {
// determine the range for the slider
let range: number = this.maxEventTimestamp - this.minEventTimestamp;
const binCount: number = 10;
const binCount = 10;
const remainder: number = range % binCount;
if (remainder > 0) {
// if the range doesn't fall evenly into binCount, increase the
@ -174,19 +176,19 @@ export class ProvenanceEventTable implements AfterViewInit {
filterForm: FormGroup;
filterColumnOptions: string[] = ['component name', 'component type', 'type'];
totalCount: number = 0;
filteredCount: number = 0;
filterApplied: boolean = false;
totalCount = 0;
filteredCount = 0;
filterApplied = false;
showLineage: boolean = false;
showLineage = false;
provenanceLineage$!: Observable<Lineage | null>;
eventId: string | null = null;
minEventTimestamp: number = -1;
maxEventTimestamp: number = -1;
eventTimestampStep: number = 1;
initialEventTimestampThreshold: number = 0;
currentEventTimestampThreshold: number = 0;
minEventTimestamp = -1;
maxEventTimestamp = -1;
eventTimestampStep = 1;
initialEventTimestampThreshold = 0;
currentEventTimestampThreshold = 0;
constructor(
private formBuilder: FormBuilder,
@ -223,7 +225,7 @@ export class ProvenanceEventTable implements AfterViewInit {
return data.sort((a, b) => {
const isAsc = sort.direction === 'asc';
let retVal: number = 0;
let retVal = 0;
switch (sort.active) {
case 'eventTime':
// event ideas are increasing, so we can use this simple number for sorting purposes

View File

@ -69,8 +69,8 @@ export class ProvenanceSearchDialog {
let startTime: string = ProvenanceSearchDialog.DEFAULT_START_TIME;
let endDate: Date = now;
let endTime: string = ProvenanceSearchDialog.DEFAULT_END_TIME;
let minFileSize: string = '';
let maxFileSize: string = '';
let minFileSize = '';
let maxFileSize = '';
if (request.currentRequest) {
const requestedStartDate = request.currentRequest.startDate;
@ -117,8 +117,8 @@ export class ProvenanceSearchDialog {
const searchableFields: SearchableField[] = request.options.searchableFields;
searchableFields.forEach((searchableField) => {
let value: string = '';
let inverse: boolean = false;
let value = '';
let inverse = false;
if (searchTerms && searchTerms[searchableField.id]) {
value = searchTerms[searchableField.id].value;
inverse = searchTerms[searchableField.id].inverse;

View File

@ -18,7 +18,6 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { Queue } from './queue.component';
import { QueueListingRoutingModule } from '../ui/queue-listing/queue-listing-routing.module';
const routes: Routes = [
{

View File

@ -54,7 +54,7 @@ export class QueueService {
}
downloadContent(flowfileSummary: FlowFileSummary): void {
let dataUri: string = `${this.nifiCommon.stripProtocol(flowfileSummary.uri)}/content`;
let dataUri = `${this.nifiCommon.stripProtocol(flowfileSummary.uri)}/content`;
const queryParameters: any = {};
@ -70,7 +70,7 @@ export class QueueService {
viewContent(flowfileSummary: FlowFileSummary, contentViewerUrl: string): void {
// build the uri to the data
let dataUri: string = `${this.nifiCommon.stripProtocol(flowfileSummary.uri)}/content`;
let dataUri = `${this.nifiCommon.stripProtocol(flowfileSummary.uri)}/content`;
const dataUriParameters: any = {};

Some files were not shown because too many files have changed in this diff Show More