Commit Graph

218 Commits

Author SHA1 Message Date
Jessica McKellar 07bb7b2fee Give users the option to propagate global stream changes.
This helps the common case of not liking our default of having audible
and desktop notifications enabled, and not making users adjust the
settings on every existing stream to fix it.

(imported from commit be75edb2c1385d1bd9a289416e2dffd8007f5e0a)
2014-03-03 16:08:32 -05:00
Jessica McKellar d89696291f Remove Notification (?) explanation popover.
(imported from commit f261f87c9571a76b8b0e2538ccb3bb4826ef449e)
2014-03-03 16:08:31 -05:00
Luke Faraone 0ac73e4d73 Use a dict in presence_info rather than strings
This allows us to extend it to contain more details, as we will shortly.

(imported from commit 59b14592609810c5ac634a8237928ce029f33a83)
2014-02-27 20:25:38 -05:00
Steve Howell 71de0ac565 Add a test for rendering realm-specific emojis in JS.
(imported from commit 5909c02f9a7931f03d7131ae16b5fb70c74746aa)
2014-02-27 20:25:26 -05:00
Steve Howell 7f2f1ad533 Add test coverage for stream_data.home_view_stream_names.
As part of this, I also made test_basics() have a third
stream that makes false positives in the test less likely.

(imported from commit d5ba64ec9346741818e30abe9e9594788c339fab)
2014-02-27 20:25:26 -05:00
Leo Franchi f22885223f Remove message id list from group divs
(imported from commit 620a219b5e11db79bfea971fe40deb09173deb10)
2014-02-27 20:25:24 -05:00
Leo Franchi 7ebe3bf824 Add template unit tests for new message groups
(imported from commit 7e520630b5ae74850fcdd6ecccc114101f9feddb)
2014-02-27 20:25:24 -05:00
Leo Franchi 568c33f294 Render messages as groups of divs instead of individual rows
Now that we no longer use tables for our message list, we can
more logically group messages together.

(imported from commit 9923a092f91a45fe3ef06f2f00e23e4e3fb62a37)
2014-02-27 20:25:23 -05:00
Steve Howell ca92292550 Test people.update() more thoroughly.
(imported from commit 48b1a5af4f3849b7d21960181149dc99b74ba660)
2014-02-27 20:25:21 -05:00
Steve Howell e16da5db45 Add test for people.get_rest_of_realm
(imported from commit 7cda63da29f7764e3932ce677bf3270adb6ea630)
2014-02-27 20:25:21 -05:00
Steve Howell 666252d749 Improve test coverage for get_topic_suggestions.
(imported from commit bba858e1f1f396f42d50e1e823ae0673d8013f53)
2014-02-27 20:25:21 -05:00
Steve Howell ef92c345ea Test that "te" matches "Bob Terry" in search suggestions.
(imported from commit 777b7d554278170765e04fc9e1041826c509e8a2)
2014-02-27 20:25:21 -05:00
Steve Howell 75c3e91a15 Add test_stream_completion() to search_suggestion unit tests.
(imported from commit 84d1b1a7e0a667e3851b46e915a4f87d146013d4)
2014-02-27 20:25:20 -05:00
Steve Howell 2ca0015c0a Cover more variations of narrowing in test_describe()
(imported from commit 145e9f624ea460c62a62f3da2d8e328642c5e2d6)
2014-02-20 11:38:51 -05:00
Steve Howell 55a862cc23 Test that narrow_stream is excluded from filter.public_operators()
(imported from commit 11c38d7108243f1496262a2cce982ec583c41894)
2014-02-20 11:38:51 -05:00
Steve Howell c729965b69 Test negated topic searches in Filter.unparse
(imported from commit 0e1e74b25b7eb1874b93dd7d62e50563caff1ebe)
2014-02-20 11:38:51 -05:00
Steve Howell b67d976809 Add test for parsing negated searches.
(imported from commit 91f79aa9cfdf939f7249c67a37d4420203c2ac63)
2014-02-20 11:38:51 -05:00
Steve Howell 3a9bdec149 Fix false positives in assert_same_operators in filter tests.
(imported from commit 8d15ec1ce113fabafbe791fb1068e4921508abeb)
2014-02-20 11:38:50 -05:00
Steve Howell 47b877357d Fix test to actually test Filter with default parameters.
(imported from commit 55b4557c8742bd2f1c8b1aa1e99a487d581fcfc4)
2014-02-20 11:38:50 -05:00
Steve Howell 1c4dcda639 Add test for in-home search when in our special narrow mode.
(imported from commit e6bc9fbd7b87377c7ed1d42e84a9b5cd369bb4fe)
2014-02-20 11:38:50 -05:00
Steve Howell 2a5dd139c8 Add node tests for hashchange.js
(imported from commit 20309e13dfea28400341e30a42e8f775479de773)
2014-02-19 16:19:16 -05:00
Steve Howell 8ce5404777 Describe negated search terms correctly.
This changes Filter.describe and Filter.operator_to_prefix
to handle negated terms correctly.

(imported from commit 673c0d3a5a77784e95772c14e12534ad2daecda2)
2014-02-19 11:05:31 -05:00
Steve Howell e645574b14 Add more test coverage to Filter.describe()
(imported from commit 9249af23e19b307f2ae168227aa73bba56b1a991)
2014-02-19 11:05:30 -05:00
Steve Howell de8509e40d Fix broken template test.
(imported from commit a5d935ab84fd16d5fb83ff25fd773b251486c5cd)
2014-02-18 12:50:31 -07:00
Steve Howell bbfd33185c Remove narrowing options from message chevron menu.
Remove the options to narrow by topic/person from the menu,
because there are better ways to do this in the UI, and
remove the time travel option, because the "Link to this
conversation" achieves mostly the same effect.

(imported from commit b7e0cfe64c0760e5a7bf7a8c9c05ed1a5b747300)
2014-02-18 13:19:39 -05:00
Steve Howell aa90e265c2 Handle negated terms in operands/has_operand/has_operator.
For the Filter helper functions above, we generally want to
ignore negated search terms, since their existence should
really only impact filter predicates and nothing else on the
JS side.  The exception is search, where even the existence
of a negated search needs to be noted to know that we can't
apply a filter locally.

(imported from commit 8bbb410a85fefed549d359e4c779a134ad830c11)
2014-02-13 14:14:25 -05:00
Steve Howell 76ff3a526c Set negated flag explicity to false in JS code.
For negated search terms, we weren't explicitly setting
"negated" to false when callers left it undefined, which was
mostly fine, since undefined is falsey, but it is better to
define it explicitly for debugging/testing purposes.

(imported from commit 68a2790b510d17caed8ca11c38188545d1dcc347)
2014-02-13 14:14:24 -05:00
Steve Howell 2fb7c0059d Support negated searches on staging.
Behind a feature flag you can now do searches like this:

    -pm-with:othello@example.com is:private

The "-" in front of "pm-with" tells us to exclude messages
with Othello from our search.  We support "-" in front of
all operators, although the behavior for "-search:" and
and "-near:" doesn't really change in this commit.

Note that the filtering out of "negated" predicates only
happens on the client side in this commit.  On the server
side we ignore negated predicates and send back a superset
of the results.

(imported from commit 6cdeaf32f2d493fbbb838630f0da3da880b1ca18)
2014-02-13 14:14:24 -05:00
Steve Howell f4db89c7e9 Supported negated terms in filter predicates (JS).
(imported from commit b50527620b5b451b4d6e0dc073de4036fe2b7e1f)
2014-02-12 16:58:08 -05:00
Steve Howell afe893b324 Remove filter_term() shim function.
The filter_term() function was supporting the transition
from using tuples for search terms to using dictionaries,
but now all of the JS code should be dictionary-compatible.
(We had already abandoned the tuples safety net on staging,
and a couple days of use have given me confidence we can
pull the shim code.)

The one side effect this change has is that search terms will be
initialized to {} instead of [].  This distinction matters
when it comes to calling JSON.stringify on the search terms.

(imported from commit 1fbe11011d8953dbea28c0657cbf88384d343e00)
2014-02-11 13:52:17 -05:00
Zev Benjamin 92b249a0a1 Replace curly quotes with regular quotes on the front-end before performing a search
(imported from commit 1be7384cea8808f9fceec889ecee6434e9bad6c2)
2014-02-11 11:45:44 -05:00
Jason Michalski 3de8bb7f80 Add a detailed description to event loop errors
(imported from commit b842b59912929d08f3d46dafaf49276d311f4ed2)
2014-02-10 17:08:11 -05:00
Steve Howell 6b93315cc3 Prevent browser errors for stream: searches.
When we typed "stream:" into the search bar, the empty operand
triggered an error in the Dict class for an undefined key, because
we were using opts[0] as a "defensive" workaround to opts.operand,
but opts.operand of '' is more correct than opts[0] being undefined.

Now we only fall back to opts[0] whe opts.operand is undefined, and
we emit a blueslip error when that happens.

(imported from commit 88a196d3bc3d67689c36bc036f378da744c652f9)
2014-02-10 15:11:43 -05:00
Steve Howell 9a01c0f3e4 Use new style search operators in node tests.
(imported from commit f54398751c258cd16957885a3bb71256c221715c)
2014-02-10 15:11:43 -05:00
Steve Howell 2fb70eb38c Remove tuples safety net for narrow filters on staging.
We have shim code that makes our internal narrow operators
support both a tuple interface and an object interface.  We
are removing the shim on staging to help expose any dark
corners of the code that still rely on operators being
represented as tuples.

(imported from commit f9d101dbb7f49a4abec14806734b9c86bd93c4e1)
2014-02-10 13:23:27 -05:00
Steve Howell fc78a2cc66 Stop using tuples in search_suggestions.js and Filter.unparse().
This is yet another change related to phasing out the
[operator, operand] tuple data structure for representing
terms in a narrow.

(imported from commit 508e58fc4eebae8a24a8ae59919ba5d94fc66850)
2014-02-06 16:42:38 -05:00
Steve Howell 90f6eb0661 Keep track of subs by stream_id inside of stream_data.js.
The JS code can now call stream_data.get_sub_by_id() to get
a sub from a stream_id.  Subs have stream_id due to a prior commit,
and we keep track of the mapping in stream_data's subs_by_stream_id
variable.

(imported from commit 409e13d6d2e79d909441a66c85ee651529d15cd2)
2014-02-06 12:09:52 -05:00
Steve Howell 583dae72a3 Change how the tutorial overrides the default stream color.
The tutorial introduces "engineering" messages that might not
be in the user's normal subscription, and they would get a gray
border if we did not override the stream color.  Before this change,
we accomplished this by overriding the core data structure in
stream_data.js.  Now we are a bit more future-proof; we only
override stream_color.default_color.

(imported from commit 0d0845b72f766912679f5aa7641ae9a60fdbb4ce)
2014-02-06 12:09:51 -05:00
Steve Howell 89ea079dce Allow Filter to accept non-tuple-based terms.
We make this happen inside of canonicalize_term.

(imported from commit 0571f6cac8ffdc806af56423cc98134c7493139e)
2014-02-04 13:16:25 -05:00
Steve Howell 112bc5ceda Rename canonicalize_tuple to canonicalize_term.
(imported from commit 07e0c4a6802b0d4b4fbb8ffd3965cab6457d4aeb)
2014-02-04 13:16:25 -05:00
Steve Howell eea8c0d1d5 Allow admins to change the realm's name in the UI.
(imported from commit 2873f872069a41c91beb87728f64fa526dd8a326)
2014-02-04 11:33:19 -05:00
Jason Michalski 0e1909f489 Prevent errors in get_updates_success from stopping the event loop
Add try/catch blocks to get_updates_success and send a blueslip error on
errors we catch. This will let get_updates_success return successfully
so that the next call to get_updates will start immediately.

(imported from commit 44d8b85d9d8e930a5552a5fbf4af1d0e5e8c07e8)
2014-02-03 15:28:27 -05:00
Jason Michalski 7b8acfea8e Add support for patching globals in the node tests
Add a helper to patch_global to change a global and then reset it to the
original value after a test file is complete.

(imported from commit 1b65ff6ea8693ad61b7f18f35dafa942429252a8)
2014-02-02 00:47:50 -05:00
Steve Howell 4b095cbad1 Make "assert" global in the node tests.
In the early days of the node tests we didn't have an index.js
driver, so each test set it up its own environment.  That ship
has long since sailed, so now we just require assert in index.js
as a global and make it so that the linter doesn't complain.

(imported from commit 1ded3d330ff40603cf4dd7c5578f6a47088d7cc8)
2014-02-03 10:54:38 -05:00
Steve Howell b52749d2ce Add admin_tab to template test output.
(imported from commit c364ea731f9833061b4fcc3551d5cc5a6a64e739)
2014-02-03 10:30:24 -05:00
Steve Howell 001d447e0f Add stream_member_list_entry to template test output.
(imported from commit cfd420f7337e315a5b3f1665fdc09faaadf0bfab)
2014-02-03 10:30:24 -05:00
Steve Howell ac57c3c16b Move stream_member_list_entry() code in templates.js
(imported from commit 8cca602597a3277d5e80bc1b314cd3fb16ea013c)
2014-02-03 10:30:24 -05:00
Steve Howell 2faf29408a Add scrolling to body of .test-js-with-node.html
(imported from commit 3836ecf6c73576bf9efc021dc091e685a7d0cdb2)
2014-02-03 10:30:23 -05:00
Steve Howell fa69047613 Add node test for people.js (just the basics for now).
(imported from commit 2f4714bedd54c731667160c65280f386061ce803)
2014-02-03 10:16:18 -05:00
Steve Howell d8eb8792ef Make node tests have _ and Dict automatically as global vars.
Having to explicitly call out the underscore/Dict dependencies
in nearly every test has proven to be more cumbersome than helpful.
We never monkeypatch those modules in the tests.

(imported from commit 49ef70c835edd4e22a5869eda9235ef3ffc3c59b)
2014-02-03 10:16:17 -05:00