From c64a9059f8b68cd803caebd0ec61f5cfbe3c1a44 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Mon, 19 Sep 2016 13:23:00 -0400 Subject: [PATCH] NIFI-2785: - Ensure the URL is updated when uploading a template to ensure it's going to the appropriate Process Group. --- .../canvas/controllers/nf-ng-canvas-operate-controller.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js index dd4ae023a523..58323328a586 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js @@ -114,8 +114,12 @@ nf.ng.Canvas.OperateCtrl = function () { init: function () { // initialize the form var templateForm = $('#template-upload-form').ajaxForm({ - url: '../nifi-api/process-groups/' + encodeURIComponent(nf.Canvas.getGroupId()) + '/templates/upload', + url: '../nifi-api/process-groups/', dataType: 'xml', + beforeSubmit: function (formData, $form, options) { + // ensure uploading to the current process group + options.url += (encodeURIComponent(nf.Canvas.getGroupId()) + '/templates/upload'); + }, success: function (response, statusText, xhr, form) { // see if the import was successful if (response.documentElement.tagName === 'templateEntity') {