exceptionfactory commented on code in PR #9884:
URL: https://github.com/apache/nifi/pull/9884#discussion_r2050769278


##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/parameter-context-table/parameter-context-table.component.ts:
##########
@@ -157,6 +170,9 @@ export class ParameterContextTable {
                 case 'description':
                     retVal = 
this.nifiCommon.compareString(this.formatDescription(a), 
this.formatDescription(b));
                     break;
+                case 'bounded process group':

Review Comment:
   The label `bounded` is not quite right, it could be `bound process groups`, 
but just using `process groups` sounds better.



##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/parameter-context-table/parameter-context-table.component.ts:
##########
@@ -86,6 +86,19 @@ export class ParameterContextTable {
         return this.canRead(entity) && entity.component ? 
entity.component.description : '';
     }
 
+    formatBoundedProcessGroups(entity: ParameterContextEntity): string {
+        return this.canRead(entity) && entity.component ? 
this.getHighLevelParameterContexts(entity.component) : '';
+    }
+
+    private getHighLevelParameterContexts(component: ParameterContext) {
+        const componentIds: string[] = component.boundProcessGroups.map(group 
=> group.component.id)
+        const boundedProcessGroupNames: string[] =  
component.boundProcessGroups
+            .filter(group => 
!componentIds.includes(group.component.parentGroupId))
+            .map(group => group.component.name);
+
+        return boundedProcessGroupNames.length <= 1 ? 
boundedProcessGroupNames.toString() : '(shared)'

Review Comment:
   Instead of returning `(shared)` for multiple groups, I recommend returning 
the number of process groups.



##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/parameter-context-table/parameter-context-table.component.html:
##########
@@ -54,6 +54,16 @@
                 </td>
             </ng-container>
 
+            <!-- Bounded Process Group Column -->
+            <ng-container matColumnDef="bounded process group">

Review Comment:
   I recommend just `process groups`, or perhaps `bound process groups`.
   ```suggestion
               <ng-container matColumnDef="process group">
   ```



##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/parameter-context-table/parameter-context-table.component.ts:
##########
@@ -86,6 +86,19 @@ export class ParameterContextTable {
         return this.canRead(entity) && entity.component ? 
entity.component.description : '';
     }
 
+    formatBoundedProcessGroups(entity: ParameterContextEntity): string {

Review Comment:
   ```suggestion
       formatBoundProcessGroups(entity: ParameterContextEntity): string {
   ```



##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/parameter-context-table/parameter-context-table.component.ts:
##########
@@ -86,6 +86,19 @@ export class ParameterContextTable {
         return this.canRead(entity) && entity.component ? 
entity.component.description : '';
     }
 
+    formatBoundedProcessGroups(entity: ParameterContextEntity): string {
+        return this.canRead(entity) && entity.component ? 
this.getHighLevelParameterContexts(entity.component) : '';
+    }
+
+    private getHighLevelParameterContexts(component: ParameterContext) {
+        const componentIds: string[] = component.boundProcessGroups.map(group 
=> group.component.id)
+        const boundedProcessGroupNames: string[] =  
component.boundProcessGroups

Review Comment:
   ```suggestion
           const boundProcessGroupNames: string[] =  
component.boundProcessGroups
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to