Mailspring/internal_packages/message-list/lib/main.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

65 lines
1.9 KiB
CoffeeScript

React = require "react"
MessageList = require "./message-list"
{ComponentRegistry} = require 'inbox-exports'
{ReplyButton,
ReplyAllButton,
ForwardButton,
ArchiveButton} = require "./core-primary-actions.cjsx"
module.exports =
item: null # The DOM item the main React component renders into
activate: (@state={}) ->
# Register Message List Actions we provide globally
ComponentRegistry.register
name: 'edgehill-reply-button'
role: 'MessageListPrimaryAction'
view: ReplyButton
ComponentRegistry.register
name: 'edgehill-reply-all-button'
role: 'MessageListPrimaryAction'
view: ReplyAllButton
ComponentRegistry.register
name: 'edgehill-forward-button'
role: 'MessageListPrimaryAction'
view: ForwardButton
ComponentRegistry.register
name: 'edgehill-archive-button'
role: 'MessageListPrimaryAction'
view: ArchiveButton
# Register Message Actions we provide globally
ComponentRegistry.register
name: 'edgehill-msg-reply-button'
role: 'MessageAction'
view: ReplyButton
ComponentRegistry.register
name: 'edgehill-msg-reply-all-button'
role: 'MessageAction'
view: ReplyAllButton
ComponentRegistry.register
name: 'edgehill-msg-forward-button'
role: 'MessageAction'
view: ForwardButton
unless @item
@item = document.createElement("div")
@item.setAttribute("id", "message-list")
@item.setAttribute("class", "message-list")
atom.workspace.addColumnItem(@item, "message-and-composer")
React.render(<MessageList /> , @item)
deactivate: ->
ComponentRegistry.unregister 'edgehill-reply-button'
ComponentRegistry.unregister 'edgehill-reply-all-button'
ComponentRegistry.unregister 'edgehill-forward-button'
ComponentRegistry.unregister 'edgehill-archive-button'
React.unmountComponentAtNode(@item)
@item.remove()
@item = null
serialize: -> @state