From ecca76099afea4944ce097981f14a4dd6b3c5142 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Fri, 29 Jul 2016 13:12:55 -0400 Subject: [PATCH] NIFI-2427: - Only showing read/write data policies for applicable components. Disabling for labels, controller services, reporting tasks, and templates. This closes #748 Signed-off-by: jpercivall --- .../js/nf/canvas/nf-policy-management.js | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js index 5415cdae99..6f0756c3e5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js @@ -974,6 +974,12 @@ nf.PolicyManagement = (function () { .combo('setOptionEnabled', { value: 'write-send-data' }, false) + .combo('setOptionEnabled', { + value: 'read-data' + }, false) + .combo('setOptionEnabled', { + value: 'write-data' + }, false) .combo('setSelectedOption', { value: 'read-component' }); @@ -1012,6 +1018,12 @@ nf.PolicyManagement = (function () { .combo('setOptionEnabled', { value: 'write-send-data' }, false) + .combo('setOptionEnabled', { + value: 'read-data' + }, false) + .combo('setOptionEnabled', { + value: 'write-data' + }, false) .combo('setSelectedOption', { value: 'read-component' }); @@ -1050,6 +1062,12 @@ nf.PolicyManagement = (function () { .combo('setOptionEnabled', { value: 'write-send-data' }, false) + .combo('setOptionEnabled', { + value: 'read-data' + }, false) + .combo('setOptionEnabled', { + value: 'write-data' + }, false) .combo('setSelectedOption', { value: 'read-component' }); @@ -1083,7 +1101,13 @@ nf.PolicyManagement = (function () { }, false) .combo('setOptionEnabled', { value: 'write-send-data' - }, false); + }, false) + .combo('setOptionEnabled', { + value: 'read-data' + }, true) + .combo('setOptionEnabled', { + value: 'write-data' + }, true); } else { var d = selection.datum(); $('#selected-policy-component-id').text(d.id); @@ -1111,7 +1135,13 @@ nf.PolicyManagement = (function () { }, nf.CanvasUtils.isInputPort(selection) && nf.Canvas.getParentGroupId() === null) .combo('setOptionEnabled', { value: 'write-send-data' - }, nf.CanvasUtils.isOutputPort(selection) && nf.Canvas.getParentGroupId() === null); + }, nf.CanvasUtils.isOutputPort(selection) && nf.Canvas.getParentGroupId() === null) + .combo('setOptionEnabled', { + value: 'read-data' + }, !nf.CanvasUtils.isLabel(selection)) + .combo('setOptionEnabled', { + value: 'write-data' + }, !nf.CanvasUtils.isLabel(selection)); } // populate the initial resource