{"action":"created","comment":{"url":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/comments/166109100","pull_request_review_id":94139134,"id":166109100,"diff_hunk":"@@ -1,15 +1,50 @@\n-import React from 'react'\n+import React from 'react';\n+import PropTypes from 'prop-types';\n+\n+import { Link } from 'react-router-dom';\n+\n+import { connect } from 'react-redux';\n+import { confirmDelete } from '../redux/actions/deleteConfirmation';\n+\n import {TableRow, TableRowColumn} from 'material-ui/Table';\n import TickIcon from 'material-ui/svg-icons/action/done';\n+import IconMenu from 'material-ui/IconMenu';\n+import MenuItem from 'material-ui/MenuItem';\n+import IconButton from 'material-ui/IconButton';\n+import MoreVertIcon from 'material-ui/svg-icons/navigation/more-vert';\n \n-const AssetListItem = (props) => (\n+const AssetListItem = ({confirmDelete, asset}) => (\n   <TableRow hoverable={true}>\n-    <TableRowColumn>{props.name}</TableRowColumn>\n-    <TableRowColumn>{props.status}</TableRowColumn>\n-    <TableRowColumn>{props.department}</TableRowColumn>\n-    <TableRowColumn>{props.private ? <TickIcon/> : \"\"}</TableRowColumn>\n-    <TableRowColumn>{props.lastedited}</TableRowColumn>\n+    <TableRowColumn><Link to={'/asset/' + asset.id}>{asset.name}</Link></TableRowColumn>","path":"src/components/AssetListItem.js","position":25,"original_position":25,"commit_id":"10d689cc8a4ec5b5ba6f5036dd9336102406f8b6","original_commit_id":"10d689cc8a4ec5b5ba6f5036dd9336102406f8b6","user":{"login":"rjw57","id":146860,"avatar_url":"https://avatars0.githubusercontent.com/u/146860?v=4","gravatar_id":"","url":"https://api.github.com/users/rjw57","html_url":"https://github.com/rjw57","followers_url":"https://api.github.com/users/rjw57/followers","following_url":"https://api.github.com/users/rjw57/following{/other_user}","gists_url":"https://api.github.com/users/rjw57/gists{/gist_id}","starred_url":"https://api.github.com/users/rjw57/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjw57/subscriptions","organizations_url":"https://api.github.com/users/rjw57/orgs","repos_url":"https://api.github.com/users/rjw57/repos","events_url":"https://api.github.com/users/rjw57/events{/privacy}","received_events_url":"https://api.github.com/users/rjw57/received_events","type":"User","site_admin":false},"body":"So should fall back to the id?","created_at":"2018-02-05T20:56:17Z","updated_at":"2018-02-05T20:56:17Z","html_url":"https://github.com/uisautomation/iar-frontend/pull/32#discussion_r166109100","pull_request_url":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/32","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/comments/166109100"},"html":{"href":"https://github.com/uisautomation/iar-frontend/pull/32#discussion_r166109100"},"pull_request":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/32"}},"in_reply_to_id":166015094},"pull_request":{"url":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/32","id":167004838,"html_url":"https://github.com/uisautomation/iar-frontend/pull/32","diff_url":"https://github.com/uisautomation/iar-frontend/pull/32.diff","patch_url":"https://github.com/uisautomation/iar-frontend/pull/32.patch","issue_url":"https://api.github.com/repos/uisautomation/iar-frontend/issues/32","number":32,"state":"open","locked":false,"title":"Add API auth, asset list, delete, zero view state, infinite scrolling and fix nav links","user":{"login":"rjw57","id":146860,"avatar_url":"https://avatars0.githubusercontent.com/u/146860?v=4","gravatar_id":"","url":"https://api.github.com/users/rjw57","html_url":"https://github.com/rjw57","followers_url":"https://api.github.com/users/rjw57/followers","following_url":"https://api.github.com/users/rjw57/following{/other_user}","gists_url":"https://api.github.com/users/rjw57/gists{/gist_id}","starred_url":"https://api.github.com/users/rjw57/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjw57/subscriptions","organizations_url":"https://api.github.com/users/rjw57/orgs","repos_url":"https://api.github.com/users/rjw57/repos","events_url":"https://api.github.com/users/rjw57/events{/privacy}","received_events_url":"https://api.github.com/users/rjw57/received_events","type":"User","site_admin":false},"body":"**Testing notes:** the IAR backend needs to be running on http://localhost:8000/ and the lookupproxy needs to be running on http://localhost:8080/. Configure both backends to use the experimental OAuth2 endpoint and cut-and-paste the token into AssetForm.js. This will become less involved when the asset create/edit form is refactored to use redux.\r\n\r\nPR #9 inadvertently introduced a bug where no routes were rendered in many cases. This manifested itself as the navigation links on the sidebar having no effect.\r\n\r\nThe root cause was a desire to have the application routing be testable in a different router. (In the test suite case, a MemoryRouter.) To this end the routes were broken out into sub components.\r\n\r\nThis has the unfortunate side-effect that the tests were only ever run with a router populated with just the expected routes and so errors in route matching were silently ignored.\r\n\r\nRetain testability by breaking out all the routes into a single \"AppRoutes\" component which may be used within a MemoryRouter in the test-suite. This now lets tests check routes are correctly followed when all application routes are present.\r\n\r\nCollecting all the routes together in one place also increases readability.\r\n\r\nTake the opportunity to add a catch all \"Not Found\" route which provides some feedback on an invalid URL beyond a simple empty page.\r\n\r\n\r\nCloses #29.\r\n\r\nadd authorisation headers to API requests\r\n\r\nAdd redux-api-middleware which interprets specially formatted \"RSAA\" actions as calls to a HTTP API. Add some custom middleware which takes the token from the redux state and adds it to the authorisation headers of this HTTP response. For the moment we simply log the user out if the token is invalid or times out.\r\n\r\nFor a more sophisticated UI, we might want to look at https://github.com/esbenp/redux-refresh-token to automate the refresh of the token. This will require support in the consent app to provide an \"early fail\" UI or \"is UI-less login possible\" endpoint in order to provide a seamless experience.\r\n\r\nCloses #25.\r\n\r\nfetch asset list from API and allow deletion\r\n\r\nUse redux-api-middleware to allow fetching assets from the API and deleting them.\r\n\r\nSeparate out the AssetList table into a separate AssetTable container which has the table headings encapsulated within it.\r\n\r\nConnect up components to the redux state in order to provide functionality.  This makes the AssetList component particularly compact.\r\n\r\nCurrently the API is hard-wired to be at http://localhost:8080/.\r\n\r\nCloses #12.\r\n\r\nadd infinite scrolling support\r\n\r\nRe-factor the asset list loading to support the notion of extending the current set of assets. Instead of storing the full asset resources, store a summary and stash the full resources in an assetsByUrl object. This will allow the asset edit form to retrieve an asset without having to perform an extra fetch. (Or, similarly, let's it populate the form while the request is in flight.)\r\n\r\nThe asset list in the redux store is now viewed as a partial list of assets which may be extended via the getMoreAssets action. The first load of the asset list is therefore just a special case of dispatching getMoreAssets with the asset list being empty.\r\n\r\nThe AssetList component is now completely pure. The AssetTable component simply renders the current list of assets and the AssetList makes use of a new GetMoreAssets component. This component will dispatch the getMoreAssets action when it becomes visible.\r\n\r\nIn this way, initial asset list load and subsequent loads when one reaches the bottom of the list are no-longer separate cases. An empty asset list will have the GetMoreAssets component visible.\r\n\r\nCloses #6.\r\n\r\nadd \"zero view\" for when there are no assets in the result\r\n\r\nAdd a special ZeroAssetsRow component which is used to indicate that no assets are in the returned query. This is only displayed if a load is not currently in progress to avoid a flash of content.\r\n\r\nCloses #22.\r\n\r\nadd confirmation of asset deletion\r\n\r\nAdd new action 'confirmDelete' which is dispatched with an asset URL and the user is asked to confirm deletion of the asset. Managed via a deleteConfirmation object in the redux store which stores the URL of the asset currently being considered for deletion.\r\n\r\nAdd a DeleteConfirmationDialog component which shows a dialog when there is an asset being considered for deletion and deletes the asset if the user provides confirmation.\r\n\r\nCloses #24.","created_at":"2018-02-04T10:54:26Z","updated_at":"2018-02-05T20:56:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c05b9cccede598eb5ff87917bc99662a3abc5780","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/32/commits","review_comments_url":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/32/comments","review_comment_url":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uisautomation/iar-frontend/issues/32/comments","statuses_url":"https://api.github.com/repos/uisautomation/iar-frontend/statuses/10d689cc8a4ec5b5ba6f5036dd9336102406f8b6","head":{"label":"rjw57:add-frontend-functionality","ref":"add-frontend-functionality","sha":"10d689cc8a4ec5b5ba6f5036dd9336102406f8b6","user":{"login":"rjw57","id":146860,"avatar_url":"https://avatars0.githubusercontent.com/u/146860?v=4","gravatar_id":"","url":"https://api.github.com/users/rjw57","html_url":"https://github.com/rjw57","followers_url":"https://api.github.com/users/rjw57/followers","following_url":"https://api.github.com/users/rjw57/following{/other_user}","gists_url":"https://api.github.com/users/rjw57/gists{/gist_id}","starred_url":"https://api.github.com/users/rjw57/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjw57/subscriptions","organizations_url":"https://api.github.com/users/rjw57/orgs","repos_url":"https://api.github.com/users/rjw57/repos","events_url":"https://api.github.com/users/rjw57/events{/privacy}","received_events_url":"https://api.github.com/users/rjw57/received_events","type":"User","site_admin":false},"repo":{"id":118611557,"name":"iar-frontend","full_name":"rjw57/iar-frontend","owner":{"login":"rjw57","id":146860,"avatar_url":"https://avatars0.githubusercontent.com/u/146860?v=4","gravatar_id":"","url":"https://api.github.com/users/rjw57","html_url":"https://github.com/rjw57","followers_url":"https://api.github.com/users/rjw57/followers","following_url":"https://api.github.com/users/rjw57/following{/other_user}","gists_url":"https://api.github.com/users/rjw57/gists{/gist_id}","starred_url":"https://api.github.com/users/rjw57/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjw57/subscriptions","organizations_url":"https://api.github.com/users/rjw57/orgs","repos_url":"https://api.github.com/users/rjw57/repos","events_url":"https://api.github.com/users/rjw57/events{/privacy}","received_events_url":"https://api.github.com/users/rjw57/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rjw57/iar-frontend","description":"Frontend for IAR web application","fork":true,"url":"https://api.github.com/repos/rjw57/iar-frontend","forks_url":"https://api.github.com/repos/rjw57/iar-frontend/forks","keys_url":"https://api.github.com/repos/rjw57/iar-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rjw57/iar-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rjw57/iar-frontend/teams","hooks_url":"https://api.github.com/repos/rjw57/iar-frontend/hooks","issue_events_url":"https://api.github.com/repos/rjw57/iar-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/rjw57/iar-frontend/events","assignees_url":"https://api.github.com/repos/rjw57/iar-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/rjw57/iar-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/rjw57/iar-frontend/tags","blobs_url":"https://api.github.com/repos/rjw57/iar-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rjw57/iar-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rjw57/iar-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/rjw57/iar-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rjw57/iar-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/rjw57/iar-frontend/languages","stargazers_url":"https://api.github.com/repos/rjw57/iar-frontend/stargazers","contributors_url":"https://api.github.com/repos/rjw57/iar-frontend/contributors","subscribers_url":"https://api.github.com/repos/rjw57/iar-frontend/subscribers","subscription_url":"https://api.github.com/repos/rjw57/iar-frontend/subscription","commits_url":"https://api.github.com/repos/rjw57/iar-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/rjw57/iar-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/rjw57/iar-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/rjw57/iar-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/rjw57/iar-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/rjw57/iar-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rjw57/iar-frontend/merges","archive_url":"https://api.github.com/repos/rjw57/iar-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rjw57/iar-frontend/downloads","issues_url":"https://api.github.com/repos/rjw57/iar-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/rjw57/iar-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/rjw57/iar-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/rjw57/iar-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rjw57/iar-frontend/labels{/name}","releases_url":"https://api.github.com/repos/rjw57/iar-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/rjw57/iar-frontend/deployments","created_at":"2018-01-23T13:07:24Z","updated_at":"2018-01-23T13:07:26Z","pushed_at":"2018-02-05T19:59:36Z","git_url":"git://github.com/rjw57/iar-frontend.git","ssh_url":"git@github.com:rjw57/iar-frontend.git","clone_url":"https://github.com/rjw57/iar-frontend.git","svn_url":"https://github.com/rjw57/iar-frontend","homepage":null,"size":371,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"uisautomation:master","ref":"master","sha":"9fa35498de99cc524c6f0305a68b2f283d3a7c3f","user":{"login":"uisautomation","id":34515307,"avatar_url":"https://avatars0.githubusercontent.com/u/34515307?v=4","gravatar_id":"","url":"https://api.github.com/users/uisautomation","html_url":"https://github.com/uisautomation","followers_url":"https://api.github.com/users/uisautomation/followers","following_url":"https://api.github.com/users/uisautomation/following{/other_user}","gists_url":"https://api.github.com/users/uisautomation/gists{/gist_id}","starred_url":"https://api.github.com/users/uisautomation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uisautomation/subscriptions","organizations_url":"https://api.github.com/users/uisautomation/orgs","repos_url":"https://api.github.com/users/uisautomation/repos","events_url":"https://api.github.com/users/uisautomation/events{/privacy}","received_events_url":"https://api.github.com/users/uisautomation/received_events","type":"Organization","site_admin":false},"repo":{"id":116982368,"name":"iar-frontend","full_name":"uisautomation/iar-frontend","owner":{"login":"uisautomation","id":34515307,"avatar_url":"https://avatars0.githubusercontent.com/u/34515307?v=4","gravatar_id":"","url":"https://api.github.com/users/uisautomation","html_url":"https://github.com/uisautomation","followers_url":"https://api.github.com/users/uisautomation/followers","following_url":"https://api.github.com/users/uisautomation/following{/other_user}","gists_url":"https://api.github.com/users/uisautomation/gists{/gist_id}","starred_url":"https://api.github.com/users/uisautomation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uisautomation/subscriptions","organizations_url":"https://api.github.com/users/uisautomation/orgs","repos_url":"https://api.github.com/users/uisautomation/repos","events_url":"https://api.github.com/users/uisautomation/events{/privacy}","received_events_url":"https://api.github.com/users/uisautomation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uisautomation/iar-frontend","description":"Frontend for IAR web application","fork":false,"url":"https://api.github.com/repos/uisautomation/iar-frontend","forks_url":"https://api.github.com/repos/uisautomation/iar-frontend/forks","keys_url":"https://api.github.com/repos/uisautomation/iar-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uisautomation/iar-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uisautomation/iar-frontend/teams","hooks_url":"https://api.github.com/repos/uisautomation/iar-frontend/hooks","issue_events_url":"https://api.github.com/repos/uisautomation/iar-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/uisautomation/iar-frontend/events","assignees_url":"https://api.github.com/repos/uisautomation/iar-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/uisautomation/iar-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/uisautomation/iar-frontend/tags","blobs_url":"https://api.github.com/repos/uisautomation/iar-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uisautomation/iar-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uisautomation/iar-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/uisautomation/iar-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uisautomation/iar-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/uisautomation/iar-frontend/languages","stargazers_url":"https://api.github.com/repos/uisautomation/iar-frontend/stargazers","contributors_url":"https://api.github.com/repos/uisautomation/iar-frontend/contributors","subscribers_url":"https://api.github.com/repos/uisautomation/iar-frontend/subscribers","subscription_url":"https://api.github.com/repos/uisautomation/iar-frontend/subscription","commits_url":"https://api.github.com/repos/uisautomation/iar-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/uisautomation/iar-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/uisautomation/iar-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/uisautomation/iar-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/uisautomation/iar-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/uisautomation/iar-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uisautomation/iar-frontend/merges","archive_url":"https://api.github.com/repos/uisautomation/iar-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uisautomation/iar-frontend/downloads","issues_url":"https://api.github.com/repos/uisautomation/iar-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/uisautomation/iar-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/uisautomation/iar-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/uisautomation/iar-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uisautomation/iar-frontend/labels{/name}","releases_url":"https://api.github.com/repos/uisautomation/iar-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/uisautomation/iar-frontend/deployments","created_at":"2018-01-10T16:28:36Z","updated_at":"2018-01-18T16:31:53Z","pushed_at":"2018-02-05T13:58:00Z","git_url":"git://github.com/uisautomation/iar-frontend.git","ssh_url":"git@github.com:uisautomation/iar-frontend.git","clone_url":"https://github.com/uisautomation/iar-frontend.git","svn_url":"https://github.com/uisautomation/iar-frontend","homepage":null,"size":185,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":24,"license":null,"forks":3,"open_issues":24,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/32"},"html":{"href":"https://github.com/uisautomation/iar-frontend/pull/32"},"issue":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/issues/32"},"comments":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/uisautomation/iar-frontend/statuses/10d689cc8a4ec5b5ba6f5036dd9336102406f8b6"}},"author_association":"OWNER"}}
{"actor":{"display_login":"rjw57"}}