Commit Graph

3972 Commits

Author SHA1 Message Date
Jessica McKellar 69753f228c hotkeys: fix assumptions that message lists are non-empty.
This fixes user-visible browser errors caused by trying to use the id
of messages in an empty message list.

One error could be triggered by trying to go to the end of your feed
with the End key during a reload.

Another could be triggered by trying to narrow to a stream or subject
using hotkeys while in an empty narrow.

(imported from commit a0e5456fd3b475aecac6eddd7104772baaf3aeb8)
2013-04-10 16:36:11 -04:00
Zev Benjamin f6a6a6b220 Add per-stream desktop notifications
(imported from commit b4a0576847b3aec1495f017ca9805febe80c9275)
2013-04-10 16:11:27 -04:00
Zev Benjamin e754479e9c [schema] Add notifications to Subscription model
(imported from commit 4d6a7aa17f3fad4b6f8fb7a100b3b578446e3625)
2013-04-10 16:11:27 -04:00
Zev Benjamin 34e9b7d4da [South] Migration to add notifications to Subscription table
(imported from commit 5f3517f755f22ba17f56e9b166cbc8c8aff16920)
2013-04-10 16:11:27 -04:00
Zev Benjamin b8a5ba56b9 Make check-box subscription settings' HTML more generic
(imported from commit 58c02449245bd03eedab1ee6eabebdbd972d1678)
2013-04-10 16:11:27 -04:00
Zev Benjamin 3424bbd8d7 Reduce client-side code duplication in setting stream properties
(imported from commit 879384fea499a2d30104d2bc1d96f16dbd867532)
2013-04-10 16:11:27 -04:00
Zev Benjamin 7e532a02ad Simplify subscription property views
This also changes the API for GET /json/subscriptions/property to
only retrieve the property for a particular stream instead of
returning all streams and their properties.  We weren't using this
functionality anywhere and the change makes the API more consistent.

(imported from commit 2799aec2550fd0558e2282beb19734d60801bdb8)
2013-04-10 16:11:27 -04:00
Zev Benjamin a2010871e3 Make subscription properties less free-form
(imported from commit eda607c2abfa51d2dadddc7b9ecba3e2d0b5be4d)
2013-04-10 16:11:27 -04:00
Tim Abbott da8fa73a92 Fix duplicate narrow.deactivate() call via hashchange on Chrome.
I noticed that on chrome, calling narrow.deactivate() actually ended
up calling itself recursively due to the hashchange code not correctly
handling the fact that in Chrome if you set

window.location.hash = '#';

and then read out the value, you get '' back out.

(imported from commit 9b5047fbe0e2ac1846e5325d066c72306634c523)
2013-04-10 11:02:35 -04:00
Tim Abbott 55f606b417 Fix scrolling bug when unnarrowing after receiving a message.
What was happening is that if you un-narrowed immediately after
receiving a message (e.g. because you just sent it), the autoscroll
animation from the zfilt table would still be running after you return
to the home view, resulting in the viewport being scrolled to an
apparently random point in the home view (even though the pointer was
still in the right place).

This cancels the autoscroll animations whenever you do one of:
(1) hashchange (e.g. to go to the settings page)
(2) select a message (covers narrowing/unnarrowing as well as keyboard hotkeys)
(3) mousewheel scroll
since those are basically the cases where we set the viewport
scrolltop directly.

Arguably this should instead be something where we somehow detect
which scroll events are triggered by what and cancel for any scroll
event not from the animation or rererendering, but that seems hard.

(imported from commit f776021303404c87b36241c733b3d1bcb083163b)
2013-04-10 11:02:32 -04:00
Zev Benjamin 5e307f9cce Fix calculation of number of active users
(imported from commit 0a74f1d8db51988ec806deb6af7cd8a6ef18d08c)
2013-04-09 13:35:09 -04:00
Tim Abbott ea95a8b167 Future-proof adding new users to default streams.
The previous code for adding users to default streams wouldn't do so
if the user didn't have a PreregistrationUser row.

(imported from commit 25f1383f6771319542d07660b29d891368889212)
2013-04-09 11:58:07 -04:00
Tim Abbott 1b11eeb2bc Simplify the default_subscriptions code path.
(imported from commit 62894a5949621465fcfd8d25372316d7ab495252)
2013-04-09 11:58:07 -04:00
Leo Franchi a9151e4bc3 Handle populate_db generating read messages
NOTE: If you are getting test failures, please run generate-fixtures --force.

(imported from commit 7b44b40e3955742edf337335deb0d92829c7e2e1)
2013-04-09 11:56:32 -04:00
Leo Franchi 57974787b3 Set messages to read in populate_db
(imported from commit 726d2015dbb446f56e5a640b44107a3713917ed5)
2013-04-09 09:59:31 -04:00
Luke Faraone d89f5670bb Add nagios check to verify mailchimp is running on staging/app.
(imported from commit 2aa79cc6252aadaa0a212b5c60eff9c5c55b7781)
2013-04-05 14:44:18 -07:00
Waseem Daher 062e106400 Update Jenkins integration instructions.
Now that our plugin is in the Jenkins marketplace thing,
we don't need to have the user laboriously download it
from us and upload it themselves.

(imported from commit 25e9926f7f2314db8f3ea6c00c40514b6fd546c3)
2013-04-05 17:32:41 -04:00
Tim Abbott 807b6396e0 realm_stats: Only count messages sent by humans in most stats.
For our primary measures of user engagement, messages sent by bots can
confuse the picture (e.g. a realm could be dead, but not appear to be,
because they didn't bother uninstalling their github and jenkins
hooks).  So it's best to leave those out of our main stats.

(imported from commit 4d0f0e6442093daab164d0ed016fff1d1aa906c7)
2013-04-05 17:28:04 -04:00
Tim Abbott e1173b08df Fix check for non-default Subscription colors.
(imported from commit b904220f7b1a013081b1d680d98b15a7532f0839)
2013-04-05 17:28:04 -04:00
Luke Faraone 429edfbdcd Insert a link with a pretty file name when uploading a file.
(imported from commit 1367004792e145afa19a02417fb564ad3662f576)
2013-04-05 13:39:08 -07:00
Luke Faraone 59684c20f2 Don't insert a link of "undefined" if the process fails.
(imported from commit ba7d2c8bc9a280225862bd5edce302735d916e61)
2013-04-05 13:38:55 -07:00
Luke Faraone 28afd7126f Send test uploads to their own bucket.
(imported from commit b47628c410b7732b2b58af42b40369e01da8a250)
2013-04-05 13:07:18 -07:00
Luke Faraone 424c5b49ef Add a progress bar to show file upload progress from browser to Django.
When testing locally this bar sort of lies, because the actual bottleneck
is Django→S3.

In prod, our connection to S3 will supposudly be really fast so this won't
matter.

(imported from commit c9f4b4882cbfdf3bbb8180f1500f35d8481c1f39)
2013-04-05 13:07:18 -07:00
Luke Faraone b692e8fc99 Abort the XHR if you close the alert or cancel the compose.
(imported from commit 21540f7b290d3f55f8116f9940554a5feb8809d7)
2013-04-05 13:07:18 -07:00
Luke Faraone 932e98f456 [third] Store the XHR produced by filedrop in the calling object's .data.
(imported from commit 92d165d66e09cb8fe02652b32000850665e675e5)
2013-04-05 13:07:17 -07:00
Luke Faraone 0f10d1c6d4 Boostrapify filedrop errors.
(imported from commit b2ff2850e952f33af3e99fc14c21599f856345d1)
2013-04-05 13:07:17 -07:00
Luke Faraone 00900b99fe Bump nginx max file upload limit to 25M.
(imported from commit f8f82e718aeab52a0ea228737d144487c49fa706)
2013-04-05 13:07:17 -07:00
Luke Faraone f20f605376 [manual] Add file upload support.
This allows users to drag and drop content onto the compose box, storing
their data in Amazon S3.

New dependencies:
 - python-boto

(imported from commit 339874e483db5c36312c9ceae56db29da6ca0d99)
2013-04-05 13:07:13 -07:00
Luke Faraone ca1e729ea2 [third] Import jquery.filedrop.js drom http://www.github.com/weixiyen/jquery-filedrop
License: MIT

(imported from commit b523594e31e242dbb9d00cfbed12d6e455c8a6ca)
2013-04-05 13:03:49 -07:00
Luke Faraone 2fd4525531 Add process-mailchimp-signups-command-line so we can fire and forget this daemon.
(imported from commit 7a966199da51ec22ae62386d6382ebf05d151f31)
2013-04-05 10:22:27 -07:00
Luke Faraone f4d00b6af9 [manual] Push new users' data to MailChimp.
This creates a new management command, subscribe_new_users, which should be
run as a daemon process. When new users are created, an event is passed to
RabbitMQ including the following data:
 * Email
 * Full name
 * IP address of the person who confirmed registration
 * Time of registration confirmation

MailChimp strongly encourages the collection of the last two to enable
responses to abuse requests, and providing more data lowers the chance that
we could get banned from their service if complaints do occur.

To use this commit, you need to install the "postmonkey" module from
PyPI.

(imported from commit 20c628c3fa8bb985aaead85a80ad3b38bf94b9dc)
2013-04-05 10:22:26 -07:00
Keegan McAllister 36a4e587ec Fix a markup test for Python-Markdown 2.3
Apparently it no longer coalesces adjacent blank lines in a code block (which
seems like an improvement).  The new test case doesn't have adjacent blank
lines and will work on old and new versions alike (tested on staging).

(imported from commit e49902be041cf1e7d6fbe489685b966cf4eae108)
2013-04-05 13:14:00 -04:00
Keegan McAllister 3c40dd3bf3 bugdown: Fix fenced_code for Python-Markdown 2.3
(imported from commit 3954444708e222217407df228f07d2cad402a02b)
2013-04-05 13:14:00 -04:00
Zev Benjamin 64b0106e47 puppet: Log slow autovacuum actions
(imported from commit 8f311261cfe41acd1fbda0db5c52f2816e234157)
2013-04-05 13:12:46 -04:00
Tim Abbott bfd9287068 Append timestamp to URLs when getting templates on dev machines.
This prevents the templates from being cached by over-aggressive
chrome caching.

(imported from commit 1a1f7f697a823f6e806d3f2289c3bbda7e3f0d79)
2013-04-05 10:38:38 -04:00
Tim Abbott fdefa06190 Eliminate use of old StreamColor model.
(imported from commit c72a06bdc44f30fb6bca299463e259262367e8c2)
2013-04-04 17:48:51 -04:00
Tim Abbott f6affa8802 gather_subscriptions: Use the colors from the Subscription table.
(imported from commit c23829ad4141a97c61e21b970e5031eae20e24b4)
2013-04-04 17:48:51 -04:00
Zev Benjamin a701083f71 Report additional information for "message in the middle of msg_list" errors
Hopefully this will help us track down what the problem is.

(imported from commit b8e30ee23ab8f1bf93525faa4f52ce9a4ccc9013)
2013-04-04 17:42:09 -04:00
Zev Benjamin d4acc3dd94 blueslip: Add mechanism for reporting additional information
(imported from commit 738bd3b8800e3b67497755580a2b7ccf66bb3829)
2013-04-04 17:42:09 -04:00
Zev Benjamin be04cff7c1 blueslip: Don't report some fatal errors twice
(imported from commit e50a324c3fc74e076b82c6154686a98e70ebed90)
2013-04-04 17:42:09 -04:00
Zev Benjamin b7cd8db139 Small code cleanup
(imported from commit d9f09e5a9b33be0b23ddae072a3021bb01a3de3e)
2013-04-04 17:42:09 -04:00
Tim Abbott c65f37c910 do-destroy-rebuild-database: Fix migration with AUTH_USER_MODEL.
Django's South migrations support for setting up a new database
doesn't properly handle AUTH_USER_MODEL changing over time.  Fix this
by having the initial migration be run with AUTH_USER_MODEL set to the
default value.

(imported from commit c373db9edc61f26527c486c741f8e870614600e3)
2013-04-04 17:39:01 -04:00
Leo Franchi 8fe82085c4 [schema][manual] Automatically subscribe users to default streams only after tutorial
(imported from commit 6511851c0aee2628bef597bf1310d6f96b0fd1d4)
2013-04-04 17:11:39 -04:00
Tim Abbott 7ce6154464 Set UserProfile to be the AUTH_USER_MODEL.
(imported from commit 92bf66b3e6a8ed06054bd491bcc96ef422a1fbe1)
2013-04-04 15:45:44 -04:00
Tim Abbott a1aae4a39f [South] [schema] Add an index on Userprofile.email.
We accidentally lost this when we did the User/UserProfile merge (this
commit also deletes the old code to add the auth_user index in
do-destroy-rebuild-database).

This below is mostly just notes for future reference, but when
deploying this change to staging, we should consider running the
following instead of using the migration directly:

CREATE UNIQUE INDEX CONCURRENTLY zephyr_userprofile_email_uniq ON zephyr_userprofile(email);
ALTER TABLE zephyr_userprofile ADD CONSTRAINT zephyr_userprofile_email_uniq UNIQUE USING INDEX zephyr_userprofile_email_uniq;
CREATE INDEX CONCURRENTLY zephyr_userprofile_email ON zephyr_userprofile(email);

But I think it might be the case that it's fine to just run it
directly, since the ALTER TABLE part seems to hang if there's an open
transaction working on a UserProfile object anyway.

(imported from commit 1bf34ce242de51e97c91c8bab86b6b273e17fb43)
2013-04-04 15:45:42 -04:00
Tim Abbott 33562adc4f Update subscription color migration to run on sqlite.
(imported from commit 8ca8d36b390d4afb85fca725b0ba2fb539438a0d)
2013-04-04 15:25:43 -04:00
Tim Abbott 0ee684a4b5 [schema] [manual] Add colors to the subscription model.
This is preparatory for removing the StreamColor model, so we also set
things up so anything changing the StreamColor model changes the
Subscription model too.

The manual task is to run the copy_colors.py management command after
deployment to each of staging and prod.

(imported from commit 1be7523ca59f5266eb2c4dc2009e31209ed49635)
2013-04-04 14:17:01 -04:00
Tim Abbott b06284717c [South] Migration to add color to Subscription model.
(imported from commit 0dc8c5924b6398ea73e90c5322dd4fd1beddccf1)
2013-04-04 14:17:01 -04:00
Reid Barton 94c46a0af2 Tutorial punctuation tweaks
(imported from commit 0097cfad492de2658a2ab8a08fba0844ec6ba3fa)
2013-04-04 14:11:15 -04:00
Zev Benjamin 9d1548fe08 Add empty feed notices for private messages
(imported from commit e4067336f6b2e9e82b794599d30dfc3825852652)
2013-04-04 11:36:51 -04:00