From 322be256b561cd4e2af84118c64eb594ccafd285 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Fri, 10 Apr 2015 11:03:05 -0400 Subject: [PATCH 1/4] NIFI-459: - Fixing the label for the units in the hex view label. --- .../src/main/webapp/WEB-INF/jsp/hexview.jsp | 2 +- .../nifi-web-content-viewer/src/main/webapp/css/main.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/WEB-INF/jsp/hexview.jsp b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/WEB-INF/jsp/hexview.jsp index c6e7f382ff..f4e9fd29de 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/WEB-INF/jsp/hexview.jsp +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/WEB-INF/jsp/hexview.jsp @@ -29,4 +29,4 @@ -
Showing up to 1.5kb
\ No newline at end of file +
Showing up to 1.5 KB
\ No newline at end of file diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/css/main.css b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/css/main.css index a66198de20..fe68b627f6 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/css/main.css +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/src/main/webapp/css/main.css @@ -87,7 +87,7 @@ padding: 2px; } -#trancation-message { +#truncation-message { position: absolute; left: 100px; bottom: 35px; From 9299355ae9fe31d47824acab21aa02fc92c5d897 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Fri, 10 Apr 2015 11:30:54 -0400 Subject: [PATCH 2/4] NIFI-497: - Requiring new property names to be unique. --- .../propertytable/jquery.propertytable.js | 72 ++++++++++++------- 1 file changed, 47 insertions(+), 25 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 b5f56b0490..7ffaa3f23f 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 @@ -1375,37 +1375,59 @@ var add = function () { var propertyName = $.trim(newPropertyNameField.val()); - // ensure the property name and value is specified + // ensure the property name is specified if (propertyName !== '') { - // load the descriptor and add the property - options.descriptorDeferred(propertyName).done(function(response) { - var descriptor = response.propertyDescriptor; - - // store the descriptor for use later - var descriptors = table.data('descriptors'); - if (!nf.Common.isUndefined(descriptors)) { - descriptors[descriptor.name] = descriptor; + var propertyGrid = table.data('gridInstance'); + var propertyData = propertyGrid.getData(); + + // ensure the property name is unique + var existingPropertyId = null; + $.each(propertyData.getItems(), function (_, item) { + if (propertyName === item.property) { + existingPropertyId = item.id; + return false; } + }); + + if (existingPropertyId === null) { + // load the descriptor and add the property + options.descriptorDeferred(propertyName).done(function(response) { + var descriptor = response.propertyDescriptor; - // add a row for the new property - var propertyGrid = table.data('gridInstance'); - var propertyData = propertyGrid.getData(); - var id = propertyData.getLength(); - propertyData.addItem({ - id: id, - hidden: false, - property: propertyName, - displayName: propertyName, - previousValue: null, - value: null, - type: 'userDefined' + // store the descriptor for use later + var descriptors = table.data('descriptors'); + if (!nf.Common.isUndefined(descriptors)) { + descriptors[descriptor.name] = descriptor; + } + + // add a row for the new property + var id = propertyData.getLength(); + propertyData.addItem({ + id: id, + hidden: false, + property: propertyName, + displayName: propertyName, + previousValue: null, + value: null, + type: 'userDefined' + }); + + // select the new properties row + var row = propertyData.getRowById(id); + propertyGrid.setSelectedRows([row]); + propertyGrid.scrollRowIntoView(row); }); - - // select the new properties row - var row = propertyData.getRowById(id); + } else { + nf.Dialog.showOkDialog({ + dialogContent: 'A property with this name already exists.', + overlayBackground: false + }); + + // select the existing properties row + var row = propertyData.getRowById(existingPropertyId); propertyGrid.setSelectedRows([row]); propertyGrid.scrollRowIntoView(row); - }); + } } else { nf.Dialog.showOkDialog({ dialogContent: 'Property name must be specified.', From cd845c08f27a44092389af18a9753f328f46b622 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Fri, 10 Apr 2015 12:34:52 -0400 Subject: [PATCH 3/4] NIFI-508: - Fixing the ordering of words when the text wraps.. --- .../src/main/webapp/js/nf/canvas/nf-canvas-utils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js index f1cb458fb1..4c6be57d44 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js @@ -311,8 +311,9 @@ nf.CanvasUtils = (function () { // if we've reached the last line, use single line ellipsis if (++i >= lineCount) { - // restore the current word - var remainder = [word].concat(words); + // get the remainder using the current word and + // reversing whats left + var remainder = [word].concat(words.reverse()); // apply ellipsis to the last line nf.CanvasUtils.ellipsis(tspan, remainder.join(' ')); @@ -322,7 +323,7 @@ nf.CanvasUtils = (function () { } else { tspan.text(word); - // other prep the line for the next iteration + // prep the line for the next iteration line = [word]; } } From df5755514c43bc297295ac8d39c650ab2aa381db Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Fri, 10 Apr 2015 14:48:01 -0400 Subject: [PATCH 4/4] NIFI-510: - Only reacting to window resize events when the target of the event is the window. --- .../src/main/webapp/js/nf/canvas/nf-canvas.js | 8 +++++--- .../src/main/webapp/js/application.js | 13 +++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js index 6fda98481b..38894d8d2b 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js @@ -529,9 +529,11 @@ nf.Canvas = (function () { }; // listen for browser resize events to reset the graph size - $(window).on('resize', function () { - updateGraphSize(); - nf.Settings.resetTableSize(); + $(window).on('resize', function (e) { + if (e.target === window) { + updateGraphSize(); + nf.Settings.resetTableSize(); + } }).on('keydown', function (evt) { var isCtrl = evt.ctrlKey || evt.metaKey; diff --git a/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js b/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js index eb7bdfbb40..80a3df88ed 100644 --- a/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js +++ b/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js @@ -14,6 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* global Slick */ + $(document).ready(function () { ua.editable = $('#attribute-updater-editable').text() === 'true'; ua.init(); @@ -43,10 +46,12 @@ var ua = { var actionsGrid = ua.initActionsGrid(); // enable grid resizing - $(window).resize(function () { - conditionsGrid.resizeCanvas(); - actionsGrid.resizeCanvas(); - ua.resizeSelectedRuleNameField(); + $(window).resize(function (e) { + if (e.target === window) { + conditionsGrid.resizeCanvas(); + actionsGrid.resizeCanvas(); + ua.resizeSelectedRuleNameField(); + } }); // initialize the rule list