Commit Graph

13375 Commits

Author SHA1 Message Date
Steve Howell e732892654 css: De-duplicate some common styles for unread counts. 2016-11-14 16:16:55 -08:00
Steve Howell 7c1711179c Rename subject_count class to topic-unread-count. 2016-11-14 16:16:55 -08:00
Steve Howell 72b8200b0b refactor: Extract update_unread_count() in topic_list.js.
This function does the "heavy" lifting of updating an unread
count.  (It's not exactly heavy lifting, but it makes it so
the parent just needs to find the outer element of the unread
div, using whatever method makes sense for the parent.)
2016-11-14 16:16:55 -08:00
Umair Khan 9b0f9bf326 Django 1.10: apply_response_fixes was removed.
Ref: https://code.djangoproject.com/ticket/26052?cversion=0&cnum_hist=2
2016-11-14 16:09:12 -08:00
Umair Khan 3d3800314f Django 1.10: Setup django before running queue processors. 2016-11-14 16:09:12 -08:00
Umair Khan 7d51efe9a1 Django 1.10: Fix dummy data for count stat.
Django 1.10 checks the foreign key constraints as part of the testing
suite so we need to create test data which passes validation tests.
2016-11-14 16:09:12 -08:00
Umair Khan 47e8a56870 Django 1.10: Use compatible django guardian. 2016-11-14 16:09:12 -08:00
Umair Khan e89af4c470 Django 1.10: Fix django-bitfield.
SubfieldBase was deprecated in Django 1.10 so the version we use now
doesn't rely on that class.
2016-11-14 16:09:12 -08:00
Umair Khan 5cfd54994a Django 1.10: validate is replaced with check.
See
https://docs.djangoproject.com/en/dev/releases/1.7/#modeladmin-validators
for explanation.
2016-11-14 16:09:12 -08:00
Steve Howell e7a2b51647 Consolidate people searches (buddy list/subscribers).
We now use the same people-filtering code for the buddy
list that we use in subscriber search.
2016-11-14 16:01:13 -08:00
Steve Howell 71d93207cd Match "Charles Dickens" with "ch di" in subscriber search. 2016-11-14 16:01:13 -08:00
Steve Howell 6eb1dc3e73 Refactor filter_people_by_search_terms().
Build individual matchers for each search term.
2016-11-14 16:01:13 -08:00
Steve Howell 2746518f3c Make subscriber filter match on emails.
We will match emails that start with search terms.
2016-11-14 16:01:13 -08:00
Steve Howell 504045f47d Pass in search terms as arrays to test_filtered_users(). 2016-11-14 16:01:13 -08:00
hackerkid b2e91eae13 Add marked.js support to emojis in miscellaneous and dingbats block.
https://en.wikipedia.org/wiki/Emoji#Unicode_blocks
2016-11-14 15:58:16 -08:00
Steve Howell 8fa519ded6 Remove some dead code in stream_list.js.
I forgot to remove this code in a recent refactoring that copied
this code into activity.js.  It should not have caused any errors,
but it's no longer needed.
2016-11-14 15:53:23 -08:00
Steve Howell fad0a86554 Add HelpTest for help pages. 2016-11-14 15:47:35 -08:00
Steve Howell 02cf40ade8 Add test_redirect_endpoints() in test_signup.py. 2016-11-14 15:47:35 -08:00
Tim Abbott 151267edf6 Roadmap: Make several more things as finished. 2016-11-11 16:24:20 -08:00
hackerkid 8c83b34ad5 Support backend emoji rendering without whitespace. 2016-11-11 16:18:57 -08:00
Feorlen 4ed5c21821 Update Desk.com webhook integration.
Updates the HTML docs to match changes to the Desk.com website,
including all new screenshots for the custom action workflow.

Tests four types of messages that could be sent as notifications from
Desk.com. Desk.com allows an account administrator to send any text
in a custom action, so there isn't a standard format.

Custom actions send URL-encoded POST data, the test fixtures contain
URL-encoded text like what could be sent by a custom action configured
as described in the Zulip Integrations documentation to post a new
message to a stream. (See also #2169, errors in this documentation.)

New zerver.tests.webhooks.test_deskdotcom.DeskDotComHookTests:

* Static text: minimal plain text string
* Case updated: activity alert with link to a Desk.com case and message
* Unicode text Italian: activity alert with message in Italian
* Unicode text Japanese: activity alert with message in Japanese

Each posts a new message in the deskdotcom stream.

Tested on Ubuntu 14.04. I created the fixtures with Emacs, I would
appreciate if someone can check that the Italian and Japanese messages
look ok. I used the same text for a live test and it displayed correctly.

Fixes #2031
2016-11-11 16:06:22 -08:00
Tomasz Kolek 4659abae65 test_fixtures: handle a case when given database does not exist.
Sometimes i.e. when you force close (ctrl-c) during ./tools/test-backend
a next execution might raise an error becuase DATBASE_NAME does not exist.
2016-11-11 15:40:10 -08:00
Tomasz Kolek f05b71b9ca Add handling multiple push info in one request to Bitbucket2 integration. 2016-11-11 15:36:45 -08:00
Tomasz Kolek 085cdb7028 Fix Bitbucket2 push message by truncated commits list. 2016-11-11 15:36:45 -08:00
Tomasz Kolek ed1d7f7997 Add is_truncated param to git integrations push commits event.
Add is_truncated param for cases when we know that there were more commits
but we dont know actual number and want just inform about existing of the rest.
2016-11-11 15:36:45 -08:00
Tomasz Kolek 81f18b829d Normalize pushing tags event messages in Bitbucket2 integration. 2016-11-11 15:36:45 -08:00
Tomasz Kolek 5980a75e07 Normalize pushing tags event messages in GitLab integration. 2016-11-11 15:36:45 -08:00
Tomasz Kolek 6be27a1396 Add get_push_tag_event_message function to git integrations common (git.py). 2016-11-11 15:36:45 -08:00
Rishi Gupta 5681ee90fa models.py: Rename split_email_to_domain to email_to_domain.
In order to better match models.email_to_username.
2016-11-11 15:26:51 -08:00
Rishi Gupta c1713c9659 Prevent code from using email domain to determine realm when subdomains.
Also removes the intermediate step of going through Realm.domain in the
non-subdomains case. Part of a larger project to remove Realm.domain
entirely.
2016-11-11 15:26:51 -08:00
Rishi Gupta 411a7b08e0 bulk_create_users: No longer de-alias user email addresses.
bulk_create.bulk_create_users is only called by initialize_voyager_db.py and
populate_db.py, both of which only have realms with single domains.

Part of a larger project to remove the Realm.domain field.
2016-11-11 15:26:51 -08:00
Rishi Gupta 91f2582c2b templates: Remove for_you block from jinja templates.
No change in behavior. The for_you block had already been removed in
portico.html long ago in a6889080ce. The
contents of the block are still present in the non-portico 404.html
and 5xx.html error pages.
2016-11-11 15:26:08 -08:00
Rishi Gupta 6608627bc0 models.py: Move Realm and RealmAlias functions to appropriate locations.
Currently refactoring the Realm and RealmAlias portions of models.py to no
longer use Realm.domain. Move various functions related and not-related to
the two model objects to more conventional places in the file.

No change to behavior.
2016-11-11 15:24:42 -08:00
Steve Howell 47ef26fa55 refactoring: Let activity.js manage its own unread counts.
This change breaks a needless dependency of activity.js on
stream_list.js.
2016-11-11 12:27:03 -08:00
Steve Howell f3373d62e1 stream sidebar: Clean up unsubscribe logic.
From subs.js we don't redundantly try to remove an element
from ths sidebar; we just trigger the event.

In stream_list.js we continue to remove the element from
the DOM, and we also remove the widget from our internal
Dict of sidebar rows, so that if we re-subscribe, we know
we'll automatically re-build the widget from the template
and the latest data from stream_data.js.
2016-11-11 12:12:13 -08:00
Steve Howell d867cba90b Add stream_list.stream_sidebar() class.
This new class lets us store sidebar rows inside of stream_list.js
instead of putting them on sub objects from stream_data.js.
2016-11-11 12:12:13 -08:00
Steve Howell 7b0c6459b4 Extract static/js/pm_list.js.
This handles most of the details of building the Private Messages
section in the upper left corner of the app.
2016-11-11 12:12:13 -08:00
Steve Howell af794bec7a Remove unused stream_list.get_count(). 2016-11-11 12:12:13 -08:00
Steve Howell 6a3254f83f Clean up how we build individual stream sidebar rows.
We used to have hacky code where various functions would call
build_stream_sidebar_row() to get a jQuery object, and then they
would attach the jQuery object to the "sub" object from stream_data.js.

Now build_stream_sidebar_row() localizes the hack of attaching
a UI object to the "sub" object to just one function (and we can
clean this up in a follow-up commit).

Also, the UI object is now a JS object that can close on some useful
state information like the stream name and encapsulate how we
toggle the inactive_stream class.

Finally, we don't have build_stream_sidebar_row() needlessly append
list items to $('#stream_filters') when we know that our callers are
going to re-build the list anyway.
2016-11-11 12:12:13 -08:00
Steve Howell 13fbb96178 Remove unnecessary call to build_stream_list().
In refresh_pinned_or_unpinned_stream(), we no longer call
build_stream_list(), because that's already called in
update_streams_sidebar().
2016-11-11 12:12:13 -08:00
Steve Howell 16cb2bce8b Remove duplicate loop in build_stream_list().
The code removed in this commit added pinned streams to a list
of elems, only to have them added again by the next block of code
(but more concisely).  Through some strange quirk of appendTo() this
never created user-facing bugs, but you could clearly see in the console
that it was doing double work.
2016-11-11 12:12:13 -08:00
Steve Howell 06f4857221 buddy list: Make Group PMs appear more quickly.
It used to be the case that you would get new messages for a
huddle, but the huddle wouldn't show up on your buddy list until
the every-50-seconds mass update of the buddy list.

Now we make sure to work with non-stale jQuery objects, and,
more importantly, we resize ourselves if we add new huddles.

(The resize issue arises due to some complicated heuristics
where we don't want group PMs to take up too much of the buddy
list for users who don't have many in their history.)
2016-11-11 12:02:48 -08:00
Steve Howell 197edcca0e buddy list: Update huddles when you fetch PMs.
This fixes a bug with the group pm section of our
buddy list.  It wasn't updating when you fetched
old private messages.

We had been calling activity.process_loaded_messages() as
part of message_store.do_unread_count_updates(), which was
called sometimes unnecessarily and sometime not called when
we needed to get huddle info.

Now we call it when we need it most, which is when you
click on "Private Messages".
2016-11-11 10:41:18 -08:00
Steve Howell eef633efa0 minor: Make get_huddles() internal to activity.js. 2016-11-11 10:41:18 -08:00
Tim Abbott 48f671a314 same_realm_jabber_user: Remove old ist.mit.edu hack.
This is no longer in use.
2016-11-10 20:50:40 -08:00
Tim Abbott 3b145b2370 add_new_user_history: Fix ordering of created UserMessage rows.
This has no functional effect because user_message IDs aren't used,
but will make the database cleaner.
2016-11-10 20:39:34 -08:00
Tim Abbott 08ca209aed add_new_user_history: Fix race with new messages arriving during signup.
Previously, if a new message arrived between when a user is subscribed
to the default streams and when the user's initial messages are
queried, we would try to create two UserMessage rows for the same
Message, resulting in an IntegrityError crash.  We fix this and add a
test for that race condition.
2016-11-10 20:38:27 -08:00
Tim Abbott 80c2df616e signup: Extract add_new_user_history. 2016-11-10 20:37:03 -08:00
Brock Whittaker d45c050994 message_edit: Restyle message_controls options to have better spacing.
This restyles the message_controls options to center them horizontally
while fixing them closer to the right side of the edge, along with just
replacing the edit button with a preview source button once editing is
disabled.
2016-11-10 19:47:26 -08:00
Brock Whittaker 5497416a36 Move edit button to underneath message timestamp.
This moves the edit button to underneath the timestamp such that when
you hover over a message now the timestamp hides itself and the edit
button appears (if editing is allowed).

Fixes #1733 and other annoying issues with this field.
2016-11-10 19:45:09 -08:00