{"action":"created","comment":{"url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/comments/259773706","pull_request_review_id":207331325,"id":259773706,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1OTc3MzcwNg==","diff_hunk":"@@ -0,0 +1,352 @@\n+var Packlink = window.Packlink || {};\n+\n+(function () {\n+    function LocationPickerConstructor() {\n+        const days = [\n+            'monday',\n+            'tuesday',\n+            'wednesday',\n+            'thursday',\n+            'friday',\n+            'saturday',\n+            'sunday'\n+        ];\n+\n+        const searchKeys = [\n+            'id',\n+            'zip',\n+            'name',\n+            'address',\n+            'city'\n+        ];\n+\n+        let lang = null;\n+        let selectCallback = null;\n+\n+        let templateContainer = null;\n+\n+        let selectedLocation = null;\n+        let dropOffs = {};\n+        let renderedLocations = [];\n+\n+        let locations = {};\n+\n+        // Register public method and properties.\n+        this.display = display;\n+\n+        /**\n+         * Initializes location picker.map.event.trigger('resize');\n+         *\n+         * @param {array} locations Array of Drop-Off locations.\n+         * @param {function} selectLocationCallback callback that is called when user selects location.\n+         * @param {string} [language] Translation language code. Defaults to 'en' for English.\n+         */\n+        function display(locations, selectLocationCallback, language) {\n+            templateContainer = document.getElementById('template-container');\n+            lang = typeof language === 'undefined' ? 'en' : language;\n+            selectCallback = selectLocationCallback;\n+            initializeSearchBox();\n+            renderLocations(locations);\n+        }\n+\n+\n+        /**\n+         * Message receiver.\n+         *\n+         * @param {object} payload\n+         */\n+        function renderLocations(payload) {\n+            renderedLocations = [];\n+            for (let loc of payload) {\n+                locations[loc.id] = loc;\n+                renderedLocations.push(loc.id);\n+            }\n+\n+            addLocations();\n+        }\n+\n+        /**\n+         * Initializes search-box.\n+         */\n+        function initializeSearchBox() {\n+            let searchBox = getElement(document, 'search-box');\n+\n+            if (searchBox) {\n+                searchBox.addEventListener('keyup', debounce(200, searchBoxKeyupHandler));\n+\n+                let searchLabel = getElement(document, 'search-box-label');\n+                searchLabel.innerHTML = getTranslation(lang, ['searchLabel']);\n+            }\n+        }\n+\n+        /**\n+         * Handles keyup on search-box.\n+         *\n+         * @param event\n+         */\n+        function searchBoxKeyupHandler(event) {\n+            let value = event.target.value;\n+\n+            renderedLocations = Object.keys(locations);\n+\n+            if (value !== '') {\n+                renderedLocations = [];\n+\n+                for (let term of searchKeys) {\n+                    let result = filterByKey(locations, term, value);\n+                    renderedLocations.push(...result);\n+                }\n+\n+                renderedLocations = renderedLocations.filter(function (value, index, array) {\n+                    return array.indexOf(value) === index;\n+                })\n+            }\n+\n+            addLocations();\n+        }\n+\n+        /**\n+         * Adds Locations.\n+         */\n+        function addLocations() {\n+            let locationsNode = getElement(document, 'locations');\n+\n+            while (locationsNode.firstChild) {\n+                locationsNode.firstChild.remove();\n+            }\n+\n+            for (let displayed in dropOffs) {\n+                if (dropOffs.hasOwnProperty(displayed)) {\n+                    dropOffs[displayed].remove();\n+                }\n+            }\n+\n+            dropOffs = {};\n+            selectedLocation = null;\n+\n+            for (let id of renderedLocations) {\n+                let location = locations[id];\n+                let locationElement = createLocation(location);\n+                dropOffs[id] = locationElement;","path":"src/BusinessLogic/Resources/LocationPicker/js/LocationPicker.js","position":130,"original_position":130,"commit_id":"256f2974d7cc1a8a0826db4e9884aabe7024ae17","original_commit_id":"256f2974d7cc1a8a0826db4e9884aabe7024ae17","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Generic Object Injection Sink (security/detect-object-injection)](https://app.codacy.com/app/Packlink/ecommerce_module_core/pullRequest?prid=2801996)","created_at":"2019-02-25T11:00:16Z","updated_at":"2019-02-25T11:00:17Z","html_url":"https://github.com/packlink-dev/ecommerce_module_core/pull/2#discussion_r259773706","pull_request_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/comments/259773706"},"html":{"href":"https://github.com/packlink-dev/ecommerce_module_core/pull/2#discussion_r259773706"},"pull_request":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/2","id":241361921,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMzYxOTIx","html_url":"https://github.com/packlink-dev/ecommerce_module_core/pull/2","diff_url":"https://github.com/packlink-dev/ecommerce_module_core/pull/2.diff","patch_url":"https://github.com/packlink-dev/ecommerce_module_core/pull/2.patch","issue_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/issues/2","number":2,"state":"open","locked":false,"title":"Add implementation for services and controllers","user":{"login":"logeecom","id":20204230,"node_id":"MDQ6VXNlcjIwMjA0MjMw","avatar_url":"https://avatars3.githubusercontent.com/u/20204230?v=4","gravatar_id":"","url":"https://api.github.com/users/logeecom","html_url":"https://github.com/logeecom","followers_url":"https://api.github.com/users/logeecom/followers","following_url":"https://api.github.com/users/logeecom/following{/other_user}","gists_url":"https://api.github.com/users/logeecom/gists{/gist_id}","starred_url":"https://api.github.com/users/logeecom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logeecom/subscriptions","organizations_url":"https://api.github.com/users/logeecom/orgs","repos_url":"https://api.github.com/users/logeecom/repos","events_url":"https://api.github.com/users/logeecom/events{/privacy}","received_events_url":"https://api.github.com/users/logeecom/received_events","type":"User","site_admin":false},"body":"Add proper unit tests.","created_at":"2018-12-28T16:36:14Z","updated_at":"2019-02-25T11:00:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e61a5bef0ca1d7975a50665b85bec7377ba8d406","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/2/commits","review_comments_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/2/comments","review_comment_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/issues/2/comments","statuses_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/statuses/256f2974d7cc1a8a0826db4e9884aabe7024ae17","head":{"label":"logeecom:dev","ref":"dev","sha":"256f2974d7cc1a8a0826db4e9884aabe7024ae17","user":{"login":"logeecom","id":20204230,"node_id":"MDQ6VXNlcjIwMjA0MjMw","avatar_url":"https://avatars3.githubusercontent.com/u/20204230?v=4","gravatar_id":"","url":"https://api.github.com/users/logeecom","html_url":"https://github.com/logeecom","followers_url":"https://api.github.com/users/logeecom/followers","following_url":"https://api.github.com/users/logeecom/following{/other_user}","gists_url":"https://api.github.com/users/logeecom/gists{/gist_id}","starred_url":"https://api.github.com/users/logeecom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logeecom/subscriptions","organizations_url":"https://api.github.com/users/logeecom/orgs","repos_url":"https://api.github.com/users/logeecom/repos","events_url":"https://api.github.com/users/logeecom/events{/privacy}","received_events_url":"https://api.github.com/users/logeecom/received_events","type":"User","site_admin":false},"repo":{"id":162699141,"node_id":"MDEwOlJlcG9zaXRvcnkxNjI2OTkxNDE=","name":"pl_module_core","full_name":"logeecom/pl_module_core","private":false,"owner":{"login":"logeecom","id":20204230,"node_id":"MDQ6VXNlcjIwMjA0MjMw","avatar_url":"https://avatars3.githubusercontent.com/u/20204230?v=4","gravatar_id":"","url":"https://api.github.com/users/logeecom","html_url":"https://github.com/logeecom","followers_url":"https://api.github.com/users/logeecom/followers","following_url":"https://api.github.com/users/logeecom/following{/other_user}","gists_url":"https://api.github.com/users/logeecom/gists{/gist_id}","starred_url":"https://api.github.com/users/logeecom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logeecom/subscriptions","organizations_url":"https://api.github.com/users/logeecom/orgs","repos_url":"https://api.github.com/users/logeecom/repos","events_url":"https://api.github.com/users/logeecom/events{/privacy}","received_events_url":"https://api.github.com/users/logeecom/received_events","type":"User","site_admin":false},"html_url":"https://github.com/logeecom/pl_module_core","description":null,"fork":true,"url":"https://api.github.com/repos/logeecom/pl_module_core","forks_url":"https://api.github.com/repos/logeecom/pl_module_core/forks","keys_url":"https://api.github.com/repos/logeecom/pl_module_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/logeecom/pl_module_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/logeecom/pl_module_core/teams","hooks_url":"https://api.github.com/repos/logeecom/pl_module_core/hooks","issue_events_url":"https://api.github.com/repos/logeecom/pl_module_core/issues/events{/number}","events_url":"https://api.github.com/repos/logeecom/pl_module_core/events","assignees_url":"https://api.github.com/repos/logeecom/pl_module_core/assignees{/user}","branches_url":"https://api.github.com/repos/logeecom/pl_module_core/branches{/branch}","tags_url":"https://api.github.com/repos/logeecom/pl_module_core/tags","blobs_url":"https://api.github.com/repos/logeecom/pl_module_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/logeecom/pl_module_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/logeecom/pl_module_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/logeecom/pl_module_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/logeecom/pl_module_core/statuses/{sha}","languages_url":"https://api.github.com/repos/logeecom/pl_module_core/languages","stargazers_url":"https://api.github.com/repos/logeecom/pl_module_core/stargazers","contributors_url":"https://api.github.com/repos/logeecom/pl_module_core/contributors","subscribers_url":"https://api.github.com/repos/logeecom/pl_module_core/subscribers","subscription_url":"https://api.github.com/repos/logeecom/pl_module_core/subscription","commits_url":"https://api.github.com/repos/logeecom/pl_module_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/logeecom/pl_module_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/logeecom/pl_module_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/logeecom/pl_module_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/logeecom/pl_module_core/contents/{+path}","compare_url":"https://api.github.com/repos/logeecom/pl_module_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/logeecom/pl_module_core/merges","archive_url":"https://api.github.com/repos/logeecom/pl_module_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/logeecom/pl_module_core/downloads","issues_url":"https://api.github.com/repos/logeecom/pl_module_core/issues{/number}","pulls_url":"https://api.github.com/repos/logeecom/pl_module_core/pulls{/number}","milestones_url":"https://api.github.com/repos/logeecom/pl_module_core/milestones{/number}","notifications_url":"https://api.github.com/repos/logeecom/pl_module_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/logeecom/pl_module_core/labels{/name}","releases_url":"https://api.github.com/repos/logeecom/pl_module_core/releases{/id}","deployments_url":"https://api.github.com/repos/logeecom/pl_module_core/deployments","created_at":"2018-12-21T10:11:15Z","updated_at":"2018-12-21T10:37:42Z","pushed_at":"2019-02-25T10:38:09Z","git_url":"git://github.com/logeecom/pl_module_core.git","ssh_url":"git@github.com:logeecom/pl_module_core.git","clone_url":"https://github.com/logeecom/pl_module_core.git","svn_url":"https://github.com/logeecom/pl_module_core","homepage":"","size":769,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"packlink-dev:dev","ref":"dev","sha":"fd6490b751a3c8bf070fbe95be4699bf2419e184","user":{"login":"packlink-dev","id":5609794,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2MDk3OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5609794?v=4","gravatar_id":"","url":"https://api.github.com/users/packlink-dev","html_url":"https://github.com/packlink-dev","followers_url":"https://api.github.com/users/packlink-dev/followers","following_url":"https://api.github.com/users/packlink-dev/following{/other_user}","gists_url":"https://api.github.com/users/packlink-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/packlink-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/packlink-dev/subscriptions","organizations_url":"https://api.github.com/users/packlink-dev/orgs","repos_url":"https://api.github.com/users/packlink-dev/repos","events_url":"https://api.github.com/users/packlink-dev/events{/privacy}","received_events_url":"https://api.github.com/users/packlink-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":156679405,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY2Nzk0MDU=","name":"ecommerce_module_core","full_name":"packlink-dev/ecommerce_module_core","private":false,"owner":{"login":"packlink-dev","id":5609794,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2MDk3OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5609794?v=4","gravatar_id":"","url":"https://api.github.com/users/packlink-dev","html_url":"https://github.com/packlink-dev","followers_url":"https://api.github.com/users/packlink-dev/followers","following_url":"https://api.github.com/users/packlink-dev/following{/other_user}","gists_url":"https://api.github.com/users/packlink-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/packlink-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/packlink-dev/subscriptions","organizations_url":"https://api.github.com/users/packlink-dev/orgs","repos_url":"https://api.github.com/users/packlink-dev/repos","events_url":"https://api.github.com/users/packlink-dev/events{/privacy}","received_events_url":"https://api.github.com/users/packlink-dev/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/packlink-dev/ecommerce_module_core","description":"Core library for e-commerces (PS, Woo, Magento, etc) modules","fork":false,"url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core","forks_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/forks","keys_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/teams","hooks_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/hooks","issue_events_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/issues/events{/number}","events_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/events","assignees_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/assignees{/user}","branches_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/branches{/branch}","tags_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/tags","blobs_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/statuses/{sha}","languages_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/languages","stargazers_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/stargazers","contributors_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/contributors","subscribers_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/subscribers","subscription_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/subscription","commits_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/contents/{+path}","compare_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/merges","archive_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/downloads","issues_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/issues{/number}","pulls_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls{/number}","milestones_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/milestones{/number}","notifications_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/labels{/name}","releases_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/releases{/id}","deployments_url":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/deployments","created_at":"2018-11-08T09:07:59Z","updated_at":"2019-01-04T12:24:55Z","pushed_at":"2019-02-25T10:38:18Z","git_url":"git://github.com/packlink-dev/ecommerce_module_core.git","ssh_url":"git@github.com:packlink-dev/ecommerce_module_core.git","clone_url":"https://github.com/packlink-dev/ecommerce_module_core.git","svn_url":"https://github.com/packlink-dev/ecommerce_module_core","homepage":null,"size":151,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/2"},"html":{"href":"https://github.com/packlink-dev/ecommerce_module_core/pull/2"},"issue":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/issues/2"},"comments":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/packlink-dev/ecommerce_module_core/statuses/256f2974d7cc1a8a0826db4e9884aabe7024ae17"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"codacy-bot"}}