NIFI-2785: - Ensure the URL is updated when uploading a template to ensure it's going to the appropriate Process Group.

This closes #1029.

Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
Matt Gilman 2016-09-19 13:23:00 -04:00 committed by Bryan Bende
parent be83c0c5b2
commit b304f70f3e
No known key found for this signature in database
GPG Key ID: A0DDA9ED50711C39
1 changed files with 5 additions and 1 deletions

View File

@ -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') {