Commit Graph

40163 Commits

Author SHA1 Message Date
Anders Kaseorg d13a039b54 actions: Sort available_notification_sounds.
os.listdir uses an arbitrary filesystem-dependent order.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-07 06:33:55 -05:00
Anders Kaseorg 42a9e473ae components: Allow passing labels as HTML (but explicitly).
Fixes the sorting button labels in stream settings, which were
regressed by commit f8fbae4d8e (because
the HTML was not marked as being HTML).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 20:12:57 -08:00
Aman Agrawal 6972b31721 subscription_members: Make the help text more clear. 2021-02-06 08:51:36 +05:30
m-e-l-u-h-a-n 0e6343c071 users: Clarify readability issues related to access_user_by_id.
zerver/lib/users.py has a function named access_user_by_id, which is
used in /users views to fetch a user by it's id. Along with fetching
the user this function also does important validations regarding
checking of required permissions for fetching the target user.

In an attempt to solve the above problem this commit introduces
following changes:
1. Make all the parameters except user_profile, target_user_id
   to be keyword only.
2. Use for_admin parameter instead of read_only.
3. Adds a documentary note to the function describing the reason for
   changes along with recommended way to call this function in future.
4. Changes in views and tests to call this function in this changed
   format.

Changes were tested using ./tools/test-backend.

Fixes #17111.
2021-02-05 17:31:45 -08:00
Nikhil Maske abff97df39 prod_settings_template: Standardize on no space after the "#" for settings lines. 2021-02-05 17:03:07 -08:00
Nikhil Maske 89b25556dc prod_settings_template: Move LDAP up into authentication, and merge part 1/2. 2021-02-05 17:02:27 -08:00
Nikhil Maske 6ad79b4f85 prod_settings_template: Merge the two "misc" sections into one.
Merge the two "misc" sections into one and place all the service
configurations next to each other. Place the TERMS_OF_SERVICE
and PRIVACY_POLICY at the bottom of the "misc" section.
2021-02-05 17:02:27 -08:00
Anders Kaseorg 87cbd3bf16 node_tests: Use MockDate in timerender test too.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 13:46:37 -08:00
Aman Agrawal 93889d9690 notificaiton_sounds: Add some atonal sounds created by @stwime.
Removed underscore from names.
2021-02-05 12:28:20 -08:00
Aman Agrawal 8baade439d notification_sounds: Add sounds created by @stwime.
These are all good notification sounds that may fit taste of
different users.
2021-02-05 12:28:20 -08:00
aryanshridhar ba197ec97e node_tests: Fixed failing rendered_markdown tests.
Follow up of #16451, since the changes in blueslip
were still referring to Moment as a library within the markdown.
2021-02-05 12:19:08 -08:00
Atharva Parkale 4b6a807925 docs: Fix a few grammar issues in translation guidelines.
Edited by tabbott to include the hunks that fix things.

Fixes #17144.
2021-02-05 11:51:49 -08:00
Abhijeet Prasad Bodas e8b4902c8a node tests: Refactor muting test in message_list.
This is a minor refactor in the muting test in
`message_list`.

The `unmuted_messages` function filters out messages only
considering topic mutes, and not stream mutes.
The test previously made it look like we were testing
stream muting, by stubbing the `is_topic_muted` on the
basis of `stream_id`.

This also replaces the stub and uses real data instead.
2021-02-05 11:17:46 -08:00
Abhijeet Prasad Bodas fd2bf0b31b refactor: Rename frontend muting stuff to include 'topic'.
This is a prep commit, which renames some variables
and functions involved in topic muting to include
the word "topic" in them.

This is done to have clarity when similar code
will be added as a part of the mute-user in
future commits.
2021-02-05 11:17:46 -08:00
Abhijeet Prasad Bodas 5eec4b23ac minor: Explicitly handle undefined date while muting a topic.
If we don't pass `date_muted`, we shouldn't calculate
date_muted * 1000. This code used to work because of
how javascript treats `undefined`.

This commit deals with the `date_muted=undefined` case
in a cleaner manner.
2021-02-05 11:17:46 -08:00
Abhijeet Prasad Bodas dbb69f76fa settings: Fix message not shown in empty muted topics list.
This commit fixes a small bug in the
settings/muted-topics pane.
When there are zero muted topics, the
"You have not muted any topics yet." message
was not shown.

This is fixed by adding the `required-text`
class to the table body.
The bug was introduced in 3bc818b9f7.
2021-02-05 11:17:46 -08:00
aryanshridhar f92f99d92d dependencies: Replace moment.js with date-fns.
Replaced methods/functions of moment.js with date-fns library.
The motive was to replace it with a smaller frontend timezone library.

Date-fns ~ 11.51 kb
moment.js ~ 217.87 kb

Some of the format strings change because date-fns encodes them
differently from how moment did.

Fixes #16373.
2021-02-05 11:04:32 -08:00
Suyash Vardhan Mathur 26a81ab3aa api docs: Display data type of responses in API Documentation.
Previously, the data type of responses wasn't displayed in the API
Documentation, even though that OpenAPI data is carefully validated
against the implementation. Here we add a recursive function to
render the data types visibly in API Documentation.
Fixes part of #15967.
2021-02-05 10:41:42 -08:00
Suyash Vardhan Mathur 38dc1131b9 api docs: Minor fixes in documentation.
Added some missing response names and type in additionalProperties.
2021-02-05 10:41:42 -08:00
Suyash Vardhan Mathur 63c13a8f13 api docs: Fix documentation of update-subscription-settings.
The responses for the API weren't being rendered from yaml, and were
incorrectly formatted in yaml. The parameters also weren't completely
included in yaml and needed to be moved. Made appropriate fixes in
yaml and markdown file.
2021-02-05 10:41:42 -08:00
Anders Kaseorg 764049657f docs: Add missing width to Zulip logo.
This is needed by Firefox.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:49:33 -08:00
IgnisDa 497e3c74f7 docs: conf.py: Add zulip logo to the sidebar.
This commit adds the Zulip logo to the readthedocs
documentation by adding an .svg file (taken from
zulip.com) to the `docs/images` directory.
Morever, it removes the name `Zulip` which was
written at the top of the sidebar because the
logo already has that.
2021-02-05 09:39:38 -08:00
Ganesh Pawar 7eeca9da46 provision: Add provision support for Ubuntu 20.10(Groovy).
PostgreSQL 13 is used when os_version is 20.10.
2021-02-05 09:30:34 -08:00
Ganesh Pawar 65e23dd713 puppet: Add Zulip specific postgresql configuration for 13.
Based on the work done in a03e4784c7.
2021-02-05 09:30:34 -08:00
Ganesh Pawar 90a3dc8a91 puppet: Add upstream version of postgresql 13 config.
This is a prep commit to add provision support for Ubuntu 20.10 Groovy.
2021-02-05 09:30:34 -08:00
Anders Kaseorg c1c9a2e8ee docs: Bump copyright year.
Also fix incorrect 2011 copyright years; the original Zulip, Inc. that
was merged into Dropbox, Inc. was incorporated in 2012, not 2011.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:28:15 -08:00
Anders Kaseorg 6ea11b003b license: Move copyright notice from LICENSE to NOTICE.
A LICENSE file is supposed to be an unmodified copy of the license,
and the license appendix explains that the copyright line should be
included with the notice.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:28:12 -08:00
Anders Kaseorg f8d11c6479 compose: Generate properly escaped HTML.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:26:47 -08:00
Anders Kaseorg 154fc03fa5 composebox_typeahed: Generate properly escaped HTML.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:26:47 -08:00
Anders Kaseorg dc0972b775 loading: Generate properly escaped HTML.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:26:47 -08:00
Anders Kaseorg 56d0d30387 hotspots: Generate properly escaped HTML.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:26:47 -08:00
Anders Kaseorg f8fbae4d8e components: Generate properly escaped HTML.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:26:47 -08:00
Anders Kaseorg 64b78ad992 styles: Use range context queries to eliminate *_max variables.
On a high-DPI display or with a non-default zoom level, the browser
viewport may have a width strictly between md_max = 767px and md_min =
768px.  Use only the *_min bounds for consistency.

This requires queries with strict inequalities to express upper
bounds (width < md_min).  Fortunately, that functionality is provided
by range context queries.  Unfortunately, those are not supported in
all browsers.  Fortunately, we can compile them away using
postcss-media-minmax.  Unfortunately, postcss-media-minmax currently
subtracts 1px for strict inequalities anyway to work around a Safari
rounding bug.  Fortunately, 0.02px should be sufficient for that, so I
submitted a PR:

https://github.com/postcss/postcss-media-minmax/pull/28

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:23:59 -08:00
Anders Kaseorg d679aa015d scroll_bar: Flip max-width queries for min-width.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 09:23:59 -08:00
Anders Kaseorg ae0afa2390 markdown: Explode config dict.
Commit 434094e599 (#11321) changed this
from an Extension to a subclass of Markdown, so it no longer has any
reason to use a config dict structured like that of an Extension.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-05 10:52:31 -05:00
ritik 50b0496a3a bitbucket webhook: Fully deprecate username field. 2021-02-05 09:46:27 -05:00
Vishnu KS 6a9e534a22 help: Clarify the number of invites one can send.
The 100 invite per day restriction is only for the free plan. Also,
the value 100 is configurable using
settings.INVITES_DEFAULT_REALM_DAILY_MAX. On top of this, newly
created realms on free plan combined can only send
INVITES_NEW_REALM_LIMIT_DAYS number of invites. So it's better not
to hardcode 100 in the doc.
2021-02-04 21:08:06 -05:00
marchantia 56bf5f2a50 docs: Fix typo in 'caching in zulip'.
Change 'These days are fetched in' to 'This data is fetched in'.
2021-02-04 21:00:13 -05:00
Anders Kaseorg aa650a4c88 js: Escape strings interpolated into CSS selectors with CSS.escape.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-04 11:00:06 -08:00
Steve Howell 9fc1adce60 node tests: Clean up subs test.
We start our stream_id sequence at 101, and we
clarify the somewhat strange assertions related
to the "active" class.
2021-02-04 13:55:34 -05:00
Steve Howell c407293577 node tests: Clean up hard coded stream_ids.
I use 101 for the stream_id (so less chance for
false positives) and avoid hard coding it.
2021-02-04 13:55:34 -05:00
Steve Howell 8a8bf636c6 node tests: Remove unnecessary zjquery stubs.
It's not clear to me why this code was necessary,
and I assume it was either originally written
with a bit of misunderstanding of how zjquery
works or it became unnecessary with some refactoring
of the "real" code.
2021-02-04 11:53:46 -05:00
Anders Kaseorg 3560eb90b2 node_tests: Fix #comepose-textarea typo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-04 09:24:13 -05:00
Anders Kaseorg 08fe6e4a8f blueslip: Pass through the return value in measure_time.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-04 09:11:04 -05:00
m-e-l-u-h-a-n ccf520ff13 logging: Migrate many backend tests to use assertLogs.
This commit  migrates some of the backend tests to use assertLogs(),
instead of mock.patch() as planned in #15331.

Tweaked by tabbott to avoid tautological assertions.
2021-02-03 17:55:49 -08:00
m-e-l-u-h-a-n 7417ac9165 logging: Remove unncessary logging patches in backend tests.
There were some tests that had mock patches for logging, although no
logging was actually happening there. This commit removes such patches
in `corporate/tests/test_stripe.py`, `zerver/tests/test_cache.py`,
`zerver/tests/test_queue_worker.py`,
and `zerver/tests/test_signup.py`.
2021-02-03 17:47:38 -08:00
Steve Howell c2e3d626e2 node tests: Move data setup to module level for peer_data.
We move some of the data setup to the top of the file.

We also remove some get_sub() calls that aren't really
necessary now that peer_data and stream_data are more
independent.
2021-02-03 15:23:17 -08:00
Steve Howell 17ea215f18 minor: Remove peer_data.clear(). 2021-02-03 15:23:17 -08:00
Steve Howell 58855e8224 refactor: Remove maybe_clear_subscribers().
The maybe_clear_subscribers() function was an artifact of
when we used to attach subscribers to the "sub" records in
stream_data.js.  I think it was basically a refactoring
shim, and due to some other recent cleanup, it was only
used in test code.

We also change how we validate stream ids.

Going forward, peer_data just looks up stream_ids with the
normal stream_data API when it's trying to warn about
rogue stream_ids coming in.  As I alluded to in an earlier
commit, some of the warning code here might be overly
defensive, but at least it's pretty self-contained.
2021-02-03 15:23:17 -08:00
Steve Howell e44e48ef20 minor: Add get_user_set call that I missed earlier.
In my recent commit to introduce get_user_set() I
inadvertently skipped one place to call it.

I also remove a return statement that was made
unnecessary by the new get_user_set() helper.
2021-02-03 15:23:17 -08:00