Commit Graph

31675 Commits

Author SHA1 Message Date
Yashashvi Dave bbff797a93 zerver/tests/test_realm: Fix not-avaliable video-chat-provider value. 2019-05-13 11:34:34 -07:00
Tim Abbott 243db9a22f css: Fix width calculations for fluid width.
Apparently, while b38ae6e0ed was correct
for the default Zulip UI, it was not correct for the fluid width case,
where we did actually want to override the 1400px width rule for the
non-fixed `.app-main` element.

The right fix here is to add an additional CSS rule tweak to our
scrollbar logic.  This has been carefully tested with both initial
setting states as well as toggling the state.
2019-05-13 11:27:00 -07:00
Tim Abbott 45305c93ae auth: Fix Apache SSO port number in confirmation links.
We had a report in the thread around
https://chat.zulip.org/#narrow/stream/31-production-help/topic/Apache-based.20SSO/near/741013
that confirmation links were taking the user to the /register form on
the Apache server, which of course doesn't work because the Apache
server architecture we have is intended to only serve a single
endpoint, /accounts/login/sso, and not any static assets (etc.).

This manifested as users getting a broke page with a bunch of JS
errors about missing static assets when trying to sign up for an
account.  The right fix is to ensure that we serve these confirmation
links (and maybe in the future, redirects) to the nginx server.
2019-05-13 11:14:41 -07:00
Puneeth Chaganti 5dee17dca0 bugdown: Show previews for manually created youtube playlists.
Youtube playlists can be created by manually listing video_ids, as follows:
https://youtube.com/watch_videos?video_ids=vid1,vid2,vid3. This commit adds
previews for URLs of this type, using the first video ID.
2019-05-12 22:24:42 -07:00
Puneeth Chaganti a1f0713b2c bugdown: Show previews for youtube playlist URLs, if possible.
If a youtube playlist URL has a video-id, we show a preview for the URL.

Closes #8562
2019-05-12 22:24:42 -07:00
Puneeth Chaganti 4de261c2de bugdown: Don't show previews for youtube URLs without video ids.
`youtube.com/playlist?list=<list-id>` incorrectly matches the regex since the
change in 8afda1c1bb. The regex was modified to
match URLs of the form `youtu.be/<id>` and this playlist URL incorrectly matches
with the `<id>` set to `playlist`.

This commit avoids this match by verifying that the ID is not playlist.
2019-05-12 22:24:42 -07:00
Roman Godov a50824e031 models: Rename Subscription.in_home_view field to is_muted.
This renames Subscription.in_home_view field to is_muted, for greater
clarity as to what it does just from seeing the setting name, without
having to look it up.

Also disabled an obsolete test_migrations test.

Fixes #10042.
2019-05-12 22:08:10 -07:00
Tim Abbott 5ec8f6e812 test_migrations: Disable migrations test.
Our migrations test suite only really works when no future migrations
conflict with it.
2019-05-12 22:06:17 -07:00
Mateusz Mandera f71c1e6a0c email_mirror: Add test for process_message not finding valid recipient. 2019-05-12 18:55:47 -07:00
Mateusz Mandera fb3fa7883b email_mirror: Clean up TestStreamEmailMessagesEmptyBody.
These tests have some code and comments that only used to apply when
these empty body scenarios used to raise the regular
ZulipEmailForwardError - now they raise ZulipEmailForwardUserError.
We adapt the tests to this fact and test by mocking logging.warning and
making sure it gets called with the intended warning message. This is
also needed to cover the ZulipEmailForwardUserError case with tests to
get to 100% coverage of email_mirror.py.
2019-05-12 18:55:24 -07:00
Mateusz Mandera f892ef1d3f email_mirror: Add tests for messages with attachments. 2019-05-12 18:55:24 -07:00
Mateusz Mandera ede0991ef5 email_mirror: Add tests for filter_footer. 2019-05-12 18:55:24 -07:00
Mateusz Mandera 30c588636b email_mirror: Add test for stream missed message emails. 2019-05-12 18:55:24 -07:00
Mateusz Mandera c2e5661f69 email_mirror: Add test for redis_client.hmget returning None values.
We add a test for the case "if not all(val is not None for val in result):"
on result returned by redis_client.hmget in send_to_missed_message_address.
2019-05-12 18:55:24 -07:00
Mateusz Mandera 2e9dfc1739 email_mirror: Add test to cover empty body after footer stripping. 2019-05-12 18:55:24 -07:00
Tim Abbott b38ae6e0ed scrollbar: Fix incorrect CSS selector.
In a838de63d8, we incorrectly changed
the selector for accessing .fixed-app .app-main to just be .app-main,
which resulted in it affecting parts of the site it should not have.

The end result was a significant layout regression of the floating
recipient bar at some widths.
2019-05-10 11:45:46 -07:00
Tim Abbott 349c6f972b scroll_bar: Calculate the scrollbar width only once.
We wouldn't do it often in any case, but this is a cleaner workflow in
case a future design has us call these size adjustment functions more
often.
2019-05-10 11:44:27 -07:00
Puneeth Chaganti 4383c819cf digest: Fix visibility toggling of digest notifications checkbox. 2019-05-10 09:08:02 -07:00
Puneeth Chaganti 28df5f83dd digest: Always render digest day options as js controls visibility. 2019-05-10 09:08:02 -07:00
Tim Abbott b7d50190b7 process_fts_updates: Batch updates when catching up.
Previously, if process_fts_updates ended up very far behind
(e.g. 100,000s of messages), it was unable to recover without doing
some very expensive databsae operations to fetch and then delete the
list of message IDs needing updates.  This change fixes that issue by
doing the catch-up work in batches.
2019-05-09 22:44:07 -07:00
Puneeth Chaganti 62d9ad534c digest: Trigger additional query to make tests more deterministic.
A couple of tests asserted that the number of queries were within a range,
because they ran one additional query when they were run individually, as
compared to running all the tests in `TestDigestEmailMessages`. We now trigger
these additional queries within the tests, to make the tests deterministic and
assert that the number of queries is a number, instead of a range.
2019-05-09 15:10:05 -07:00
Puneeth Chaganti ab2850c225 digest: Re-enable digest emails for soft deactivated users.
Digest emails were disabled for soft deactivated users, since UserMessage
objects are created for such users lazily when they return.

We now compute the message list for gathering hot conversations by looking at
all the messages sent to the streams where the user is subscribed, while they
were subscribed.

Fixes #6297
2019-05-09 15:10:05 -07:00
Puneeth Chaganti 6abed82fb9 digest: Use one hour cutoff to generate digest emails in test.
Otherwise, the test may flake on a slow/hosed machine, where simulating a
conversation takes longer than 1 sec.
2019-05-09 15:10:05 -07:00
Tim Abbott abae98a901 css: Add detailed comment explaining our 1400px max-width.
The reference to this being overriding in scroll_bar.js and how it
causes flashes is valuable.
2019-05-09 14:07:27 -07:00
Tim Abbott beb3059547 css: Remove long-dead "sticky" CSS rules.
The code that uses these rules was removed in
f1e90086f5.
2019-05-09 13:58:41 -07:00
Pragati Agrawal a838de63d8 settings: Add option for fixed/fluid width.
This adds a new option for "fluid width" under `Display settings` section
of SETTINGS/DISPLAY SETTINGS tab.

Fixes: #11844.
2019-05-09 13:57:57 -07:00
Pragati Agrawal 389c56e88d settings_display: Refactor settings_display.
This commit refactors settings_display in order to make code more precise
and clear.
2019-05-09 13:49:43 -07:00
Eeshan Garg 49ac516b50 webhooks/pivotal: Use proper punctuation. 2019-05-09 13:05:49 -07:00
Eeshan Garg 550ea64b4d webhooks/trello: Use proper punctuation. 2019-05-09 13:05:49 -07:00
Eeshan Garg b434cc7054 webhooks/taiga: Use proper punctuation and new style string formatting. 2019-05-09 13:05:49 -07:00
Eeshan Garg eaf1c4d8b2 webhooks/teamcity: Improve punctuation and message formatting. 2019-05-09 13:05:49 -07:00
Eeshan Garg 6d62522ff0 webhooks/raygun: Improve punctuation and message formatting. 2019-05-09 13:05:49 -07:00
Eeshan Garg 44038fc431 webhooks/raygun: Raise exception for unsupported event types. 2019-05-09 13:05:49 -07:00
Eeshan Garg 5a1f70f6e8 webhooks/opsgenie: Improve punctuation and message formatting. 2019-05-09 13:05:49 -07:00
Eeshan Garg 120937a1f4 webhooks/mention: Use proper message formatting. 2019-05-09 13:05:49 -07:00
Eeshan Garg 1948924cdb webhooks/jira: Improve punctuation and message formatting. 2019-05-09 13:05:49 -07:00
Eeshan Garg ef070ef019 webhooks/github: Improve punctuation. 2019-05-09 13:05:49 -07:00
Eeshan Garg 9516699c73 webhooks/front: Use proper punctuation and fix spelling errors. 2019-05-09 13:05:49 -07:00
Tim Abbott 71f84a3a8b docs: Link to Ksplice blog for more example posts.
This update is in response to feedback that we only had one example
post available.
2019-05-09 11:47:27 -07:00
Mateusz Mandera 40f5755546 email_mirror: Handle case of unspecified charset in Content-Type header.
If the text part of an email message didn't specify the charset in the
Content-Type header, the text content wouldn't be found. We fix this, by
assuming us-ascii charset in those cases, as specified by RFC6657:
https://tools.ietf.org/html/rfc6657
2019-05-09 09:57:40 -07:00
Tim Abbott 7c94d350d4 ci: Run test-backend with limited parallelism.
See the comment for details; this should fix timeouts we've been
seeing in CI.
2019-05-08 18:26:26 -07:00
Harshit Bansal b553507412 subscriptions: Migrate notification setting defaults model.
This commit migrates the Subscription's notification fields from a
BooleanField to a NullBooleanField where a value of None means to
inherit the value from user's profile.

Also includes a migrations to set the corresponding settings to None
if they match the user profile's values. This migration helps us in
getting rid of the weird "Apply to all" widget that we offered on
subscription settings page.

The mobile apps can't handle None appearing as the stream-level
notification settings, so for backwards-compatibility we arrange to
only send True/False to the mobile apps by applying those defaults
server-side.  We introduce a notification_settings_null value within a
client_capabilities structure that newer versions of the mobile apps
can use to request the new model.

This mobile compatibility code is pretty effectively tested by the
existing test_events tests for the subscriptions subsystem.
2019-05-08 17:45:10 -07:00
Tim Abbott 8a2057e3cf test_events: Print out the state when it hasn't changed.
This is often a part of what one will want when debugging.
2019-05-08 17:43:21 -07:00
vinitS101 18a424be79 uploads: Remove unusable UI elements if file uploading is disabled.
If MAX_FILE_UPLOAD_SIZE is set to 0, then UI elements like the upload
icon in the compose and message edit UI and "Attachments" menu in
"/#settings" are not displayed.
A different error message is also displayed if a user tries to drag and
drop or paste a file into the compose message box.

Fixes #12152.
2019-05-08 17:10:07 -07:00
Wyatt Hoodes ececf0a209 provision.py: Add a conditional to remove '.eslintcache'.
It was discovered that the '.eslintcache' file was causing eslint to
throw a TypeError after a recent update/addition to the dependencies.
It makes sense to remove this file as part of the provisioning process
to avoid such exceptions.
2019-05-08 17:06:17 -07:00
Rishi Gupta c40eb524de org settings: Change a few references to Jitsi to Jitsi Meet.
Jitsi Meet is the correct name for the product we integrate with. There is
one other reference to Jitsi, but it's in the db and will require a
migration.
2019-05-08 15:10:21 -07:00
Tim Abbott 1d44fd724b audit log: Log which server admin deactivated a realm too. 2019-05-08 15:09:48 -07:00
Rishi Gupta 0218da64f1 support: Update success message for plan type change. 2019-05-08 15:09:48 -07:00
Rishi Gupta 42c37ef2ee support: Update wording of scrub realm button. 2019-05-08 15:09:48 -07:00
Rishi Gupta 98da11c558 support: Rename deactive to deactivated. 2019-05-08 15:09:48 -07:00