mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-29 03:17:47 +08:00
3a947ccf54
Summary: Give UpdateThreadsTask a description method for strings like "Marked as read" Give ChangeLabelsTask a better description method that returns shorter strings and is specific when possible Give ChangeFolderTask a more specific description and don't assume folderOrId will always be a folder Make it so that passive "mark as read" from the message store isn't undoable Give the base class a description method that names the object Change UndoRedo component CSS a bit: - Use "inline-flexbox" with a max-width so that we can define shrinking rules on the label and Undo button (label gets ellipsis, button does not shrink at all) - Avoid left:39%, since it assumed that the undo-redo element would be 22% of the width of the thread list, which wasn't always true. Instead, make the `undo-redo-manager` container "text-align:center", so the `undo-redo` div is always centered within it. - Add `cursor:default` so that the user sees the pointer, not the text insertion cursor when hovering over "Undo" - Add overflow / text-overflow so that if the message is ever too long, the user sees `...` ellipsis properly. Test Plan: Run a few new tests Reviewers: evan, ethanb Reviewed By: ethanb Differential Revision: https://phab.nylas.com/D1830
40 lines
1.7 KiB
CoffeeScript
40 lines
1.7 KiB
CoffeeScript
Task = require '../../src/flux/tasks/task'
|
|
Thread = require '../../src/flux/models/thread'
|
|
NylasAPI = require '../../src/flux/nylas-api'
|
|
Attributes = require '../../src/flux/attributes'
|
|
DatabaseStore = require '../../src/flux/stores/database-store'
|
|
UpdateThreadsTask = require '../../src/flux/tasks/update-threads-task'
|
|
|
|
{APIError} = require '../../src/flux/errors'
|
|
|
|
describe 'UpdateThreadsTask', ->
|
|
describe "description", ->
|
|
it 'should include special cases for changing unread', ->
|
|
objects = [
|
|
new Thread(id:"id-1")
|
|
new Thread(id:"id-2")
|
|
new Thread(id:"id-3")
|
|
]
|
|
task = new UpdateThreadsTask(objects, {unread: true})
|
|
expect(task.description()).toEqual("Marked 3 threads as unread")
|
|
task = new UpdateThreadsTask([objects[0]], {unread: true})
|
|
expect(task.description()).toEqual("Marked as unread")
|
|
task = new UpdateThreadsTask(objects, {unread: false})
|
|
expect(task.description()).toEqual("Marked 3 threads as read")
|
|
task = new UpdateThreadsTask([objects[0]], {unread: false})
|
|
expect(task.description()).toEqual("Marked as read")
|
|
|
|
it 'should include special cases for changing starred', ->
|
|
objects = [
|
|
new Thread(id:"id-1")
|
|
new Thread(id:"id-2")
|
|
new Thread(id:"id-3")
|
|
]
|
|
task = new UpdateThreadsTask(objects, {starred: true})
|
|
expect(task.description()).toEqual("Starred 3 threads")
|
|
task = new UpdateThreadsTask([objects[0]], {starred: true})
|
|
expect(task.description()).toEqual("Starred")
|
|
task = new UpdateThreadsTask(objects, {starred: false})
|
|
expect(task.description()).toEqual("Unstarred 3 threads")
|
|
task = new UpdateThreadsTask([objects[0]], {starred: false})
|
|
expect(task.description()).toEqual("Unstarred")
|