{"action":"created","comment":{"url":"https://api.github.com/repos/cozy/cozy-emails/pulls/comments/51430863","id":51430863,"diff_hunk":"@@ -1,166 +1,144 @@\n {div, ul, li, span, a, button} = React.DOM\n-{MenuHeader, MenuItem, MenuDivider} = require './basic_components'\n+{Menu, MenuHeader, MenuItem, MenuDivider} = require './basic_components'\n {FlagsConstants} = require '../constants/app_constants'\n \n \n+\n+# This component is used in 3 places\n+#  - for the conversation\n+#  - for the message\n+#  - at the top of the list on selection\n+\n module.exports = ToolboxActions = React.createClass\n     displayName: 'ToolboxActions'\n \n-\n     propTypes:\n-\n+        # let the dropdown be aligned on right or left\n         direction            : React.PropTypes.string.isRequired\n-        displayConversations : React.PropTypes.bool.isRequired\n+        # one of conversation / message\n+        mode                 : React.PropTypes.string.isRequired\n+        # is the message or all messages flagged\n         isFlagged            : React.PropTypes.bool\n+        # is the message or all messages seen\n         isSeen               : React.PropTypes.bool\n+        # mailboxes this message can be moved to\n         mailboxes            : React.PropTypes.object.isRequired\n-        message              : React.PropTypes.object\n+        # id of the message we are working on (empty for conversation)\n         messageID            : React.PropTypes.string\n+        # handlers for action\n         onConversationDelete : React.PropTypes.func.isRequired\n         onConversationMark   : React.PropTypes.func.isRequired\n         onConversationMove   : React.PropTypes.func.isRequired\n         onHeaders            : React.PropTypes.func\n-        onMark               : React.PropTypes.func.isRequired\n+        onMark               : React.PropTypes.func\n \n \n     shouldComponentUpdate: (nextProps, nextState) ->\n         return not(_.isEqual(nextState, @state)) or\n                not(_.isEqual(nextProps, @props))\n \n-\n     render: ->\n-        direction = if @props.direction is 'right' then 'right' else 'left'\n-        div className: 'menu-action btn-group btn-group-sm',\n-            button\n-                className: 'btn btn-default dropdown-toggle fa fa-cog'\n-                type: 'button'\n-                'data-toggle': 'dropdown'\n-                ' '\n-                    span className: 'caret'\n-            ul\n-                className: \"dropdown-menu dropdown-menu-#{direction}\"\n-                role: 'menu',\n-                    # in conversation mode, only shows actions on conversation\n-                    if not @props.displayConversations\n-                        @renderMarkActions()\n-                    if not @props.displayConversations\n-                        MenuDivider()\n-                    @renderRawActions()...\n-                    if @props.inConversation\n-                        @renderConversationActions()\n-                    if @props.inConversation\n-                        MenuDivider key: 'divider'\n-                    if @props.inConversation\n-                        MenuHeader key: 'header-move',\n-                            t 'mail action conversation move'\n-                    if @props.inConversation\n-                        @renderMailboxes()\n-\n-\n-    renderMarkActions: ->\n-        items = [\n-            MenuHeader key: 'header-mark', t 'mail action mark'\n-\n-            if not @props.isSeen? or not @props.isSeen\n+        message = @props.mode is 'message'\n+        conversation = @props.mode is 'conversation'\n+        Menu\n+            icon: 'fa-cog'\n+            direction: if @props.direction is 'right' then 'right' else 'left'\n+        ,\n+\n+            if message\n+                MenuHeader key: 'header-mark', t 'mail action mark'\n+\n+            if message and @props.isSeen isnt true","path":"client/app/components/toolbox_actions.coffee","position":91,"original_position":91,"commit_id":"6de489a4cc6c8eaefba3eea64a961247cfa3ffb8","original_commit_id":"6de489a4cc6c8eaefba3eea64a961247cfa3ffb8","user":{"login":"nono","id":2767,"avatar_url":"https://avatars.githubusercontent.com/u/2767?v=3","gravatar_id":"","url":"https://api.github.com/users/nono","html_url":"https://github.com/nono","followers_url":"https://api.github.com/users/nono/followers","following_url":"https://api.github.com/users/nono/following{/other_user}","gists_url":"https://api.github.com/users/nono/gists{/gist_id}","starred_url":"https://api.github.com/users/nono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nono/subscriptions","organizations_url":"https://api.github.com/users/nono/orgs","repos_url":"https://api.github.com/users/nono/repos","events_url":"https://api.github.com/users/nono/events{/privacy}","received_events_url":"https://api.github.com/users/nono/received_events","type":"User","site_admin":false},"body":"There is a good reason to write `isnt true` instead of `is false`? I'd have expected `isSeen` to be a boolean, but maybe it can take other values.","created_at":"2016-02-01T15:25:34Z","updated_at":"2016-02-01T15:25:34Z","html_url":"https://github.com/cozy/cozy-emails/pull/732#discussion_r51430863","pull_request_url":"https://api.github.com/repos/cozy/cozy-emails/pulls/732","_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-emails/pulls/comments/51430863"},"html":{"href":"https://github.com/cozy/cozy-emails/pull/732#discussion_r51430863"},"pull_request":{"href":"https://api.github.com/repos/cozy/cozy-emails/pulls/732"}}},"pull_request":{"url":"https://api.github.com/repos/cozy/cozy-emails/pulls/732","id":57538766,"html_url":"https://github.com/cozy/cozy-emails/pull/732","diff_url":"https://github.com/cozy/cozy-emails/pull/732.diff","patch_url":"https://github.com/cozy/cozy-emails/pull/732.patch","issue_url":"https://api.github.com/repos/cozy/cozy-emails/issues/732","number":732,"state":"open","locked":false,"title":"Several fixes","user":{"login":"aenario","id":1580287,"avatar_url":"https://avatars.githubusercontent.com/u/1580287?v=3","gravatar_id":"","url":"https://api.github.com/users/aenario","html_url":"https://github.com/aenario","followers_url":"https://api.github.com/users/aenario/followers","following_url":"https://api.github.com/users/aenario/following{/other_user}","gists_url":"https://api.github.com/users/aenario/gists{/gist_id}","starred_url":"https://api.github.com/users/aenario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aenario/subscriptions","organizations_url":"https://api.github.com/users/aenario/orgs","repos_url":"https://api.github.com/users/aenario/repos","events_url":"https://api.github.com/users/aenario/events{/privacy}","received_events_url":"https://api.github.com/users/aenario/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-28T17:48:47Z","updated_at":"2016-02-01T15:25:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97ea89a6f714f669caa29b75bfdc3a988896071e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cozy/cozy-emails/pulls/732/commits","review_comments_url":"https://api.github.com/repos/cozy/cozy-emails/pulls/732/comments","review_comment_url":"https://api.github.com/repos/cozy/cozy-emails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cozy/cozy-emails/issues/732/comments","statuses_url":"https://api.github.com/repos/cozy/cozy-emails/statuses/6de489a4cc6c8eaefba3eea64a961247cfa3ffb8","head":{"label":"aenario:several-fixes","ref":"several-fixes","sha":"6de489a4cc6c8eaefba3eea64a961247cfa3ffb8","user":{"login":"aenario","id":1580287,"avatar_url":"https://avatars.githubusercontent.com/u/1580287?v=3","gravatar_id":"","url":"https://api.github.com/users/aenario","html_url":"https://github.com/aenario","followers_url":"https://api.github.com/users/aenario/followers","following_url":"https://api.github.com/users/aenario/following{/other_user}","gists_url":"https://api.github.com/users/aenario/gists{/gist_id}","starred_url":"https://api.github.com/users/aenario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aenario/subscriptions","organizations_url":"https://api.github.com/users/aenario/orgs","repos_url":"https://api.github.com/users/aenario/repos","events_url":"https://api.github.com/users/aenario/events{/privacy}","received_events_url":"https://api.github.com/users/aenario/received_events","type":"User","site_admin":false},"repo":{"id":23427866,"name":"cozy-emails","full_name":"aenario/cozy-emails","owner":{"login":"aenario","id":1580287,"avatar_url":"https://avatars.githubusercontent.com/u/1580287?v=3","gravatar_id":"","url":"https://api.github.com/users/aenario","html_url":"https://github.com/aenario","followers_url":"https://api.github.com/users/aenario/followers","following_url":"https://api.github.com/users/aenario/following{/other_user}","gists_url":"https://api.github.com/users/aenario/gists{/gist_id}","starred_url":"https://api.github.com/users/aenario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aenario/subscriptions","organizations_url":"https://api.github.com/users/aenario/orgs","repos_url":"https://api.github.com/users/aenario/repos","events_url":"https://api.github.com/users/aenario/events{/privacy}","received_events_url":"https://api.github.com/users/aenario/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aenario/cozy-emails","description":"Emails client for Cozycloud","fork":true,"url":"https://api.github.com/repos/aenario/cozy-emails","forks_url":"https://api.github.com/repos/aenario/cozy-emails/forks","keys_url":"https://api.github.com/repos/aenario/cozy-emails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aenario/cozy-emails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aenario/cozy-emails/teams","hooks_url":"https://api.github.com/repos/aenario/cozy-emails/hooks","issue_events_url":"https://api.github.com/repos/aenario/cozy-emails/issues/events{/number}","events_url":"https://api.github.com/repos/aenario/cozy-emails/events","assignees_url":"https://api.github.com/repos/aenario/cozy-emails/assignees{/user}","branches_url":"https://api.github.com/repos/aenario/cozy-emails/branches{/branch}","tags_url":"https://api.github.com/repos/aenario/cozy-emails/tags","blobs_url":"https://api.github.com/repos/aenario/cozy-emails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aenario/cozy-emails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aenario/cozy-emails/git/refs{/sha}","trees_url":"https://api.github.com/repos/aenario/cozy-emails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aenario/cozy-emails/statuses/{sha}","languages_url":"https://api.github.com/repos/aenario/cozy-emails/languages","stargazers_url":"https://api.github.com/repos/aenario/cozy-emails/stargazers","contributors_url":"https://api.github.com/repos/aenario/cozy-emails/contributors","subscribers_url":"https://api.github.com/repos/aenario/cozy-emails/subscribers","subscription_url":"https://api.github.com/repos/aenario/cozy-emails/subscription","commits_url":"https://api.github.com/repos/aenario/cozy-emails/commits{/sha}","git_commits_url":"https://api.github.com/repos/aenario/cozy-emails/git/commits{/sha}","comments_url":"https://api.github.com/repos/aenario/cozy-emails/comments{/number}","issue_comment_url":"https://api.github.com/repos/aenario/cozy-emails/issues/comments{/number}","contents_url":"https://api.github.com/repos/aenario/cozy-emails/contents/{+path}","compare_url":"https://api.github.com/repos/aenario/cozy-emails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aenario/cozy-emails/merges","archive_url":"https://api.github.com/repos/aenario/cozy-emails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aenario/cozy-emails/downloads","issues_url":"https://api.github.com/repos/aenario/cozy-emails/issues{/number}","pulls_url":"https://api.github.com/repos/aenario/cozy-emails/pulls{/number}","milestones_url":"https://api.github.com/repos/aenario/cozy-emails/milestones{/number}","notifications_url":"https://api.github.com/repos/aenario/cozy-emails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aenario/cozy-emails/labels{/name}","releases_url":"https://api.github.com/repos/aenario/cozy-emails/releases{/id}","deployments_url":"https://api.github.com/repos/aenario/cozy-emails/deployments","created_at":"2014-08-28T12:56:14Z","updated_at":"2015-04-22T07:06:08Z","pushed_at":"2016-02-01T14:09:45Z","git_url":"git://github.com/aenario/cozy-emails.git","ssh_url":"git@github.com:aenario/cozy-emails.git","clone_url":"https://github.com/aenario/cozy-emails.git","svn_url":"https://github.com/aenario/cozy-emails","homepage":null,"size":39255,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cozy:development","ref":"development","sha":"6476decb176b5be80722dec1608b6f30dca029dc","user":{"login":"cozy","id":7690525,"avatar_url":"https://avatars.githubusercontent.com/u/7690525?v=3","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"repo":{"id":21939095,"name":"cozy-emails","full_name":"cozy/cozy-emails","owner":{"login":"cozy","id":7690525,"avatar_url":"https://avatars.githubusercontent.com/u/7690525?v=3","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cozy/cozy-emails","description":"Email Client for Cozy","fork":false,"url":"https://api.github.com/repos/cozy/cozy-emails","forks_url":"https://api.github.com/repos/cozy/cozy-emails/forks","keys_url":"https://api.github.com/repos/cozy/cozy-emails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cozy/cozy-emails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cozy/cozy-emails/teams","hooks_url":"https://api.github.com/repos/cozy/cozy-emails/hooks","issue_events_url":"https://api.github.com/repos/cozy/cozy-emails/issues/events{/number}","events_url":"https://api.github.com/repos/cozy/cozy-emails/events","assignees_url":"https://api.github.com/repos/cozy/cozy-emails/assignees{/user}","branches_url":"https://api.github.com/repos/cozy/cozy-emails/branches{/branch}","tags_url":"https://api.github.com/repos/cozy/cozy-emails/tags","blobs_url":"https://api.github.com/repos/cozy/cozy-emails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cozy/cozy-emails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cozy/cozy-emails/git/refs{/sha}","trees_url":"https://api.github.com/repos/cozy/cozy-emails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cozy/cozy-emails/statuses/{sha}","languages_url":"https://api.github.com/repos/cozy/cozy-emails/languages","stargazers_url":"https://api.github.com/repos/cozy/cozy-emails/stargazers","contributors_url":"https://api.github.com/repos/cozy/cozy-emails/contributors","subscribers_url":"https://api.github.com/repos/cozy/cozy-emails/subscribers","subscription_url":"https://api.github.com/repos/cozy/cozy-emails/subscription","commits_url":"https://api.github.com/repos/cozy/cozy-emails/commits{/sha}","git_commits_url":"https://api.github.com/repos/cozy/cozy-emails/git/commits{/sha}","comments_url":"https://api.github.com/repos/cozy/cozy-emails/comments{/number}","issue_comment_url":"https://api.github.com/repos/cozy/cozy-emails/issues/comments{/number}","contents_url":"https://api.github.com/repos/cozy/cozy-emails/contents/{+path}","compare_url":"https://api.github.com/repos/cozy/cozy-emails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cozy/cozy-emails/merges","archive_url":"https://api.github.com/repos/cozy/cozy-emails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cozy/cozy-emails/downloads","issues_url":"https://api.github.com/repos/cozy/cozy-emails/issues{/number}","pulls_url":"https://api.github.com/repos/cozy/cozy-emails/pulls{/number}","milestones_url":"https://api.github.com/repos/cozy/cozy-emails/milestones{/number}","notifications_url":"https://api.github.com/repos/cozy/cozy-emails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cozy/cozy-emails/labels{/name}","releases_url":"https://api.github.com/repos/cozy/cozy-emails/releases{/id}","deployments_url":"https://api.github.com/repos/cozy/cozy-emails/deployments","created_at":"2014-07-17T11:17:51Z","updated_at":"2016-01-11T14:20:31Z","pushed_at":"2016-02-01T14:09:46Z","git_url":"git://github.com/cozy/cozy-emails.git","ssh_url":"git@github.com:cozy/cozy-emails.git","clone_url":"https://github.com/cozy/cozy-emails.git","svn_url":"https://github.com/cozy/cozy-emails","homepage":"","size":39716,"stargazers_count":37,"watchers_count":37,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":115,"forks":25,"open_issues":115,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-emails/pulls/732"},"html":{"href":"https://github.com/cozy/cozy-emails/pull/732"},"issue":{"href":"https://api.github.com/repos/cozy/cozy-emails/issues/732"},"comments":{"href":"https://api.github.com/repos/cozy/cozy-emails/issues/732/comments"},"review_comments":{"href":"https://api.github.com/repos/cozy/cozy-emails/pulls/732/comments"},"review_comment":{"href":"https://api.github.com/repos/cozy/cozy-emails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cozy/cozy-emails/pulls/732/commits"},"statuses":{"href":"https://api.github.com/repos/cozy/cozy-emails/statuses/6de489a4cc6c8eaefba3eea64a961247cfa3ffb8"}}}}