You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by scottyaslan <gi...@git.apache.org> on 2017/04/07 16:38:57 UTC

[GitHub] nifi pull request #1659: [NIFI-3035] use api supported .entries() to iterate...

GitHub user scottyaslan opened a pull request:

    https://github.com/apache/nifi/pull/1659

    [NIFI-3035] use api supported .entries() to iterate over URLSearchParams

    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [ ] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [ ] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/scottyaslan/nifi NIFI-3035

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1659.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1659
    
----
commit 4f65a138ea74d8903b881b6556f774b121ee61ef
Author: Scott Aslan <sc...@gmail.com>
Date:   2017-04-07T15:45:08Z

    [NIFI-3035] use api supported .entries() to iterate over URLSearchParams

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1659: [NIFI-3035] use api supported .entries() to iterate...

Posted by gresockj <gi...@git.apache.org>.
Github user gresockj commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1659#discussion_r110865211
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js ---
    @@ -412,9 +412,9 @@
     
                     // create object whose keys are the parameter name and the values are the parameter values
                     var paramsObject = {};
    -                params.forEach(function (v, k) {
    -                    paramsObject[k] = v;
    -                });
    +                for(var pair of params.entries()) {
    --- End diff --
    
    Yes, this works in build and in bringing up the console!  Thanks for the update.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1659: [NIFI-3035] use URLSearchParams .toString() to upda...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/1659


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1659: [NIFI-3035] use api supported .entries() to iterate...

Posted by gresockj <gi...@git.apache.org>.
Github user gresockj commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1659#discussion_r110669589
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js ---
    @@ -412,9 +412,9 @@
     
                     // create object whose keys are the parameter name and the values are the parameter values
                     var paramsObject = {};
    -                params.forEach(function (v, k) {
    -                    paramsObject[k] = v;
    -                });
    +                for(var pair of params.entries()) {
    --- End diff --
    
    Interesting, I see what you mean.  When I build the nifi-web-ui module with the "of" in place, I get the following error:
    [ERROR] /var/local/workspace/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js [1:0]: Compilation produced 301 syntax errors.
    [ERROR] ...nf-canvas-utils.js:line 1:column 0:Compilation produced 301 syntax errors.
    
    However, when I change "of " to "in", the error goes away and it is able to build the nar.  How did you get around this issue?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1659: [NIFI-3035] use api supported .entries() to iterate...

Posted by gresockj <gi...@git.apache.org>.
Github user gresockj commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1659#discussion_r110516478
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js ---
    @@ -412,9 +412,9 @@
     
                     // create object whose keys are the parameter name and the values are the parameter values
                     var paramsObject = {};
    -                params.forEach(function (v, k) {
    -                    paramsObject[k] = v;
    -                });
    +                for(var pair of params.entries()) {
    --- End diff --
    
    I think this should be "pair **in** params.entries()"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1659: [NIFI-3035] use api supported .entries() to iterate...

Posted by scottyaslan <gi...@git.apache.org>.
Github user scottyaslan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1659#discussion_r110667414
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js ---
    @@ -412,9 +412,9 @@
     
                     // create object whose keys are the parameter name and the values are the parameter values
                     var paramsObject = {};
    -                params.forEach(function (v, k) {
    -                    paramsObject[k] = v;
    -                });
    +                for(var pair of params.entries()) {
    --- End diff --
    
    Changing the "of" to "in" is not correct... I tried it and verified that using the "in" breaks deep linking. If you look here (in the Browser Compatibility section): https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams we see that "for...of" is the supported way to iterate over the GET params...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1659: [NIFI-3035] use URLSearchParams .toString() to update URL

Posted by mcgilman <gi...@git.apache.org>.
Github user mcgilman commented on the issue:

    https://github.com/apache/nifi/pull/1659
  
    Thanks guys. This has been merged to master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1659: [NIFI-3035] use api supported .entries() to iterate...

Posted by gresockj <gi...@git.apache.org>.
Github user gresockj commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1659#discussion_r110516800
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js ---
    @@ -412,9 +412,9 @@
     
                     // create object whose keys are the parameter name and the values are the parameter values
                     var paramsObject = {};
    -                params.forEach(function (v, k) {
    -                    paramsObject[k] = v;
    -                });
    +                for(var pair of params.entries()) {
    --- End diff --
    
    Btw, after I applied your patch and changed "of" to "in", the issue was indeed resolved and I can now load the console.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1659: [NIFI-3035] use URLSearchParams .toString() to upda...

Posted by scottyaslan <gi...@git.apache.org>.
Github user scottyaslan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1659#discussion_r110898619
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js ---
    @@ -412,9 +412,9 @@
     
                     // create object whose keys are the parameter name and the values are the parameter values
                     var paramsObject = {};
    -                params.forEach(function (v, k) {
    -                    paramsObject[k] = v;
    -                });
    +                for(var pair of params.entries()) {
    --- End diff --
    
    :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1659: [NIFI-3035] use api supported .entries() to iterate...

Posted by scottyaslan <gi...@git.apache.org>.
Github user scottyaslan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1659#discussion_r110735389
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js ---
    @@ -412,9 +412,9 @@
     
                     // create object whose keys are the parameter name and the values are the parameter values
                     var paramsObject = {};
    -                params.forEach(function (v, k) {
    -                    paramsObject[k] = v;
    -                });
    +                for(var pair of params.entries()) {
    --- End diff --
    
    Good catch! As it turns out we dont need to loop over the URLSearchParams...we can just use the .toString(). I have updated this PR to reflect this change. Please test and let me know if it works for you.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---