{"action":"created","comment":{"url":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/comments/167853234","pull_request_review_id":96112152,"id":167853234,"diff_hunk":"@@ -76,25 +78,43 @@ class Datagrid extends Component {\n         this.props.setSort(event.currentTarget.dataset.sort);\n     };\n \n+    handleSelectAll = () => {\n+        if (this.props.selectedIds.length > 0) {\n+            return this.props.onSelect([]);\n+        }\n+        this.props.onSelect(this.props.ids);\n+    };\n+\n     render() {\n         const {\n-            resource,\n+            basePath,\n+            data,\n             children,\n             classes,\n             className,\n+            currentSort,\n             ids,\n             isLoading,\n-            data,\n-            currentSort,\n-            basePath,\n+            resource,\n             rowStyle,\n+            selectedIds,\n             setSort,\n+            onSelect,\n+            onToggleItem,\n             ...rest\n         } = this.props;\n+\n         return (\n             <Table className={classnames(classes.table, className)} {...rest}>\n                 <TableHead>\n                     <TableRow className={classes.row}>\n+                        <TableCell padding=\"checkbox\">","path":"packages/react-admin/src/mui/list/Datagrid.js","position":49,"original_position":49,"commit_id":"f7978997ff720faa650c7196920e92fee259f896","original_commit_id":"f7978997ff720faa650c7196920e92fee259f896","user":{"login":"alexisjanvier","id":547706,"avatar_url":"https://avatars0.githubusercontent.com/u/547706?v=4","gravatar_id":"","url":"https://api.github.com/users/alexisjanvier","html_url":"https://github.com/alexisjanvier","followers_url":"https://api.github.com/users/alexisjanvier/followers","following_url":"https://api.github.com/users/alexisjanvier/following{/other_user}","gists_url":"https://api.github.com/users/alexisjanvier/gists{/gist_id}","starred_url":"https://api.github.com/users/alexisjanvier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexisjanvier/subscriptions","organizations_url":"https://api.github.com/users/alexisjanvier/orgs","repos_url":"https://api.github.com/users/alexisjanvier/repos","events_url":"https://api.github.com/users/alexisjanvier/events{/privacy}","received_events_url":"https://api.github.com/users/alexisjanvier/received_events","type":"User","site_admin":false},"body":"Couldn't the display of `<Checkbox>` (and `<DatagridRow>`) be conditioned by the addition or not of the prop `bulkActions` on `<List>` ?","created_at":"2018-02-13T12:47:57Z","updated_at":"2018-02-13T13:04:47Z","html_url":"https://github.com/marmelab/admin-on-rest/pull/1521#discussion_r167853234","pull_request_url":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/1521","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/comments/167853234"},"html":{"href":"https://github.com/marmelab/admin-on-rest/pull/1521#discussion_r167853234"},"pull_request":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/1521"}}},"pull_request":{"url":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/1521","id":168597140,"html_url":"https://github.com/marmelab/admin-on-rest/pull/1521","diff_url":"https://github.com/marmelab/admin-on-rest/pull/1521.diff","patch_url":"https://github.com/marmelab/admin-on-rest/pull/1521.patch","issue_url":"https://api.github.com/repos/marmelab/admin-on-rest/issues/1521","number":1521,"state":"open","locked":false,"title":"[RFR] Bulk actions ","user":{"login":"djhi","id":1122076,"avatar_url":"https://avatars2.githubusercontent.com/u/1122076?v=4","gravatar_id":"","url":"https://api.github.com/users/djhi","html_url":"https://github.com/djhi","followers_url":"https://api.github.com/users/djhi/followers","following_url":"https://api.github.com/users/djhi/following{/other_user}","gists_url":"https://api.github.com/users/djhi/gists{/gist_id}","starred_url":"https://api.github.com/users/djhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djhi/subscriptions","organizations_url":"https://api.github.com/users/djhi/orgs","repos_url":"https://api.github.com/users/djhi/repos","events_url":"https://api.github.com/users/djhi/events{/privacy}","received_events_url":"https://api.github.com/users/djhi/received_events","type":"User","site_admin":false},"body":"- [x] Allow to select items in Datagrid\r\n- [x] Show a bulk actions button when items are selected\r\n- [x] Add a default DELETE_MANY bulk action\r\n- [x] Allow to specify custom bulk actions\r\n- [x] Tests\r\n- [x] Documentation","created_at":"2018-02-12T14:46:02Z","updated_at":"2018-02-13T13:04:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5752a77343fb82e18cdd619c3f20a7f5d2ceb6ea","assignee":null,"assignees":[],"requested_reviewers":[{"login":"fzaninotto","id":99944,"avatar_url":"https://avatars3.githubusercontent.com/u/99944?v=4","gravatar_id":"","url":"https://api.github.com/users/fzaninotto","html_url":"https://github.com/fzaninotto","followers_url":"https://api.github.com/users/fzaninotto/followers","following_url":"https://api.github.com/users/fzaninotto/following{/other_user}","gists_url":"https://api.github.com/users/fzaninotto/gists{/gist_id}","starred_url":"https://api.github.com/users/fzaninotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fzaninotto/subscriptions","organizations_url":"https://api.github.com/users/fzaninotto/orgs","repos_url":"https://api.github.com/users/fzaninotto/repos","events_url":"https://api.github.com/users/fzaninotto/events{/privacy}","received_events_url":"https://api.github.com/users/fzaninotto/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/1521/commits","review_comments_url":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/1521/comments","review_comment_url":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marmelab/admin-on-rest/issues/1521/comments","statuses_url":"https://api.github.com/repos/marmelab/admin-on-rest/statuses/f7978997ff720faa650c7196920e92fee259f896","head":{"label":"marmelab:bulk_actions","ref":"bulk_actions","sha":"f7978997ff720faa650c7196920e92fee259f896","user":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars1.githubusercontent.com/u/3116319?v=4","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"repo":{"id":63226588,"name":"admin-on-rest","full_name":"marmelab/admin-on-rest","owner":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars1.githubusercontent.com/u/3116319?v=4","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marmelab/admin-on-rest","description":"A frontend framework for building admin SPAs on top of REST services, using React and Material Design","fork":false,"url":"https://api.github.com/repos/marmelab/admin-on-rest","forks_url":"https://api.github.com/repos/marmelab/admin-on-rest/forks","keys_url":"https://api.github.com/repos/marmelab/admin-on-rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marmelab/admin-on-rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marmelab/admin-on-rest/teams","hooks_url":"https://api.github.com/repos/marmelab/admin-on-rest/hooks","issue_events_url":"https://api.github.com/repos/marmelab/admin-on-rest/issues/events{/number}","events_url":"https://api.github.com/repos/marmelab/admin-on-rest/events","assignees_url":"https://api.github.com/repos/marmelab/admin-on-rest/assignees{/user}","branches_url":"https://api.github.com/repos/marmelab/admin-on-rest/branches{/branch}","tags_url":"https://api.github.com/repos/marmelab/admin-on-rest/tags","blobs_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marmelab/admin-on-rest/statuses/{sha}","languages_url":"https://api.github.com/repos/marmelab/admin-on-rest/languages","stargazers_url":"https://api.github.com/repos/marmelab/admin-on-rest/stargazers","contributors_url":"https://api.github.com/repos/marmelab/admin-on-rest/contributors","subscribers_url":"https://api.github.com/repos/marmelab/admin-on-rest/subscribers","subscription_url":"https://api.github.com/repos/marmelab/admin-on-rest/subscription","commits_url":"https://api.github.com/repos/marmelab/admin-on-rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/marmelab/admin-on-rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/marmelab/admin-on-rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/marmelab/admin-on-rest/contents/{+path}","compare_url":"https://api.github.com/repos/marmelab/admin-on-rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marmelab/admin-on-rest/merges","archive_url":"https://api.github.com/repos/marmelab/admin-on-rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marmelab/admin-on-rest/downloads","issues_url":"https://api.github.com/repos/marmelab/admin-on-rest/issues{/number}","pulls_url":"https://api.github.com/repos/marmelab/admin-on-rest/pulls{/number}","milestones_url":"https://api.github.com/repos/marmelab/admin-on-rest/milestones{/number}","notifications_url":"https://api.github.com/repos/marmelab/admin-on-rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marmelab/admin-on-rest/labels{/name}","releases_url":"https://api.github.com/repos/marmelab/admin-on-rest/releases{/id}","deployments_url":"https://api.github.com/repos/marmelab/admin-on-rest/deployments","created_at":"2016-07-13T07:58:54Z","updated_at":"2018-02-13T13:00:18Z","pushed_at":"2018-02-13T10:10:56Z","git_url":"git://github.com/marmelab/admin-on-rest.git","ssh_url":"git@github.com:marmelab/admin-on-rest.git","clone_url":"https://github.com/marmelab/admin-on-rest.git","svn_url":"https://github.com/marmelab/admin-on-rest","homepage":"http://marmelab.com/admin-on-rest","size":72390,"stargazers_count":3621,"watchers_count":3621,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":701,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":701,"open_issues":50,"watchers":3621,"default_branch":"master"}},"base":{"label":"marmelab:next","ref":"next","sha":"aa8a30d517e6c15b3fed2515dc62029c91cdbbec","user":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars1.githubusercontent.com/u/3116319?v=4","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"repo":{"id":63226588,"name":"admin-on-rest","full_name":"marmelab/admin-on-rest","owner":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars1.githubusercontent.com/u/3116319?v=4","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marmelab/admin-on-rest","description":"A frontend framework for building admin SPAs on top of REST services, using React and Material Design","fork":false,"url":"https://api.github.com/repos/marmelab/admin-on-rest","forks_url":"https://api.github.com/repos/marmelab/admin-on-rest/forks","keys_url":"https://api.github.com/repos/marmelab/admin-on-rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marmelab/admin-on-rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marmelab/admin-on-rest/teams","hooks_url":"https://api.github.com/repos/marmelab/admin-on-rest/hooks","issue_events_url":"https://api.github.com/repos/marmelab/admin-on-rest/issues/events{/number}","events_url":"https://api.github.com/repos/marmelab/admin-on-rest/events","assignees_url":"https://api.github.com/repos/marmelab/admin-on-rest/assignees{/user}","branches_url":"https://api.github.com/repos/marmelab/admin-on-rest/branches{/branch}","tags_url":"https://api.github.com/repos/marmelab/admin-on-rest/tags","blobs_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marmelab/admin-on-rest/statuses/{sha}","languages_url":"https://api.github.com/repos/marmelab/admin-on-rest/languages","stargazers_url":"https://api.github.com/repos/marmelab/admin-on-rest/stargazers","contributors_url":"https://api.github.com/repos/marmelab/admin-on-rest/contributors","subscribers_url":"https://api.github.com/repos/marmelab/admin-on-rest/subscribers","subscription_url":"https://api.github.com/repos/marmelab/admin-on-rest/subscription","commits_url":"https://api.github.com/repos/marmelab/admin-on-rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/marmelab/admin-on-rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/marmelab/admin-on-rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/marmelab/admin-on-rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/marmelab/admin-on-rest/contents/{+path}","compare_url":"https://api.github.com/repos/marmelab/admin-on-rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marmelab/admin-on-rest/merges","archive_url":"https://api.github.com/repos/marmelab/admin-on-rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marmelab/admin-on-rest/downloads","issues_url":"https://api.github.com/repos/marmelab/admin-on-rest/issues{/number}","pulls_url":"https://api.github.com/repos/marmelab/admin-on-rest/pulls{/number}","milestones_url":"https://api.github.com/repos/marmelab/admin-on-rest/milestones{/number}","notifications_url":"https://api.github.com/repos/marmelab/admin-on-rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marmelab/admin-on-rest/labels{/name}","releases_url":"https://api.github.com/repos/marmelab/admin-on-rest/releases{/id}","deployments_url":"https://api.github.com/repos/marmelab/admin-on-rest/deployments","created_at":"2016-07-13T07:58:54Z","updated_at":"2018-02-13T13:00:18Z","pushed_at":"2018-02-13T10:10:56Z","git_url":"git://github.com/marmelab/admin-on-rest.git","ssh_url":"git@github.com:marmelab/admin-on-rest.git","clone_url":"https://github.com/marmelab/admin-on-rest.git","svn_url":"https://github.com/marmelab/admin-on-rest","homepage":"http://marmelab.com/admin-on-rest","size":72390,"stargazers_count":3621,"watchers_count":3621,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":701,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":701,"open_issues":50,"watchers":3621,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/1521"},"html":{"href":"https://github.com/marmelab/admin-on-rest/pull/1521"},"issue":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/issues/1521"},"comments":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/issues/1521/comments"},"review_comments":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/1521/comments"},"review_comment":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/pulls/1521/commits"},"statuses":{"href":"https://api.github.com/repos/marmelab/admin-on-rest/statuses/f7978997ff720faa650c7196920e92fee259f896"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexisjanvier"}}