You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "mcgilman (via GitHub)" <gi...@apache.org> on 2024/02/15 19:16:52 UTC

[PR] NIFI-12795: Including embedded help documentation [nifi]

mcgilman opened a new pull request, #8416:
URL: https://github.com/apache/nifi/pull/8416

   NIFI-12795:
   - Including embedded help documentation.
   - Support linking to specific help documentation from the canvas and component listings.


-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492468292


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/state/documentation/documentation.reducer.ts:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { createReducer, on } from '@ngrx/store';
+import { DocumentationState } from './index';
+import { clearDocumentationParameters, navigateToComponentDocumentation } from './documentation.actions';

Review Comment:
   Thus far we've only been doing this in Effects. 



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492467286


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/flow-analysis-rules/flow-analysis-rule-table/flow-analysis-rule-table.component.html:
##########
@@ -31,7 +31,10 @@
                 <td mat-cell *matCellDef="let item">
                     @if (canRead(item)) {
                         <div class="flex items-center gap-x-3">
-                            <div class="pointer fa fa-book" title="Usage"></div>
+                            <div
+                                class="pointer fa fa-book"
+                                (click)="viewDocumentationClicked(item, $event)"
+                                title="View Documentation"></div>

Review Comment:
   For these buttons and icons in table listings, they have been used. We are still tracking other info icons throughout the application which could yield yet another type of tooltip. We should consider our options with light/dark mode in mind.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492472236


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/management-controller-services/management-controller-services.component.ts:
##########
@@ -45,6 +45,7 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
 import { loadFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.actions';
 import { CurrentUser } from '../../../../state/current-user';
 import { getComponentStateAndOpenDialog } from '../../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Same comment as above.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/flow-analysis-rules/flow-analysis-rules.component.ts:
##########
@@ -41,6 +41,7 @@ import { selectCurrentUser } from '../../../../state/current-user/current-user.s
 import { NiFiState } from '../../../../state';
 import { FlowAnalysisRuleEntity, FlowAnalysisRulesState } from '../../state/flow-analysis-rules';
 import { getComponentStateAndOpenDialog } from '../../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Same comment as above.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492472637


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/documentation/feature/documentation.component.ts:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Component, OnDestroy, SecurityContext } from '@angular/core';
+import { NiFiState } from '../../../state';
+import { Store } from '@ngrx/store';
+import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
+import { HttpParams } from '@angular/common/http';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { selectDocumentationParameters } from '../../../state/documentation/documentation.selectors';
+import { DocumentationParameters } from '../../../state/documentation';
+import { clearDocumentationParameters } from '../../../state/documentation/documentation.actions';

Review Comment:
   Same comment as above.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/controller-service/controller-services.component.ts:
##########
@@ -46,6 +46,7 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
 import { NiFiState } from '../../../../state';
 import { loadFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.actions';
 import { getComponentStateAndOpenDialog } from '../../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Same comment as above.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "scottyaslan (via GitHub)" <gi...@apache.org>.
scottyaslan commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1491658606


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/documentation/feature/documentation.component.html:
##########
@@ -0,0 +1,27 @@
+<!--
+  ~ 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.
+  -->
+
+<div class="pb-5 flex flex-col h-screen justify-between">
+    <header class="nifi-header">
+        <navigation></navigation>

Review Comment:
   I thought we landed a PR where if the user clicks the nifi logo in the header we returned the user to the selected component on the canvas? Or at least to the PG they were in:
   
   ![Kapture 2024-02-15 at 15 53 40](https://github.com/apache/nifi/assets/6797571/6d418309-ef8a-4039-933a-628e551d43b6)
   
   Also, dark mode does not look great with the documentation app. We will need to address that in a follow on effort.
   



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492471475


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/controller-service/controller-service-table/controller-service-table.component.html:
##########
@@ -31,13 +31,11 @@
                 <td mat-cell *matCellDef="let item">
                     @if (canRead(item)) {
                         <div class="flex items-center gap-x-3">
-                            <div class="pointer fa fa-book" title="Usage"></div>
-                            <!--
-              nifiTooltip dynamically inserts the tooltip component
-              into the dom. the dom placement caused shifting of icons
-              because of the gap between items. simple solution is to
-              just wrap the target.
-              -->
+                            <div
+                                class="pointer fa fa-book"
+                                (click)="viewDocumentationClicked(item, $event)"
+                                title="View Documentation"></div>

Review Comment:
   We could look at other options when considering our strategy for tooltips throughout. We still need to address all the info icons. But thus far, all buttons and icons in table listings have used `title`. Here I only updated the value.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/parameter-providers/parameter-providers-table/parameter-providers-table.component.html:
##########
@@ -31,25 +31,29 @@
                     <ng-container matColumnDef="moreDetails">
                         <th mat-header-cell *matHeaderCellDef></th>
                         <td mat-cell *matCellDef="let item">
-                            <div class="flex items-center gap-x-3">
-                                <!-- TODO: open details -->
-                                <div class="pointer fa fa-info-circle" title="View details"></div>
+                            @if (canRead(item)) {
+                                <div class="flex items-center gap-x-3">
+                                    <!-- TODO: open details -->
+                                    <div class="pointer fa fa-info-circle" title="View details"></div>
 
-                                <!-- TODO: open documentation -->
-                                <div class="pointer fa fa-book" title="View Documentation"></div>
+                                    <div
+                                        class="pointer fa fa-book"
+                                        (click)="viewDocumentationClicked(item, $event)"
+                                        title="View Documentation"></div>

Review Comment:
   Same comment as above.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492454355


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/app-routing.module.ts:
##########
@@ -28,6 +28,12 @@ const routes: Routes = [
         path: 'error',
         loadChildren: () => import('./pages/error/feature/error.module').then((m) => m.ErrorModule)
     },
+    {
+        path: 'documentation',
+        canMatch: [authenticationGuard],

Review Comment:
   We display the current user in the header. The authentication guard ensures the current user is loaded for cases when the user directly visits the documentation.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492471864


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/reporting-tasks/reporting-tasks.component.ts:
##########
@@ -43,6 +43,7 @@ import { NiFiState } from '../../../../state';
 import { loadFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.actions';
 import { selectFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.selectors';
 import { getComponentStateAndOpenDialog } from '../../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Same comment as above.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/parameter-providers/parameter-providers.component.ts:
##########
@@ -34,6 +34,7 @@ import { initialParameterProvidersState } from '../../state/parameter-providers/
 import { switchMap, take } from 'rxjs';
 import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
 import { isDefinedAndNotNull } from '../../../../state/shared';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Same comment as above.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492472964


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/service/canvas-context-menu.service.ts:
##########
@@ -57,6 +57,7 @@ import {
 } from '../../../ui/common/context-menu/context-menu.component';
 import { promptEmptyQueueRequest, promptEmptyQueuesRequest } from '../state/queue/queue.actions';
 import { getComponentStateAndOpenDialog } from '../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../state/documentation/documentation.actions';

Review Comment:
   Same command as above.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "scottyaslan (via GitHub)" <gi...@apache.org>.
scottyaslan merged PR #8416:
URL: https://github.com/apache/nifi/pull/8416


-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "scottyaslan (via GitHub)" <gi...@apache.org>.
scottyaslan commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1491655724


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/documentation/feature/documentation.component.spec.ts:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { Documentation } from './documentation.component';
+import { RouterModule } from '@angular/router';
+import { RouterTestingModule } from '@angular/router/testing';
+import { Component } from '@angular/core';
+import { provideMockStore } from '@ngrx/store/testing';
+import { initialState } from '../../../state/documentation/documentation.reducer';
+
+describe('Documentation', () => {
+    let component: Documentation;
+    let fixture: ComponentFixture<Documentation>;
+
+    @Component({
+        selector: 'navigation',
+        standalone: true,
+        template: ''
+    })
+    class MockNavigation {}

Review Comment:
   This mock could be useful in other tests. Do you think it is worth it to move it to a common location?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/flow-analysis-rules/flow-analysis-rule-table/flow-analysis-rule-table.component.html:
##########
@@ -31,7 +31,10 @@
                 <td mat-cell *matCellDef="let item">
                     @if (canRead(item)) {
                         <div class="flex items-center gap-x-3">
-                            <div class="pointer fa fa-book" title="Usage"></div>
+                            <div
+                                class="pointer fa fa-book"
+                                (click)="viewDocumentationClicked(item, $event)"
+                                title="View Documentation"></div>

Review Comment:
   General question: are we using title for tooltips in the new NiFi UI? The styles are different from other tooltips and likely don't work well with light/dark themes.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/documentation/feature/documentation.component.html:
##########
@@ -0,0 +1,27 @@
+<!--
+  ~ 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.
+  -->
+
+<div class="pb-5 flex flex-col h-screen justify-between">
+    <header class="nifi-header">
+        <navigation></navigation>

Review Comment:
   I thought we landed a PR where if the user clicks the nifi logo in the header they are returned the user to the selected component on the canvas? Or at least to the PG they were in:
   
   ![Kapture 2024-02-15 at 15 53 40](https://github.com/apache/nifi/assets/6797571/6d418309-ef8a-4039-933a-628e551d43b6)
   
   Also, dark mode does not look great with the documentation app. We will need to address that in a follow on effort.
   



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/app-routing.module.ts:
##########
@@ -28,6 +28,12 @@ const routes: Routes = [
         path: 'error',
         loadChildren: () => import('./pages/error/feature/error.module').then((m) => m.ErrorModule)
     },
+    {
+        path: 'documentation',
+        canMatch: [authenticationGuard],

Review Comment:
   Does the user really need to be authorized to view the documentation?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/service/canvas-context-menu.service.ts:
##########
@@ -57,6 +57,7 @@ import {
 } from '../../../ui/common/context-menu/context-menu.component';
 import { promptEmptyQueueRequest, promptEmptyQueuesRequest } from '../state/queue/queue.actions';
 import { getComponentStateAndOpenDialog } from '../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../state/documentation/documentation.actions';

Review Comment:
   Should this be 'import * as DocumentationActions from './documentation.actions';'?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/controller-service/controller-services.component.ts:
##########
@@ -46,6 +46,7 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
 import { NiFiState } from '../../../../state';
 import { loadFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.actions';
 import { getComponentStateAndOpenDialog } from '../../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Should this be 'import * as DocumentationActions from './documentation.actions';'?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/service/canvas-context-menu.service.ts:
##########
@@ -717,13 +718,26 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
             },
             {
                 condition: (selection: any) => {
-                    // TODO - hasUsage
-                    return false;
+                    return (
+                        this.canvasUtils.canRead(selection) &&

Review Comment:
   Does the user need read policy to view the documentation for a processor?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/navigation/navigation.component.html:
##########
@@ -136,15 +136,18 @@
                             <mat-divider></mat-divider>
                         }
                     }
-                    <button mat-menu-item class="global-menu-item">
+                    <button mat-menu-item class="global-menu-item" [routerLink]="['/documentation']">
                         <i class="fa fa-fw fa-question-circle mr-2"></i>
                         Help
                     </button>
                     <button mat-menu-item class="global-menu-item">
                         <i class="fa fa-fw fa-info-circle mr-2"></i>
                         About
                     </button>
-                    <button mat-menu-item [matMenuTriggerFor]="theming">Appearance</button>
+                    <button mat-menu-item [matMenuTriggerFor]="theming">
+                        <i class="fa fa-fw mr-2"></i>

Review Comment:
   Thanks for fixing this!



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/controller-service/controller-service-table/controller-service-table.component.html:
##########
@@ -31,13 +31,11 @@
                 <td mat-cell *matCellDef="let item">
                     @if (canRead(item)) {
                         <div class="flex items-center gap-x-3">
-                            <div class="pointer fa fa-book" title="Usage"></div>
-                            <!--
-              nifiTooltip dynamically inserts the tooltip component
-              into the dom. the dom placement caused shifting of icons
-              because of the gap between items. simple solution is to
-              just wrap the target.
-              -->
+                            <div
+                                class="pointer fa fa-book"
+                                (click)="viewDocumentationClicked(item, $event)"
+                                title="View Documentation"></div>

Review Comment:
   title versus tooltip?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/reporting-tasks/reporting-tasks.component.ts:
##########
@@ -43,6 +43,7 @@ import { NiFiState } from '../../../../state';
 import { loadFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.actions';
 import { selectFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.selectors';
 import { getComponentStateAndOpenDialog } from '../../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Should this be 'import * as DocumentationActions from './documentation.actions';'?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/parameter-providers/parameter-providers-table/parameter-providers-table.component.html:
##########
@@ -31,25 +31,29 @@
                     <ng-container matColumnDef="moreDetails">
                         <th mat-header-cell *matHeaderCellDef></th>
                         <td mat-cell *matCellDef="let item">
-                            <div class="flex items-center gap-x-3">
-                                <!-- TODO: open details -->
-                                <div class="pointer fa fa-info-circle" title="View details"></div>
+                            @if (canRead(item)) {
+                                <div class="flex items-center gap-x-3">
+                                    <!-- TODO: open details -->
+                                    <div class="pointer fa fa-info-circle" title="View details"></div>
 
-                                <!-- TODO: open documentation -->
-                                <div class="pointer fa fa-book" title="View Documentation"></div>
+                                    <div
+                                        class="pointer fa fa-book"
+                                        (click)="viewDocumentationClicked(item, $event)"
+                                        title="View Documentation"></div>

Review Comment:
   title versus tooltip?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/documentation/feature/documentation.component.ts:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Component, OnDestroy, SecurityContext } from '@angular/core';
+import { NiFiState } from '../../../state';
+import { Store } from '@ngrx/store';
+import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
+import { HttpParams } from '@angular/common/http';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { selectDocumentationParameters } from '../../../state/documentation/documentation.selectors';
+import { DocumentationParameters } from '../../../state/documentation';
+import { clearDocumentationParameters } from '../../../state/documentation/documentation.actions';

Review Comment:
   Should this be 'import * as DocumentationActions from './documentation.actions';'?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/flow-analysis-rules/flow-analysis-rules.component.ts:
##########
@@ -41,6 +41,7 @@ import { selectCurrentUser } from '../../../../state/current-user/current-user.s
 import { NiFiState } from '../../../../state';
 import { FlowAnalysisRuleEntity, FlowAnalysisRulesState } from '../../state/flow-analysis-rules';
 import { getComponentStateAndOpenDialog } from '../../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Should this be 'import * as DocumentationActions from './documentation.actions';'?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/state/documentation/documentation.reducer.ts:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { createReducer, on } from '@ngrx/store';
+import { DocumentationState } from './index';
+import { clearDocumentationParameters, navigateToComponentDocumentation } from './documentation.actions';

Review Comment:
   Should this be 'import * as DocumentationActions from './documentation.actions';'? I think we talked about this in the effects modules but do we want to follow that same approach in the reducers?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/management-controller-services/management-controller-services.component.ts:
##########
@@ -45,6 +45,7 @@ import { selectFlowConfiguration } from '../../../../state/flow-configuration/fl
 import { loadFlowConfiguration } from '../../../../state/flow-configuration/flow-configuration.actions';
 import { CurrentUser } from '../../../../state/current-user';
 import { getComponentStateAndOpenDialog } from '../../../../state/component-state/component-state.actions';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Should this be 'import * as DocumentationActions from './documentation.actions';'?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/settings/ui/parameter-providers/parameter-providers.component.ts:
##########
@@ -34,6 +34,7 @@ import { initialParameterProvidersState } from '../../state/parameter-providers/
 import { switchMap, take } from 'rxjs';
 import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
 import { isDefinedAndNotNull } from '../../../../state/shared';
+import { navigateToComponentDocumentation } from '../../../../state/documentation/documentation.actions';

Review Comment:
   Should this be 'import * as DocumentationActions from './documentation.actions';'?



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492462044


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/service/canvas-context-menu.service.ts:
##########
@@ -717,13 +718,26 @@ export class CanvasContextMenu implements ContextMenuDefinitionProvider {
             },
             {
                 condition: (selection: any) => {
-                    // TODO - hasUsage
-                    return false;
+                    return (
+                        this.canvasUtils.canRead(selection) &&

Review Comment:
   Yes. Without permissions, the user does not know what type of Processor is on canvas. The details needed for the deep link are only available when the user can read.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492463462


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/documentation/feature/documentation.component.html:
##########
@@ -0,0 +1,27 @@
+<!--
+  ~ 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.
+  -->
+
+<div class="pb-5 flex flex-col h-screen justify-between">
+    <header class="nifi-header">
+        <navigation></navigation>

Review Comment:
   The dark mode will be an issue for any of our applications (documentation, data viewers, custom UIs, etc) until they can be updated to also support it.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "scottyaslan (via GitHub)" <gi...@apache.org>.
scottyaslan commented on PR #8416:
URL: https://github.com/apache/nifi/pull/8416#issuecomment-1947316800

   Reviewing...


-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492458688


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/documentation/feature/documentation.component.html:
##########
@@ -0,0 +1,27 @@
+<!--
+  ~ 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.
+  -->
+
+<div class="pb-5 flex flex-col h-screen justify-between">
+    <header class="nifi-header">
+        <navigation></navigation>

Review Comment:
   If I recall correctly, that behavior targeted the Canvas menu item in the global menu. It should also work for the icon. This was an oversight that we'll need to fix.



-- 
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-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-12795: Including embedded help documentation [nifi]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8416:
URL: https://github.com/apache/nifi/pull/8416#discussion_r1492460016


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/documentation/feature/documentation.component.spec.ts:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { Documentation } from './documentation.component';
+import { RouterModule } from '@angular/router';
+import { RouterTestingModule } from '@angular/router/testing';
+import { Component } from '@angular/core';
+import { provideMockStore } from '@ngrx/store/testing';
+import { initialState } from '../../../state/documentation/documentation.reducer';
+
+describe('Documentation', () => {
+    let component: Documentation;
+    let fixture: ComponentFixture<Documentation>;
+
+    @Component({
+        selector: 'navigation',
+        standalone: true,
+        template: ''
+    })
+    class MockNavigation {}

Review Comment:
   This is a good idea. We have a few other mocks that would be good candidates.



-- 
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-unsubscribe@nifi.apache.org

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