GitHub PullRequestReviewCommentEvent at 2014-11-19 13:41:41
Repository: rdstation-js-integration
Actor: marcelinol
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/comments/20574672","id":20574672,"diff_hunk":"@@ -79,10 +79,28 @@ var RdIntegration = (function () {\n       var inputs = $($form).find(':input');\n       inputs = _removeNotAllowedFields(inputs);\n       inputs = inputs.serializeArray();\n+      inputs = _fieldMap(inputs);\n       inputs.push($accountSettings.identifier, $accountSettings.token, $accountSettings.c_utmz);\n       return inputs;\n     },\n \n+    _fieldMap = function (inputs) {\n+      if ($options.fieldMapping) {\n+        inputs = _translateFields(inputs);\n+      }\n+      return inputs;\n+    },\n+\n+    _translateFields = function (inputs) {","path":"app/rd-js-integration.js","position":54,"original_position":54,"commit_id":"3f24744c159af82f38513d326b1706470e92713f","original_commit_id":"3f24744c159af82f38513d326b1706470e92713f","user":{"login":"marcelinol","id":7313714,"avatar_url":"https://avatars.githubusercontent.com/u/7313714?v=3","gravatar_id":"","url":"https://api.github.com/users/marcelinol","html_url":"https://github.com/marcelinol","followers_url":"https://api.github.com/users/marcelinol/followers","following_url":"https://api.github.com/users/marcelinol/following{/other_user}","gists_url":"https://api.github.com/users/marcelinol/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelinol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelinol/subscriptions","organizations_url":"https://api.github.com/users/marcelinol/orgs","repos_url":"https://api.github.com/users/marcelinol/repos","events_url":"https://api.github.com/users/marcelinol/events{/privacy}","received_events_url":"https://api.github.com/users/marcelinol/received_events","type":"User","site_admin":false},"body":"pedi umas sugestões pro @geisonbiazus :smile: ","created_at":"2014-11-19T13:41:41Z","updated_at":"2014-11-19T13:41:41Z","html_url":"https://github.com/ResultadosDigitais/rdstation-js-integration/pull/19#discussion_r20574672","pull_request_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/comments/20574672"},"html":{"href":"https://github.com/ResultadosDigitais/rdstation-js-integration/pull/19#discussion_r20574672"},"pull_request":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/19","id":24687077,"html_url":"https://github.com/ResultadosDigitais/rdstation-js-integration/pull/19","diff_url":"https://github.com/ResultadosDigitais/rdstation-js-integration/pull/19.diff","patch_url":"https://github.com/ResultadosDigitais/rdstation-js-integration/pull/19.patch","issue_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues/19","number":19,"state":"open","locked":false,"title":"De para","user":{"login":"marcelinol","id":7313714,"avatar_url":"https://avatars.githubusercontent.com/u/7313714?v=3","gravatar_id":"","url":"https://api.github.com/users/marcelinol","html_url":"https://github.com/marcelinol","followers_url":"https://api.github.com/users/marcelinol/followers","following_url":"https://api.github.com/users/marcelinol/following{/other_user}","gists_url":"https://api.github.com/users/marcelinol/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelinol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelinol/subscriptions","organizations_url":"https://api.github.com/users/marcelinol/orgs","repos_url":"https://api.github.com/users/marcelinol/repos","events_url":"https://api.github.com/users/marcelinol/events{/privacy}","received_events_url":"https://api.github.com/users/marcelinol/received_events","type":"User","site_admin":false},"body":"O usuário informa qual o *name* do input dele e a qual dado do RD Station esse input se refere e o script envia os dados corretamente.\r\n\r\nMuito importante para tornar o JS Integration mais universal (aceitando qualquer input de e-mail) e futuramente  atenderá à nova infra de campos customizados.\r\n\r\nO objeto com os dados do De-para estão dentro de outro objeto porque futuramente será implementado uym mecanismo para retirar os campos que o cliente não quer que sejam enviados ao RD Station.\r\n\r\nTestes:\r\n\r\n- [ ] Traduz corretamente os campos;\r\n- [ ] Não quebra quando há mais dados no De-para do que no formulário;\r\n- [ ] Não quebra quando o campo escrito pelo usuário não existe no formulário;\r\n","created_at":"2014-11-19T13:15:25Z","updated_at":"2014-11-19T13:41:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2093f0529bc826b9f78f8a13125f6d6114f1b232","assignee":{"login":"pedrovitti","id":446112,"avatar_url":"https://avatars.githubusercontent.com/u/446112?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrovitti","html_url":"https://github.com/pedrovitti","followers_url":"https://api.github.com/users/pedrovitti/followers","following_url":"https://api.github.com/users/pedrovitti/following{/other_user}","gists_url":"https://api.github.com/users/pedrovitti/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrovitti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrovitti/subscriptions","organizations_url":"https://api.github.com/users/pedrovitti/orgs","repos_url":"https://api.github.com/users/pedrovitti/repos","events_url":"https://api.github.com/users/pedrovitti/events{/privacy}","received_events_url":"https://api.github.com/users/pedrovitti/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/19/commits","review_comments_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/19/comments","review_comment_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues/19/comments","statuses_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/statuses/3f24744c159af82f38513d326b1706470e92713f","head":{"label":"ResultadosDigitais:de-para","ref":"de-para","sha":"3f24744c159af82f38513d326b1706470e92713f","user":{"login":"ResultadosDigitais","id":817058,"avatar_url":"https://avatars.githubusercontent.com/u/817058?v=3","gravatar_id":"","url":"https://api.github.com/users/ResultadosDigitais","html_url":"https://github.com/ResultadosDigitais","followers_url":"https://api.github.com/users/ResultadosDigitais/followers","following_url":"https://api.github.com/users/ResultadosDigitais/following{/other_user}","gists_url":"https://api.github.com/users/ResultadosDigitais/gists{/gist_id}","starred_url":"https://api.github.com/users/ResultadosDigitais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ResultadosDigitais/subscriptions","organizations_url":"https://api.github.com/users/ResultadosDigitais/orgs","repos_url":"https://api.github.com/users/ResultadosDigitais/repos","events_url":"https://api.github.com/users/ResultadosDigitais/events{/privacy}","received_events_url":"https://api.github.com/users/ResultadosDigitais/received_events","type":"Organization","site_admin":false},"repo":{"id":22604202,"name":"rdstation-js-integration","full_name":"ResultadosDigitais/rdstation-js-integration","owner":{"login":"ResultadosDigitais","id":817058,"avatar_url":"https://avatars.githubusercontent.com/u/817058?v=3","gravatar_id":"","url":"https://api.github.com/users/ResultadosDigitais","html_url":"https://github.com/ResultadosDigitais","followers_url":"https://api.github.com/users/ResultadosDigitais/followers","following_url":"https://api.github.com/users/ResultadosDigitais/following{/other_user}","gists_url":"https://api.github.com/users/ResultadosDigitais/gists{/gist_id}","starred_url":"https://api.github.com/users/ResultadosDigitais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ResultadosDigitais/subscriptions","organizations_url":"https://api.github.com/users/ResultadosDigitais/orgs","repos_url":"https://api.github.com/users/ResultadosDigitais/repos","events_url":"https://api.github.com/users/ResultadosDigitais/events{/privacy}","received_events_url":"https://api.github.com/users/ResultadosDigitais/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ResultadosDigitais/rdstation-js-integration","description":"Criar uma plataforma de integração com aplicações de clientes independente da tecnologia.","fork":false,"url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration","forks_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/forks","keys_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/teams","hooks_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/hooks","issue_events_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues/events{/number}","events_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/events","assignees_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/assignees{/user}","branches_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/branches{/branch}","tags_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/tags","blobs_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/statuses/{sha}","languages_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/languages","stargazers_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/stargazers","contributors_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/contributors","subscribers_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/subscribers","subscription_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/subscription","commits_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues/comments/{number}","contents_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/contents/{+path}","compare_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/merges","archive_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/downloads","issues_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues{/number}","pulls_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls{/number}","milestones_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/milestones{/number}","notifications_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/labels{/name}","releases_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/releases{/id}","created_at":"2014-08-04T13:01:51Z","updated_at":"2014-11-18T16:17:01Z","pushed_at":"2014-11-19T13:35:40Z","git_url":"git://github.com/ResultadosDigitais/rdstation-js-integration.git","ssh_url":"git@github.com:ResultadosDigitais/rdstation-js-integration.git","clone_url":"https://github.com/ResultadosDigitais/rdstation-js-integration.git","svn_url":"https://github.com/ResultadosDigitais/rdstation-js-integration","homepage":null,"size":11324,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"ResultadosDigitais:master","ref":"master","sha":"ad83f6c4ee843788b427ebd7d12246091c2854d2","user":{"login":"ResultadosDigitais","id":817058,"avatar_url":"https://avatars.githubusercontent.com/u/817058?v=3","gravatar_id":"","url":"https://api.github.com/users/ResultadosDigitais","html_url":"https://github.com/ResultadosDigitais","followers_url":"https://api.github.com/users/ResultadosDigitais/followers","following_url":"https://api.github.com/users/ResultadosDigitais/following{/other_user}","gists_url":"https://api.github.com/users/ResultadosDigitais/gists{/gist_id}","starred_url":"https://api.github.com/users/ResultadosDigitais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ResultadosDigitais/subscriptions","organizations_url":"https://api.github.com/users/ResultadosDigitais/orgs","repos_url":"https://api.github.com/users/ResultadosDigitais/repos","events_url":"https://api.github.com/users/ResultadosDigitais/events{/privacy}","received_events_url":"https://api.github.com/users/ResultadosDigitais/received_events","type":"Organization","site_admin":false},"repo":{"id":22604202,"name":"rdstation-js-integration","full_name":"ResultadosDigitais/rdstation-js-integration","owner":{"login":"ResultadosDigitais","id":817058,"avatar_url":"https://avatars.githubusercontent.com/u/817058?v=3","gravatar_id":"","url":"https://api.github.com/users/ResultadosDigitais","html_url":"https://github.com/ResultadosDigitais","followers_url":"https://api.github.com/users/ResultadosDigitais/followers","following_url":"https://api.github.com/users/ResultadosDigitais/following{/other_user}","gists_url":"https://api.github.com/users/ResultadosDigitais/gists{/gist_id}","starred_url":"https://api.github.com/users/ResultadosDigitais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ResultadosDigitais/subscriptions","organizations_url":"https://api.github.com/users/ResultadosDigitais/orgs","repos_url":"https://api.github.com/users/ResultadosDigitais/repos","events_url":"https://api.github.com/users/ResultadosDigitais/events{/privacy}","received_events_url":"https://api.github.com/users/ResultadosDigitais/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ResultadosDigitais/rdstation-js-integration","description":"Criar uma plataforma de integração com aplicações de clientes independente da tecnologia.","fork":false,"url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration","forks_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/forks","keys_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/teams","hooks_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/hooks","issue_events_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues/events{/number}","events_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/events","assignees_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/assignees{/user}","branches_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/branches{/branch}","tags_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/tags","blobs_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/statuses/{sha}","languages_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/languages","stargazers_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/stargazers","contributors_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/contributors","subscribers_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/subscribers","subscription_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/subscription","commits_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues/comments/{number}","contents_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/contents/{+path}","compare_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/merges","archive_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/downloads","issues_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues{/number}","pulls_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls{/number}","milestones_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/milestones{/number}","notifications_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/labels{/name}","releases_url":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/releases{/id}","created_at":"2014-08-04T13:01:51Z","updated_at":"2014-11-18T16:17:01Z","pushed_at":"2014-11-19T13:35:40Z","git_url":"git://github.com/ResultadosDigitais/rdstation-js-integration.git","ssh_url":"git@github.com:ResultadosDigitais/rdstation-js-integration.git","clone_url":"https://github.com/ResultadosDigitais/rdstation-js-integration.git","svn_url":"https://github.com/ResultadosDigitais/rdstation-js-integration","homepage":null,"size":11324,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/19"},"html":{"href":"https://github.com/ResultadosDigitais/rdstation-js-integration/pull/19"},"issue":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues/19"},"comments":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/ResultadosDigitais/rdstation-js-integration/statuses/3f24744c159af82f38513d326b1706470e92713f"}}}}