Commit Graph

29007 Commits

Author SHA1 Message Date
Yashashvi Dave a394778cde statis/js/popover.js: Remove unused arg from `show_user_profile` func.
Remove unused argument `element` from function `show_user_profile`.
2018-11-16 09:52:05 -08:00
Vishnu Ks 9d398ee335 activity: Move the total row from last to first. 2018-11-16 09:22:32 -08:00
Nolan Darilek 5d291eb52c accessibility: Model messages as a list with items, each representing a single message.
Previously, messages were a string of disconnected regions. Modeling them as a list brings several benefits:
 * Quickly jump to the message list by using a screen reader's list navigation hotkey.
 * Quickly jump between messages by using a screen reader's list item navigation hotkey.
 * Quickly jump to the beginning or end of message lists in screen readers that support it.
2018-11-16 08:54:01 -08:00
Tim Abbott 209dd5db67 actions: Add a function for changing realm subdomains.
This is initial work, which will help us establish habits of using a
well-tested approach for renaming a Zulip organization (since as part
of https://github.com/zulip/zulip-mobile/issues/3142, we'll likely
need to make this function do more).
2018-11-15 14:39:14 -08:00
Tim Abbott 9e4058efd3 test_realm: Use update_fields when saving realm objects.
This is a slight cache performance optimization, and more importantly
matches our standard style for modifying objects.
2018-11-15 14:39:14 -08:00
Vishnu Ks 74ee41912a auth: Always force Google to show account chooser.
Fixes #10515
2018-11-15 11:12:45 -08:00
Tim Abbott 86801d350a compose: Store raw_content after fetching it for quoting.
This is a nice performance optimization for the rare case where the
user does quote-and-reply on a message, aborts the compose, and then
re-does the quote-and-reply.
2018-11-14 23:55:26 -08:00
Marco Burstein f37e4df471 compose: Check if `raw_content` is present when quoting.
If `raw_content` is already present for the selected message, there is
no need to make a request to the server.
2018-11-14 23:52:08 -08:00
Steve Howell 6546fb3f1d subject -> topic: Fix local subject vars. 2018-11-14 23:24:06 -08:00
Steve Howell 51f8ac91ec subject -> topic: Rename current_subject. 2018-11-14 23:24:06 -08:00
Steve Howell a172ac264d subject -> topic: Rename by_stream_subject_uri. 2018-11-14 23:24:06 -08:00
Steve Howell b615f0df4d subject -> topic: Fix stream/subject in comments. 2018-11-14 23:24:06 -08:00
Steve Howell c6ad12d058 subject -> topic: Fix local vars in stream_list. 2018-11-14 23:24:06 -08:00
Steve Howell 3a9c81ed8c subject -> topic: Rename add_subject_links. 2018-11-14 23:24:06 -08:00
Steve Howell 91e4784b92 subject -> topic: Rename narrow.by_subject. 2018-11-14 23:24:06 -08:00
Steve Howell 6c1a96174e subject -> topic: Rename narrow_by_subject. 2018-11-14 23:24:06 -08:00
Steve Howell 7ae8907b3f subject -> topic: Rename narrows_by_subject. 2018-11-14 23:24:06 -08:00
Rohitt Vashishtha d7a0bd4a6c subject-to-topic: Add topics to compose_state.js. 2018-11-14 23:24:06 -08:00
Steve Howell f69a4f11e3 subject -> topic: Fix narrow tests.
This fixes the last remaining "subject" references except
for uses of it in expected SQL statements.
2018-11-14 23:24:06 -08:00
Steve Howell c0fd8660d2 subject -> topic: Fix analytics test (minor). 2018-11-14 23:24:06 -08:00
Steve Howell f3e529c694 minor: Use topic_name() in travis test. 2018-11-14 23:24:06 -08:00
Steve Howell eb4d279bbc Extract get_turtle_message().
This seems like kind of a silly function to extract
to topic.py, but it will theoretically help us sweep
"subject" if we change the DB.

It had test coverage.
2018-11-14 23:24:06 -08:00
Steve Howell cc33e4cd0c digest: Eliminate unneeded queries for hot convos.
We can easily keep track of messages by bucket from the
original loop through messages.
2018-11-14 23:24:06 -08:00
Steve Howell 3091412806 refactor: Use messages in gather_hot_conversations().
We rename stream_messages -> stream_ums, and then we get
messages at the top for the loop that only cares about
messages.
2018-11-14 23:24:06 -08:00
Steve Howell f961408782 digest: Reduce queries using select_related().
We use the message a lot for the query modified
here, so I think it's worth taking the up-front
hit of getting bulkier objects to avoid O(N)
hops back to the database.
2018-11-14 23:24:06 -08:00
Steve Howell 51aa313833 test coverage: Add test_multiple_stream_senders().
This exercises a loop in digest.gather_hot_conversations().
2018-11-14 23:24:06 -08:00
Steve Howell 5a539d44b0 subject -> topic: Fix notification tests.
The URLs changed here are artificial, so we can convert
subject -> topic without breaking anything.
2018-11-14 23:24:06 -08:00
Steve Howell 8cf93a25c5 Use email_subject as var in test_notifications.
We change subject -> email_subject for all local vars
here, so it's easier to skip past this code if you
are sweeping subject -> topic.
2018-11-14 23:24:06 -08:00
Steve Howell 27d79352da topic -> subject: Extract get_topic_from_message_info().
This changes files where it's safe to just assume caller
may use either "topic" or "subject", and we prefer "topic"
but support "subject".
2018-11-14 23:24:06 -08:00
Steve Howell aa4e9cec2d minor: Add a code comment and move two constants. 2018-11-14 23:24:06 -08:00
Steve Howell b666a6bd6c subject -> topic: Fix most of api_test_helpers.
We don't want to change anything that can end
up in docs yet, but for test setup, we can switch
to topic_name.
2018-11-14 23:24:06 -08:00
Steve Howell 44cbcdf00c minor: Remove txt file from lint exception.
It's already ignored because it's not a .py file.
2018-11-14 23:24:06 -08:00
Steve Howell 2505a2f3cc lint: Build exceptions for subject. 2018-11-14 23:24:06 -08:00
Steve Howell a3460d1ef6 lint: Remove obsolete exemptions.
These two files have been cleaned up since the original
lint rule exemption.
2018-11-14 23:24:06 -08:00
Steve Howell c69c40a55a lint: Extract check_file_for_pattern(). 2018-11-14 23:24:06 -08:00
Steve Howell fd0b249a29 lint: Calculate strip_rule outside the loop.
This adds up over a million lines. :)
2018-11-14 23:24:06 -08:00
Steve Howell f386c64759 lint: Speed up by doing fewer regex compiles.
Even though you'd think these regexes would be
cached, compiling the regex outside of looping
through lines makes a difference.

My timings are 8.4s -> 6.0s.  (You need to hack
on the linter to isolate the custom checks.)
2018-11-14 23:24:06 -08:00
Steve Howell 08e44aac0d lint: Extract get_rules_applying_to_fn(). 2018-11-14 23:24:06 -08:00
Steve Howell eda138343b lint: Extract get_line_info_from_file(). 2018-11-14 23:24:06 -08:00
Steve Howell 6d88210110 lint: Extract check_file_for_long_lines().
In passing this removes some unnecessary string
decoding that's a relic of python2.
2018-11-14 23:24:06 -08:00
Steve Howell ea26372083 hipchat: Make conversion work with UUID ids from Stride.
Normal hipchat exports use integer ids for their
users and "rooms," which we just borrowed during
conversion.

Atlassian Stride uses stride UUIDs for these instead, but otherwise
has the same export format.

We now introduce IdMapper to handle external ids
that aren't integer.  The IdMapper will map UUID
ids to ints and remember them.  For ints it just
leaves them alone.

Fixes #10805.
2018-11-14 23:22:40 -08:00
Steve Howell aff84cd1e9 hipchat: Skip attachments without paths.
This is a short term workaround.  Some variants
of HipChat exports are missing `path`, and we just
punt for now.
2018-11-14 23:14:13 -08:00
Vishnu Ks 546fd5d60e email log: Inline email CSS when generating emails.
This saves a step in the development cycle for iterating on the email
HTML and CSS.
2018-11-14 23:05:44 -08:00
Steve Howell 47e464528c refactor: Split up add_display_time().
We split out two new functions and call them
everywhere that we used to call add_display_time():

    - `update_group_time_display`
    - `update_timestr`

We also make some of the local vars more consistent,
as well as doing more explicit clearing of vars than
`delete`.

Splitting these functions will allow us to muck with date
dividers without affecting the `update_str` functionality.
2018-11-14 22:47:29 -08:00
Eeshan Garg ab7d0de782 webhooks/github: Enable PM notifications for non-JSON payloads. 2018-11-14 22:35:57 -08:00
Eeshan Garg d9958610a4 webhook_decorator: Support notifying bot owner on invalid JSON.
Our webhook-errors.log file is riddled with exceptions that are
logged when a webhook is incorrectly configured to send data in
a non-JSON format. To avoid this, api_key_only_webhook_view
now supports an additional argument, notify_bot_owner_on_invalid_json.
This argument, when True, will send a PM notification to the bot's
owner notifying them of the configuration issue.
2018-11-14 22:35:56 -08:00
Tim Abbott 71174d53cb docs: Add a document with notes on the Django upgrade process. 2018-11-14 17:53:27 -08:00
Tim Abbott f1c65975ad docs: Clarify preparatory process for data import.
You need a Zulip server running the a matching version, and no longer
need to do an upgrade from master before using established import tools.
2018-11-14 17:02:33 -08:00
Tim Abbott 67c3593b39 sessions: Add coverage exception for now. 2018-11-14 15:28:35 -08:00
Tim Abbott ae6fc0a471 sessions: Resync session middleware from Django upstream.
Until we resolve https://github.com/zulip/zulip/issues/10832, we will
need to maintain our own forked copy of Django's SessionMiddleware.
We apparently let this get out of date.

This fixes a few subtle bugs involving the user logout experience that
were throwing occasional exceptions (e.g. the UpdateError fix you can
see).
2018-11-14 15:16:12 -08:00