You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/12/01 00:47:13 UTC

[GitHub] [nifi] mtien-apache commented on a change in pull request #5559: NIFI-9336 - Show icon for property values with leading or trailing whitespace

mtien-apache commented on a change in pull request #5559:
URL: https://github.com/apache/nifi/pull/5559#discussion_r759771041



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
##########
@@ -996,6 +996,30 @@
             }
         },
 
+        /**
+         * Returns a tooltip for leading and/or trailing whitespace.
+         *
+         * @returns {string}
+         */
+        formatWhitespaceTooltip: function () {
+            return nfCommon.escapeHtml('The specified value contains leading and/or trailing whitespace character(s). ' +
+                'This could produce unexpected results if it was not intentional.');
+
+        },
+
+        /**
+         * Checks the specified value for leading and/or trailing whitespace.
+         *
+         * @argument {string} value     The value to check
+         */
+        hasWhitespace : function (value) {
+            if (!value) {
+                return false;
+            }
+            var leadOrTrailWhitespaceRegex = /^[ \s]+|[ \s]+$/;

Review comment:
       Thanks for reviewing, @mcgilman! I misunderstood the criteria. I've changed the condition to return `true` if the value has leading and/or trailing whitespace and to return `false` if the value is _only_ whitespace.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org