mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
a26b8d4bc4
Summary: Fix T1822 - saving templates not working, not showing template Fix T1800 - give composers a minimum size Fix the bottom bar of the composer so the gray bar goes all the way across in popout mode. Fix T1825 - switch to a more attractive "June 4, 2015 at 3:10 PM" styling for expanded dates Remove, rather than hide, react components for text fields in composer. Fixes T1147 Fix specs Switch to 999+ instead of infinity. Fixes T1768 Fix broken TemplateStore specs Test Plan: Run tests Reviewers: evan Reviewed By: evan Maniphest Tasks: T1147, T1768, T1822, T1800, T1825 Differential Revision: https://phab.nylas.com/D1601
70 lines
1.9 KiB
CoffeeScript
70 lines
1.9 KiB
CoffeeScript
_ = require 'underscore'
|
|
React = require 'react'
|
|
|
|
{NamespaceStore,
|
|
DatabaseStore,
|
|
Message,
|
|
ComponentRegistry,
|
|
WorkspaceStore} = require('nylas-exports')
|
|
ComposeButton = require('./compose-button')
|
|
ComposerView = require('./composer-view')
|
|
|
|
|
|
class ComposerWithWindowProps extends React.Component
|
|
@displayName: 'ComposerWithWindowProps'
|
|
@containerRequired: false
|
|
|
|
constructor: (@props) ->
|
|
@state = atom.getWindowProps()
|
|
|
|
componentDidMount: ->
|
|
@unlisten = atom.onWindowPropsReceived (windowProps) =>
|
|
{errorMessage} = windowProps
|
|
@_showInitialErrorDialog(errorMessage) if errorMessage
|
|
@setState(windowProps)
|
|
|
|
componentWillUnmount: ->
|
|
@unlisten()
|
|
|
|
render: ->
|
|
<div className="composer-full-window">
|
|
<ComposerView mode="fullwindow" localId={@state.draftLocalId} />
|
|
</div>
|
|
|
|
_showInitialErrorDialog: (msg) ->
|
|
remote = require('remote')
|
|
dialog = remote.require('dialog')
|
|
dialog.showMessageBox remote.getCurrentWindow(), {
|
|
type: 'warning'
|
|
buttons: ['Okay'],
|
|
message: "Error"
|
|
detail: msg
|
|
}
|
|
|
|
module.exports =
|
|
activate: (@state={}) ->
|
|
atom.registerHotWindow
|
|
windowType: 'composer'
|
|
replenishNum: 2
|
|
|
|
# Register our composer as the app-wide Composer
|
|
ComponentRegistry.register ComposerView,
|
|
role: 'Composer'
|
|
|
|
if atom.isMainWindow()
|
|
ComponentRegistry.register ComposeButton,
|
|
location: WorkspaceStore.Location.RootSidebar.Toolbar
|
|
else
|
|
atom.getCurrentWindow().setMinimumSize(600, 400)
|
|
WorkspaceStore.defineSheet 'Main', {root: true},
|
|
list: ['Center']
|
|
ComponentRegistry.register ComposerWithWindowProps,
|
|
location: WorkspaceStore.Location.Center
|
|
|
|
deactivate: ->
|
|
atom.unregisterHotWindow('composer')
|
|
ComponentRegistry.unregister(ComposerView)
|
|
ComponentRegistry.unregister(ComposeButton)
|
|
ComponentRegistry.unregister(ComposerWithWindowProps)
|
|
|
|
serialize: -> @state
|