mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
3954289cf4
Summary: There are now two objects, Folders & Labels. These inherit from `Category` (that's what Eben said they were using on the backend). There are two separate tasks. 1. MoveToFolderTask 2. ApplyLabelsTask It turns out that the semantics between the two are quite different. The reverse operation for moving to a folder is a bit tricky. As of 7-8-15, the Tasks are pretty much complete. I need to write tests for them still and do some manual testing in the client. Test Plan: Writing specs Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D1724
45 lines
1.3 KiB
CoffeeScript
45 lines
1.3 KiB
CoffeeScript
_ = require 'underscore'
|
|
React = require 'react'
|
|
{Actions,
|
|
Utils,
|
|
Thread,
|
|
ArchiveThreadHelper,
|
|
NamespaceStore} = require 'nylas-exports'
|
|
|
|
class ThreadListQuickActions extends React.Component
|
|
@displayName: 'ThreadListQuickActions'
|
|
@propTypes:
|
|
thread: React.PropTypes.object
|
|
|
|
render: =>
|
|
actions = []
|
|
actions.push <div key="reply" className="action action-reply" onClick={@_onReply}></div>
|
|
actions.push <div key="fwd" className="action action-forward" onClick={@_onForward}></div>
|
|
if not @props.thread.hasCategoryName('archive')
|
|
actions.push <div key="archive" className="action action-archive" onClick={@_onArchive}></div>
|
|
|
|
<div className="inner">
|
|
{actions}
|
|
</div>
|
|
|
|
shouldComponentUpdate: (newProps, newState) ->
|
|
newProps.thread.id isnt @props?.thread.id
|
|
|
|
_onForward: (event) =>
|
|
Actions.composeForward({thread: @props.thread, popout: true})
|
|
# Don't trigger the thread row click
|
|
event.stopPropagation()
|
|
|
|
_onReply: (event) =>
|
|
Actions.composeReply({thread: @props.thread, popout: true})
|
|
# Don't trigger the thread row click
|
|
event.stopPropagation()
|
|
|
|
_onArchive: (event) =>
|
|
task = ArchiveThreadHelper.getArchiveTask([@props.thread])
|
|
Actions.queueTask(task)
|
|
|
|
# Don't trigger the thread row click
|
|
event.stopPropagation()
|
|
|
|
module.exports = ThreadListQuickActions
|