Mailspring/internal_packages/inbox-activity-bar/lib/activity-bar-task.cjsx
Ben Gotow 0468cb4b39 feat(drafts) Reply to draft and minor fixes
Summary:
Initial hooks for reply to message

Per-message actions and reply to message!

Always commit changes before openinig popout composer

Flip message display - newest at bottom like Gmail

WIP specs

New activity bar inspector for deltas

Don't allow long polling connection to restart after end() called

A bit of activity bar refactoring and filter options, clear

Include "On ... someone wrote" in replies / fw

Slightly more robust quoted text removal, detects "On..."

Abort request to really end it

Additional specs for draft store

Test Plan: Run 20 new tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1230
2015-02-24 16:19:47 -08:00

47 lines
1.4 KiB
CoffeeScript

React = require 'react/addons'
module.exports =
ActivityBarTask = React.createClass
displayName: 'ActivityBarTask'
getInitialState: ->
expanded: false
render: ->
<div className={@_classNames()} onClick={=> @setState expanded: not @state.expanded}>
<div className="task-summary">
{@_taskSummary()}
</div>
<div className="task-details">
{JSON.stringify(@props.task.toJSON())}
</div>
</div>
_taskSummary: ->
qs = @props.task.queueState
errType = ""
errCode = ""
errMessage = ""
if qs.localError?
localError = qs.localError
errType = localError.constructor.name
errMessage = localError.message ? JSON.stringify(localError)
else if qs.remoteError?
remoteError = qs.remoteError
errType = remoteError.constructor.name
errCode = remoteError.statusCode ? ""
errMessage = remoteError.body?.message ? remoteError?.message ? JSON.stringify(remoteError)
return "#{@props.task.constructor.name} #{errType} #{errCode} #{errMessage}"
_classNames: ->
qs = @props.task.queueState ? {}
React.addons.classSet
"task": true
"task-queued": @props.type is "queued"
"task-completed": @props.type is "completed"
"task-expanded": @state.expanded
"task-local-error": qs.localError
"task-remote-error": qs.remoteError
"task-is-processing": qs.isProcessing
"task-success": qs.performedLocal and qs.performedRemote