{"action":"created","issue":{"url":"https://api.github.com/repos/x-team/x-map/issues/175","repository_url":"https://api.github.com/repos/x-team/x-map","labels_url":"https://api.github.com/repos/x-team/x-map/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/x-team/x-map/issues/175/comments","events_url":"https://api.github.com/repos/x-team/x-map/issues/175/events","html_url":"https://github.com/x-team/x-map/pull/175","id":154849543,"number":175,"title":"Fixes for 1.0.1","user":{"login":"jedrzej","id":291904,"avatar_url":"https://avatars.githubusercontent.com/u/291904?v=3","gravatar_id":"","url":"https://api.github.com/users/jedrzej","html_url":"https://github.com/jedrzej","followers_url":"https://api.github.com/users/jedrzej/followers","following_url":"https://api.github.com/users/jedrzej/following{/other_user}","gists_url":"https://api.github.com/users/jedrzej/gists{/gist_id}","starred_url":"https://api.github.com/users/jedrzej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedrzej/subscriptions","organizations_url":"https://api.github.com/users/jedrzej/orgs","repos_url":"https://api.github.com/users/jedrzej/repos","events_url":"https://api.github.com/users/jedrzej/events{/privacy}","received_events_url":"https://api.github.com/users/jedrzej/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/x-team/x-map/labels/ready","name":"ready","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-14T11:48:29Z","updated_at":"2016-05-28T15:18:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/x-team/x-map/pulls/175","html_url":"https://github.com/x-team/x-map/pull/175","diff_url":"https://github.com/x-team/x-map/pull/175.diff","patch_url":"https://github.com/x-team/x-map/pull/175.patch"},"body":"\n\n<!-- Reviewable:start -->\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/x-team/x-map/175)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/x-team/x-map/issues/comments/222313696","html_url":"https://github.com/x-team/x-map/pull/175#issuecomment-222313696","issue_url":"https://api.github.com/repos/x-team/x-map/issues/175","id":222313696,"user":{"login":"jedrzej","id":291904,"avatar_url":"https://avatars.githubusercontent.com/u/291904?v=3","gravatar_id":"","url":"https://api.github.com/users/jedrzej","html_url":"https://github.com/jedrzej","followers_url":"https://api.github.com/users/jedrzej/followers","following_url":"https://api.github.com/users/jedrzej/following{/other_user}","gists_url":"https://api.github.com/users/jedrzej/gists{/gist_id}","starred_url":"https://api.github.com/users/jedrzej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedrzej/subscriptions","organizations_url":"https://api.github.com/users/jedrzej/orgs","repos_url":"https://api.github.com/users/jedrzej/repos","events_url":"https://api.github.com/users/jedrzej/events{/privacy}","received_events_url":"https://api.github.com/users/jedrzej/received_events","type":"User","site_admin":false},"created_at":"2016-05-28T15:18:22Z","updated_at":"2016-05-28T15:18:22Z","body":"\n\n\n\n\n\nReview status: 7 of 10 files reviewed at latest revision, 4 unresolved discussions.\n\n---\n\n*[client/js/components/pages/ProfilesPage.js, line 6 \\[r1\\]](https://reviewable.io:443/reviews/x-team/x-map/175#-KHkDqKoQKrbM-_pAEXn:-KIr_SW2U1-6RfWNnzZd:-898918127) ([raw file](https://github.com/x-team/x-map/blob/738a71708e85e430f5ea47007413943b01f90b29/client/js/components/pages/ProfilesPage.js#L6)):*\n<details><summary><i>Previously, diegodurli (Diego Durli) wrote…</i></summary>\n> Hi Jed, great idea to make it common to use, makes it reusable!\n> I would only bring some \"functional\" to the table about it.\n> \n> My idea for common would be like this:\n> \n> ```\n> import R from 'ramda';\n> \n> const fullname = (first, last) => R.join(' ', [first, last]);\n> \n> function sortByName(name1, name2) {\n>   return (name1 < name2) ? -1 :\n>           (name1 > name2) ? 1 : 0;\n> }\n> \n> const sortUsersByName = (user1, user2) => {\n>   return sortByName.bind(this, fullname(user1.firstName, user1.lastName), fullname(user2.firstName, user2.lastName));\n> };\n> \n> const sortTeamsByName = (team1, team2) => sortByName.bind(this, team1.name, team2.name);\n> ```\n> \n> Only to make it more composable and keep it DRY.\n</details>\nThanks for the tip, I've refactored the code. I've skipped adding ramda lib though. As it's a kind of a learning project I'm not sure it's good introduce too many new technologies/libs/paradigms at once. I'd love to first check if everyone is ok with that move and then start using everywhere in the project where it makes sense. I really like the lib so I hope we can include it soon.\n\n---\n\n*[client/js/components/pages/ProfilesPage.js, line 22 \\[r1\\]](https://reviewable.io:443/reviews/x-team/x-map/175#-KHkEkQTJQQCbQykgdAB:-KIrfqnHC1M_F00xzbow:-2047622267) ([raw file](https://github.com/x-team/x-map/blob/738a71708e85e430f5ea47007413943b01f90b29/client/js/components/pages/ProfilesPage.js#L22)):*\n<details><summary><i>Previously, diegodurli (Diego Durli) wrote…</i></summary>\n> Talking about functional, my proposal for this part would be:\n> \n> ```\n> const UserListItem = (props) => (\n>   <li className=\"list-group-item\" key={props.id}>\n>     {props.firstName + ' ' + props.lastName}\n>   </li>\n> );\n> \n> class ProfilesPage extends React.Component {\n>   render() {\n>     const { users } = this.props,\n>       profiles = R.compose(\n>         R.map((user) => <UserListItem {...user} />),\n>         R.sort(sortUsersByName),\n>         R.values\n>       )(users);\n> \n>     return (\n>       <div>\n>         {profiles || <p className=\"alert error\">Something has gone wrong. No profiles found.</p>}\n>       </div>\n>     );\n>   }\n> }\n> ```\n> \n> This is just an example and doesn't include all HTML from this render, only the necessary.\n> It would make it simpler in my opinion.\n> \n> You can see it here: https://jsbin.com/kofutip/6/edit?js,console,output\n</details>\nI've refactored the code a bit, it's now much simpler but again I've skipped ramda lib for the reasons described earlier. TBH I can't wait till we start using it as it seems it could make most of the processing we do in our components much simpler.\n\n---\n\n*[client/js/components/pages/TeamsPage.js, line 28 \\[r1\\]](https://reviewable.io:443/reviews/x-team/x-map/175#-KHkFUnKOnr442f4UstF:-KIrc7YvrckXB6K99Dim:1240993694) ([raw file](https://github.com/x-team/x-map/blob/738a71708e85e430f5ea47007413943b01f90b29/client/js/components/pages/TeamsPage.js#L28)):*\n<details><summary><i>Previously, diegodurli (Diego Durli) wrote…</i></summary>\n> Here we could take advantage of those R.compose functions.\n</details>\nSee the reply to your first comment.\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/x-team/x-map/175)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"jedrzej"}}