From fa996cd418601b0f1abeb5a926ac6146a96b0c07 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Wed, 3 Jan 2018 20:57:37 -0500 Subject: [PATCH] NIFI-4436: - Minor tweak to when the max height for the options list is calculated per PR comments. - Resolving logic issue in two phase commit when updating variable registry. - Fixing variable visibility. --- .../nifi/web/api/ProcessGroupResource.java | 2 +- .../apache/nifi/web/api/VersionsResource.java | 12 ++++++------ .../webapp/js/jquery/combo/jquery.combo.js | 4 ++++ .../webapp/js/nf/canvas/nf-flow-version.js | 18 ------------------ 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java index 96e1e08d3b..6e99a07ea3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java @@ -620,7 +620,7 @@ public class ProcessGroupResource extends ApplicationResource { final VariableRegistryDTO requestRegistryDto = requestVariableRegistryEntity.getVariableRegistry(); if (!groupId.equals(requestRegistryDto.getProcessGroupId())) { throw new IllegalArgumentException(String.format("The process group id (%s) in the request body does " - + "not equal the process group id of the requested resource (%s).", registryDto.getProcessGroupId(), groupId)); + + "not equal the process group id of the requested resource (%s).", requestRegistryDto.getProcessGroupId(), groupId)); } if (isReplicateRequest()) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java index 53dc091c5b..b1069489e6 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java @@ -1590,12 +1590,12 @@ public class VersionsResource extends ApplicationResource { private static class InitiateChangeFlowVersionRequestWrapper extends Entity { - final VersionControlInformationEntity versionControlInformationEntity; - final ComponentLifecycle componentLifecycle; - final URI exampleUri; - final Set affectedComponents; - final boolean replicateRequest; - final VersionedFlowSnapshot flowSnapshot; + private final VersionControlInformationEntity versionControlInformationEntity; + private final ComponentLifecycle componentLifecycle; + private final URI exampleUri; + private final Set affectedComponents; + private final boolean replicateRequest; + private final VersionedFlowSnapshot flowSnapshot; public InitiateChangeFlowVersionRequestWrapper(final VersionControlInformationEntity versionControlInformationEntity, final ComponentLifecycle componentLifecycle, final URI exampleUri, final Set affectedComponents, final boolean replicateRequest, diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js index 009f2067c4..07d1c5b67a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/combo/jquery.combo.js @@ -176,6 +176,10 @@ if (maxHeight > 0) { comboOptions.css('max-height', maxHeight + 'px'); } + } else { + var windowHeight = $(window).height(); + maxHeight = windowHeight - (position.top + Math.round(combo.outerHeight())) - 32; + comboOptions.css('max-height', maxHeight + 'px'); } // create the list that will contain the options diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js index 96c467ab20..ebbfd25c89 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js @@ -214,14 +214,8 @@ }); } - // determine the max registry height - var windowHeight = $(window).height(); - var registryOffset = $('#import-flow-version-registry-combo').offset(); - var registryMaxHeight = windowHeight - registryOffset.top - 64; - // load the registries registryCombo.combo({ - maxHeight: registryMaxHeight, options: registries, select: function (selectedOption) { selectRegistry(dialog, selectedOption, bucketCombo, flowCombo, selectBucket, bucketCheck) @@ -296,14 +290,8 @@ } } - // determine the max bucket height - var windowHeight = $(window).height(); - var bucketOffset = $('#import-flow-version-bucket-combo').offset(); - var bucketMaxHeight = windowHeight - bucketOffset.top - 64; - // load the buckets bucketCombo.combo('destroy').combo({ - maxHeight: bucketMaxHeight, options: buckets, select: selectBucket }); @@ -902,14 +890,8 @@ }); } - // determine the max flow height - var windowHeight = $(window).height(); - var flowOffset = $('#import-flow-version-name-combo').offset(); - var flowMaxHeight = windowHeight - flowOffset.top - 64; - // load the buckets $('#import-flow-version-name-combo').combo('destroy').combo({ - maxHeight: flowMaxHeight, options: versionedFlows, select: function (selectedFlow) { if (nfCommon.isDefinedAndNotNull(selectedFlow.value)) {