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


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/state/management-controller-services/index.ts:
##########
@@ -41,6 +42,19 @@ export interface ConfigureControllerServiceRequest {
     postUpdateNavigation?: string[];
 }
 
+export interface ConfigureReportingTaskRequest {
+    id: string;
+    uri: string;
+    payload: any;
+    postUpdateNavigation?: string[];
+}
+
+export interface ConfigureReportingTaskSuccess {
+    id: string;
+    reportingTask: ReportingTaskEntity;
+    postUpdateNavigation?: string[];
+}
+

Review Comment:
   These belong in `../reporting-tasks/index.ts`, not in with the mgt cs's



##########
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.reducer.ts:
##########
@@ -61,6 +62,15 @@ export const reportingTasksReducer = createReducer(
         error,
         status: 'error' as const
     })),
+    on(configureReportingTaskSuccess, (state, { response }) => {
+        return produce(state, (draftState) => {
+            const componentIndex: number = 
draftState.reportingTasks.findIndex((f: any) => response.id === f.id);
+            if (componentIndex > -1) {
+                draftState.reportingTasks[componentIndex] = 
response.reportingTask;
+            }
+            draftState.saving = false;
+        });
+    }),
     on(createReportingTask, deleteReportingTask, (state, { request }) => ({

Review Comment:
   We should add `configureReportingTask` here
   
   ```suggestion
       on(createReportingTask, deleteReportingTask, configureReportingTask, 
(state, { request }) => ({
           ...state,
           saving: true
       })),
   ```



##########
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:
##########
@@ -0,0 +1,115 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<h2 mat-dialog-title>Edit Reporting Task</h2>
+<form class="reporting-task-edit-form" [formGroup]="editReportingTaskForm">
+    <mat-dialog-content>
+        <mat-tab-group>
+            <mat-tab label="Settings">
+                <div class="tab-content py-4 flex gap-x-4">
+                    <div class="w-full">
+                        <div class="flex">
+                            <mat-form-field>
+                                <mat-label>Name</mat-label>
+                                <input matInput formControlName="name" 
type="text" />
+                            </mat-form-field>
+                            <mat-checkbox formControlName="state" 
class="pl-1"> Enabled </mat-checkbox>
+                        </div>
+                        <div class="flex flex-col mb-5">
+                            <div>Id</div>
+                            <div class="value">{{ request.reportingTask.id 
}}</div>
+                        </div>
+                        <div class="flex flex-col mb-5">
+                            <div>Type</div>
+                            <div class="value">{{ 
formatType(request.reportingTask) }}</div>
+                        </div>
+                        <div class="flex flex-col mb-5">
+                            <div>Bundle</div>
+                            <div class="value">{{ 
formatBundle(request.reportingTask) }}</div>
+                        </div>
+                    </div>
+                    <div class="flex flex-col w-full">
+                        <div>
+                            <mat-form-field>
+                                <mat-label>Scheduling Strategy</mat-label>
+                                <mat-select
+                                    formControlName="schedulingStrategy"
+                                    
(selectionChange)="schedulingStrategyChanged($event.value)">
+                                    <mat-option
+                                        *ngFor="let option of strategies"
+                                        [value]="option.value"
+                                        nifiTooltip
+                                        [tooltipComponentType]="TextTip"
+                                        
[tooltipInputData]="getPropertyTipData(option)"
+                                        [delayClose]="false">
+                                        {{ option.text }}
+                                    </mat-option>
+                                </mat-select>
+                            </mat-form-field>
+                        </div>
+                        <div>
+                            <mat-form-field>
+                                <mat-label>Run Schedule</mat-label>
+                                <input
+                                    matInput
+                                    formControlName="schedulingPeriod"
+                                    (change)="schedulingPeriodChanged()"
+                                    type="text" />
+                            </mat-form-field>
+                        </div>
+                    </div>
+                </div>
+            </mat-tab>
+            <mat-tab label="Properties">
+                <div class="tab-content py-4">
+                    <property-table
+                        formControlName="properties"
+                        [createNewProperty]="createNewProperty"
+                        [createNewService]="createNewService"
+                        [getParameters]="getParameters"
+                        [parameterContext]="parameterContext"
+                        [goToParameter]="goToParameter"
+                        [convertToParameter]="convertToParameter"
+                        [goToService]="goToService"
+                        [supportsSensitiveDynamicProperties]="
+                            
request.reportingTask.component.supportsSensitiveDynamicProperties
+                        ">
+                    </property-table>

Review Comment:
   It seems there is a bug in nf-editor such that it always sets 
`supportsParameters` to true when the input `getParameters` is called... even 
if the method argument provided is undefined/null. Here, we are providing 
`getParameters`, `converToParameter`, `goToParameter` (and never provide 
implementation) for the properties even though parameters are not supported.
   
   
   <img width="786" alt="Screenshot 2024-01-08 at 9 33 20 AM" 
src="https://github.com/apache/nifi/assets/713866/93dcb75d-5330-4c04-9463-27ef5798fe10";>
   
   <img width="807" alt="Screenshot 2024-01-08 at 9 35 14 AM" 
src="https://github.com/apache/nifi/assets/713866/977cca8a-7cae-449d-a40f-ed23a330764e";>
   
   
   I think we should update nf-editor to check that the method provided as an 
argument is actually defined before setting anything.
   In addition, we should probably not set them here either... even though they 
are technically undefined here. It just adds confusion.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

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

Reply via email to