NIFI-2715 - When performing a Queue Listing, if... ...FlowFile has no content, UI does not indicate this fact
For FlowFiles with no content: * Added a simple title replacing the Content Claim's one. * Defaulted File Size to 0 bytes using common formatting. Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/a7ea178c Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/a7ea178c Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/a7ea178c Branch: refs/heads/master Commit: a7ea178cdc02355cf8fa1b83555351a477522ecd Parents: acee262 Author: yuri1969 <[email protected]> Authored: Wed Aug 16 22:42:08 2017 +0200 Committer: Scott Aslan <[email protected]> Committed: Thu Aug 24 18:38:29 2017 -0400 ---------------------------------------------------------------------- .../WEB-INF/partials/canvas/flowfile-details-dialog.jsp | 3 +++ .../src/main/webapp/js/nf/canvas/nf-queue-listing.js | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/a7ea178c/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/flowfile-details-dialog.jsp ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/flowfile-details-dialog.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/flowfile-details-dialog.jsp index a2de56a..b366b72 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/flowfile-details-dialog.jsp +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/flowfile-details-dialog.jsp @@ -65,6 +65,9 @@ </div> <div class="spacer"> </div> <div class="settings-right"> + <div id="flowfile-with-no-content" class="content-details"> + <div class="flowfile-header">No Content Available</div> + </div> <div id="flowfile-content-details" class="content-details"> <div class="flowfile-header">Content Claim</div> <div class="flowfile-detail"> http://git-wip-us.apache.org/repos/asf/nifi/blob/a7ea178c/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js index 5528105..f214158 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js @@ -415,6 +415,9 @@ }).done(function (response) { var flowFile = response.flowFile; + // set a default for flowfiles with no content claim + var fileSize = nfCommon.isDefinedAndNotNull(flowFile.contentClaimFileSize) ? flowFile.contentClaimFileSize : nfCommon.formatDataSize(0); + // show the URI to this flowfile $('#flowfile-uri').text(flowFile.uri); @@ -422,7 +425,7 @@ $('#flowfile-uuid').html(nfCommon.formatValue(flowFile.uuid)); $('#flowfile-filename').html(nfCommon.formatValue(flowFile.filename)); $('#flowfile-queue-position').html(nfCommon.formatValue(flowFile.position)); - $('#flowfile-file-size').html(nfCommon.formatValue(flowFile.contentClaimFileSize)); + $('#flowfile-file-size').html(nfCommon.formatValue(fileSize)); $('#flowfile-queued-duration').text(nfCommon.formatDuration(flowFile.queuedDuration)); $('#flowfile-lineage-duration').text(nfCommon.formatDuration(flowFile.lineageDuration)); $('#flowfile-penalized').text(flowFile.penalized === true ? 'Yes' : 'No'); @@ -454,8 +457,10 @@ // show the content details $('#flowfile-content-details').show(); + $('#flowfile-with-no-content').hide(); } else { $('#flowfile-content-details').hide(); + $('#flowfile-with-no-content').show(); } // attributes
