Commit Graph

16295 Commits

Author SHA1 Message Date
Tim Abbott ceeb95ebb1 tests: Fix missing test coverage for /json/realm.
In aa880b0419, we used the raw
do_set_realm_description method rather than calling the API, which
meant that the API success path wasn't actually tested.
2017-03-19 22:49:16 -07:00
Yago González df94719707 lint: Ban redundant linkified URLs. 2017-03-19 22:46:25 -07:00
Jacob Hurwitz eb1843fd37 [zephyr_mirror] add support for zcrypt'ed classes with colons
The regex used for parsing .crypt-table didn't allow colons in class
names. This commit changes the [^:] token with \S, meaning that class
names can now contain colons but can no longer contain whitespace.

I think this should be fine, since zcrypt is only used for MIT zephyr,
where (by convention) class names do not contain whitespace.

Additionally, it should not be possible for us to accidentally consume a
field-separating colon as part of the class capture group because the
regex enforces that all field-separating colons are followed by one or
more whitespace characters, whereas the class name cannot contain
whitespace.
2017-03-19 22:30:21 -07:00
Tim Abbott 81194df65d test_bots: Add stream is not None asserts. 2017-03-19 22:26:25 -07:00
Tim Abbott e2eeef5118 recipient_for_emails: Fix confusing type reuse. 2017-03-19 22:26:25 -07:00
Tim Abbott 7e5d5b5cce mypy: Clean up repetition in test_realm_aliases.
The assert added in this refactoring addresses a mypy issue with
strict optional since get_realm_by_email_domain might return None.
2017-03-19 22:26:25 -07:00
Tim Abbott 5b0ff2a69a mypy: Fix some strict-optional related issues. 2017-03-19 22:26:25 -07:00
Tim Abbott 2b62c4fa38 mypy: Fix missing annotation in Tornado handlers.
This was accidentally removed in
9866124b78, but is needed on the current
mypy version.
2017-03-19 22:26:25 -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
Brock Whittaker 2c28e519d8 Fix un-tab-able links in gear menu.
This fixes some un-tab-able links in the gear menu to have a tabindex
so that they can be tabbed over with shortcuts.
2017-03-19 22:06:27 -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
Tim Abbott 8fa60cf77c py3: Remove use of typing.Deque.
Apparently this is only available in ultra-modern versions of Python 3?
2017-03-19 21:39:54 -07:00
Steve Howell edb8b0cb5e Improve js-dep-visualizer.
This adds a report of nodes, handles some errors better, adds
some helpful output, cleans up some abspath calls, and
updates which modules and/or dependencies we temporarily are
ignoring for the report.
2017-03-19 21:03:45 -07:00
Steve Howell fd856d728c Extract message_util.js 2017-03-19 21:03:45 -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
Tim Abbott 9866124b78 mypy: Fix some new errors flagged by latest mypy master.
Mostly list -> List bugs in annotations.
2017-03-19 21:03:45 -07:00
wangjames e0813c7288 collapse: Fix new messages not being collapsed consistently.
This fixes a bug where newly received very-long messages would only
sometimes be collapsed properly until a second message arrived
(whether it did the right thing dependened on whether the new message
had the same recipient or a different recipient from other arriving
messages).

Apparently, we correctly called condense.condense_and_collapse in all
but one of the codepaths of `render` that add new messages.  This
adds a call on the missing codepath.

Fixes #3978.
2017-03-19 20:39:21 -07:00
Tim Abbott 7e74af3cea docs: Shorten some keyboard shortcut descriptions.
In particular, this fixes some unnecessarily multi-line descriptions
that made the keyboard shortcuts display look bad.
2017-03-19 14:45:16 -07:00
Joshua Pan 93609cc39d Update shortcuts modal and documentation with reaction hotkeys. 2017-03-19 14:45:00 -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 b600e4d594 Pressing enter in reactions search picks first reaction. 2017-03-19 14:36:34 -07:00
Joshua Pan 9c3d63a80b Add '+' hotkey to add thumbs up reaction.
Fixes #3910.
2017-03-19 14:36:33 -07:00
Joshua Pan c8f2da3f3e reactions.js: Refactor reaction_popover_reaction_on_click. 2017-03-19 14:25:10 -07:00
Elliott Jin 356f57c831 refactor: Simplify pattern for adding external linters. 2017-03-19 14:13:38 -07:00
Elliott Jin ac488fd45f tools: Don't lint in pre-commit hook if no files changed. 2017-03-19 14:13:38 -07:00
Elliott Jin 5ada385b91 refactor: Check for empty list with `len(X) == 0` instead of `not X`. 2017-03-19 14:13:38 -07:00
Elliott Jin 750769f637 tools: Only lint changed template files in pre-commit hook. 2017-03-19 14:13:38 -07:00
Elliott Jin 2e246a936f tools: Support checking specific files in `check-templates`. 2017-03-19 14:13:38 -07:00
Elliott Jin 357e1a001f refactor: Move `check-templates` argument parsing to top level. 2017-03-19 14:13:38 -07:00
Elliott Jin 0d677042e7 tools: Remove assert in template linter.
Currently, in the case where `--modified` is not passed, the linter asserts
that it's checking at least 10 files.  Removing this (somewhat arbitrary)
check makes it easier to:

- Add support for specifying files to check via command line arguments
- Reason about cases where `check-templates` is called from `lint-all`
2017-03-19 14:13:38 -07:00
wangjames 12eeb27442 js dependencies: Extract ui_state.js.
The function home_tab_obscured used to be in the ui_state
namespace via a shim, but now we have an actual module for
it.
2017-03-19 14:11:50 -07:00
Sarah Stringer aa880b0419 Add organization description field to realm settings.
This adds an organization description field to the Realm model, as well as
an input field to the organization settings template. Added three tests.
Set the max length of the field to 100 characters.

Fixes #3962.
2017-03-19 14:05:01 -07:00
Daw-Ran Liou 81f9de7cc8 Add "*" hotkey to toggle starred flag on the selected message. 2017-03-19 13:42:11 -07:00
Brock Whittaker 24e2f31d3d Remove second background from #lighbox_overlay.
The child ".image-preview" has a background which is ordinarily
invisible (as it is the same color as the #lightbox_overlay bg,
however when fading in it is noticeable.
2017-03-19 12:43:10 -07:00
Joshua Pan 234e8b500e Add tests for ctrl key functionality. 2017-03-19 12:17:28 -07:00
Joshua Pan c053f786f7 Add ctrl+[ hotkey.
Fixes #4016.
2017-03-19 12:17:28 -07:00
Joshua Pan fcbc2e0cb9 Add ctrl key functionality to hotkeys. 2017-03-19 12:17:28 -07:00
Elliott Jin bdf4b22772 tools: Only lint changed css files in pre-commit hook. 2017-03-19 11:49:19 -07:00
Elliott Jin ac5b62359a refactor: Use consistent naming for lint functions. 2017-03-19 11:49:19 -07:00
Jacob Hurwitz 0a76a609ec Fix bugs with handling of the empty narrow.
An empty narrow (ie, the home view) can be represented in code as either
`None` or `[]` but we had incorrect handling that failed to fully
properly deal with either case.

(1) In `get_stream_name_from_narrow`, we failed to deal with `None` by
trying to always iterate over `narrow`.
(2) In several other places, we failed to deal with `[]` by explicitly
checking `if narrow is None` or `if narrow is not None`. Changing these
to truthiness checks should work for both the `None` and `[]` cases.
2017-03-19 11:47:03 -07:00
Daw-Ran Liou f67751d1f0 Add hotkey "l" for opening image in lightbox.
Open the lightbox in the current selected message. Only the first image
shows in the lightbox.
2017-03-19 11:43:21 -07:00
Tim Abbott e9f1531fc7 hotkey: Remap v hotkey -> P. 2017-03-19 11:41:02 -07:00
Steve Howell eda046409c Move paging methods into navigate.js. 2017-03-19 11:05:46 -07:00
Steve Howell d026344b37 Extract js/ui_util.js. 2017-03-19 11:05:45 -07:00
Steve Howell 099f401b9b Move mark_subscribed/mark_unsubscribed to stream_events.js. 2017-03-19 11:05:45 -07:00
Steve Howell b98cd55ddb Add ui_report shim. 2017-03-19 11:05:44 -07:00
Steve Howell c67aebf633 Move keep_pointer_in_view() to message_viewport.js. 2017-03-19 10:56:09 -07:00