Commit Graph

529 Commits

Author SHA1 Message Date
Steve Howell
79e945edb1 node tests: Test people.small_avatar_url(). 2017-04-03 16:34:16 -07:00
Steve Howell
e21bb2ebfe node tests: Test people.pm_reply_to(). 2017-04-03 16:34:16 -07:00
Steve Howell
7d3a7e12e8 node test: Add test_get_recipients(). 2017-04-03 16:34:16 -07:00
Steve Howell
4ec4b28562 Add tests for people.reply_to_to_user_ids_string(). 2017-04-03 16:34:16 -07:00
Steve Howell
99d603b424 node tests: Add test cases for pm-with filter.
This commit gets us to 100% line coverage for filter.js.
2017-04-03 16:31:57 -07:00
Steve Howell
3ddb8690af node tests: Test some zero-count cases for unread.js.
Our unread.js code basically silently treats empty recipient
strings or unknown streams as having zero unread messages,
which is probably the correct behavior.  We now have tests
that cover this.  This commit also gets us to 100% line
coverage on the module (but not yet 100% branch coverage).
2017-04-03 16:31:57 -07:00
Steve Howell
8d647868ca Use fewer messages in test_num_unread_for_subject().
I am not sure why I originally coded this to use 10000
messages, since it's not really a performance test.
2017-04-03 16:31:57 -07:00
Brock Whittaker
34f9ccb87c alerts: Change sidebar alerts to be at top of the screen.
This changes the alerts to be individual boxes that slide down from
the top of the screen for a better UI experience.
2017-04-03 16:22:05 -07:00
Sampriti Panda
32e76c2c60 drafts: Move snapshot_message from compose to drafts
Previously drafts called compose.snapshot_message which would then
get the message object from compose.create_message_object. This method often
checked for the validity of stream/user recipients which would often cause tracebacks.

The new method in drafts.snapshot message just gets the data from the fields and
stores them in the draft model without any additional checking.
2017-03-30 10:20:37 -07:00
Sampriti Panda
400a2e0ff1 drafts: Fix faulty draft_model addDraft and editDraft tests
The addDraft and editDraft tests were copying objects by reference
which meant the methods weren't tested properly. Due to this, a bug with
stubTimestamp was also discovered where the method wasn't getting stubbed
2017-03-30 10:20:37 -07:00
Jonathan Pan
5556d2341c hotkey.js: Add hotkey for drafts.
* 'd' in message view opens drafts.

This also adds hotkeys within the drafts UI:
* Up/down arrow keys navigate the drafts.
* Pressing enter edits the selected draft.
* Pressing backspace deletes the selected draft.

Some variable names tweaked by tabbott.
2017-03-27 14:05:00 -07:00
Harshit Bansal
d17b759fa2 admin: Display last active time of users in admin users table.
Fixes: #2097.
2017-03-27 13:39:47 -07:00
Steve Howell
cf6545a71f reactions: Only warn for unknown user ids.
If we get reactions for deactivated users, or otherwise missing
users, we only issue a blueslip warning now.  The function
get_message_reactions() was indirectly causing blueslip errors
before this fix, but we can downgrade to warnings now that this
function has better unit tests around it.

We eventually want to track deactivated users on the client.

Fixes #4289
2017-03-26 11:51:36 -07:00
Steve Howell
3da047e10e Add people.is_known_user_id(). 2017-03-26 11:39:06 -07:00
Steve Howell
03b7e59b59 node tests: Add reactions.js test module.
We test get_message_reactions() in our first test here.
2017-03-26 11:39:05 -07:00
Cynthia Lin
6e2d180a34 hotkeys: Add hotkey n for opening New streams modal in Streams menu. 2017-03-25 18:35:21 -07:00
Cynthia Lin
ca460fad1f hotkeys: Add hotkey V for viewing selected stream in Streams menu. 2017-03-25 18:35:21 -07:00
Cynthia Lin
b800cb05c0 hotkeys: Add left/right arrow keys to toggle views in Streams menu.
Fixes #4228
2017-03-25 18:35:21 -07:00
Cynthia Lin
69c32daffa hotkeys: Add U hotkey for unsubscribing/subscribing in Streams menu.
Fixes #4229
2017-03-25 18:35:21 -07:00
Cynthia Lin
d17131dcb4 hotkeys: Rename subs.arrow_keys() to subs.switch_rows(). 2017-03-25 18:35:21 -07:00
Joshua Pan
7adf70e5ad Add node tests for M hotkey. 2017-03-25 09:42:49 -07:00
Tim Abbott
e16b082b70 casper: Attempt to fix flakiness in new reload test. 2017-03-23 13:56:59 -07:00
Tim Abbott
49f5be1dba hotkey: Extend tests for message_view_only_keys. 2017-03-23 11:38:37 -07:00
Joshua Pan
f40b43a491 hotkeys: Add hotkey G an alias for End.
Fixes #4195.
2017-03-23 11:38:36 -07:00
Tim Abbott
5d030e9173 casper: Add test for the reload hashchange logic. 2017-03-22 23:06:08 -07:00
hackerkid
ed72ee476f Make user_popover use user_info_popover template. 2017-03-22 16:04:38 -07:00
hackerkid
b2fc8d6fa2 Rename message_info_popover* templates to user_info_popover*. 2017-03-22 16:04:38 -07:00
hackerkid
23a5f56023 Add sender avatar in message popover. 2017-03-22 16:04:38 -07:00
hackerkid
32bc5893d0 Remove arrow from message info popover by providing template.
Provide custom template (user_info_popover.handlebars) to message info popover.
2017-03-22 16:04:38 -07:00
hollywoodno
d6716838ad bugdown: Remove trailing whitespace on fence code blocks.
This fixes fenced code blocks that are copy-pasted from certain
clients having trailing whitespace anoyingly often.

Fixes #3998.
2017-03-22 14:17:34 -07:00
Steve Howell
2991c19fea Extract typing indicator inbound timing logic.
We now track our inbound timing events using code in
typing_data.js.

This code may be a little more robust with variations on how
recipients are represented in events, although there are no known
bugs here.
2017-03-22 08:20:21 -07:00
Steve Howell
642be6ad18 Revamp state tracking for outbound typing indicators.
This change moves most of the logic related to starting and
stopping outbound typing indicators to a new module called
typing_status.js that is heavily unit tested.

While this was in some sense a rewrite, the logic was mostly
inspired by the existing code.

This change does fix one known bug, which is that when we
were changing recipients before (while typing was active), we
were not stopping and starting typing indicators.  This was
a fairly minor bug, since usually users leave the compose
box to change recipients, and we would do stop/start under
that scenario.  Now we also handle the case where the user
does not leave the compose box to change recipients.
2017-03-22 07:01:20 -07:00
Cynthia Lin
1dfac12c4b hotkeys: Add arrow key navigation in streams/subscriptions menu.
Fixes #4198.
2017-03-21 20:32:28 -07:00
Steve Howell
67a2094ed1 Add typing_data.js, which can track users who are typing.
(A subsequent commit will actually integrate this into the app.)
2017-03-21 17:24:40 -07:00
Tim Abbott
8b9e78e486 compose: Extract and test get_focus_area. 2017-03-21 17:24:40 -07:00
Yago González
34a9e1ae11 markdown: Add TeX typesetting support.
Co-authored-by: Reid Barton <rwbarton@gmail.com>

Fixes #2056.
2017-03-21 16:40:00 -07:00
Brock Whittaker
9c38dc84a7 Change two console.log statements to one with prefixed newline.
The console.log statement that is empty can be replaced with just a
single newline.
2017-03-21 14:28:13 -07:00
adnrs96
a91012bd70 Move thirdparty-fonts.css from static/styles to static/third. 2017-03-21 13:40:05 -07:00
Tim Abbott
32b77d970b casper: Fix missing casper.then in subscriptions tests. 2017-03-20 23:21:38 -07:00
Raghav Jajodia
2d4ba0fde5 stream_data: Linkify URL in stream description.
If a url is present in stream description, it will be
rendered as a clickable link under /streams page.

Tweaked by tabbott to use the separate rendered_description element to
avoid duplicate rendering and to live-update.

Fixes #1435.
2017-03-20 22:25:03 -07:00
Steve Howell
2296bf5859 Clean up rendering code for reaction popovers.
Instead of passing in a hash to template whose keys are a
mixture of records and strings, we now pass in an
array of records.  This also removes a spurious if condition
in the template that was a result of the janky data structure.
2017-03-20 20:23:32 -07:00
Tim Abbott
b701062d16 Update + hotkey to use the keypress mechanism.
This fixes in issue where the new + hotkey only worked if you hit
shift+=, not if you pressed an actual "+" key on the keyboard.

Fixes #4182.
2017-03-20 09:46:26 -07:00
Brock Whittaker
2775707a67 hotkeys: Add lightbox image feed with controls.
This adds an image feed that you can scroll through with hotkeys
in the lightbox.

The left and right arrow keys along with the left and right arrows
will go to the prev/next image, and clicking on an image will also
take a user to that image.
2017-03-19 22:11:38 -07:00
Brock Whittaker
fa5a093738 hotkeys: Add keyboard shortcut for opening the gear menu.
This adds the shortcut “g” for opening the gear menu.
2017-03-19 22:08:21 -07:00
Tim Abbott
70a0df73ba tests: Add some documentation for the hotkey node tests. 2017-03-19 22:06:27 -07:00
Brock Whittaker
32d1e64530 hotkey: Improve clarity of error messages in hotkeys tests.
This will provide a clearer error message than a ReferenceError as to
what's wrong when the wrong values are in hotkey tests.
2017-03-19 22:06:27 -07:00
Steve Howell
8d3d70984d Extract message_events.js. 2017-03-19 21:03:45 -07:00
Steve Howell
1114c8bf62 Extract message_fetch.js. 2017-03-19 21:03:45 -07:00
Joshua Pan
5ec21e2230 hotkey.js: Add opening reactions hotkey.
Add frontend tests for ":" hotkey.

Fixes #3911.
2017-03-19 14:37:05 -07:00
Joshua Pan
9c3d63a80b Add '+' hotkey to add thumbs up reaction.
Fixes #3910.
2017-03-19 14:36:33 -07:00