{"action":"created","comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments/172177077","pull_request_review_id":101148516,"id":172177077,"diff_hunk":"@@ -290,23 +295,179 @@ describe('editor/layers/layers-content-view/data/data-content-view', function ()\n     expect(view.$('.js-apply').hasClass('.CDB-Size-small')).toBeFalsy();\n   });\n \n-  it('should manage time-series properly', function () {\n-    renderSpy.and.callThrough();\n-    handleWidgetSpy.and.callThrough();\n-    normalizeTSColumnSpy.and.callThrough();\n+  describe('._handleWidget', function () {\n+    var saveWidgetOptionSpy;\n \n-    view.render();\n+    beforeEach(function () {\n+      renderSpy.and.callThrough();\n+      handleWidgetSpy.and.callThrough();\n+      saveWidgetOptionSpy = spyOn(view._userActions, 'saveWidgetOption')\n+        .and.returnValue(Promise.resolve(view._columnsCollection.at(1)));\n+    });\n+\n+    it('should be called when a widget selected state is changed', function () {\n+      view.render();\n+\n+      view._columnsCollection.at(1).set({ selected: true });\n \n-    view._columnsModel.set({ render: true });\n-    expect(view._renderStats).toHaveBeenCalled();\n+      expect(view._handleWidget).toHaveBeenCalled();\n+    });\n+\n+    it('should call add a new widget if the model is selected', function () {\n+      spyOn(view, '_addWidget');\n+\n+      view.render();\n \n-    view._columnsCollection.at(1).set({ selected: true });\n-    expect(view._handleWidget).toHaveBeenCalled();\n+      view._columnsCollection.at(1).set({ selected: true });\n+      view._handleWidget(view._columnsCollection.at(1));\n \n-    view._columnsCollection.at(2).set({ selected: true });\n-    expect(view._columnsCollection.at(2).get('widget')).toBeTruthy();\n-    expect(view._normalizeTimeSeriesColumn).toHaveBeenCalled();\n-    expect(view._columnsCollection.at(1).get('selected')).toBe(false);\n-    expect(view._columnsCollection.at(1).get('widget')).toBeFalsy();\n+      expect(view._addWidget).toHaveBeenCalledWith(view._columnsCollection.at(1));\n+    });\n+\n+    it('should destroy the widget if the model is selected', function () {\n+      spyOn(view, '_destroyWidget');\n+\n+      view.render();\n+\n+      view._handleWidget(view._columnsCollection.at(1));\n+\n+      expect(view._handleWidget).toHaveBeenCalled();\n+      expect(view._destroyWidget).toHaveBeenCalledWith(view._columnsCollection.at(1));\n+    });\n+  });\n+\n+  describe('._addWidget', function () {\n+    var saveWidgetOptionSpy;","path":"lib/assets/test/spec/builder/editor/layers/layer-content-view/data/data-content-view.spec.js","position":110,"original_position":110,"commit_id":"c52562e6f612ce29593476cdea52a3d664ddac58","original_commit_id":"c52562e6f612ce29593476cdea52a3d664ddac58","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"'saveWidgetOptionSpy' is assigned a value but never used  no-unused-vars","created_at":"2018-03-05T12:54:17Z","updated_at":"2018-03-05T12:54:18Z","html_url":"https://github.com/CartoDB/cartodb/pull/13587#discussion_r172177077","pull_request_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/13587","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments/172177077"},"html":{"href":"https://github.com/CartoDB/cartodb/pull/13587#discussion_r172177077"},"pull_request":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/13587"}}},"pull_request":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/13587","id":170004582,"html_url":"https://github.com/CartoDB/cartodb/pull/13587","diff_url":"https://github.com/CartoDB/cartodb/pull/13587.diff","patch_url":"https://github.com/CartoDB/cartodb/pull/13587.patch","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/13587","number":13587,"state":"open","locked":false,"title":"Make widgets appear on top v2 [WIP]","user":{"login":"elenatorro","id":3824953,"avatar_url":"https://avatars2.githubusercontent.com/u/3824953?v=4","gravatar_id":"","url":"https://api.github.com/users/elenatorro","html_url":"https://github.com/elenatorro","followers_url":"https://api.github.com/users/elenatorro/followers","following_url":"https://api.github.com/users/elenatorro/following{/other_user}","gists_url":"https://api.github.com/users/elenatorro/gists{/gist_id}","starred_url":"https://api.github.com/users/elenatorro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elenatorro/subscriptions","organizations_url":"https://api.github.com/users/elenatorro/orgs","repos_url":"https://api.github.com/users/elenatorro/repos","events_url":"https://api.github.com/users/elenatorro/events{/privacy}","received_events_url":"https://api.github.com/users/elenatorro/received_events","type":"User","site_admin":false},"body":"Related issue #13370\r\n\r\n## Screenshots \r\n\r\n![add_widget](https://user-images.githubusercontent.com/3824953/36389837-eebeb98a-15a0-11e8-9f78-a1b9eb3f519b.gif)\r\n\r\n## Acceptance\r\n- [ ] Pick an existing map with lots of widgets. Write down the widgets order.\r\n- [ ] Add new widgets in Builder in another map. Widgets should be added on top.\r\n- [ ] Check that the order of those new widgets is preserved in embed views.\r\n- [ ] Assert that the first map has the widgets in the same order.\r\n\r\n","created_at":"2018-02-19T16:27:30Z","updated_at":"2018-03-05T12:54:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b623308b545f949279851fa7304fbd3264a14892","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/13587/commits","review_comments_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/13587/comments","review_comment_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/13587/comments","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/c52562e6f612ce29593476cdea52a3d664ddac58","head":{"label":"CartoDB:13370-make-widgets-appear-on-top","ref":"13370-make-widgets-appear-on-top","sha":"c52562e6f612ce29593476cdea52a3d664ddac58","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars0.githubusercontent.com/u/1799254?v=4","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":4909355,"name":"cartodb","full_name":"CartoDB/cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars0.githubusercontent.com/u/1799254?v=4","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/cartodb","description":"Location Intelligence & Data Visualization tool","fork":false,"url":"https://api.github.com/repos/CartoDB/cartodb","forks_url":"https://api.github.com/repos/CartoDB/cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/cartodb/deployments","created_at":"2012-07-05T15:23:45Z","updated_at":"2018-03-04T22:15:33Z","pushed_at":"2018-03-05T12:54:00Z","git_url":"git://github.com/CartoDB/cartodb.git","ssh_url":"git@github.com:CartoDB/cartodb.git","clone_url":"https://github.com/CartoDB/cartodb.git","svn_url":"https://github.com/CartoDB/cartodb","homepage":"http://carto.com","size":366973,"stargazers_count":1773,"watchers_count":1773,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":491,"mirror_url":null,"archived":false,"open_issues_count":480,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":491,"open_issues":480,"watchers":1773,"default_branch":"master"}},"base":{"label":"CartoDB:master","ref":"master","sha":"22dd94d016c5f573e89e86ce519348d7d1960cda","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars0.githubusercontent.com/u/1799254?v=4","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":4909355,"name":"cartodb","full_name":"CartoDB/cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars0.githubusercontent.com/u/1799254?v=4","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/cartodb","description":"Location Intelligence & Data Visualization tool","fork":false,"url":"https://api.github.com/repos/CartoDB/cartodb","forks_url":"https://api.github.com/repos/CartoDB/cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/cartodb/deployments","created_at":"2012-07-05T15:23:45Z","updated_at":"2018-03-04T22:15:33Z","pushed_at":"2018-03-05T12:54:00Z","git_url":"git://github.com/CartoDB/cartodb.git","ssh_url":"git@github.com:CartoDB/cartodb.git","clone_url":"https://github.com/CartoDB/cartodb.git","svn_url":"https://github.com/CartoDB/cartodb","homepage":"http://carto.com","size":366973,"stargazers_count":1773,"watchers_count":1773,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":491,"mirror_url":null,"archived":false,"open_issues_count":480,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":491,"open_issues":480,"watchers":1773,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/13587"},"html":{"href":"https://github.com/CartoDB/cartodb/pull/13587"},"issue":{"href":"https://api.github.com/repos/CartoDB/cartodb/issues/13587"},"comments":{"href":"https://api.github.com/repos/CartoDB/cartodb/issues/13587/comments"},"review_comments":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/13587/comments"},"review_comment":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/13587/commits"},"statuses":{"href":"https://api.github.com/repos/CartoDB/cartodb/statuses/c52562e6f612ce29593476cdea52a3d664ddac58"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"houndci-bot"}}