Commit Graph

61201 Commits

Author SHA1 Message Date
Anders Kaseorg 71ca928ec9 ruff: Fix SIM115 Use a context manager for opening files.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-20 18:16:27 -07:00
Anders Kaseorg 10271fb850 ruff: Fix SIM910 Use `.get(key)` instead of `.get(key, None)`.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-20 18:16:27 -07:00
Aman Agrawal 1cc9947786 message_events: Don't update msg if we don't have it cached locally.
This fixes a bug where we try to rerender the anchor message even
if we don't have it locally cached which results in error.

The bug was introduced in #31942.
2024-10-18 14:46:59 -07:00
Prakhar Pratyush eaee5763d6 realm_export: Add realm_export_consent feature to API.
Fixes part of #31201.
2024-10-18 14:08:20 -07:00
Sahil Batra 70b6e46516 stream_create: Do not show banner if the current user is subscribed.
There is no need to show the banner if the user creating the channel
is subscribed to it because user will eventually be narrowed to
channel narrow and seeing the banner flash doesn't look good.
2024-10-18 10:20:32 -07:00
Sahil Batra 77c1204d45 stream_create: Remove banner shown on successful API request.
There was a banner showed on channel creation page on successful
completion of the API request, but we do not need that now since
we anyways move to a different UI, either the settings for the
created channel or to the message view narrowed to the new channel.
2024-10-18 10:20:32 -07:00
Alya Abbott 916ddd4832 help: Recommend unsubscribing from muted channels. 2024-10-17 15:54:20 -07:00
Alya Abbott a420169721 help: Document navigating to channel feed for unsubscribed channels. 2024-10-17 15:54:20 -07:00
PieterCK c9375fb5ee storage: Hash system bots avatar files.
This commit makes sure system bots avatar files are hashed when served
as static files. This way, requests for these avatar files will be
served with long-lived caching headers by our nginx (see #22275).

We don't need to worry about stale caches for these files because they
will only be used by system bots.

Fixes #31458.
2024-10-17 15:47:40 -07:00
Tim Abbott 46db52dc96 avatar: Use fixed avatars for system bots.
This makes a Zulip server more isolated than relying on gravatar, and
avoids complex logistics if in the future we move system bots to live
inside individual realms.

Co-authored-by: PieterCK <pieterceka123@gmail.com>
2024-10-17 15:47:17 -07:00
Alya Abbott 98ac036a5d portico: Fix typo. 2024-10-17 14:33:26 -07:00
Alya Abbott 9ab465c689 portico: Make "Get a demo" button easier to find. 2024-10-17 14:33:26 -07:00
Sahil Batra e5043b991a user_groups: Add API support to add subgroups during group creation.
This commit adds support to add subgroups to a group while
creating it.

User can add the subgroups to group irrespective of permissions
like user can add members during creating it.
2024-10-17 14:27:21 -07:00
Sahil Batra 1e818c4708 user_groups: Allow updating subgroups and members using same endpoint.
`POST /user_groups/{user_group_id}/members` now allows updating
subgroups as well.
2024-10-17 14:27:21 -07:00
Sahil Batra 47a611f989 user_groups: Check permission when adding subgroups.
This commit updates code to allow users with permission
to add members to add subgroups as well. And only users
with permission to manage the group can remove subgroups.

Also updated tests to check permissions in separate tests
and removed them from the existing test.
2024-10-17 14:27:21 -07:00
Sahil Batra 30e0c72919 test_user_groups: Remove incorrect comment.
The comment about non-admins and non-moderators who are not
member of the group cannot update subgroups of that group
is not correct since there is no such restriction now after
c9d527603. The test passes because the member user is not
part of can_manage_group or can_manage_all_groups.
2024-10-17 14:27:21 -07:00
Sahil Batra b748623a77 changelog: Fix request method for group members update endpoint.
Members of a user group can be updated using "POST" method for
"/user_groups/{user_group_id}/members" and not "PATCH".
2024-10-17 14:27:21 -07:00
Tim Abbott 010410c849 rocketchat: Validate custom emoji before larger data sets.
This is a data set that's relatively likely to have weird failures,
and also likely to be fairly small.
2024-10-17 12:25:18 -07:00
Tim Abbott 6e4da50577 rocketchat: Complete metadata verification before importing uploads.
This is not the best factored version of this, but it saves effort
changing the tests, and importantly should make failures involving
metadata only take a couple seconds rather than first doing a giant
BSON read before learning about them.
2024-10-17 12:25:18 -07:00
Tim Abbott 79b6f43d0e rocketchat: Move bson_code_options to a global variable.
This will make it a lot easier to only read files in when we actually
need them.
2024-10-17 12:25:18 -07:00
Aman Agrawal b93b05eddd pricing_model: Show `Contact sales` to already upgraded customers.
Customers who are already on a paid / sponsored plan will see
"Contact sales" on other paid plans.
2024-10-17 11:41:43 -07:00
Tim Abbott c4f5cd6552 migrations: Fix unnecessary loop in 0602. 2024-10-17 11:21:56 -07:00
evykassirer 7a53db8498 stream_create: Convert module to typescript. 2024-10-17 10:56:59 -07:00
evykassirer b27ce42f6d stream_create: Don't return anything from create_stream.
The return value is not being used anywhere.
2024-10-17 10:56:59 -07:00
Lauryn Menard fa36c7ffde todo-widget: Add TODO for inbound/outbound data schema refactor. 2024-10-17 10:53:26 -07:00
Sahil Batra fde8b2d2e0 stream_creation: Fix subscriber pills being too long.
The CSS for setting min-width was added in 63a7c9061b
to set the width of pill containers used for group
settings, but that also applied to pill containers of
subscribers in stream creation form.

This commit updates the CSS to be applied only for
settings in groups UI.
2024-10-17 10:52:58 -07:00
Karl Stolley 746042915a portico: Align mobile subhead colors with desktop. 2024-10-16 16:20:56 -07:00
Lauryn Menard be3ac06cf4 invite-user-modal: Add validation on custom time input.
Disables the submit button on the invite user modal if the custom
time input value is a negative number or if the number is not an
integer.

Also updates the text for when the invite expires so say that the
custom time value is invalid.
2024-10-16 15:21:40 -07:00
Lauryn Menard 7d5a715ddf settings-input: Move time input check helper to web/src/util.
Moves the helper function for converting a time input into a
number so that it can be reused in both modals and settings
components.
2024-10-16 15:21:40 -07:00
Lauryn Menard 8e3317d15a invite-user-modal: Update invitate expiration text once post render. 2024-10-16 15:21:40 -07:00
Lauryn Menard b8888d2c33 invite-user-modal: Generalize converting custom input into minutes.
Moves custom time input helper to `web/src/util.ts` so that it
can be reused for other modals where users can select a custom
time duration.

Co-authored by: Ujjawal Modi <umodi2003@gmail.com>
2024-10-16 15:21:40 -07:00
Lauryn Menard cc1a3eeec1 invite-user-modal: Internationalize custom time unit options.
Prep for using these values other modals, specifically the
deactivate realm modal.
2024-10-16 15:21:40 -07:00
Vector73 68dc914b6e users: Refactor `has_permission` function.
Refactored `has_permission` function to programmatically check if the `policy_name`
is a group-based setting.
2024-10-16 14:26:20 -07:00
Vector73 8d341d1af9 settings: Remove `move_messages_between_streams_policy` setting.
Removed `move_messages_between_streams_policy` property, as the permission
to move messages between channels is now controlled by
`can_move_messages_between_channels_group` setting.
2024-10-16 14:26:20 -07:00
Vector73 1be0cb1b75 settings: Add `can_move_messages_between_channels_group` realm setting.
Added `can_move_messages_between_channels_group` realm setting to replace
`move_messages_between_streams_policy`.
2024-10-16 14:26:18 -07:00
Harsh c1ec39f3ba invites: Extract helpers for accessing invites by ID.
This adds `access_invite_by_id` to retrieve the preregistration user
for email invites by id, and a parallel function for multi-user invites.
2024-10-16 14:06:32 -07:00
Prakhar Pratyush ed18175ce7 migration: Add migration to mark 'intro_resolve_topic' as read.
This commit adds a migration to mark the 'intro_resolve_topic'
modal as shown for users who have edited/moved a message previously.
2024-10-16 13:47:12 -07:00
Shubham Padia 1e85bec9a9 user_groups: Change cursor to not-allowed if cannot leave. 2024-10-16 13:43:03 -07:00
Shubham Padia 4a2f126af9 user_groups: Open group setting typeahead on clicking label.
Fixes #32007.
2024-10-16 13:43:03 -07:00
Shubham Padia 5980f4a502 user_groups: Show not-allowed cursor on labels also.
Fixes part of #32007.
2024-10-16 13:43:03 -07:00
Shubham Padia 8055617900 user_groups: Use group picker for can_mention_group. 2024-10-16 13:43:03 -07:00
Shubham Padia 05a6d7f870 user_groups: Reorder group permission settings.
Fixes part of #32007.
2024-10-16 13:43:03 -07:00
Shubham Padia 5508acfbbd user_groups: Reword tooltip message when user cannot leave group.
Fixes part of #32007.
On the group left sidebar, when a user cannot leave a group, make the
tooltip message same as the leave group button on the right side panel.
2024-10-16 13:43:01 -07:00
Shubham Padia 5c357a7f84 user_groups: Reword tooltip message when user cannot join group.
Fixes part of #32007.
On the group left sidebar, when a user cannot join a group, make the
tooltip message same as the leave group button on the right side panel.
2024-10-16 13:42:47 -07:00
Karl Stolley 9fe5f44b30 left_sidebar: Show DM header hover controls when zoomed in. 2024-10-16 13:41:15 -07:00
Karl Stolley ab1a8367f0 left_sidebar: Add uniform LONG_DELAY class. 2024-10-16 13:41:15 -07:00
Karl Stolley 6935c803c3 left_sidebar: Add New DM hover button to DM header row. 2024-10-16 13:41:15 -07:00
Lauryn Menard b70fb4a082 typing: Check empty topic string if realm has mandatory topics.
Before sending typing notifications to the server, if the realm
requires topics for channel messages, make sure that the topic
string is not an empty string in the compose box.
2024-10-16 09:41:55 -07:00
Mateusz Mandera 5cbdb10211 help: Fix incorrect link in help/change-your-email-address. 2024-10-16 09:41:04 -07:00
Sahil Batra f24f1bfd14 user_groups: Refactor code to check permission for updating groups.
Users with permission to manage the group have all the permissions
including joining/leaving the group, adding others group which also
have a separate setting to control them.

So, it makes sense to just check managing permissions first in
access_user_group_for_update and then check the specific permission.
There is no behavioral change in this commit, it only changes the
order of checking permissions.
2024-10-16 09:40:07 -07:00