forked from nylas/nylas-mail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(archive): shows trash for non-archive accounts
Summary: Fixes T3570 Fixes T3737 Rename ArchiveThreadHelper to RemoveThreadHelper Rename of `getRemovalTask` Remove unarchive from `RemoveThreadHelper`. Pass in mailviewfilter Rename actions Rename archive action renmaing support trash and archive folders in RemoveThreadHelper Move everything over to trash add tests Hide trash and archive Test Plan: new tests Reviewers: dillon, bengotow Reviewed By: dillon, bengotow Maniphest Tasks: T3570, T3737 Differential Revision: https://phab.nylas.com/D2089
- Loading branch information
Showing
17 changed files
with
316 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
internal_packages/message-list/lib/thread-archive-button.cjsx
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
internal_packages/message-list/lib/thread-remove-button.cjsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
_ = require 'underscore' | ||
React = require 'react' | ||
{Actions, | ||
DOMUtils, | ||
RemoveThreadHelper, | ||
FocusedMailViewStore} = require 'nylas-exports' | ||
{RetinaImg} = require 'nylas-component-kit' | ||
|
||
class ThreadRemoveButton extends React.Component | ||
@displayName: "ThreadRemoveButton" | ||
@containerRequired: false | ||
|
||
render: => | ||
focusedMailViewFilter = FocusedMailViewStore.mailView() | ||
return false unless focusedMailViewFilter?.canRemoveThreads() | ||
|
||
if RemoveThreadHelper.removeType() is RemoveThreadHelper.Type.Archive | ||
tooltip = "Archive" | ||
imgName = "toolbar-archive.png" | ||
else if RemoveThreadHelper.removeType() is RemoveThreadHelper.Type.Trash | ||
tooltip = "Trash" | ||
imgName = "toolbar-trash.png" | ||
|
||
<button className="btn btn-toolbar" | ||
style={order: -106} | ||
data-tooltip={tooltip} | ||
onClick={@_onRemove}> | ||
<RetinaImg name={imgName} mode={RetinaImg.Mode.ContentIsMask}/> | ||
</button> | ||
|
||
_onRemove: (e) => | ||
return unless DOMUtils.nodeIsVisible(e.currentTarget) | ||
Actions.removeCurrentlyFocusedThread() | ||
e.stopPropagation() | ||
|
||
|
||
module.exports = ThreadRemoveButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 10 additions & 51 deletions
61
internal_packages/thread-list/lib/thread-list-quick-actions.cjsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.