{"action":"created","comment":{"url":"https://api.github.com/repos/indico/indico/pulls/comments/228824893","pull_request_review_id":169178864,"id":228824893,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODgyNDg5Mw==","diff_hunk":"@@ -160,30 +170,184 @@ class BookingDetailsModal extends React.Component {\n         </Message>\n     );\n \n-    renderActionButtons = (canCancel, canReject, showAccept) => (\n-        <Modal.Actions>\n-            {canCancel && (\n-                <Button type=\"button\"\n-                        icon=\"remove circle\"\n-                        size=\"small\"\n-                        content={<Translate>Cancel booking</Translate>} />\n-            )}\n-            {canReject && (\n-                <Button type=\"button\"\n-                        icon=\"remove circle\"\n-                        color=\"red\"\n-                        size=\"small\"\n-                        content={<Translate>Reject booking</Translate>} />\n-            )}\n-            {showAccept && (\n-                <Button type=\"button\"\n-                        icon=\"check circle\"\n-                        color=\"green\"\n-                        size=\"small\"\n-                        content={<Translate>Accept booking</Translate>} />\n-            )}\n-        </Modal.Actions>\n-    );\n+    renderActionButtons = (canCancel, canReject, showAccept) => {\n+        const {bookingStateChangeInProgress} = this.props;\n+        const {actionInProgress} = this.state;\n+        const rejectButton = (\n+            <Button type=\"button\"\n+                    icon=\"remove circle\"\n+                    color=\"red\"\n+                    size=\"small\"\n+                    loading={actionInProgress === 'reject' && bookingStateChangeInProgress}\n+                    disabled={actionInProgress !== 'reject' && bookingStateChangeInProgress}\n+                    content={<Translate>Reject booking</Translate>} />\n+        );\n+\n+        const cancelButton = (\n+            <Button type=\"button\"\n+                    icon=\"remove circle\"\n+                    size=\"small\"\n+                    loading={actionInProgress === 'cancel' && bookingStateChangeInProgress}\n+                    disabled={actionInProgress !== 'cancel' && bookingStateChangeInProgress}\n+                    content={<Translate>Cancel booking</Translate>} />\n+        );\n+\n+        const validate = ({reason}) => {\n+            const errors = {};\n+            if (!reason) {\n+                errors.reason = Translate.string('Rejection reason is required');\n+            }\n+            return errors;\n+        };\n+\n+        const renderForm = (placeholder, buttonText) => {\n+            return ({handleSubmit, hasValidationErrors, submitSucceeded, submitting}) => {\n+                return (\n+                    <Form styleName=\"rejection-form\" onSubmit={handleSubmit}>\n+                        <Field name=\"reason\"\n+                               component={ReduxFormField}\n+                               as={Form.TextArea}\n+                               format={formatters.trim}\n+                               placeholder={placeholder}\n+                               disabled={submitting}\n+                               rows={2}\n+                               formatOnBlur />\n+                        <Button type=\"submit\"\n+                                disabled={hasValidationErrors || submitSucceeded}\n+                                loading={submitting}\n+                                floated=\"right\"\n+                                primary>\n+                            {buttonText}\n+                        </Button>\n+                    </Form>\n+                );\n+            };\n+        };\n+\n+        return (\n+            <Modal.Actions>\n+                {canCancel && (\n+                    <Popup trigger={cancelButton}\n+                           position=\"right center\"\n+                           on=\"click\">\n+                        <FinalForm onSubmit={(data) => this.changeState('cancel', data)}\n+                                   validate={validate}\n+                                   render={renderForm(\n+                                       Translate.string('Provide the cancellation reason'),\n+                                       Translate.string('Cancel the booking')\n+                                   )}\n+                                   initialValues={{reason: ''}} />","path":"indico/modules/rb_new/client/js/common/bookings/BookingDetailsModal.jsx","position":139,"original_position":139,"commit_id":"bd207e7d3b4259da8ce5d352ed4f1fe14d98be8a","original_commit_id":"bd207e7d3b4259da8ce5d352ed4f1fe14d98be8a","user":{"login":"mic4ael","id":3616940,"node_id":"MDQ6VXNlcjM2MTY5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/3616940?v=4","gravatar_id":"","url":"https://api.github.com/users/mic4ael","html_url":"https://github.com/mic4ael","followers_url":"https://api.github.com/users/mic4ael/followers","following_url":"https://api.github.com/users/mic4ael/following{/other_user}","gists_url":"https://api.github.com/users/mic4ael/gists{/gist_id}","starred_url":"https://api.github.com/users/mic4ael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic4ael/subscriptions","organizations_url":"https://api.github.com/users/mic4ael/orgs","repos_url":"https://api.github.com/users/mic4ael/repos","events_url":"https://api.github.com/users/mic4ael/events{/privacy}","received_events_url":"https://api.github.com/users/mic4ael/received_events","type":"User","site_admin":false},"body":"yeah, indeed, you don't perform any action on `undefined`","created_at":"2018-10-29T07:53:42Z","updated_at":"2018-10-29T07:53:42Z","html_url":"https://github.com/indico/indico/pull/3639#discussion_r228824893","pull_request_url":"https://api.github.com/repos/indico/indico/pulls/3639","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/indico/indico/pulls/comments/228824893"},"html":{"href":"https://github.com/indico/indico/pull/3639#discussion_r228824893"},"pull_request":{"href":"https://api.github.com/repos/indico/indico/pulls/3639"}},"in_reply_to_id":228558014},"pull_request":{"url":"https://api.github.com/repos/indico/indico/pulls/3639","id":225794744,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1Nzk0NzQ0","html_url":"https://github.com/indico/indico/pull/3639","diff_url":"https://github.com/indico/indico/pull/3639.diff","patch_url":"https://github.com/indico/indico/pull/3639.patch","issue_url":"https://api.github.com/repos/indico/indico/issues/3639","number":3639,"state":"open","locked":false,"title":"Booking status","user":{"login":"mic4ael","id":3616940,"node_id":"MDQ6VXNlcjM2MTY5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/3616940?v=4","gravatar_id":"","url":"https://api.github.com/users/mic4ael","html_url":"https://github.com/mic4ael","followers_url":"https://api.github.com/users/mic4ael/followers","following_url":"https://api.github.com/users/mic4ael/following{/other_user}","gists_url":"https://api.github.com/users/mic4ael/gists{/gist_id}","starred_url":"https://api.github.com/users/mic4ael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic4ael/subscriptions","organizations_url":"https://api.github.com/users/mic4ael/orgs","repos_url":"https://api.github.com/users/mic4ael/repos","events_url":"https://api.github.com/users/mic4ael/events{/privacy}","received_events_url":"https://api.github.com/users/mic4ael/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-25T15:00:44Z","updated_at":"2018-10-29T07:53:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c363aa8ae0b9c449b2acfc1c7cb4a2ac225b38bb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/indico/indico/pulls/3639/commits","review_comments_url":"https://api.github.com/repos/indico/indico/pulls/3639/comments","review_comment_url":"https://api.github.com/repos/indico/indico/pulls/comments{/number}","comments_url":"https://api.github.com/repos/indico/indico/issues/3639/comments","statuses_url":"https://api.github.com/repos/indico/indico/statuses/bd207e7d3b4259da8ce5d352ed4f1fe14d98be8a","head":{"label":"mic4ael:booking-status","ref":"booking-status","sha":"bd207e7d3b4259da8ce5d352ed4f1fe14d98be8a","user":{"login":"mic4ael","id":3616940,"node_id":"MDQ6VXNlcjM2MTY5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/3616940?v=4","gravatar_id":"","url":"https://api.github.com/users/mic4ael","html_url":"https://github.com/mic4ael","followers_url":"https://api.github.com/users/mic4ael/followers","following_url":"https://api.github.com/users/mic4ael/following{/other_user}","gists_url":"https://api.github.com/users/mic4ael/gists{/gist_id}","starred_url":"https://api.github.com/users/mic4ael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic4ael/subscriptions","organizations_url":"https://api.github.com/users/mic4ael/orgs","repos_url":"https://api.github.com/users/mic4ael/repos","events_url":"https://api.github.com/users/mic4ael/events{/privacy}","received_events_url":"https://api.github.com/users/mic4ael/received_events","type":"User","site_admin":false},"repo":{"id":36723985,"node_id":"MDEwOlJlcG9zaXRvcnkzNjcyMzk4NQ==","name":"indico","full_name":"mic4ael/indico","private":false,"owner":{"login":"mic4ael","id":3616940,"node_id":"MDQ6VXNlcjM2MTY5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/3616940?v=4","gravatar_id":"","url":"https://api.github.com/users/mic4ael","html_url":"https://github.com/mic4ael","followers_url":"https://api.github.com/users/mic4ael/followers","following_url":"https://api.github.com/users/mic4ael/following{/other_user}","gists_url":"https://api.github.com/users/mic4ael/gists{/gist_id}","starred_url":"https://api.github.com/users/mic4ael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic4ael/subscriptions","organizations_url":"https://api.github.com/users/mic4ael/orgs","repos_url":"https://api.github.com/users/mic4ael/repos","events_url":"https://api.github.com/users/mic4ael/events{/privacy}","received_events_url":"https://api.github.com/users/mic4ael/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mic4ael/indico","description":"The Indico Project","fork":true,"url":"https://api.github.com/repos/mic4ael/indico","forks_url":"https://api.github.com/repos/mic4ael/indico/forks","keys_url":"https://api.github.com/repos/mic4ael/indico/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mic4ael/indico/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mic4ael/indico/teams","hooks_url":"https://api.github.com/repos/mic4ael/indico/hooks","issue_events_url":"https://api.github.com/repos/mic4ael/indico/issues/events{/number}","events_url":"https://api.github.com/repos/mic4ael/indico/events","assignees_url":"https://api.github.com/repos/mic4ael/indico/assignees{/user}","branches_url":"https://api.github.com/repos/mic4ael/indico/branches{/branch}","tags_url":"https://api.github.com/repos/mic4ael/indico/tags","blobs_url":"https://api.github.com/repos/mic4ael/indico/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mic4ael/indico/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mic4ael/indico/git/refs{/sha}","trees_url":"https://api.github.com/repos/mic4ael/indico/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mic4ael/indico/statuses/{sha}","languages_url":"https://api.github.com/repos/mic4ael/indico/languages","stargazers_url":"https://api.github.com/repos/mic4ael/indico/stargazers","contributors_url":"https://api.github.com/repos/mic4ael/indico/contributors","subscribers_url":"https://api.github.com/repos/mic4ael/indico/subscribers","subscription_url":"https://api.github.com/repos/mic4ael/indico/subscription","commits_url":"https://api.github.com/repos/mic4ael/indico/commits{/sha}","git_commits_url":"https://api.github.com/repos/mic4ael/indico/git/commits{/sha}","comments_url":"https://api.github.com/repos/mic4ael/indico/comments{/number}","issue_comment_url":"https://api.github.com/repos/mic4ael/indico/issues/comments{/number}","contents_url":"https://api.github.com/repos/mic4ael/indico/contents/{+path}","compare_url":"https://api.github.com/repos/mic4ael/indico/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mic4ael/indico/merges","archive_url":"https://api.github.com/repos/mic4ael/indico/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mic4ael/indico/downloads","issues_url":"https://api.github.com/repos/mic4ael/indico/issues{/number}","pulls_url":"https://api.github.com/repos/mic4ael/indico/pulls{/number}","milestones_url":"https://api.github.com/repos/mic4ael/indico/milestones{/number}","notifications_url":"https://api.github.com/repos/mic4ael/indico/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mic4ael/indico/labels{/name}","releases_url":"https://api.github.com/repos/mic4ael/indico/releases{/id}","deployments_url":"https://api.github.com/repos/mic4ael/indico/deployments","created_at":"2015-06-02T09:51:56Z","updated_at":"2018-10-04T07:56:01Z","pushed_at":"2018-10-26T14:15:43Z","git_url":"git://github.com/mic4ael/indico.git","ssh_url":"git@github.com:mic4ael/indico.git","clone_url":"https://github.com/mic4ael/indico.git","svn_url":"https://github.com/mic4ael/indico","homepage":"http://indico-software.org","size":205242,"stargazers_count":0,"watchers_count":0,"language":"Python","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":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"indico:master","ref":"master","sha":"11572e850d2c876fa85feb372ff3322d8c16f0bb","user":{"login":"indico","id":715236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxNTIzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/715236?v=4","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"repo":{"id":2113067,"node_id":"MDEwOlJlcG9zaXRvcnkyMTEzMDY3","name":"indico","full_name":"indico/indico","private":false,"owner":{"login":"indico","id":715236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxNTIzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/715236?v=4","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/indico/indico","description":"Indico - A complete event management system","fork":false,"url":"https://api.github.com/repos/indico/indico","forks_url":"https://api.github.com/repos/indico/indico/forks","keys_url":"https://api.github.com/repos/indico/indico/keys{/key_id}","collaborators_url":"https://api.github.com/repos/indico/indico/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/indico/indico/teams","hooks_url":"https://api.github.com/repos/indico/indico/hooks","issue_events_url":"https://api.github.com/repos/indico/indico/issues/events{/number}","events_url":"https://api.github.com/repos/indico/indico/events","assignees_url":"https://api.github.com/repos/indico/indico/assignees{/user}","branches_url":"https://api.github.com/repos/indico/indico/branches{/branch}","tags_url":"https://api.github.com/repos/indico/indico/tags","blobs_url":"https://api.github.com/repos/indico/indico/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/indico/indico/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/indico/indico/git/refs{/sha}","trees_url":"https://api.github.com/repos/indico/indico/git/trees{/sha}","statuses_url":"https://api.github.com/repos/indico/indico/statuses/{sha}","languages_url":"https://api.github.com/repos/indico/indico/languages","stargazers_url":"https://api.github.com/repos/indico/indico/stargazers","contributors_url":"https://api.github.com/repos/indico/indico/contributors","subscribers_url":"https://api.github.com/repos/indico/indico/subscribers","subscription_url":"https://api.github.com/repos/indico/indico/subscription","commits_url":"https://api.github.com/repos/indico/indico/commits{/sha}","git_commits_url":"https://api.github.com/repos/indico/indico/git/commits{/sha}","comments_url":"https://api.github.com/repos/indico/indico/comments{/number}","issue_comment_url":"https://api.github.com/repos/indico/indico/issues/comments{/number}","contents_url":"https://api.github.com/repos/indico/indico/contents/{+path}","compare_url":"https://api.github.com/repos/indico/indico/compare/{base}...{head}","merges_url":"https://api.github.com/repos/indico/indico/merges","archive_url":"https://api.github.com/repos/indico/indico/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/indico/indico/downloads","issues_url":"https://api.github.com/repos/indico/indico/issues{/number}","pulls_url":"https://api.github.com/repos/indico/indico/pulls{/number}","milestones_url":"https://api.github.com/repos/indico/indico/milestones{/number}","notifications_url":"https://api.github.com/repos/indico/indico/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/indico/indico/labels{/name}","releases_url":"https://api.github.com/repos/indico/indico/releases{/id}","deployments_url":"https://api.github.com/repos/indico/indico/deployments","created_at":"2011-07-27T13:56:30Z","updated_at":"2018-10-28T23:12:08Z","pushed_at":"2018-10-26T16:23:02Z","git_url":"git://github.com/indico/indico.git","ssh_url":"git@github.com:indico/indico.git","clone_url":"https://github.com/indico/indico.git","svn_url":"https://github.com/indico/indico","homepage":"https://getindico.io","size":205479,"stargazers_count":399,"watchers_count":399,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":147,"mirror_url":null,"archived":false,"open_issues_count":675,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":147,"open_issues":675,"watchers":399,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/indico/indico/pulls/3639"},"html":{"href":"https://github.com/indico/indico/pull/3639"},"issue":{"href":"https://api.github.com/repos/indico/indico/issues/3639"},"comments":{"href":"https://api.github.com/repos/indico/indico/issues/3639/comments"},"review_comments":{"href":"https://api.github.com/repos/indico/indico/pulls/3639/comments"},"review_comment":{"href":"https://api.github.com/repos/indico/indico/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/indico/indico/pulls/3639/commits"},"statuses":{"href":"https://api.github.com/repos/indico/indico/statuses/bd207e7d3b4259da8ce5d352ed4f1fe14d98be8a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mic4ael"}}