diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts index f826dc8175..771a616164 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts @@ -30,6 +30,7 @@ import { EditControllerService } from '../../../../ui/common/controller-service/ import { ComponentType, ControllerServiceReferencingComponent, + EditControllerServiceDialogRequest, UpdateControllerServiceRequest } from '../../../../state/shared'; import { Router } from '@angular/router'; @@ -196,6 +197,30 @@ export class ControllerServicesEffects { this.actions$.pipe( ofType(ControllerServicesActions.openConfigureControllerServiceDialog), map((action) => action.request), + concatLatestFrom(() => this.store.select(selectCurrentProcessGroupId)), + switchMap(([request, processGroupId]) => + from(this.propertyTableHelperService.getComponentHistory(request.id)).pipe( + map((history) => { + return { + ...request, + history: history.componentHistory + } as EditControllerServiceDialogRequest; + }), + tap({ + error: (errorResponse: HttpErrorResponse) => { + this.store.dispatch( + ControllerServicesActions.selectControllerService({ + request: { + processGroupId, + id: request.id + } + }) + ); + this.store.dispatch(ErrorActions.snackBarError({ error: errorResponse.error })); + } + }) + ) + ), concatLatestFrom(() => [ this.store.select(selectParameterContext), this.store.select(selectCurrentProcessGroupId) @@ -205,9 +230,7 @@ export class ControllerServicesEffects { const editDialogReference = this.dialog.open(EditControllerService, { ...LARGE_DIALOG, - data: { - controllerService: request.controllerService - }, + data: request, id: serviceId }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts index dff3184311..6c43c18234 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts @@ -1102,11 +1102,15 @@ export class FlowEffects { ofType(FlowActions.openEditProcessorDialog), map((action) => action.request), switchMap((request) => - from(this.flowService.getProcessor(request.entity.id)).pipe( - map((entity) => { + combineLatest([ + this.flowService.getProcessor(request.entity.id), + this.propertyTableHelperService.getComponentHistory(request.entity.id) + ]).pipe( + map(([entity, history]) => { return { ...request, - entity + entity, + history: history.componentHistory }; }), tap({ diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/index.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/index.ts index 01e96fc0c3..092cab1e54 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/index.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/index.ts @@ -19,6 +19,7 @@ import { BreadcrumbEntity, Position } from '../shared'; import { BulletinEntity, Bundle, + ComponentHistory, ComponentType, DocumentedType, ParameterContextReferenceEntity, @@ -346,6 +347,7 @@ export interface EditComponentDialogRequest { type: ComponentType; uri: string; entity: any; + history?: ComponentHistory; } export interface EditRemotePortDialogRequest extends EditComponentDialogRequest { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html index 1aac444331..1aadd8c6ac 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html @@ -170,6 +170,7 @@ [parameterContext]="parameterContext" [convertToParameter]="convertToParameter" [goToService]="goToService" + [propertyHistory]="request.history" [supportsSensitiveDynamicProperties]=" request.entity.component.supportsSensitiveDynamicProperties "> diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/flow-analysis-rules/flow-analysis-rules.effects.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/flow-analysis-rules/flow-analysis-rules.effects.ts index ec1ed5f6aa..02af6d4809 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/flow-analysis-rules/flow-analysis-rules.effects.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/flow-analysis-rules/flow-analysis-rules.effects.ts @@ -31,7 +31,7 @@ import { Router } from '@angular/router'; import { selectSaving } from '../management-controller-services/management-controller-services.selectors'; import { UpdateControllerServiceRequest } from '../../../../state/shared'; import { EditFlowAnalysisRule } from '../../ui/flow-analysis-rules/edit-flow-analysis-rule/edit-flow-analysis-rule.component'; -import { CreateFlowAnalysisRuleSuccess } from './index'; +import { CreateFlowAnalysisRuleSuccess, EditFlowAnalysisRuleDialogRequest } from './index'; import { PropertyTableHelperService } from '../../../../service/property-table-helper.service'; import * as ErrorActions from '../../../../state/error/error.actions'; import { ErrorHelper } from '../../../../service/error-helper.service'; @@ -218,14 +218,38 @@ export class FlowAnalysisRulesEffects { this.actions$.pipe( ofType(FlowAnalysisRuleActions.openConfigureFlowAnalysisRuleDialog), map((action) => action.request), + switchMap((request) => + from(this.propertyTableHelperService.getComponentHistory(request.id)).pipe( + map((history) => { + return { + ...request, + history: history.componentHistory + } as EditFlowAnalysisRuleDialogRequest; + }), + tap({ + error: (errorResponse: HttpErrorResponse) => { + this.store.dispatch( + FlowAnalysisRuleActions.selectFlowAnalysisRule({ + request: { + id: request.id + } + }) + ); + this.store.dispatch( + FlowAnalysisRuleActions.flowAnalysisRuleSnackbarApiError({ + error: errorResponse.error + }) + ); + } + }) + ) + ), tap((request) => { const ruleId: string = request.id; const editDialogReference = this.dialog.open(EditFlowAnalysisRule, { ...LARGE_DIALOG, - data: { - flowAnalysisRule: request.flowAnalysisRule - }, + data: request, id: ruleId }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/flow-analysis-rules/index.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/flow-analysis-rules/index.ts index 679daf3f62..a22639b86a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/flow-analysis-rules/index.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/flow-analysis-rules/index.ts @@ -15,7 +15,14 @@ * limitations under the License. */ -import { BulletinEntity, Bundle, DocumentedType, Permissions, Revision } from '../../../../state/shared'; +import { + BulletinEntity, + Bundle, + ComponentHistory, + DocumentedType, + Permissions, + Revision +} from '../../../../state/shared'; export const flowAnalysisRulesFeatureKey = 'flowAnalysisRules'; @@ -88,6 +95,7 @@ export interface ConfigureFlowAnalysisRuleRequest { export interface EditFlowAnalysisRuleDialogRequest { id: string; flowAnalysisRule: FlowAnalysisRuleEntity; + history?: ComponentHistory; } export interface DeleteFlowAnalysisRuleRequest { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/management-controller-services/management-controller-services.effects.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/management-controller-services/management-controller-services.effects.ts index 6ad48b8b83..eb44d76f85 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/management-controller-services/management-controller-services.effects.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/management-controller-services/management-controller-services.effects.ts @@ -32,6 +32,7 @@ import { EditControllerService } from '../../../../ui/common/controller-service/ import { ComponentType, ControllerServiceReferencingComponent, + EditControllerServiceDialogRequest, UpdateControllerServiceRequest } from '../../../../state/shared'; import { Router } from '@angular/router'; @@ -188,14 +189,38 @@ export class ManagementControllerServicesEffects { this.actions$.pipe( ofType(ManagementControllerServicesActions.openConfigureControllerServiceDialog), map((action) => action.request), + switchMap((request) => + from(this.propertyTableHelperService.getComponentHistory(request.id)).pipe( + map((history) => { + return { + ...request, + history: history.componentHistory + } as EditControllerServiceDialogRequest; + }), + tap({ + error: (errorResponse: HttpErrorResponse) => { + this.store.dispatch( + ManagementControllerServicesActions.selectControllerService({ + request: { + id: request.id + } + }) + ); + this.store.dispatch( + ManagementControllerServicesActions.managementControllerServicesSnackbarApiError({ + error: errorResponse.error + }) + ); + } + }) + ) + ), tap((request) => { const serviceId: string = request.id; const editDialogReference = this.dialog.open(EditControllerService, { ...LARGE_DIALOG, - data: { - controllerService: request.controllerService - }, + data: request, id: serviceId }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/parameter-providers/index.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/parameter-providers/index.ts index c8a0759c59..41504a6543 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/parameter-providers/index.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/parameter-providers/index.ts @@ -18,6 +18,7 @@ import { AffectedComponentEntity, Bundle, + ComponentHistory, DocumentedType, ParameterContextReferenceEntity, ParameterEntity, @@ -158,6 +159,7 @@ export interface DeleteParameterProviderSuccess { export interface EditParameterProviderRequest { id: string; parameterProvider: ParameterProviderEntity; + history?: ComponentHistory; } export interface ConfigureParameterProviderRequest { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/parameter-providers/parameter-providers.effects.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/parameter-providers/parameter-providers.effects.ts index 06ca0e3735..2dd01d690a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/parameter-providers/parameter-providers.effects.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/parameter-providers/parameter-providers.effects.ts @@ -49,7 +49,7 @@ import { CreateParameterProvider } from '../../ui/parameter-providers/create-par import { YesNoDialog } from '../../../../ui/common/yes-no-dialog/yes-no-dialog.component'; import { EditParameterProvider } from '../../ui/parameter-providers/edit-parameter-provider/edit-parameter-provider.component'; import { PropertyTableHelperService } from '../../../../service/property-table-helper.service'; -import { ParameterProviderEntity, UpdateParameterProviderRequest } from './index'; +import { EditParameterProviderRequest, ParameterProviderEntity, UpdateParameterProviderRequest } from './index'; import { ManagementControllerServiceService } from '../../service/management-controller-service.service'; import { FetchParameterProviderParameters } from '../../ui/parameter-providers/fetch-parameter-provider-parameters/fetch-parameter-provider-parameters.component'; import * as ErrorActions from '../../../../state/error/error.actions'; @@ -266,13 +266,33 @@ export class ParameterProvidersEffects { this.actions$.pipe( ofType(ParameterProviderActions.openConfigureParameterProviderDialog), map((action) => action.request), + switchMap((request) => + from(this.propertyTableHelperService.getComponentHistory(request.id)).pipe( + map((history) => { + return { + ...request, + history: history.componentHistory + } as EditParameterProviderRequest; + }), + tap({ + error: (errorResponse: HttpErrorResponse) => { + this.store.dispatch( + ParameterProviderActions.selectParameterProvider({ + request: { + id: request.id + } + }) + ); + this.store.dispatch(ErrorActions.snackBarError({ error: errorResponse.error })); + } + }) + ) + ), tap((request) => { const id = request.id; const editDialogReference = this.dialog.open(EditParameterProvider, { ...LARGE_DIALOG, - data: { - parameterProvider: request.parameterProvider - }, + data: request, id }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/reporting-tasks/index.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/reporting-tasks/index.ts index c887504d5b..5371471e44 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/reporting-tasks/index.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/reporting-tasks/index.ts @@ -15,7 +15,14 @@ * limitations under the License. */ -import { BulletinEntity, Bundle, DocumentedType, Permissions, Revision } from '../../../../state/shared'; +import { + BulletinEntity, + Bundle, + ComponentHistory, + DocumentedType, + Permissions, + Revision +} from '../../../../state/shared'; export const reportingTasksFeatureKey = 'reportingTasks'; @@ -66,6 +73,7 @@ export interface UpdateReportingTaskRequest { export interface EditReportingTaskDialogRequest { id: string; reportingTask: ReportingTaskEntity; + history?: ComponentHistory; } export interface StartReportingTaskRequest { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/reporting-tasks/reporting-tasks.effects.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/reporting-tasks/reporting-tasks.effects.ts index fcfbde7508..5a3d8fade4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/reporting-tasks/reporting-tasks.effects.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/reporting-tasks/reporting-tasks.effects.ts @@ -30,7 +30,7 @@ import { Router } from '@angular/router'; import { selectSaving } from '../management-controller-services/management-controller-services.selectors'; import { UpdateControllerServiceRequest } from '../../../../state/shared'; import { EditReportingTask } from '../../ui/reporting-tasks/edit-reporting-task/edit-reporting-task.component'; -import { CreateReportingTaskSuccess } from './index'; +import { CreateReportingTaskSuccess, EditReportingTaskDialogRequest } from './index'; import { ManagementControllerServiceService } from '../../service/management-controller-service.service'; import { PropertyTableHelperService } from '../../../../service/property-table-helper.service'; import * as ErrorActions from '../../../../state/error/error.actions'; @@ -232,14 +232,36 @@ export class ReportingTasksEffects { this.actions$.pipe( ofType(ReportingTaskActions.openConfigureReportingTaskDialog), map((action) => action.request), + switchMap((request) => + from(this.propertyTableHelperService.getComponentHistory(request.id)).pipe( + map((history) => { + return { + ...request, + history: history.componentHistory + } as EditReportingTaskDialogRequest; + }), + tap({ + error: (errorResponse: HttpErrorResponse) => { + this.store.dispatch( + ReportingTaskActions.selectReportingTask({ + request: { + id: request.id + } + }) + ); + this.store.dispatch( + ReportingTaskActions.reportingTasksSnackbarApiError({ error: errorResponse.error }) + ); + } + }) + ) + ), tap((request) => { const taskId: string = request.id; const editDialogReference = this.dialog.open(EditReportingTask, { ...LARGE_DIALOG, - data: { - reportingTask: request.reportingTask - }, + data: request, id: taskId }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/flow-analysis-rules/edit-flow-analysis-rule/edit-flow-analysis-rule.component.html b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/flow-analysis-rules/edit-flow-analysis-rule/edit-flow-analysis-rule.component.html index 0f25471b3b..2c89a8415a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/flow-analysis-rules/edit-flow-analysis-rule/edit-flow-analysis-rule.component.html +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/flow-analysis-rules/edit-flow-analysis-rule/edit-flow-analysis-rule.component.html @@ -73,6 +73,7 @@ formControlName="properties" [createNewProperty]="createNewProperty" [createNewService]="createNewService" + [propertyHistory]="request.history" [goToService]="goToService"> diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/parameter-providers/edit-parameter-provider/edit-parameter-provider.component.html b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/parameter-providers/edit-parameter-provider/edit-parameter-provider.component.html index 0c5ed2b361..d190127e78 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/parameter-providers/edit-parameter-provider/edit-parameter-provider.component.html +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/parameter-providers/edit-parameter-provider/edit-parameter-provider.component.html @@ -71,6 +71,7 @@ formControlName="properties" [createNewProperty]="createNewProperty" [createNewService]="createNewService" + [propertyHistory]="request.history" [goToService]="goToService"> diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/reporting-tasks/edit-reporting-task/edit-reporting-task.component.html b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/reporting-tasks/edit-reporting-task/edit-reporting-task.component.html index f92a2cb13f..f5e96b09ae 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/reporting-tasks/edit-reporting-task/edit-reporting-task.component.html +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/reporting-tasks/edit-reporting-task/edit-reporting-task.component.html @@ -89,6 +89,7 @@ [createNewProperty]="createNewProperty" [createNewService]="createNewService" [goToService]="goToService" + [propertyHistory]="request.history" [supportsSensitiveDynamicProperties]=" request.reportingTask.component.supportsSensitiveDynamicProperties "> diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/service/property-table-helper.service.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/service/property-table-helper.service.ts index a75b9aa76d..8d8f2417a3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/service/property-table-helper.service.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/service/property-table-helper.service.ts @@ -19,6 +19,7 @@ import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { catchError, EMPTY, map, Observable, switchMap, take, takeUntil, tap } from 'rxjs'; import { + ComponentHistoryEntity, ControllerServiceCreator, ControllerServiceEntity, CreateControllerServiceRequest, @@ -37,20 +38,29 @@ import { Client } from './client.service'; import { NiFiState } from '../state'; import { Store } from '@ngrx/store'; import { snackBarError } from '../state/error/error.actions'; -import { HttpErrorResponse } from '@angular/common/http'; +import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { LARGE_DIALOG, SMALL_DIALOG } from '../index'; @Injectable({ providedIn: 'root' }) export class PropertyTableHelperService { + private static readonly API: string = '../nifi-api'; + constructor( + private httpClient: HttpClient, private dialog: MatDialog, private store: Store, private extensionTypesService: ExtensionTypesService, private client: Client ) {} + getComponentHistory(componentId: string): Observable { + return this.httpClient.get( + `${PropertyTableHelperService.API}/flow/history/components/${componentId}` + ); + } + /** * Returns a function that can be used to pass into a PropertyTable to support creating a new property * @param id id of the component to create the property for diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/state/shared/index.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/state/shared/index.ts index daf9b7e112..7ed8312e4a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/state/shared/index.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/state/shared/index.ts @@ -128,6 +128,7 @@ export interface CreateControllerServiceDialogRequest { export interface EditControllerServiceDialogRequest { id: string; controllerService: ControllerServiceEntity; + history?: ComponentHistory; } export interface UpdateControllerServiceRequest { @@ -204,6 +205,25 @@ export interface ProvenanceEventDialogRequest { event: ProvenanceEvent; } +export interface PreviousValue { + previousValue: string; + timestamp: string; + userIdentity: string; +} + +export interface PropertyHistory { + previousValues: PreviousValue[]; +} + +export interface ComponentHistory { + componentId: string; + propertyHistory: { [key: string]: PropertyHistory }; +} + +export interface ComponentHistoryEntity { + componentHistory: ComponentHistory; +} + export interface TextTipInput { text: string; } @@ -232,6 +252,7 @@ export interface BulletinsTipInput { export interface PropertyTipInput { descriptor: PropertyDescriptor; + propertyHistory?: PropertyHistory; } export interface ParameterTipInput { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.html b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.html index f55d4553fd..fd2e20136d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.html +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.html @@ -102,6 +102,7 @@ [goToParameter]="goToParameter" [convertToParameter]="convertToParameter" [goToService]="goToService" + [propertyHistory]="request.history" [supportsSensitiveDynamicProperties]=" request.controllerService.component.supportsSensitiveDynamicProperties "> diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/property-table.component.html b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/property-table.component.html index 75286c4738..3917c325de 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/property-table.component.html +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/property-table.component.html @@ -37,14 +37,12 @@ {{ item.descriptor.displayName }}
- @if (hasInfo(item.descriptor)) { -
- } +
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/property-table.component.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/property-table.component.ts index 8d8919eaf8..9f3423ae66 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/property-table.component.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/property-table.component.ts @@ -34,6 +34,7 @@ import { NiFiCommon } from '../../../service/nifi-common.service'; import { AsyncPipe, NgTemplateOutlet } from '@angular/common'; import { AllowableValueEntity, + ComponentHistory, InlineServiceCreationRequest, InlineServiceCreationResponse, Parameter, @@ -105,6 +106,7 @@ export class PropertyTable implements AfterViewInit, ControlValueAccessor { @Input() convertToParameter!: (name: string, sensitive: boolean, value: string | null) => Observable; @Input() goToService!: (serviceId: string) => void; @Input() supportsSensitiveDynamicProperties = false; + @Input() propertyHistory: ComponentHistory | undefined; private static readonly PARAM_REF_REGEX: RegExp = /#{[a-zA-Z0-9-_. ]+}/; @@ -348,14 +350,6 @@ export class PropertyTable implements AfterViewInit, ControlValueAccessor { return 'property-' + item.id; } - hasInfo(descriptor: PropertyDescriptor): boolean { - return ( - !this.nifiCommon.isBlank(descriptor.description) || - !this.nifiCommon.isBlank(descriptor.defaultValue) || - descriptor.supportsEl - ); - } - isSensitiveProperty(descriptor: PropertyDescriptor): boolean { return descriptor.sensitive; } @@ -396,7 +390,8 @@ export class PropertyTable implements AfterViewInit, ControlValueAccessor { getPropertyTipData(item: PropertyItem): PropertyTipInput { return { - descriptor: item.descriptor + descriptor: item.descriptor, + propertyHistory: this.propertyHistory?.propertyHistory[item.property] }; } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/tooltips/property-tip/property-tip.component.html b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/tooltips/property-tip/property-tip.component.html index cb330a6c92..33e160f598 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/tooltips/property-tip/property-tip.component.html +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/tooltips/property-tip/property-tip.component.html @@ -16,8 +16,8 @@ -->
- @if (data?.descriptor; as descriptor) { -
+
+ @if (data?.descriptor; as descriptor) { @if (hasDescription(descriptor)) {
{{ descriptor.description }}
} @@ -38,7 +38,16 @@ [bundle]="descriptor.identifiesControllerServiceBundle">
} - -
- } + } + @if (data?.propertyHistory; as propertyHistory) { +
+ History +
    + @for (previousValue of propertyHistory.previousValues; track previousValue) { +
  • {{ previousValue.previousValue }} - {{ previousValue.timestamp }} ({{ previousValue.userIdentity }})
  • + } +
+
+ } +