Commit Graph

2124 Commits

Author SHA1 Message Date
Waseem Daher 5dfd4485b5 Properly sort member list on streams page.
(imported from commit 702e78810278584fc8b2e217523ee38ff7907471)
2013-02-07 14:17:58 -05:00
Waseem Daher 87b1c91406 Don't show success notifications on subscribe.
A visual change in the form will already have made it clear
that the action succeeded.

(imported from commit 114bc3a9c9ee759993b8e2c80f7d9a479d365e21)
2013-02-07 14:17:58 -05:00
Waseem Daher bd6be38010 Slightly cleaner subscriptions page error handling.
Prior to this commit, successfully creating a stream (or unsubscribing
from a stream) didn't clear earlier error messages.

Here's how you could reproduce it:
* Try to subscribe to ""
  (You get an error)
* Now unsubscribe from something, or subscribe
  to a new stream
  (The error message does not go away)

(imported from commit c3c6fa6081df00378182ff0c3499e9d907577c04)
2013-02-07 14:17:58 -05:00
Keegan McAllister 5be28bbbb4 expunge_logs: Abort on keyboard interrupt
(imported from commit b1fe93859c15e447c0935fcfb0e83a200bc016ba)
2013-02-07 11:34:49 -05:00
Keegan McAllister a8ffa339de retention_policy: On unrecognized events, print the timestamp to full precision
(imported from commit 0f5908e0602fa8be7dea3d9e3b1ecbc437531df9)
2013-02-07 11:34:49 -05:00
Keegan McAllister d80dd021f1 retention_policy: Retain realm_created events
Previously these fell through and printed a warning message.

(imported from commit b3e488ff845b636e17c8b5b51d6cd84c1451bd2b)
2013-02-07 11:34:49 -05:00
Waseem Daher e57d8883af invite: Only clear email addresses after successful invite.
Prior to this commit, we also cleared out all of your checkboxes,
which is frustrating if you wanted to invite another person to the
exact same set of streams.

(imported from commit 389f27ec35dc9bf8c9058c5ffa867929ac90f674)
2013-02-06 20:18:00 -05:00
Waseem Daher e98b4b9f1e invite: Draw lock by invite-only streams (and don't select by default).
(imported from commit 1ad8a033801f70d3c6491691eebef79bbce82b77)
2013-02-06 20:15:12 -05:00
Zev Benjamin 1618ee09fc Make integral easter-egg not move the word "Humbug"
(imported from commit 7fa8088343bf5cd049c17f511495d0220faa497d)
2013-02-06 18:07:51 -05:00
Waseem Daher 209a1bee3b integrations: Trac documentation.
(imported from commit 14978913711e3386ce3c845e434fc8e16ed0adf0)
2013-02-06 17:37:44 -05:00
Waseem Daher d8b9151a31 Initial documentation page for integrations.
(imported from commit cd73c63306ab7ed8c886c30488d5ab928fac6c06)
2013-02-06 16:53:13 -05:00
Waseem Daher c7447e19d9 Add a footer to all our portico content.
This makes /api look less abruptly cut off at the end.

(imported from commit 296e431dad2aa1f72b02bb59f5572c0bf33a7bc9)
2013-02-06 14:11:00 -05:00
Keegan McAllister 59bfe38448 Fix wait condition in subscriptions frontend test
Waiting for text "Waseemio" to appear isn't reliable, because the "create
stream" modal already contains that text.  Instead, do a more specific check
for a .subscription_name element.

(imported from commit 54689aeb9d243c3fb62d1765b2b4fb93d3bb40db)
2013-02-06 13:49:37 -05:00
Zev Benjamin 526995316f Use the new tsvector cache column for full text search
Note that the tsvector cache column should be fully populated before
commit is deployed.  Otherwise, full text search will be broken until
it's populated.

(imported from commit 23c36fb7d146c289148e8243c3d6a9a6494cfc62)
2013-02-06 12:09:49 -05:00
Zev Benjamin 88937655fd [manual] Add a ts_vector cache column on zephyr_message along with the appropriate trigger and index
This needs to be done in three South migrations to not block users
from sending messages for a long time.  Adding the column requires a
write lock on the zephyr_message table and populating the new column
takes a long time.  Thus, we can't do them both in the same
transaction (which South forces on migrations).  Additionally,
creating the index takes a lot of computation and needs to lock the
table when not done CONCURRENTLY, which can't be done inside of a
transaction.

To do this manual change, you need to run:
    python manage.py migrate zephyr 0007
    ssh postgres.humbughq.com 'echo "CREATE INDEX CONCURRENTLY zephyr_message_search_tsvector ON zephyr_message USING gin(search_tsvector);" | psql'
    python manage.py migrate zephyr 0008

on staging. No action is required on prod since the database is
shared.

Note that this migration must be done completely before we switch to
using the tsvector cache column.

(imported from commit b6a27013a60c1fd196eabb095d2d11d20bba5aac)
2013-02-06 12:09:49 -05:00
Leo Franchi c637b9cf44 Handle chars at end of link better
(imported from commit 53842bc17bbb9cfb555738ee6b72291d7ce61d67)
2013-02-06 11:51:52 -05:00
Waseem Daher bff57ad983 Only draw the subscriptions-page lock icon at render time.
Because a stream can never stop being invite-only, we don't
actually need any Javascript to manipulate this besides what's
in the Handlebars template.

(imported from commit 30dc3b0baf623d88d03a643f18cd411dbe3eacfb)
2013-02-05 17:24:29 -05:00
Waseem Daher 4da5c83f64 Optionally draw a lock icon by the stream name in the main view.
If it's an invite-only stream.

(imported from commit 02bb80fee6df2cd32ded0c6f2c2b918b8aa8ac05)
2013-02-05 17:24:29 -05:00
Waseem Daher f20bd27cf9 Expose our invite-only bit to subs.js's stream object.
(imported from commit bd4d6f62331262cef5c9763d7e0e9acfd4890396)
2013-02-05 17:24:29 -05:00
Waseem Daher 99edd920c5 tests: Make sure that our subscriptions list properly returns the invite-only bit.
(imported from commit c060c6b350d335d5e94c07314fcfe7c766f2efcd)
2013-02-05 17:24:29 -05:00
Waseem Daher af45236968 tests: Cause existing tests to pass after change to gather_subscriptions.
(imported from commit 3524a5d69d9228810ae863fdea9a9f007a1ca7db)
2013-02-05 17:24:29 -05:00
Waseem Daher 66850b5dcd Make gather_subscriptions pass along whether or not a stream is invite-only.
(imported from commit f71c171185a0552dba4917967d3feffb9c92c4fe)
2013-02-05 17:24:29 -05:00
Luke Faraone ff59e28f53 Catch all exceptions when sending a message from AdminHumbugHandler
If the database is down and the Handler crashes, we get an email with an
obnoxiously long subject line and without proper sanitization performed.

By wrapping internal_send_message in a try-except, we eliminate the most
common (read: to date, only) cause of crashes in our Handlers.

(imported from commit fd59e931ad0a4fff574d3cafa47348eacacb858f)
2013-02-05 16:12:48 -05:00
Luke Faraone e7762422e4 Filter out all cookies and the csrfmiddlewaretoken.
We also remove META here since it rarely contains anything useful, and
often contains sensitive environment vars.

(imported from commit 2909613f9f52684bef9175600961801104644c75)
2013-02-05 16:12:48 -05:00
Keegan McAllister c57368d71e Fix missing close brace in zephyr.css
This was introduced in d19991c7.  Fixes code highlighting when minified.

(imported from commit ea4360f8dcc51da464619b4d570884edb0de8e26)
2013-02-05 15:43:56 -05:00
Luke Faraone 914aa336c7 Don't send "in" operators to the server, as this is a client-side filter.
(imported from commit 1f3d3c09e24093e038d83985003af0b1c87d4ed8)
2013-02-05 15:34:37 -05:00
Luke Faraone 77d0a07e4f Don't add messages to zhome if the message's Stream has in_home_view=false.
We also introduce support narrowing to "home" and "all".

(imported from commit 53b8dea9c6045a0cde368b3163f6fd6ecde1c649)
2013-02-05 15:34:37 -05:00
Luke Faraone 3de93f2b2b Pass stream information in initial template.
This allows us to remove fetch_colors() entirely, and should speed up page
load a bit.

We also JSONEncoderForHTML instead of dumps so that the result is safe
to embed.

(imported from commit 013630911960e2ac1d0bae6f5df31ad342750594)
2013-02-05 15:34:37 -05:00
Luke Faraone ac0dbd0864 Return in_home_view in gather_subscriptions.
This enables us to do client-side filtering on messages by the value of
this setting.

(imported from commit e69a7772dc90c67cb91ea8f630f5b78c902e8fa8)
2013-02-05 15:34:37 -05:00
Luke Faraone e8afaa8b8e Return a dictionary in subscriptions/list instead of a tuple.
This will give us flexibility in the future to add new properties to the
list.

In order to support that, we now do a list comprehension rather than just
returning the gather_subscriptions list in get_stream_colors.

(imported from commit a3c0f749a3320f647440f800105942434da08111)
2013-02-05 15:34:37 -05:00
Luke Faraone 1c3c3cc33f Add call to toggle whether a view is in the home view.
(imported from commit 5ece7b74a5ac4929a46d3d66ae5d838e1f418b44)
2013-02-05 15:34:37 -05:00
Luke Faraone 2a01b355a4 Correctly return a JSON error if property value is not passed.
Previously we checked if property was false after doing .strip(). Since
you can't call string methods on a NoneType, we were 500ing.

The code now does a normal dictionary get via [] and catches the
KeyError.

(imported from commit da7f28febf0865f44e92bcac1791f817c3d370f3)
2013-02-05 15:34:37 -05:00
Luke Faraone b78d154370 Factor out subscription retrieval code into another function.
(imported from commit 6a66a4feb03990e11c98cd8666d1a7bb97299987)
2013-02-05 15:34:36 -05:00
Luke Faraone 3d25fbce49 Replace calls to json_error to raise JsonableError.
Returning json_error inside an inner function call will result in the error
getting lost.

(imported from commit fd7754b15f7b62fd6e4197fd72ae03d6996a93da)
2013-02-05 15:34:36 -05:00
Luke Faraone 2d4ef59f68 Fix InviteOnlyStreamTest to call public API
Previously we made calls to the JSON api, which means that the API key
was being ignored.

(imported from commit 46d8d0e5ac7926e824f300fd846ec42bc939e2c0)
2013-02-05 15:34:36 -05:00
Luke Faraone f0afa56cd3 [manual] South migration for Subscriptions model change.
Autogenerated schema migration:
 + Added field in_home_view on zephyr.Subscription

To do this manual change, you need to run:
    python manage.py migrate zephyr 0005

on staging. No action is required on prod since there is a shared database.

(imported from commit d554f17b25631482ec2d5605a42ac0b9d6df421e)
2013-02-05 15:34:35 -05:00
Luke Faraone cb5c9ed047 [schema] Add new boolean field in_home_view to Subscriptions
This is part of the Oppa Gmail Style proposed by Waseem.

(imported from commit 0663889bcb1f691842f69d243fd4ac0e4e3e0868)
2013-02-05 15:34:03 -05:00
Tim Abbott a3a0880266 middleware: Improve logging of users causing 40x errors.
Previously we only got the user ID for /json requests, not /api
requests, and also only got the user ID, not the email address.

(imported from commit c3625f9c1a48430e35183be6c90a7855f3714948)
2013-02-05 14:36:48 -05:00
Keegan McAllister 9349a2039c Fix comment syntax error in CSS
Introduced in d19991c7.  //-style comments aren't supported in CSS.

This was causing update-prod-static to fail with a stack overflow.

(imported from commit 4cb11a7025e8fef32c852d691fccf18a5ad3b955)
2013-02-05 14:05:10 -05:00
Leo Franchi 054420fc38 Match .co.uk before .co in linkification
(imported from commit 2461cb4d49eef15431dde30dda646b25dc860a7b)
2013-02-05 13:04:45 -05:00
Keegan McAllister a8ade10fde Restore streams-example.png for /new-user
This was removed in 63788aa3.  It was the only non-symlink in
zephyr/static-access-control/.

(imported from commit c9ee043b07c5fd4050aeaafa40394a6b69915bfb)
2013-02-05 12:07:41 -05:00
Jessica McKellar 5221885035 tests: add tests for get_subscribers.
(imported from commit 25ff513dcba72ad04487e6bfd9227457f8e3cc16)
2013-02-05 10:12:04 -05:00
Jessica McKellar fdb0d15080 Don't let non-subscribers of invite-only streams query the membership.
(imported from commit 01bd8ea089dec96e487e5e82fb38df65703679ae)
2013-02-05 10:12:04 -05:00
Jessica McKellar a1506779ca tests: Add missing logins in InviteOnlyStreamTest.
This test case was supposed to be making requests as 2 different
users, but was not logging in as each of them and thus used the wrong
credentials.

(imported from commit 0dfdc86fcb385d3d2a721181b2f8075bc39ad723)
2013-02-05 10:12:04 -05:00
Jessica McKellar a9f5513181 subs: compare names using localCompare.
(imported from commit e4dcfe5147601221e720ea6622266402ed09f18a)
2013-02-05 10:12:00 -05:00
Jessica McKellar a8a5d0b511 Strip whitespace before looking up a stream name with get_stream.
This came up when I tried to subscribe myself to an existing stream
name but with leading whitespace added; the get_subscribers request
failed with a 400.

(imported from commit 03fe370d1e80fd7e8c282f260e63b7e5ada05960)
2013-02-05 10:01:45 -05:00
Jessica McKellar ab21823c19 Fix bug allowing people to subscribe themselves to others' invite-only streams.
(imported from commit db7634d81677217032c180d8bab297cc766228f1)
2013-02-05 10:01:45 -05:00
Jessica McKellar 4d170530cc subscriptions: stylize invite_only streams with a lock icon.
(imported from commit afa99dbc61ba66a6e9662780ef8daaa3d4f9e543)
2013-02-05 10:01:45 -05:00
Jessica McKellar dc66d6290b views: be more strict about the value of invite_only in add_subscriptions_backend.
(imported from commit 565375b06bb38382100923554e52a16549a18e00)
2013-02-05 10:01:45 -05:00
Jessica McKellar 85080f7ca5 decorator: deduplicate json_to_* logic.
(imported from commit d2470ebe38c391a8bb2e389a508f8b50d2e11fec)
2013-02-05 10:01:45 -05:00