NIFI-4518:
- Addressing issues when handling the done callback for controller service 
references.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/f2bd9f87
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/f2bd9f87
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/f2bd9f87

Branch: refs/heads/master
Commit: f2bd9f87ba3ec6c3aca502aaccf7227b58cd3a0b
Parents: 32c0e2b
Author: Matt Gilman <[email protected]>
Authored: Thu Oct 26 12:43:02 2017 -0400
Committer: Matt Gilman <[email protected]>
Committed: Thu Oct 26 12:43:02 2017 -0400

----------------------------------------------------------------------
 .../src/main/webapp/js/nf/canvas/nf-canvas-utils.js          | 8 +++++++-
 .../src/main/webapp/js/nf/canvas/nf-controller-service.js    | 3 +--
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/f2bd9f87/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
index f9178e2..68a918a 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
@@ -284,7 +284,13 @@
 
             if (queries.length === 1) {
                 // if there was only one query, return it
-                return queries[0].fail(nfErrorHandler.handleAjaxError);
+                return $.Deferred(function (deferred) {
+                    queries[0].done(function (response) {
+                        deferred.resolve(response);
+                    }).fail(function () {
+                        deferred.reject();
+                    }).fail(nfErrorHandler.handleAjaxError);
+                }).promise();
             } else {
                 // if there were multiple queries, wait for each to complete
                 return $.Deferred(function (deferred) {

http://git-wip-us.apache.org/repos/asf/nifi/blob/f2bd9f87/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
index c7d9c43..c97c861 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
@@ -864,8 +864,7 @@
                     dataType: 'json'
                 });
 
-                $.when(bulletins, service).done(function (bulletinResult, 
serviceResult) {
-                    var bulletinResponse = bulletinResult[0];
+                $.when(bulletins, service).done(function (bulletinResponse, 
serviceResult) {
                     var serviceResponse = serviceResult[0];
                     conditionMet(serviceResponse.component, 
bulletinResponse.bulletinBoard.bulletins);
                 }).fail(function (xhr, status, error) {

Reply via email to