mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +08:00
0468cb4b39
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
47 lines
1.4 KiB
CoffeeScript
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
|