You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "zeevo (via GitHub)" <gi...@apache.org> on 2024/05/24 03:47:07 UTC
[PR] NIFI-13289 Add tooltip to NewCanvas item [nifi]
zeevo opened a new pull request, #8870:
URL: https://github.com/apache/nifi/pull/8870
# Summary
[NIFI-13289](https://issues.apache.org/jira/browse/NIFI-13289)
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- [x] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- [x] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
### Pull Request Formatting
- [x] Pull Request based on current revision of the `main` branch
- [x] Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [x] Build completed using `mvn clean install -P contrib-check`
- [x] JDK 21
### UI Contributions
- [x] NiFi is modernizing its UI. Any contributions that update the [current UI](https://github.com/apache/nifi/tree/main/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui) also need to be implemented in the [new UI](https://github.com/apache/nifi/tree/main/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi).
### Licensing
- [x] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [x] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [x] Documentation formatting appears as expected in rendered files
--
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-13289 Add tooltip to NewCanvas item [nifi]
Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows merged PR #8870:
URL: https://github.com/apache/nifi/pull/8870
--
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-13289 Add tooltip to NewCanvas item [nifi]
Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on code in PR #8870:
URL: https://github.com/apache/nifi/pull/8870#discussion_r1618830563
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/tooltips/nifi-tooltip.directive.ts:
##########
@@ -58,11 +59,29 @@ export class NifiTooltipDirective<T> implements OnDestroy {
}
}
+ @HostListener('mousemove')
+ mouseMove() {
+ if (this.overlayRef?.hasAttached() && this.tooltipDisabled) {
+ this.overlayRef?.detach();
+ } else {
+ this.attach();
Review Comment:
I don't think this attach is needed. In fact it causes console errors...
<img width="803" alt="Screenshot 2024-05-29 at 8 49 10 AM" src="https://github.com/apache/nifi/assets/713866/e9060af1-ddb5-44f5-9e24-9089513668e4">
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/tooltips/nifi-tooltip.directive.ts:
##########
@@ -58,11 +59,29 @@ export class NifiTooltipDirective<T> implements OnDestroy {
}
}
+ @HostListener('mousemove')
+ mouseMove() {
+ if (this.overlayRef?.hasAttached() && this.tooltipDisabled) {
+ this.overlayRef?.detach();
+ } else {
+ this.attach();
+ }
+ }
+
+ @HostListener('mouseup')
+ mouseup() {
+ this.attach();
Review Comment:
Nice touch but i think this should also be guarded. It currently can cause an error (similar to the above) if you mousedown outside of the target object and then mouseup over it. The tooltip will render based on the mouseenter and then try to attach another on the mouseup.
```suggestion
if (!this.overlayRef?.hasAttached()) {
this.attach();
}
```
--
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-13289 Add tooltip to NewCanvas item [nifi]
Posted by "zeevo (via GitHub)" <gi...@apache.org>.
zeevo commented on code in PR #8870:
URL: https://github.com/apache/nifi/pull/8870#discussion_r1613638267
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/header/new-canvas-item/new-canvas-item.component.ts:
##########
@@ -25,19 +25,33 @@ import { selectDragging } from '../../../../state/flow/flow.selectors';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ComponentType } from '../../../../../../state/shared';
import { CanvasView } from '../../../../service/canvas-view.service';
+import { NifiTooltipDirective } from '../../../../../../ui/common/tooltips/nifi-tooltip.directive';
+import { TextTip } from '../../../../../../ui/common/tooltips/text-tip/text-tip.component';
+import { ConnectedPosition } from '@angular/cdk/overlay';
@Component({
selector: 'new-canvas-item',
standalone: true,
templateUrl: './new-canvas-item.component.html',
- imports: [CdkDrag],
+ imports: [CdkDrag, NifiTooltipDirective],
styleUrls: ['./new-canvas-item.component.scss']
})
export class NewCanvasItem {
@Input() type!: ComponentType;
@Input() iconClass = '';
@Input() iconHoverClass = '';
@Input() disabled = false;
+ @Input() tooltip = '';
+
+ protected readonly TextTip = TextTip;
+
+ tooltipPosition: ConnectedPosition = {
+ originX: 'center', // maybe start?
Review Comment:
I need to remove this comment
--
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-13289 Add tooltip to NewCanvas item [nifi]
Posted by "zeevo (via GitHub)" <gi...@apache.org>.
zeevo commented on code in PR #8870:
URL: https://github.com/apache/nifi/pull/8870#discussion_r1619511161
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/tooltips/nifi-tooltip.directive.ts:
##########
@@ -58,11 +59,29 @@ export class NifiTooltipDirective<T> implements OnDestroy {
}
}
+ @HostListener('mousemove')
+ mouseMove() {
+ if (this.overlayRef?.hasAttached() && this.tooltipDisabled) {
+ this.overlayRef?.detach();
+ } else {
+ this.attach();
Review Comment:
Removed `else` block
--
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-13289 Add tooltip to NewCanvas item [nifi]
Posted by "zeevo (via GitHub)" <gi...@apache.org>.
zeevo commented on code in PR #8870:
URL: https://github.com/apache/nifi/pull/8870#discussion_r1619510853
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/tooltips/nifi-tooltip.directive.ts:
##########
@@ -58,11 +59,29 @@ export class NifiTooltipDirective<T> implements OnDestroy {
}
}
+ @HostListener('mousemove')
+ mouseMove() {
+ if (this.overlayRef?.hasAttached() && this.tooltipDisabled) {
+ this.overlayRef?.detach();
+ } else {
+ this.attach();
+ }
+ }
+
+ @HostListener('mouseup')
+ mouseup() {
+ this.attach();
Review Comment:
Added guard
--
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-13289 Add tooltip to NewCanvas item [nifi]
Posted by "zeevo (via GitHub)" <gi...@apache.org>.
zeevo commented on PR #8870:
URL: https://github.com/apache/nifi/pull/8870#issuecomment-2136240955
@rfellows Thanks for the review and in-depth suggestions. It really helped.
My latest commit has the following new behaviors:
- Tooltip dismisses on drag.
- Tooltip reappears on mouse up if within a canvas item.
I decided to short circuit within `attach()` as it made things easier in my opinion. Let me know if you disagree with that implementation, and I'll try doing it within the `HostListener` event methods.
--
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