From 9b15858bf2ecba65d4d87cce8d2f24a97285fe64 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Fri, 6 Feb 2015 18:47:31 -0500 Subject: [PATCH] fix(attachment): fix message attachment & rename to AttachmentComponent --- dot-inbox/config.cson | 3 ++- ...{message-attachment.cjsx => attachment-component.cjsx} | 4 ++-- internal_packages/attachments/lib/main.cjsx | 8 ++++---- internal_packages/composer/lib/composer-view.cjsx | 6 +++--- internal_packages/message-list/lib/message-item.cjsx | 5 +++-- 5 files changed, 14 insertions(+), 12 deletions(-) rename internal_packages/attachments/lib/{message-attachment.cjsx => attachment-component.cjsx} (96%) diff --git a/dot-inbox/config.cson b/dot-inbox/config.cson index a3b88c55d..8671bf30e 100644 --- a/dot-inbox/config.cson +++ b/dot-inbox/config.cson @@ -90,5 +90,6 @@ # Temporarily disabled "sidebar-fullcontact", "message-templates", - "calendar-bar" + "calendar-bar", + "salesforce" ] diff --git a/internal_packages/attachments/lib/message-attachment.cjsx b/internal_packages/attachments/lib/attachment-component.cjsx similarity index 96% rename from internal_packages/attachments/lib/message-attachment.cjsx rename to internal_packages/attachments/lib/attachment-component.cjsx index c87fa7db9..e3783abe0 100644 --- a/internal_packages/attachments/lib/message-attachment.cjsx +++ b/internal_packages/attachments/lib/attachment-component.cjsx @@ -8,8 +8,8 @@ React = require 'react' # @props.file is a File object module.exports = -MessageAttachment = React.createClass - displayName: 'MessageAttachment' +AttachmentComponent = React.createClass + displayName: 'AttachmentComponent' propTypes: file: React.PropTypes.object.isRequired, diff --git a/internal_packages/attachments/lib/main.cjsx b/internal_packages/attachments/lib/main.cjsx index 875f01626..875fe8518 100644 --- a/internal_packages/attachments/lib/main.cjsx +++ b/internal_packages/attachments/lib/main.cjsx @@ -2,14 +2,14 @@ module.exports = activate: (@state={}) -> - MessageAttachment = require "./message-attachment.cjsx" + AttachmentComponent = require "./attachment-component.cjsx" ComponentRegistry.register - name: 'MessageAttachment' - view: MessageAttachment + name: 'AttachmentComponent' + view: AttachmentComponent role: 'Attachment' deactivate: -> - ComponentRegistry.unregister "MessageAttachment" + ComponentRegistry.unregister "AttachmentComponent" serialize: -> @state diff --git a/internal_packages/composer/lib/composer-view.cjsx b/internal_packages/composer/lib/composer-view.cjsx index de75dc2dc..aa5c51524 100644 --- a/internal_packages/composer/lib/composer-view.cjsx +++ b/internal_packages/composer/lib/composer-view.cjsx @@ -35,7 +35,7 @@ ComposerView = React.createClass getComponentRegistryState: -> ResizableComponent: ComponentRegistry.findViewByName 'ResizableComponent' - MessageAttachment: ComponentRegistry.findViewByName 'MessageAttachment' + AttachmentComponent: ComponentRegistry.findViewByName 'AttachmentComponent' FooterComponents: ComponentRegistry.findAllViewsByRole 'Composer:Footer' componentWillMount: -> @@ -174,9 +174,9 @@ ComposerView = React.createClass _fileComponents: -> - MessageAttachment = @state.MessageAttachment + AttachmentComponent = @state.AttachmentComponent (@state.files ? []).map (file) => - diff --git a/internal_packages/message-list/lib/message-item.cjsx b/internal_packages/message-list/lib/message-item.cjsx index 77415636f..325a37f08 100644 --- a/internal_packages/message-list/lib/message-item.cjsx +++ b/internal_packages/message-list/lib/message-item.cjsx @@ -15,7 +15,7 @@ MessageItem = React.createClass thread_participants: React.PropTypes.arrayOf(React.PropTypes.object), mixins: [ComponentRegistry.Mixin] - components: ['MessageAttachment'] + components: ['AttachmentComponent'] getInitialState: -> # Holds the downloadData (if any) for all of our files. It's a hash @@ -102,9 +102,10 @@ MessageItem = React.createClass _formatContacts: (contacts=[]) -> _attachmentComponents: -> + AttachmentComponent = @state.AttachmentComponent attachments = _.filter @props.message.files, (f) -> not f.contentId? attachments.map (file) => - + _messageTime: -> moment(@props.message.date).format(@_timeFormat())