You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2023/04/04 14:25:10 UTC

[GitHub] [nifi] exceptionfactory commented on a diff in pull request #7117: NIFI-11287: detect dependent properties when the property it depends on references a parameter (UI)

exceptionfactory commented on code in PR #7117:
URL: https://github.com/apache/nifi/pull/7117#discussion_r1157337337


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js:
##########
@@ -2001,6 +2021,43 @@
         propertyData.setItems([]);
     };
 
+    /**
+     * Gets all the referenced parameters from the {parameterContext} based on the value of {parameterReference} with matching {sensitive} property
+     *
+     * @param {string} parameterReference
+     * @param {ParameterContextEntity} parameterContext
+     * @param {boolean} sensitive
+     * @returns {ParameterEntity[]}
+     */
+    var getExistingParametersReferenced = function (parameterReference, parameterContext, sensitive) {
+        var parameters = _.get(parameterContext.component, 'parameters', []);
+        var existingParametersReferenced = [];
+
+        if (!_.isNil(parameterReference) && !_.isEmpty(parameters)) {
+            // can't use from common/constants because we are modifying the lastIndex below
+            var paramRefsRegex = /#{(')?([a-zA-Z0-9-_. ]+)\1}/gm;

Review Comment:
   Is it necessary to define a capturing group for the `'` character? It seems like the pattern could be adjusted to use a single capturing group:
   ```suggestion
               var paramRefsRegex = /#{'?([a-zA-Z0-9-_. ]+)'?}/gm;
   ```



-- 
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