From 387dce5ad09c3902983a1d4a74660d24d69d34d4 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Thu, 9 Nov 2017 12:48:42 -0500 Subject: [PATCH] NIFI-4591: - Ensuring View Details button is visible if the user has read access and the service is defined in the current Process Group. This closes #2262 Signed-off-by: Scott Aslan --- .../js/nf/canvas/nf-controller-services.js | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) 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 59041c4769..30f653049e 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 @@ -844,7 +844,7 @@ var controllerServiceActionFormatter = function (row, cell, value, columnDef, dataContext) { var markup = ''; - if (dataContext.permissions.canRead && dataContext.permissions.canWrite) { + if (dataContext.permissions.canRead) { var definedByCurrentGroup = false; if (nfCommon.isDefinedAndNotNull(dataContext.component.parentGroupId)) { // when opened in the process group context, the current group is store in #process-group-id @@ -857,30 +857,39 @@ } if (definedByCurrentGroup === true) { - if (dataContext.component.state === 'ENABLED' || dataContext.component.state === 'ENABLING') { - markup += '
'; - markup += '
'; - } else if (dataContext.component.state === 'DISABLED') { - markup += '
'; + if (dataContext.permissions.canWrite) { + // write permission... allow actions based on the current state of the service + if (dataContext.component.state === 'ENABLED' || dataContext.component.state === 'ENABLING') { + markup += '
'; + markup += '
'; + } else if (dataContext.component.state === 'DISABLED') { + markup += '
'; - // if there are no validation errors allow enabling - if (nfCommon.isEmpty(dataContext.component.validationErrors)) { - markup += '
'; + // if there are no validation errors allow enabling + if (nfCommon.isEmpty(dataContext.component.validationErrors)) { + markup += '
'; + } + + if (dataContext.component.multipleVersionsAvailable === true) { + markup += '
'; + } + + if (canWriteControllerServiceParent(dataContext)) { + markup += '
'; + } } - if (dataContext.component.multipleVersionsAvailable === true) { - markup += '
'; + if (dataContext.component.persistsState === true) { + markup += '
'; } - - if (canWriteControllerServiceParent(dataContext)) { - markup += '
'; + } else { + // no write permission... allow viewing configuration if in current group + if (definedByCurrentGroup === true) { + markup += '
'; } } - - if (dataContext.component.persistsState === true) { - markup += '
'; - } } else { + // not defined in current group... show go to arrow markup += '
'; } }