You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/02/28 16:01:40 UTC
[GitHub] [nifi] koccs opened a new pull request #5812: [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized
koccs opened a new pull request #5812:
URL: https://github.com/apache/nifi/pull/5812
#### Description of PR
Displays a new icon on Connection Label to show when head of the queue is penalized
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [ ] Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [ ] Has your PR been rebased against the latest commit within the target branch (typically `main`)?
- [ ] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._
### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] Have you verified that the full build is successful on JDK 8?
- [ ] Have you verified that the full build is successful on JDK 11?
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-assembly`?
- [ ] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`?
- [ ] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.
--
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
[GitHub] [nifi] mcgilman merged pull request #5812: [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized
Posted by GitBox <gi...@apache.org>.
mcgilman merged pull request #5812:
URL: https://github.com/apache/nifi/pull/5812
--
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
[GitHub] [nifi] mcgilman commented on pull request #5812: [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized
Posted by GitBox <gi...@apache.org>.
mcgilman commented on pull request #5812:
URL: https://github.com/apache/nifi/pull/5812#issuecomment-1058082866
Thanks @koccs! +1 This has been merged to main.
--
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
[GitHub] [nifi] koccs commented on a change in pull request #5812: [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized
Posted by GitBox <gi...@apache.org>.
koccs commented on a change in pull request #5812:
URL: https://github.com/apache/nifi/pull/5812#discussion_r817393093
##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
##########
@@ -1820,6 +1820,41 @@
.attrs({
'filter': getDropShadow
});
+
+ // penalized icon
+ var connectionLabelContainer = updated.select('g.connection-label-container');
+ if (connectionLabelContainer.select('text.penalized-icon').empty()) {
+ connectionLabelContainer.select('g.queued-container')
+ .append('text')
+ .attrs({
+ 'class': 'penalized-icon',
+ 'y': 14
+ })
+ .text(function () {
+ return '\uf252';
+ })
+ .append('title');
+ }
+
+ // determine whether or not to show the penalized icon
+ connectionLabelContainer.select('text.penalized-icon')
+ .classed('hidden', function () {
+ var flowFileAvailability = _.get(d, 'status.aggregateSnapshot.flowFileAvailability', null)
Review comment:
Thanks, I have tested it with `return false;` to see the icon and did not check the console after the last touches.
--
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
[GitHub] [nifi] mcgilman commented on a change in pull request #5812: [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized
Posted by GitBox <gi...@apache.org>.
mcgilman commented on a change in pull request #5812:
URL: https://github.com/apache/nifi/pull/5812#discussion_r816212791
##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
##########
@@ -1467,6 +1478,33 @@
}
});
+ // determine whether or not to show the penalized icon
+ connectionLabelContainer.select('text.penalized-icon')
+ .classed('hidden', function () {
+ if (d.permissions.canRead) {
+ return d.component.flowFileAvailability !== 'HEAD_OF_QUEUE_PENALIZED';
+ } else {
+ return true;
+ }
+ })
+ .attr('x', function() {
+ var offset = 0;
+ if(!connectionLabelContainer.select('text.expiration-icon').classed('hidden')) {
+ offset += 16;
+ }
+ if(!connectionLabelContainer.select('text.load-balance-icon').classed('hidden')) {
+ offset += 16;
+ }
+ return 208 - offset;
+ })
+ .select('title').text(function () {
+ if (d.permissions.canRead) {
Review comment:
With the `flowFileAvailability` as part of the status, we do not need to check permissions. Statuses are surfaced regardless of permissions to ensure the user is aware of the state of the data flow even if they don't know what the Processors are doing. When we move this to `updateConnectionStatus` we can remove these `canRead` conditions.
##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
##########
@@ -1467,6 +1478,33 @@
}
});
+ // determine whether or not to show the penalized icon
+ connectionLabelContainer.select('text.penalized-icon')
+ .classed('hidden', function () {
+ if (d.permissions.canRead) {
+ return d.component.flowFileAvailability !== 'HEAD_OF_QUEUE_PENALIZED';
Review comment:
Looks like `flowFileAvailability` is part of the Connection status and not part of the Connection configuration. This makes sense as this value will change as the data is flowing. The path to `fileFileAvailability` should be `d.status.aggregateSnapshot.flowFileAvailability`. The convention is that the rendering status should be in `updateConnectionStatus` instead of `updateConnection`.
--
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
[GitHub] [nifi] koccs commented on pull request #5812: [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized
Posted by GitBox <gi...@apache.org>.
koccs commented on pull request #5812:
URL: https://github.com/apache/nifi/pull/5812#issuecomment-1055188154
> Thanks for the PR @koccs! Since the `flowFileAvailability` is part of the connection status we'll need to make a few updates here.
Thanks for the review @mcgilman, I was not aware of the property hierarchy. I have updated my solution, please check it again.
--
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
[GitHub] [nifi] mcgilman commented on a change in pull request #5812: [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized
Posted by GitBox <gi...@apache.org>.
mcgilman commented on a change in pull request #5812:
URL: https://github.com/apache/nifi/pull/5812#discussion_r816999929
##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
##########
@@ -1820,6 +1820,41 @@
.attrs({
'filter': getDropShadow
});
+
+ // penalized icon
+ var connectionLabelContainer = updated.select('g.connection-label-container');
+ if (connectionLabelContainer.select('text.penalized-icon').empty()) {
+ connectionLabelContainer.select('g.queued-container')
+ .append('text')
+ .attrs({
+ 'class': 'penalized-icon',
+ 'y': 14
+ })
+ .text(function () {
+ return '\uf252';
+ })
+ .append('title');
+ }
+
+ // determine whether or not to show the penalized icon
+ connectionLabelContainer.select('text.penalized-icon')
+ .classed('hidden', function () {
+ var flowFileAvailability = _.get(d, 'status.aggregateSnapshot.flowFileAvailability', null)
Review comment:
The callback to `classed` provides `d` as an argument. In the `updateConnections` function, we were in a for each context that already provided it. In the `updateConnectionStatus` we are not and its need and needs to be parameterized in the callback.
> nf-connection.js?1.16.0-SNAPSHOT:1842 Uncaught ReferenceError: d is not defined
at SVGTextElement.<anonymous> (nf-connection.js?1.16.0-SNAPSHOT:1842:54)
--
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