{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/mercury/pulls/comments/55490038","id":55490038,"diff_hunk":"@@ -126,111 +191,68 @@ export default Ember.Route.extend(ConfirmationMixin, {\n \t},\n \n \t/**\n-\t * @desc add oasis portable infobox styles to DOM\n-\t * and add class to main application body to be\n-\t * able to style whole containter as we want\n+\t * Adds oasis portable infobox styles to the DOM and a class to the body element\n \t *\n-\t * @param {Array} promiseResponseArray\n+\t * @param {Object} serverResponse\n \t * @returns {Ember.RSVP.Promise}\n \t */\n-\tsetupStyles(promiseResponseArray) {\n+\tsetupStyles(serverResponse) {\n \t\tEmber.$('body').addClass('infobox-builder-body-wrapper');\n \n-\t\treturn new Ember.RSVP.Promise((resolve) => {\n+\t\tif (serverResponse.css) {\n \t\t\tlet html = '';\n \n-\t\t\tpromiseResponseArray[0].css.forEach(\n+\t\t\tserverResponse.css.forEach(\n \t\t\t\t(url) => {\n \t\t\t\t\thtml += `<link type=\"text/css\" rel=\"stylesheet\" href=\"${url}\">`;\n \t\t\t\t}\n \t\t\t);\n \n \t\t\t$(html).appendTo('head');\n-\n-\t\t\tresolve(promiseResponseArray);\n-\t\t});\n+\t\t}\n \t},\n \n \t/**\n-\t * @desc pass received from MW infobox state (for already existing infobox templates)\n-\t * and set it as a property on controller. We don't need to keep this in model as it's\n-\t * not connected with data we need there.\n+\t * Accepts data received from MW and sets it on controller to be used in afterModel\n \t *\n-\t * @param {Array} promiseResponseArray\n-\t * @returns {Array} not modified promiseResponseArray\n+\t * @param {Object} serverResponse\n+\t * @returns {void}\n \t */\n-\tsetupInfoboxState(promiseResponseArray) {\n-\t\tconst assets = promiseResponseArray[0].data;\n-\t\tlet templateData = {};\n-\n-\t\tif (assets) {\n-\t\t\ttemplateData = JSON.parse(assets);\n-\t\t\tif (templateData.data) {\n-\t\t\t\tthis.controllerFor('infobox-builder').set('templateData', templateData.data);\n-\t\t\t}\n+\tsetupInfoboxData(serverResponse) {\n+\t\tconst infoboxData = serverResponse.data,\n+\t\t\tcontroller = this.controllerFor('infobox-builder');\n+\t\tlet infoboxDataParsed = {};\n+\n+\t\tif (infoboxData) {\n+\t\t\tinfoboxDataParsed = JSON.parse(infoboxData);\n+\t\t\tcontroller.set('infoboxData', infoboxDataParsed);\n \t\t}\n \n-\t\treturn promiseResponseArray;\n+\t\tcontroller.set('isNew', serverResponse.isNew);","path":"front/main/app/routes/infobox-builder.js","position":261,"original_position":261,"commit_id":"cee9ac79290b882d39233a8285fbc90a1b13d78d","original_commit_id":"cee9ac79290b882d39233a8285fbc90a1b13d78d","user":{"login":"RafLeszczynski","id":859645,"avatar_url":"https://avatars.githubusercontent.com/u/859645?v=3","gravatar_id":"","url":"https://api.github.com/users/RafLeszczynski","html_url":"https://github.com/RafLeszczynski","followers_url":"https://api.github.com/users/RafLeszczynski/followers","following_url":"https://api.github.com/users/RafLeszczynski/following{/other_user}","gists_url":"https://api.github.com/users/RafLeszczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/RafLeszczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RafLeszczynski/subscriptions","organizations_url":"https://api.github.com/users/RafLeszczynski/orgs","repos_url":"https://api.github.com/users/RafLeszczynski/repos","events_url":"https://api.github.com/users/RafLeszczynski/events{/privacy}","received_events_url":"https://api.github.com/users/RafLeszczynski/received_events","type":"User","site_admin":false},"body":"shouldn't we set `isNew` to false if `serverResponse.isNew` is `undefined`?","created_at":"2016-03-09T09:16:37Z","updated_at":"2016-03-09T09:16:37Z","html_url":"https://github.com/Wikia/mercury/pull/2134#discussion_r55490038","pull_request_url":"https://api.github.com/repos/Wikia/mercury/pulls/2134","_links":{"self":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/comments/55490038"},"html":{"href":"https://github.com/Wikia/mercury/pull/2134#discussion_r55490038"},"pull_request":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/2134"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/mercury/pulls/2134","id":62066825,"html_url":"https://github.com/Wikia/mercury/pull/2134","diff_url":"https://github.com/Wikia/mercury/pull/2134.diff","patch_url":"https://github.com/Wikia/mercury/pull/2134.patch","issue_url":"https://api.github.com/repos/Wikia/mercury/issues/2134","number":2134,"state":"open","locked":false,"title":"DAT-3856 | Use infobox theme property to set additional class","user":{"login":"rogatty","id":7030884,"avatar_url":"https://avatars.githubusercontent.com/u/7030884?v=3","gravatar_id":"","url":"https://api.github.com/users/rogatty","html_url":"https://github.com/rogatty","followers_url":"https://api.github.com/users/rogatty/followers","following_url":"https://api.github.com/users/rogatty/following{/other_user}","gists_url":"https://api.github.com/users/rogatty/gists{/gist_id}","starred_url":"https://api.github.com/users/rogatty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogatty/subscriptions","organizations_url":"https://api.github.com/users/rogatty/orgs","repos_url":"https://api.github.com/users/rogatty/repos","events_url":"https://api.github.com/users/rogatty/events{/privacy}","received_events_url":"https://api.github.com/users/rogatty/received_events","type":"User","site_admin":false},"body":"## Links\r\n\r\n* https://wikia-inc.atlassian.net/browse/DAT-3856\r\n\r\n## Description\r\n\r\nIn https://github.com/Wikia/app/pull/9907 we started to return additional property from the Infobox Builder API - the theme. If it's present then let's add `` `theme-${theme}` `` class to the `infobox-builder-preview` element.\r\n\r\nI also used this occasion to clean up `infobox-builder` route and model. If you want to review just the theme part then look at the second commit.\r\n\r\n## Reviewers\r\n\r\n@RafLeszczynski @SebastianMarzjan ","created_at":"2016-03-08T12:52:36Z","updated_at":"2016-03-09T09:16:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ffe6b165217e8597532376eec1e56bcddd4ae7d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/mercury/pulls/2134/commits","review_comments_url":"https://api.github.com/repos/Wikia/mercury/pulls/2134/comments","review_comment_url":"https://api.github.com/repos/Wikia/mercury/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/mercury/issues/2134/comments","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/cee9ac79290b882d39233a8285fbc90a1b13d78d","head":{"label":"Wikia:DAT-3856","ref":"DAT-3856","sha":"cee9ac79290b882d39233a8285fbc90a1b13d78d","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":16710430,"name":"mercury","full_name":"Wikia/mercury","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/mercury","description":"Wikia Web application","fork":false,"url":"https://api.github.com/repos/Wikia/mercury","forks_url":"https://api.github.com/repos/Wikia/mercury/forks","keys_url":"https://api.github.com/repos/Wikia/mercury/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/mercury/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/mercury/teams","hooks_url":"https://api.github.com/repos/Wikia/mercury/hooks","issue_events_url":"https://api.github.com/repos/Wikia/mercury/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/mercury/events","assignees_url":"https://api.github.com/repos/Wikia/mercury/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/mercury/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/mercury/tags","blobs_url":"https://api.github.com/repos/Wikia/mercury/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/mercury/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/mercury/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/mercury/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/mercury/languages","stargazers_url":"https://api.github.com/repos/Wikia/mercury/stargazers","contributors_url":"https://api.github.com/repos/Wikia/mercury/contributors","subscribers_url":"https://api.github.com/repos/Wikia/mercury/subscribers","subscription_url":"https://api.github.com/repos/Wikia/mercury/subscription","commits_url":"https://api.github.com/repos/Wikia/mercury/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/mercury/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/mercury/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/mercury/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/mercury/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/mercury/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/mercury/merges","archive_url":"https://api.github.com/repos/Wikia/mercury/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/mercury/downloads","issues_url":"https://api.github.com/repos/Wikia/mercury/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/mercury/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/mercury/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/mercury/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/mercury/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/mercury/releases{/id}","deployments_url":"https://api.github.com/repos/Wikia/mercury/deployments","created_at":"2014-02-10T21:44:25Z","updated_at":"2016-01-11T15:58:43Z","pushed_at":"2016-03-09T08:33:53Z","git_url":"git://github.com/Wikia/mercury.git","ssh_url":"git@github.com:Wikia/mercury.git","clone_url":"https://github.com/Wikia/mercury.git","svn_url":"https://github.com/Wikia/mercury","homepage":"","size":74621,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":18,"forks":5,"open_issues":18,"watchers":12,"default_branch":"dev"}},"base":{"label":"Wikia:dev","ref":"dev","sha":"05b052dd96690cf69c08d3c9a73a57452d3f6308","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":16710430,"name":"mercury","full_name":"Wikia/mercury","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/mercury","description":"Wikia Web application","fork":false,"url":"https://api.github.com/repos/Wikia/mercury","forks_url":"https://api.github.com/repos/Wikia/mercury/forks","keys_url":"https://api.github.com/repos/Wikia/mercury/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/mercury/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/mercury/teams","hooks_url":"https://api.github.com/repos/Wikia/mercury/hooks","issue_events_url":"https://api.github.com/repos/Wikia/mercury/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/mercury/events","assignees_url":"https://api.github.com/repos/Wikia/mercury/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/mercury/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/mercury/tags","blobs_url":"https://api.github.com/repos/Wikia/mercury/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/mercury/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/mercury/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/mercury/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/mercury/languages","stargazers_url":"https://api.github.com/repos/Wikia/mercury/stargazers","contributors_url":"https://api.github.com/repos/Wikia/mercury/contributors","subscribers_url":"https://api.github.com/repos/Wikia/mercury/subscribers","subscription_url":"https://api.github.com/repos/Wikia/mercury/subscription","commits_url":"https://api.github.com/repos/Wikia/mercury/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/mercury/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/mercury/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/mercury/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/mercury/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/mercury/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/mercury/merges","archive_url":"https://api.github.com/repos/Wikia/mercury/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/mercury/downloads","issues_url":"https://api.github.com/repos/Wikia/mercury/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/mercury/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/mercury/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/mercury/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/mercury/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/mercury/releases{/id}","deployments_url":"https://api.github.com/repos/Wikia/mercury/deployments","created_at":"2014-02-10T21:44:25Z","updated_at":"2016-01-11T15:58:43Z","pushed_at":"2016-03-09T08:33:53Z","git_url":"git://github.com/Wikia/mercury.git","ssh_url":"git@github.com:Wikia/mercury.git","clone_url":"https://github.com/Wikia/mercury.git","svn_url":"https://github.com/Wikia/mercury","homepage":"","size":74621,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":18,"forks":5,"open_issues":18,"watchers":12,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/2134"},"html":{"href":"https://github.com/Wikia/mercury/pull/2134"},"issue":{"href":"https://api.github.com/repos/Wikia/mercury/issues/2134"},"comments":{"href":"https://api.github.com/repos/Wikia/mercury/issues/2134/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/2134/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/2134/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/mercury/statuses/cee9ac79290b882d39233a8285fbc90a1b13d78d"}}}}