Repository: nifi Updated Branches: refs/heads/master 908e7d313 -> acc9e0b45
NIFI-2967: - Disabling the Add button in the new Processor, Controller Service, and Reporting Task dialog when no components match the filter. This closes #1340 Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/acc9e0b4 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/acc9e0b4 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/acc9e0b4 Branch: refs/heads/master Commit: acc9e0b45ca726a6dc5f4725336a5d6d1fb9ff5d Parents: 908e7d3 Author: Matt Gilman <[email protected]> Authored: Mon Dec 19 15:59:39 2016 -0500 Committer: Scott Aslan <[email protected]> Committed: Thu Dec 22 11:52:20 2016 -0500 ---------------------------------------------------------------------- .../js/nf/canvas/header/components/nf-ng-processor-component.js | 5 ++++- .../src/main/webapp/js/nf/canvas/nf-controller-services.js | 5 ++++- .../nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/acc9e0b4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js index c96bab4..21e76f5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js @@ -37,6 +37,9 @@ nf.ng.ProcessorComponent = function (serviceProvider) { }); processorTypesData.refresh(); + // update the buttons to possibly trigger the disabled state + $('#new-processor-dialog').modal('refreshButtons'); + // update the selection if possible if (processorTypesData.getLength() > 0) { processorTypesGrid.setSelectedRows([0]); @@ -593,7 +596,7 @@ nf.ng.ProcessorComponent = function (serviceProvider) { var item = grid.getDataItem(selected[0]); return isSelectable(item) === false; } else { - return false; + return grid.getData().getLength() === 0; } }, handler: { http://git-wip-us.apache.org/repos/asf/nifi/blob/acc9e0b4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.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-services.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js index 9473978..2d378bd 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js @@ -74,6 +74,9 @@ nf.ControllerServices = (function () { }); controllerServiceTypesData.refresh(); + // update the buttons to possibly trigger the disabled state + $('#new-controller-service-dialog').modal('refreshButtons'); + // update the selection if possible if (controllerServiceTypesData.getLength() > 0) { controllerServiceTypesGrid.setSelectedRows([0]); @@ -908,7 +911,7 @@ nf.ControllerServices = (function () { var item = grid.getDataItem(selected[0]); return isSelectable(item) === false; } else { - return false; + return grid.getData().getLength() === 0; } }, handler: { http://git-wip-us.apache.org/repos/asf/nifi/blob/acc9e0b4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js index d41752e..4ef836d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js @@ -281,6 +281,9 @@ nf.Settings = (function () { }); reportingTaskTypesData.refresh(); + // update the buttons to possibly trigger the disabled state + $('#new-reporting-task-dialog').modal('refreshButtons'); + // update the selection if possible if (reportingTaskTypesData.getLength() > 0) { reportingTaskTypesGrid.setSelectedRows([0]); @@ -598,7 +601,7 @@ nf.Settings = (function () { var item = reportingTaskTypesGrid.getDataItem(selected[0]); return isSelectable(item) === false; } else { - return false; + return reportingTaskTypesGrid.getData().getLength() === 0; } }, handler: {
