Commit Graph

4870 Commits

Author SHA1 Message Date
Steve Howell 1ba7d1ec68 Clean up var names in test_user_getting_add_peer_event(). 2017-06-10 10:43:57 -07:00
Steve Howell e3c6c22269 Optimize push_notifications.response_listener().
We were needlessly getting a UserProfile object out of cache,
when we only needed the user_id.
2017-06-10 10:43:57 -07:00
Steve Howell b81dd0e596 Optimize get_huddle_backend().
This removes an unnecessary call to get_user_profile_by_id().
We only need user_id to create a Subscription, so fetching the
full user_profile record out of cache is wasteful.
2017-06-10 10:43:57 -07:00
Steve Howell 549a1626d9 Optimize get_recipient_user_profiles().
For the fairly rare case that a user sends messages to themselves,
we now only call get_user_profile_by_id() once.
2017-06-10 10:43:57 -07:00
Rishi Gupta 1d702d13a4 emails: Replace context variable zulip_support with support_email. 2017-06-10 01:35:03 -07:00
Rishi Gupta 15b967fc3e emails: Move support_email into a common context. 2017-06-10 01:25:44 -07:00
Rishi Gupta 056489c247 emails: Move verbose_support_offers into a common context.
Server settings should just be added to the context in build_email, so that
the individual email pathways (and later, the email testing framework)
doesn't have to worry about it.
2017-06-10 01:16:03 -07:00
Vaida Plankyte 114b080d01 emails: Add base template for html emails. 2017-06-09 23:34:24 -07:00
Rishi Gupta 2f1d678133 test_emails: Impose a specific order on the templates. 2017-06-09 23:34:24 -07:00
Rishi Gupta 69e7029663 test_emails: Use zerver.lib.send_email for rendering email.
Previously the rendering code in test_emails.py did not match the rendering
code in send_email.py. This commit removes the duplication to reduce the
chance they drift in the future.

This commit also changes test_emails.html to ensure that we always display
both the HTML and text versions of an email.
2017-06-09 23:34:24 -07:00
Rishi Gupta 7fae8fb53d test_emails: Make fixture values more helpful for visual review.
Also fixes the fact that we were pulling assets from chat.zulip.org.
2017-06-09 23:34:24 -07:00
Harshit Bansal 7be2e17827 message.py: Use dict's subscript syntax in `ReactionDict`.
Instead of using dict's `get()` method use the subscript syntax
so that we can assert correctly that the reaction row contains
all the fields and if not raise the `KeyError` instead of silently
returning None.
2017-06-09 16:38:58 -07:00
Harshit Bansal e30e244b29 emoji: Moved `unified_reactions.json` file.
Moved `unified_reactions.json` file from `tools/setup/emoji` to
`zerver/management/data` so that it can be used in production
environment.
2017-06-09 16:38:58 -07:00
Tim Abbott 14ff26bd67 test_emails: Don't require test coverage for failed template rendering. 2017-06-09 16:28:01 -07:00
Tim Abbott 2514ee4294 test_docs: Add test coverage for new /emails/ endpoint. 2017-06-09 16:25:39 -07:00
Cory Lynch 6219128d87 dev: Add /emails/ URL for testing email templates.
Fixes #5270.
2017-06-09 16:21:49 -07:00
Cory Lynch 6653e19e3a Add URL for viewing node coverage data on dev server.
Running test-js-with-node --coverage now provides a URL
to view the output data on the web.

Fixes #5177.
2017-06-09 16:17:30 -07:00
Akhil 4986027126 org-settings: Add backend for notifications stream.
Realm.notifications_stream is not a boolean, Text or integer field, and
thus doesn't fit into the do_set_realm_property framework. Added function
to update it in actions.py. Altered the view, realm.py, to accept
stream-id. Also, notifications stream can be disabled by sending a
negative id.
2017-06-09 16:03:52 -07:00
Steve Howell 96db97d4f7 minor: Sort imports in test_events.py. 2017-06-09 13:10:43 -05:00
wizsid11 d309cd29f3 webhooks/zapier: Add weather update example.
Add documentation for weather update through Zapier.
Contains tests and fixtures for weather example.

With minor fixes, docs migration to Markdown, and
rebasing by Eeshan Garg.
2017-06-08 09:14:18 -07:00
Rohitt Vashishtha 5a3a41a644 webhooks/travis: Migrate docs to markdown. 2017-06-07 14:06:01 -07:00
Jack Zhang 98a785bb25 message_edit: Replace highlighting replaced text with delete / insert.
Rationale: For the more off-to-the-side edit history view, changes
are easier to digest by highlighting deleted content in red followed
immediately by added and changed content in green.

TODO: Toggle for showing the edited messages without highlighting;
deleted content would not be shown in this view.
2017-06-07 11:06:15 -07:00
Rishi Gupta 769c5ab105 emails: Send password reset emails through zerver.lib.send_email.
Previously, the password reset email behaved differently from all the other
email Zulip sends.
2017-06-06 23:22:22 -07:00
Rishi Gupta 15e5814c27 emails: Prevent subject lines and plaintext emails from being HTML-escaped.
Adds a new template engine with autoescape=False, and uses the new engine to
render subject lines and plaintext emails.
2017-06-06 23:22:22 -07:00
Aditya Bansal 12c6ffa593 Migrate integrations/twitter.html to markdown. 2017-06-06 22:00:35 -07:00
Aditya Bansal 642deef72f Migrate integrations/google-calendar.html to markdown. 2017-06-06 22:00:03 -07:00
Aditya Bansal 2adfc8be4d Migrate integrations/trac.html to markdown. 2017-06-06 21:57:32 -07:00
Aditya Bansal 08c5af5e39 Migrate integrations/subversion.html to markdown. 2017-06-06 21:56:46 -07:00
Aditya Bansal 26212a55dd Migrate integrations/openshift.html to markdown. 2017-06-06 21:55:16 -07:00
Aditya Bansal ee53f80de9 Migrate integrations/nagios.html to markdown. 2017-06-06 21:50:25 -07:00
Aditya Bansal a712a789fc Migrate integrations/git.html to markdown. 2017-06-06 21:48:54 -07:00
Aditya Bansal a1f24dc6a3 Migrate integrations/mercurial.html to markdown. 2017-06-06 21:48:04 -07:00
Aditya Bansal 6fec949678 Migrate integrations/jira-plugin.html to markdown. 2017-06-06 21:46:46 -07:00
Aditya Bansal 6b86de3a3c Migrate capistrano.html to markdown. 2017-06-06 21:40:28 -07:00
Aditya Bansal 84bbed6c49 Add integration name and display_name to context for rendering. 2017-06-06 21:40:28 -07:00
Tim Abbott 4efdf85f62 bots: Add test for invalid bot type. 2017-06-06 21:16:27 -07:00
Abhijeet Kaur 60ff82ed7c bots: Add UI for creating different types of bot.
Add 'Type of bot' option for bots by adding dropdown option in
settings->"Your bots".  For now, this allows creating incoming webhook
bots in addition to default bots.

This will enable users to add a bot as an incoming webhook
(in addition to add full-featured bots).

With various minor tweaks and cleanups by tabbott.

Fixes #2186.
2017-06-06 21:11:22 -07:00
Tim Abbott f7b604f9be webhooks: Fix unnecessary/buggy translation string. 2017-06-06 11:59:36 -07:00
Tim Abbott ec6abddc38 portico: Remove obsolete code for Zulip open sourcing announcement.
This was only ever used on the old zulip.com.
2017-06-06 11:36:03 -07:00
Greg Price 4165c9a62e apps: Link directly to the upstream /apps page.
Now that this page redirects to upstream, make our own links
to it point directly upstream.  This saves a redirect, and
makes it more transparent where the link points if the user
examines it before following.
2017-06-06 11:21:20 -07:00
Greg Price 04b363f3a2 apps: Redirect /apps -> zulipchat.com/apps, except on upstream itself.
This page describes software the user will get from upstream for
their own devices, independent of what's on the server they're
using.  So it should live in a place maintained together with
that other software, rather than be distributed and versioned
with the server.

The use of ZILENCER_ENABLED to tell the difference is rather a hack
but is currently how we do this in the small handful of similar
spots; see #5245.

Fixes #5234.
2017-06-06 11:21:20 -07:00
Umair Khan b09b60dfff Revert "test-backend: Enable test coverage in multi-process mode."
This reverts commit a22d6d2c2a.
2017-06-06 13:07:16 +05:00
Eeshan Garg ffb3994b4e webhooks/bitbucket: Migrate docs to Markdown. 2017-06-05 11:22:06 -07:00
Eeshan Garg def4650d84 webhooks/beanstalk: Migrate docs to Markdown. 2017-06-05 11:22:06 -07:00
Eeshan Garg 0cfe089152 webhooks/github: Migrate docs to Markdown. 2017-06-05 11:22:06 -07:00
Eeshan Garg 7cfc592202 webhooks/bitbucket2: Migrate docs to Markdown.
The change to `render_markdown_path` in `app_filters.py` was
required because for bitbucket2, `integrations.name` is
`bitbucket2`, which is substituted for the stream name in our
Markdown macros. It didn't make sense to recommend the name
`bitbucket2` as a default stream name to our users (for them,
it's just bitbucket). However, the URL is still
`api/v1/external/bitbucket2`.
2017-06-05 11:22:05 -07:00
Eeshan Garg 2f28b3d35b webhooks/gogs: Migrate docs to Markdown. 2017-06-05 11:22:05 -07:00
Eeshan Garg a12fe65166 webhooks/gitlab: Migrate docs to Markdown. 2017-06-05 11:22:04 -07:00
Eeshan Garg dd15b2d997 github_webhook: Migrate docs to Markdown. 2017-06-05 11:20:49 -07:00
Eeshan Garg ae8eb14e5a integrations: Specify a generic URL in GithubIntegration.
We now supply a generic URL for our legacy and webhook GitHub
integrations, as opposed to a dynamically generated URLs
for all other WebhookIntegration(s). Previously, within
GithubIntegration, an invalid URL was dynamically generated
which wasn't even used. Now, we just manually supply the URL
to GithubIntegration.

Furthermore, we'll now be able to access the correct URL in
`render_markdown_path` for our macros.
2017-06-05 11:19:57 -07:00