From e2878170a1ddf680800409134684a62bc5ea0373 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Wed, 1 Apr 2015 11:15:07 -0400 Subject: [PATCH] NIFI-477: - Updating the property details shown in a read only dialog for properties with allowable values. Now rendering a read only combo to show the value's display name and the other available options. --- .../propertytable/jquery.propertytable.js | 159 ++++++++++++------ .../webapp/js/nf/canvas/nf-canvas-utils.js | 9 - .../src/main/webapp/js/nf/canvas/nf-canvas.js | 2 +- .../js/nf/canvas/nf-controller-service.js | 3 + .../nf/canvas/nf-processor-configuration.js | 3 + .../webapp/js/nf/canvas/nf-reporting-task.js | 3 + .../src/main/webapp/js/nf/nf-common.js | 9 + .../main/webapp/js/nf/nf-processor-details.js | 3 + 8 files changed, 127 insertions(+), 64 deletions(-) diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js index c2672f3a6b..31495bb630 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js @@ -598,7 +598,7 @@ */ var showPropertyValue = function (propertyGrid, descriptors, row, cell) { // remove any currently open detail dialogs - nf.CanvasUtils.removeAllPropertyDetailDialogs(); + nf.Common.removeAllPropertyDetailDialogs(); // get the property in question var propertyData = propertyGrid.getData(); @@ -619,7 +619,7 @@ // create the wrapper var wrapper = $('
').css({ - 'z-index': 100000, + 'z-index': 1999, 'position': 'absolute', 'background': 'white', 'padding': '5px', @@ -631,65 +631,116 @@ 'left': offset.left - 5 }).appendTo('body'); - var editor = null; - - // so the nfel editor is appropriate - if (nf.Common.supportsEl(propertyDescriptor)) { - var languageId = 'nfel'; - var editorClass = languageId + '-editor'; - - // prevent dragging over the nf editor + var allowableValues = nf.Common.getAllowableValues(propertyDescriptor); + if ($.isArray(allowableValues)) { + // prevent dragging over the combo wrapper.draggable({ - cancel: 'input, textarea, pre, .button, .' + editorClass, + cancel: '.button, .combo', containment: 'parent' }); - // create the editor - editor = $('
').addClass(editorClass).appendTo(wrapper).nfeditor({ - languageId: languageId, - width: cellNode.width(), - content: property.value, - minWidth: 175, - minHeight: 100, - readOnly: true, - resizable: true - }); - } else { - // prevent dragging over standard components - wrapper.draggable({ - containment: 'parent' + // create the read only options + var options = []; + $.each(allowableValues, function (i, allowableValue) { + options.push({ + text: allowableValue.displayName, + value: allowableValue.value, + description: nf.Common.escapeHtml(allowableValue.description), + disabled: true + }); }); - // create the input field - $('