Commit Graph

31383 Commits

Author SHA1 Message Date
Alexandra Ciobica 61758735f3 user status: Clean up code for user status options.
- Changed the <p>s to <button>s and modified the css accordingly.
- Changed the css to use scss nesting.
- Changed the line-height from 1.0em to 1.1em, because on Safari the "g" was not fully displayed.
2019-05-01 16:34:54 -07:00
Eeshan Garg 28109e0f9e webhooks/jira: Ignore comment_created message.
comment_created payloads may not contain the required issue data
to format a useful notification, therefore, it is better to handle
issue comments through issue_updated events (which we already do).

Fixes: #11995.
2019-05-01 16:32:58 -07:00
Mateusz Mandera c1ceba9037 rate_limiter: Move email_mirror limiter to use rate_limit_entity.
We change the rate limiting code in the email mirror to use the new,
general rate_limit_entity function.
2019-05-01 12:54:32 -07:00
Mateusz Mandera 40763070b7 rate_limiter: Generalise some rate_limit_user code.
We create rate_limit_entity as a general rate-limiting function for
RateLimitedObjects, from code that was possible to abstract away from
rate_limit_user and that will be used for other kinds of rate limiting.
We make rate_limit_user use this new general framework from now.
2019-05-01 12:54:32 -07:00
neiljp (Neil Pilgrim) 827c016b98 mypy: Enable strict-optional for messages.py.
This also fixes an issue where we were setting num_after to None,
which should have been 0, to disable fetching messages after the
anchor.
2019-05-01 11:24:47 -07:00
neiljp (Neil Pilgrim) 47de637c3d mirrors: Refactor create_mirrored_message_users to use new Exception.
This enables the function to either return a valid UserProfile or raise
InvalidMirrorInput, which is clearer and more pythonic than the previous
approach of a tuple of a bool and Optional[UserProfile].

In making the type clearer, this improves checking with mypy.

Tests updated.
2019-05-01 11:18:22 -07:00
neiljp (Neil Pilgrim) 3d43682f1b mypy: Enable strict-optional for auth.py. 2019-05-01 10:49:25 -07:00
neiljp (Neil Pilgrim) f3ef2a186c mypy: Enable strict-optional for calculate_first_visible_message_id. 2019-05-01 10:49:24 -07:00
Tim Abbott edb956091f export: Add a blank line in S3 upload output.
This should be more readable.
2019-04-30 16:37:23 -07:00
Shubham Padia 27ff71c96f settings: Don't check mobile notifications if they are disabled.
Fixes #12198.
2019-04-30 14:56:26 -07:00
Vishnu Ks ed81906fc9 docs: Direct GSoD students to #documentation instead of #GSoC. 2019-04-30 14:52:53 -07:00
Yashashvi Dave 7a168216ff stream_ui_updates: Extract `update_change_stream_privacy_settings`. 2019-04-30 14:37:30 -07:00
Yashashvi Dave ecc165b899 stream_ui_updates: Extract `update_regular_sub_settings`. 2019-04-30 14:37:24 -07:00
Yashashvi Dave a71eb6aa15 subs: Extract change-stream-privacy block from function.
This commit removes code to update-stream-privacy-btn
in stream settings from update-sub-settings function.
Because stream-privacy-btn is not part of regular
sub-settings, it is admins only settings.
2019-04-30 14:36:52 -07:00
Yashashvi Dave 9dd9ea5721 stream settings: Update URL when opening empty settings panel. 2019-04-30 14:36:52 -07:00
Yashashvi Dave 460515a2ee stream settings: Extract `setup_subscriptions_tab_hash` function. 2019-04-30 14:36:52 -07:00
Yashashvi Dave ec5ef08a19 subs: Fix URL not updating as per UI on stream unsubscription.
When user unsubscribe from stream by clicking on
subscription-checkmark, the URL changes to unsubscribed
stream but stream settings UI is not updated.
We should change URL and stream settings modal
simultaneously. This PR moves update-hash function
inside open-stream-modal function, which make sure that
URL is getting updated everytime open-stream-modal
function is called and not otherwise.
2019-04-30 14:37:19 -07:00
Yashashvi Dave 2d1b80e2b4 stream_ui_updates: Extract `update_settings_button_for_sub`. 2019-04-30 14:37:14 -07:00
Yashashvi Dave 859ba9e892 stream_ui_updates: Extract `update_check_button_for_sub` func. 2019-04-30 14:37:05 -07:00
Yashashvi Dave 3649a9f15c subs: Add `stream_ui_updates.js` module for managing ui elements.
This commit adds `stream_ui_updates.js` module. This module
will includes functions which will update different ui elements
(i.e. subscription button, subscriber count).
2019-04-30 14:36:52 -07:00
Tim Abbott 98a1e340ad filters: Don't include realm_counts/installation_counts in errors.
This avoids unnecessarily long error emails for these.
2019-04-30 14:10:59 -07:00
David Wood 272ed90685 settings: Create an explicit invite_to_stream_policy setting.
This commit creates a new organization setting that determines whether
a user can invite other users to streams. Previously this was linked
to the waiting period threshold, but this was both not documented and
overly limiting.

With significant tweaks by tabbott to change the database model to not
involve two threshhold fields, edit the tests, etc.

This requires follow-up work to make the create stream policy setting
work how this code implies it should.

Fixes #12042.
2019-04-29 17:11:28 -07:00
Vishnu Ks 89ada6c770 tests: Remove unecessary word from convert_data test name. 2019-04-29 11:23:17 -07:00
Vishnu Ks ecdd3bea43 billing: Add cron job to run invoice_plans once a day.
Fixes #11960
2019-04-29 11:23:17 -07:00
vinitS101 f46b5a8ba1 message view: Decreased top margin of messages with sender info.
Decreased the top margin of first line of messages to align better with
the profile picture of the user.
2019-04-29 10:12:58 -07:00
Puneeth Chaganti 0987ef8809 Merge pull request #12221 from punchagan/safari-upload-fix
Fixes couple of problems with image pastes on Safari
2019-04-28 22:51:17 -07:00
Puneeth Chaganti f3f172991b open graph: Use uploaded realm icon for open graph images. 2019-04-28 22:50:27 -07:00
Tim Abbott 9e8cfbea3b test_email_notifications: Fix a nondeterministic test.
This test made the assumption that the two emails would be ordered in
a query without a ordering.
2019-04-28 22:00:03 -07:00
Tim Abbott 9ece4c9f51 docs: Add documentation for the delete and reimport process.
This is a common thing folks ask how to do.
2019-04-28 21:49:13 -07:00
Anders Kaseorg d4b060a520 dependencies: Upgrade simplebar to 4.0.0-alpha.6.
Fixes #12038.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-04-28 21:32:55 -07:00
Vishnu Ks b4a54483ed Revert "requirements: Upgrade moto from 1.3.7 to 1.3.8."
This reverts commit 4ee65b70b4.
2019-04-28 21:18:01 -07:00
Puneeth Chaganti a98341c79f digest: Add an organisation setting to choose the digest weekday.
Closes #549.
2019-04-28 18:40:07 -07:00
Puneeth Chaganti f3d0ccb9f6 models: Add a digest_weekday field to the Realm model.
Allow realms to specify the day of the week when the digest should be sent out.
When enqueue-ing digests, pick only the realms that chose the current weekday as
the day to send out digests.
2019-04-27 15:20:41 -07:00
Puneeth Chaganti b0f485e95f org settings: Allow admins to enable or disable digest emails. 2019-04-27 15:20:41 -07:00
Puneeth Chaganti aca63f0fbe notifications: Hide digest emails user setting if globally disabled. 2019-04-27 15:20:41 -07:00
Mayank Madan 4c81474a4f webhooks: Add Buildbot integration.
With some minor changes by Eeshan Garg.

Fixes: #5639.
2019-04-27 15:19:16 -07:00
Eeshan Garg a73e8109b7 webhooks: Remove the legacy GitHub integration.
The github-services model for how GitHub would send requests to this
legacy integration is no longer available since earlier in 2019.
Removing this integration also allows us to finally remove
authenticated_api_view, the legacy authentication model from 2013 that
had been used for this integration (and other features long since
upgraded).

A few functions that were used by the Beanstalk webhook are moved into
that webhook's implementation directly.
2019-04-27 15:13:44 -07:00
Wyatt Hoodes 820dd3a946 settings: Fix broken headers in night mode.
This bug turned out to pop up wherever a table existed in both
'settings' and 'organization settings', notably *excluding* both
'Custom Emoji' and 'Authentication Methods'.

The first thought to the solution was to simply add `thead` to the css
rule that applies the appropiate color for headers and the like.  This
was successful, however it brought attention to a sub-problem:

`emoji-settings-admin` and `auth-mehtod-settings-admin` were both
creating table headers in the body of the table. This was causing the
rows in these two tables to be colored inversely from all the others.
This is also the reason why these tables are the only ones correctly
styled. These handlebars were updated with the headers moved out of the
body.

The even and odd rows of the tables were then colored appropriately.

Fixes: #12209
2019-04-27 15:03:57 -07:00
Tim Abbott 7da28600c7 settings_org: Fix linter error with ==.
Apparently this was fixed in a later commit.
2019-04-26 22:48:03 -07:00
Pragati Agrawal f9681c1f51 org settings: Remove redundant loading indicator from auth methods table.
Number of auth methods isn't much, so no need to have loading indicator
here.
2019-04-26 17:57:04 -07:00
Pragati Agrawal d0ba0c7409 org settings: Add generalised function for tip-box for org settings.
This commit adds a `insert_tip_box` function and thus adds a
`organization-settings-tip` handlebars file to add a genaralised tip for
all organization settings pages. This further removes the code for tipbox
which was added in `populate_auth_methods` functions, as it wasn't making
sense there, making it more clear and readable.
2019-04-26 17:54:58 -07:00
Pragati Agrawal 2277ee0c90 org settings: Move `disable` attribute to `admin_auth_methods_list`.
This commits disables the auth-methods table using the disabled attribute
in admin_auth_methods_list handlebars instead of doing that in
settings_org.
2019-04-26 17:52:19 -07:00
Pragati Agrawal 75fc19acfd org_settings: Refactor `get_subsection_property_elements` function.
This commit adds a class prop-element for all the property elements, so
that later on we can directly use this to access elements.

In `get_subsection_property_elements`, we were finding these elements using
a makeshift method, where we were finding all these elements by mentioning
all input elements, textarea, select elements, which is not a desirable
method.
So now, here in `get_subsection_property_elements` function, we are finding
these properties using the newly added class `prop-element` which makes
code more clear and readable.
2019-04-26 17:52:19 -07:00
Pragati Agrawal 3dd5e1642b org_settings: Fix data collection of message retention property.
In handlebars and settings_org.js, the subsection in which
`realm_message_retention_days` property lies doesn't agree, and this wasn't
observed for a long time as it's disabled, still to make things right, in
this commit we have moved the logic which handles the collection of data
from `other_permission` to `other_settings` as it makes more sense there.
2019-04-26 17:41:01 -07:00
Pragati Agrawal ed30f71e07 org_settings: Remove redundant success_continuation variable.
This removes all the instances of `success_continuation` from settings_org
and accordingly refactors some code.
2019-04-26 17:41:01 -07:00
Wyatt Hoodes d4715f23d7 public_export: Add backend API endpoint for triggering export.
An endpoint was created in zerver/views.  Basic rate-limiting was
implemented using RealmAuditLog.  The idea here is to simply log each
export event as a realm_exported event.  The number of events
occurring in the time delta is checked to ensure that the weekly
limit is not exceeded.

The event is published to the 'deferred_work' queue processor to
prevent the export process from being killed after 60s.

Upon completion of the export the realm admin(s) are notified.
2019-04-26 17:24:29 -07:00
Tim Abbott 8b5d2e9631 export: Return the S3 URL we uploaded data to.
This will make it possible to access that URL from the caller for the
data export tool.
2019-04-26 17:22:02 -07:00
Vishnu Ks 07291227d5 version: Bump PROVISION_VERSION for py packages upgrade. 2019-04-26 16:22:00 -07:00
Vishnu Ks 8d2a3e58d7 requirements: Upgrade moto from 1.3.7 to 1.3.8. 2019-04-26 16:22:00 -07:00
Vishnu Ks c99b82bae8 requirements: Upgrade setuptools from 40.8.0 to 41.0.1. 2019-04-26 16:22:00 -07:00