From 56c8cd6385b1c276952c87cd4895cb0a65b49bca Mon Sep 17 00:00:00 2001 From: Scott Aslan Date: Wed, 31 Aug 2016 16:32:37 -0400 Subject: [PATCH] [NIFI-2649] Update CS table upon creation of a CS from the RT or CS properties table --- .../src/main/webapp/css/controller-service.css | 5 ----- .../src/main/webapp/css/reporting-task.css | 2 -- .../nifi-web-ui/src/main/webapp/css/settings.css | 4 ++-- .../jquery/propertytable/jquery.propertytable.js | 7 ++++++- .../webapp/js/nf/canvas/nf-controller-service.js | 10 +++++++++- .../main/webapp/js/nf/canvas/nf-reporting-task.js | 14 +++++++++++++- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css index d8c3e0da49d5..3fe8018df1fb 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css @@ -39,11 +39,6 @@ /* controller-service settings */ -#controller-service-name { - width: 250px; - float: left; -} - /* Service references */ diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/reporting-task.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/reporting-task.css index a53a7b2b3323..bb84f3fc9279 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/reporting-task.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/reporting-task.css @@ -44,7 +44,6 @@ /* reporting-task settings */ #reporting-task-name { - font-size: 11px !important; width: 250px; float: left; } @@ -63,7 +62,6 @@ div.reporting-task-enabled-container { } input.reporting-task-scheduling-period { - font-size: 11px !important; width: 150px; } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/settings.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/settings.css index 7af87c7802a0..459c006beb3d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/settings.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/settings.css @@ -47,8 +47,8 @@ div.settings-container { #settings-refresh-container { position: absolute; bottom: 20px; - right: 20px; - left: 20px; + right: 0px; + left: 0px; } /* settings tabs */ diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js index 104bc89b3f12..d8636f9f58be 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js @@ -1021,10 +1021,15 @@ data.updateItem(item.id, $.extend(item, { value: response.component.id })); - + // close the dialog newControllerServiceDialog.modal('hide'); }); + + // invoke callback if necessary + if (typeof configurationOptions.controllerServiceCreatedDeferred === 'function') { + configurationOptions.controllerServiceCreatedDeferred(response); + } }).fail(nf.Common.handleAjaxError); }; 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 cccadcd2c64a..c6da5ffe65ab 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 @@ -23,8 +23,13 @@ nf.ControllerService = (function () { edit: 'edit', readOnly: 'read-only', serviceOnly: 'SERVICE_ONLY', - serviceAndReferencingComponents: 'SERVICE_AND_REFERENCING_COMPONENTS' + serviceAndReferencingComponents: 'SERVICE_AND_REFERENCING_COMPONENTS', + urls: { + api: '../nifi-api' + } }; + // load the controller services + var controllerServicesUri = config.urls.api + '/flow/controller/controller-services'; /** * Handle any expected controller service configuration errors. @@ -1728,6 +1733,9 @@ nf.ControllerService = (function () { readOnly: false, dialogContainer: '#new-controller-service-property-container', descriptorDeferred: getControllerServicePropertyDescriptor, + controllerServiceCreatedDeferred: function(response){ + return nf.ControllerServices.loadControllerServices(controllerServicesUri, serviceTable); + }, goToServiceDeferred: function () { return goToServiceFromProperty(serviceTable); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js index b3a8745c0360..681019a1aec3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js @@ -21,9 +21,15 @@ nf.ReportingTask = (function () { var config = { edit: 'edit', - readOnly: 'read-only' + readOnly: 'read-only', + urls: { + api: '../nifi-api' + } }; + // load the controller services + var controllerServicesUri = config.urls.api + '/flow/controller/controller-services'; + /** * Gets the controller services table. * @@ -359,6 +365,9 @@ nf.ReportingTask = (function () { readOnly: false, dialogContainer: '#new-reporting-task-property-container', descriptorDeferred: getReportingTaskPropertyDescriptor, + controllerServiceCreatedDeferred: function(response){ + return nf.ControllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); + }, goToServiceDeferred: goToServiceFromProperty }); }, @@ -380,6 +389,9 @@ nf.ReportingTask = (function () { readOnly: false, dialogContainer: '#new-reporting-task-property-container', descriptorDeferred: getReportingTaskPropertyDescriptor, + controllerServiceCreatedDeferred: function(response){ + return nf.ControllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); + }, goToServiceDeferred: goToServiceFromProperty });