Commit Graph

2713 Commits

Author SHA1 Message Date
Waseem Daher 9ecbff26f8 Very basic "Do the subscriptions and settings pages links work" tests.
(imported from commit f941b8d5f984ffa726266dab50bfab00716c34eb)
2013-01-08 13:57:48 -05:00
Tim Abbott 2d94e4c780 Improve database queries for narrowing to personals with another user.
Inspection of the postgres slow queries log showed that the "narrow to
personals with a particular user" database queries were taking a long
time to run (0.5s+).  Further investigation determined that the OR
gate construction used here was causing the entire zephyr_message
table to be scanned; primarily I think because we were using the
implicit constraint that the logged in user had received messages.

This change makes that query explicit (improving performance), while
cleaning up the code to avoid an unnecessary query and read a little
more clearly.

After this change, the relevant database query takes 10s of milliseconds.

(imported from commit 020f5af5846c958386615e37ea9318383bf99ca0)
2013-01-08 13:42:37 -05:00
Keegan McAllister 83a0d82d8f Don't retry or display connection error if we send bad narrow operators
Alternatively the server could return a successful result with an empty list of
messages.  But I prefer the solution in this commit, because it would allow us
in the future to warn the user about the problem.  It does allow users to
determine if a given stream exists, but we haven't tried to hide that
information so far.

(imported from commit a91e12c90b12d3c870c0b637c3f1d6d3cef88491)
2013-01-08 12:18:31 -05:00
Keegan McAllister 50d229fe11 Accept '{}' to mean 'no narrowing', for old mobile clients
(imported from commit 879f6ef846f2a8980a0574372324d8dc8d22c8ed)
2013-01-08 12:18:31 -05:00
Keegan McAllister 952296bb3d Hide search.update_button_visibility focus override argument from exports
(imported from commit 98201f7c833f9fc4a1c1d6ecdff033e08c28dd5c)
2013-01-08 12:18:31 -05:00
Keegan McAllister 6dea25fd9f Add narrow.by for syntactic convenience
(imported from commit 51300b93a078d54e5111e6bb16ecd9ecbcc295d2)
2013-01-08 12:18:31 -05:00
Keegan McAllister 3af2bf345a Reinstate server-side narrow filtering
(imported from commit 40f63324a8dff404b504b06bddf303b8c1ad5780)
2013-01-08 12:18:31 -05:00
Keegan McAllister 16de6e43fe tests.py: Add assert_json_error_contains
(imported from commit 5a241af5071b6e711b56f84f56a1ed1f7e7dc262)
2013-01-08 12:18:31 -05:00
Keegan McAllister 3455e37160 Get rid of is:pm alias for is:private-message
It's cleaner if the filtering code recognizes only one value.
We can add this back in by converting in the parser.

(imported from commit 453b7b01e094955c6d66be63b5d997cc56b50a35)
2013-01-08 12:18:31 -05:00
Keegan McAllister dbc4798594 Be consistent about when we display search buttons
Show the buttons iff

    - the search input is focused,
    - the search input has non-empty contents, or
    - we are narrowed.

(imported from commit f5c98471a2db4ab522160960dd1271471a9db555)
2013-01-08 12:18:31 -05:00
Keegan McAllister 60f2d06736 search: Factor out show_buttons / hide_buttons
(imported from commit 776f066129e8cf4e298ae90fdd4f62341b36dcae)
2013-01-08 12:18:30 -05:00
Keegan McAllister f3e4b3bc31 search: Simplify event handler setup
(imported from commit b14c4bafb09fa5919e03aac24e968329778a01d6)
2013-01-08 12:18:30 -05:00
Keegan McAllister ddf75b64f7 Un-narrow whenever we clear the search box
(imported from commit 15533579bfbae1644cc76b33348c3cd21a829713)
2013-01-08 12:18:30 -05:00
Keegan McAllister 4ddaf5a2ae Use case-insensitive matching for all narrow operators
We don't require that the parsed form be lower case; that's handled by
narrow.activate.  However we unparse as lower case, in order to give the user a
hint that matching is not case sensitive.

(imported from commit 2882b440deb59a049b095db7a13cfc18e047caec)
2013-01-08 12:18:30 -05:00
Keegan McAllister 3619480673 Handle narrowing operators typed into the search box
(imported from commit 6f758091e2953d00d6a331210aa774b72ba889d5)
2013-01-08 12:18:30 -05:00
Keegan McAllister d2705ab913 Add narrow.describe
(imported from commit df123384754701108fe7597710cb0cf46cb86caf)
2013-01-08 12:18:30 -05:00
Keegan McAllister 6d50e233ec Add narrow.parse
(imported from commit 2275d02c2aee411d07645f7c3d81fdff7d188607)
2013-01-08 12:18:30 -05:00
Keegan McAllister 121ba29abe Simplify searchbox_sorter
(imported from commit cce3d2fd2e56801b43c668c849ef4664edc32a6c)
2013-01-08 12:18:30 -05:00
Keegan McAllister 1fcc7a6185 Rework render_object_in_parts to use switch/case
And rename fields for conciseness.

(imported from commit 77d89085f0786ecdcbb2897e3d171c930b44137a)
2013-01-08 12:18:30 -05:00
Keegan McAllister e202638184 Rework narrow_or_search_for_term to use switch/case
(imported from commit a1296e79d9f6414113a475e407fbaccb54eadb14)
2013-01-08 12:18:30 -05:00
Keegan McAllister 5ee6a9ebca Rename narrow.show_all_messages to narrow.deactivate
(imported from commit 927374756e112abc1042b16caa315af8c1f0baec)
2013-01-08 12:18:29 -05:00
Keegan McAllister ba7ffcead4 narrow: Remove some unnecessary helpers
(imported from commit 307dfec262648bc1fc79d2fb46f8950c7a2f1e2e)
2013-01-08 12:18:29 -05:00
Keegan McAllister 3c9b9227f8 Get rid of the narrowbar
(imported from commit 53335b8177561d4b103659a51704d6b2ce7ec367)
2013-01-08 12:18:29 -05:00
Keegan McAllister 15f606a2ef frontend/tests: Add a function to inject key presses
(imported from commit d2595482ec0bef8b2a4f819e6c29d6e84175a70e)
2013-01-08 12:18:29 -05:00
Keegan McAllister d4d4ea7a8d Display narrowing operators in the search bar
(imported from commit d801128c5b961360939c9e3f3f6f89c8602f987b)
2013-01-08 12:18:29 -05:00
Keegan McAllister 38ff2d9993 Use operators to express narrowing internally
This breaks server-side filtering, for the time being.

(imported from commit 58ec2d7aa593e1c71f835b186535a038faa63239)
2013-01-08 12:18:29 -05:00
Jeff Arnold 78506acd20 Do not send the browser back on backspace when send button focused
Fixes Trac #585

(imported from commit 2b5a02db66cc09ae41da7e6921a31a14c49cf811)
2013-01-08 12:00:57 -05:00
Reid Barton e5ab18276e Move sender gravatar inline in skinny windows
(imported from commit 570c1f6409213fd8a2b6dbb98372dbf2f62ec50c)
2013-01-08 11:28:49 -05:00
Reid Barton c5b4461ac6 Fix outdated comment in CSS
(imported from commit 198e3449b5396f6698b4fb7292ee4921ed326f18)
2013-01-08 11:28:49 -05:00
Jeff Arnold dbb63cb524 Don't continuously bug user if they dismiss the notifications box
Fixes Trac #514

(imported from commit 445af7cf458118be0394491aebbd9996817b08a4)
2013-01-08 11:04:16 -05:00
Jessica McKellar 9730a65f59 nagios: revamp check_user_zephyr_mirror_liveness to monitor sudden drops in mirror use.
(imported from commit e92df66c40065584e84c049cfab8d82f71d6dddd)
2013-01-08 10:53:33 -05:00
Jessica McKellar 0655397536 Give the NTP check the default number of retries.
It had a max_check_attempts of 1, which makes it susceptible to
network blips.

(imported from commit 20e51878d75bef36d02c5afaab78b8cdd701077f)
2013-01-08 10:53:33 -05:00
Jessica McKellar 5cf5bcaed5 Add logging for the feedback bot.
(imported from commit 4beb3ec69330baf0305ff0509900a5039145f4f4)
2013-01-08 10:53:33 -05:00
Jessica McKellar 8d0a17cbc3 puppet: fix installed packages typo in humbug_apache_base.
(imported from commit f503c767cadd9ce5f501233859faafd652f2c4e8)
2013-01-08 10:53:33 -05:00
Jessica McKellar c186e8ad96 puppet: Add a humbug_bots class with supervisord dependencies.
(imported from commit f5bdf6bccf10c7c7f21cc96c415014a26d04c019)
2013-01-08 10:53:32 -05:00
Jessica McKellar 62284f39f4 nagios: monitor feedback bot liveness.
(imported from commit 64a97e74b8a44bf0a6faf97398f843d8209b8e36)
2013-01-08 10:53:32 -05:00
Waseem Daher 40a8ee48a5 Make stream_list only contain lowercase stream names.
(imported from commit 350f1b20987206c1e910fcc5c2926bd6e96baaeb)
2013-01-07 17:36:37 -05:00
Waseem Daher baba72e3b8 Cause case to be respected when adding a subscription.
And have its colorpicker work.

(imported from commit 998c54153518bb94b7ce41e073078675767694c0)
2013-01-07 17:36:03 -05:00
Waseem Daher 5501558fa7 Only request background color for stream messages.
subs.get_color is expecting a string, and so if you do this on
a PM, it breaks.

(imported from commit acf6d51b84d7bbbe643466f1f72f90a8f6cf16f6)
2013-01-07 17:34:27 -05:00
Tyler Hallada b6e1024b69 Display composebox again upon server errors
Also removed .show()s for the alert on does-not-exist and not-subscribed, where
a blank error would display. This should fix the underlying issue with #166:
that hiding the composebox before send_message() was called would hide server
errors.

(imported from commit a8a50cdf82ddf1d15f1e405432ff3bbfdb7a491a)
2013-01-07 17:03:34 -05:00
Tyler Hallada 168ee1345c Enforce 10000 char limit on message box
Add maxlength attribute to the textarea which displays a tool tip (in Chrome)
for the user, telling them they are over the limit, so that the error is caught
before the send_message step (which is too late for Create and Send).

Fixes trac ticket #166.

(imported from commit 36b211a17f42dc8345e2235b4b4ca74c8f4e86c4)
2013-01-07 17:03:34 -05:00
Reid Barton c5d37572a7 Document ordering constraint on has_request_variables
(imported from commit efb42cc8478f968ac0dcd390d73bd3d161274fe1)
2013-01-07 16:09:23 -05:00
Tim Abbott 86862a8c0a Fix running Django against postgres on Tim's laptop.
I'm not sure why this wasn't set before, but it's needed for this to work.

(imported from commit fd77c975a234ccd6a972a6f2c9bfac21fcbb2d25)
2013-01-07 15:06:28 -05:00
Tim Abbott 6cd49fbb14 populate_db: Add Humbug error bot.
This is needed to avoid exceptions trying to do internal_send_message
in any test against a simple populate_db database.

(imported from commit 36927f57cbbb7e30ae249b5f1a0549fb352827f5)
2013-01-07 15:06:28 -05:00
Tim Abbott e2292d38b1 Add tests for mirroring of private messages.
(imported from commit 8599d233c98f48a205618f52752a6ce466100d9e)
2013-01-07 15:06:28 -05:00
Tim Abbott dd843b3916 Fix buggy check for zmirror huddle sending to multiple recipients.
(imported from commit 2abc88338225a8a07c50aaf6eb54862885edcb9e)
2013-01-07 15:06:28 -05:00
Zev Benjamin 9b3e4a8bed Don't focus the new stream box after sucessfully subscribing or unsubscribing
If you have a lot of subscriptions that you're trying to modify,
jumping back up to the top of the page is very disruptive.  We still
show the success message, which has the effect of scrolling the page
and is thus surprising, but that's better than the user completely
losing their place.

We do need a story for informing users about failures to subscribe or
unsubscribe, though.  We currently jump back to the top so they can
see the error, but that's not optimal.

(imported from commit 48d938ddc47f286a72e2147f4459b91ca5684e36)
2013-01-07 13:48:19 -05:00
Zev Benjamin 42bf93fb07 Add expandable settings panel for subscription entries
(imported from commit 3c07dcac7ec8086d417c2898a307ee67fc286704)
2013-01-07 13:48:19 -05:00
Zev Benjamin e1a3765644 Give each subscription an id for easier DOM manipulation
(imported from commit 976744174d06abf8bde651ca815d8fe17b8e64ff)
2013-01-07 13:48:19 -05:00
Zev Benjamin 2b4b827715 Fix repeatedly clicking the subscribe/unsubscribe button
(imported from commit e85f2678a4ca896e5a9bd40d37c3713153825c4d)
2013-01-04 18:11:07 -05:00