Commit Graph

63435 Commits

Author SHA1 Message Date
evykassirer
92358f4793 stream/usergroup settings: Use em for exit button spacing. 2025-02-12 12:18:36 -08:00
evykassirer
6323b11448 settings: Use em for left panel icon spacing. 2025-02-12 12:18:36 -08:00
evykassirer
84ddd9f5e4 settings: Use em for exit button spacing. 2025-02-12 12:18:36 -08:00
evykassirer
9f9fc10e23 banners: Use em for font size. 2025-02-12 12:17:26 -08:00
evykassirer
2ccf9147bd inbox: Remove background on exit button hover. 2025-02-12 12:16:14 -08:00
evykassirer
b12ec2b692 right_sidebar: Use em for triple dot menu size. 2025-02-12 12:15:54 -08:00
Sahil Batra
7eeb8a2c26 settings: Add personal setting to show or hide AI features.
Fixes #33231.
2025-02-12 12:05:04 -08:00
Sahil Batra
4ca28bb850 settings: Add setting to control permission for topic summarization. 2025-02-12 12:05:04 -08:00
Sahil Batra
9b38444e42 register: Add server_can_summarize_topics to response.
We now pass a new field in register response to tell
clients whether summarizing topics is enabled for the
server or not.
2025-02-12 12:05:04 -08:00
Karl Stolley
be5c81286c rendered_markdown: Offset ordered lists by start and count.
Fixes #33424
2025-02-12 10:32:26 -08:00
Karl Stolley
1c7b1187df rendered_markdown: Better handle list-offsets for i18n. 2025-02-12 10:32:26 -08:00
evykassirer
c4c3228eac markdown: Use em for left-margin of numbered lists. 2025-02-12 10:00:41 -08:00
Mateusz Mandera
ac0af8d5ff install: Replace RTD links with our new permalinks. 2025-02-12 09:50:52 -08:00
Mateusz Mandera
a6f1916ab1 docs: Add endpoint for permalinks to some push notifs docs.
This will gives us the flexibility to edit our documentation, including
section names, without worrying about breaking links to docs hard-coded
in older releases / deployed self-hosted servers.
2025-02-12 09:50:52 -08:00
Alya Abbott
8f7c968408 help: Update self-hosted billing instructions.
Remove most references to Server 8.0 (not relevant for new installs).
2025-02-12 09:41:20 -08:00
Prakhar Pratyush
8a14018442 drafts: Show empty string as topic when realm_mandatory_topics=true.
Earlier, we were displaying `realm_empty_topic_display_name` as the
topic name when topic="".

This was not the expected behavior when `realm_mandatory_topics=true`.

This commit updates the logic to show empty string in such cases.
2025-02-12 09:37:51 -08:00
Prakhar Pratyush
0e284464f1 api_docs: Improve docs related to mandatory topics. 2025-02-12 09:37:21 -08:00
Shubham Padia
552b464de7 stream: Notify all users with metadata access when unarchiving. 2025-02-12 09:35:17 -08:00
Shubham Padia
1db2487f1c stream: Guest users cannot get metadata access to channel via groups. 2025-02-12 09:35:17 -08:00
Tim Abbott
77d3029ec5 streams: Exclude guests from permissions groups access.
This adds missing enforcement and explanatory comments regarding
`allow_everyone_group` for these permissions code paths.
2025-02-11 15:09:16 -08:00
Tim Abbott
19c7b50d77 stream_data: Rename can_administer_accessible_channel. 2025-02-11 15:09:16 -08:00
Shubham Padia
75729ae328 stream_data: Split can_change_permissions into two functions.
Previously, we were passing an argument called `require_content_access`
which was becoming difficult to read when used. This commit solves that
problem.
2025-02-11 15:09:16 -08:00
Shubham Padia
d82f595e51 stream: Disable permissions that require content access.
Disable privacy settings and can_add_subscriber_group when an admin does
not have content access to the channel.
We are going to add `can_subscriber_group` in the future which will also
require content access to change and that's why we have used
`stream_group_permission_settings_requiring_content_access` to keep the
list of such group settings.
We only show the warning banner now if the user cannot edit any of the
channel properties. For more details, see
https://chat.zulip.org/#narrow/channel/101-design/topic/Warning.20for.20settings.20that.20cannot.20be.20changed.2E
2025-02-11 15:09:16 -08:00
Shubham Padia
f94608677f stream_data: Use can administer channel for can_unsubscribe_others.
Previously, we were just checking whether a user was realm admin for
`can_unsubscribe_others`, now we also check whether they are a channel
admin for the said channel.
2025-02-11 15:09:16 -08:00
Shubham Padia
c97495c7ae stream_data: Use has_content_access for can_subscribe_others. 2025-02-11 15:09:16 -08:00
Shubham Padia
b786e70b89 stream_data: Add content/metadata access argument to change permission.
We are making this change with default set as true, since that is the
behaviour other functions are expecting. We are not making any behaviour
changes in this commit on where metadata access should be check or where
content access should be checked for this function's usage. That will be
done commit by commit for different functions using
`can_change_permissions`.
Accepting `require_content_access` makes it a bit hard to read at other
places where the argument is passed as just true or false without
knowing what the argument is for, but it was just a choice when writing
the code. We will refactor this current function into two functions in
the upcoming commits and solve that problem.
We've also removed `can_edit_description` from `stream_data` but we have
kept around `can_change_name_description` in `stream_settings_data`.
Since `can_edit_description` was just used at once place, it didn't make
much sense to keep it around, but we kep around
`can_change_name_description` since we've already done the work to have
fine tuned permissions for that setting and we don't want to undo that
work.
2025-02-11 15:09:16 -08:00
Shubham Padia
f5bcaacfc3 stream_data: Add has_content_access function.
This function will be used to check whether a user has access to a
channel's content in future commits.
2025-02-11 15:09:16 -08:00
Shubham Padia
03bfa7752d stream_data: Use has_metadata_access for can_view_subscribers.
We are using `has_metadata_access` one by one in different functions in
stream_data where possible. This commit does not represent the
exhaustive use of `has_metadata_access`.

We have kept around the `can_view_subscribers` function even though it
is the same as `has_metadata_access` right now. Since we've already done
the work of using `can_view_subscribers` at appropriate places, it would
be good to keep that work around in case that function's underlying
implementation changes in the future.
2025-02-11 15:09:16 -08:00
Shubham Padia
29a1a01325 stream_data: Add has_metadata_access function.
This function will be used in upcoming commits to determine whether a
user has access to a channel metadata or not. This function does not
give access to channel's content.
2025-02-11 15:09:16 -08:00
Shubham Padia
6e588b5b4a openapi: Make stream setting groups documentation up-to-date. 2025-02-11 15:09:16 -08:00
Shubham Padia
cbd23cc535 stream: Notify guest add subscribers group users for public channels.
For the test, we've only modified `test_rename_stream` to test for this
+ the guest susbcriber test case that was missing.
2025-02-11 15:09:16 -08:00
Shubham Padia
596aa2d357 subscription: Do not prefetch recursive user ids for single stream.
Pass a UserGroupMembershipDetails object to store
`user_recursive_group_ids` and fetch it only once max.
2025-02-11 15:09:16 -08:00
Shubham Padia
3893dcfcb8 stream: Do not send redundant events to users with metadata access.
When a user gets access to a private channel, they get a stream creation
event. Channel admins and users in `can_add_subscribers_group` already
have metadata access to a private channel and therefore do not need to
be notified.
2025-02-11 15:09:16 -08:00
Shubham Padia
33ea2b366e user_groups: Add function to get union of members of two groups.
This helps us important database queries when we want to perform a union
on the members of multiple user groups.
2025-02-11 15:09:16 -08:00
Shubham Padia
121af1c815 stream: Pass group id to get recursive group members.
Previously, we needed to pass the group to the function, which sometimes
meant having 1 extra query to fetch the user group when we just needed
the group id for this function.
2025-02-11 15:09:16 -08:00
Shubham Padia
35f9305acb stream: Modify flag to allow access for users with metadata access. 2025-02-11 15:09:16 -08:00
Shubham Padia
9725de99e9 stream: Move bulk_get_subscriber_peer_info to subscription_info.
We were not able to use
get_user_ids_with_metadata_access_via_permission_groups in the function
in question due to a cyclic dependency to `lib/streams.py`.
2025-02-11 15:09:16 -08:00
Shubham Padia
aabf42c2ce stream: Show private channel for their channel admins.
Fixes https://chat.zulip.org/#narrow/channel/101-design/topic/permissions.20for.20admin.20to.20unsubscribe.20others/near/2060197
Non realm admin users were not able to view private channels they were
an administrator of but not subscribed to it. This commit changes that.
We also made changes for those users to be able to see the subscribers
list.

The increase in query count in test_home and test_event_system can be
mitigated by only fetching recursive user group ids when needed within
the `validate_user_access_to_subscribers_helper` function. But that
would require refactoring that function to handle multiple streams and
subscriptions at once, along with changing how that function is used at
different places, which might be an exercise better left as a follow up.
We have optimised the code a little bit by not fetching the group ids in
case the current user is a realm admin.

We are fetching channel_admin_ids and users belonging to
can_add_subscribers_group directly in stream_subscription.py without
using the helper function
`get_user_ids_with_metadata_access_via_permission_groups`. This is due
to a cyclic dependency and we will move `bulk_get_subscriber_peer_info`
to another file in the next commit.
2025-02-11 15:09:16 -08:00
Shubham Padia
48eec43f48 stream: Notify users with metadata access on unarchiving stream. 2025-02-11 15:09:16 -08:00
Shubham Padia
f6301c24fe stream: Notify users with metadata access for lib/streams.py.
Users in `can_administer_channel_group` and `can_add_subscribers_group`
have access to private channel metadata. They should be notified of
relevant events.
We've only made relevant changes to lib/streams.py in this commit to
make the changes small and reviewable.
2025-02-11 15:09:16 -08:00
Shubham Padia
ca1aba9fc3 stream: Allow realm & channel admins to change private channel setting.
Previously, realm and channel admins were not able to change settings
for a private channel they were not subscribed to. This commit changes
that.

We have only added the exception for can_add_subscribers_group
and not privacy settings.

We also need proper functions with proper terminologies for content
and metadata access.
2025-02-11 15:09:16 -08:00
Shubham Padia
4d02a082a0 stream: Users with permission to administer can unsubscribe others.
We've also converted the function to check for permission to unsubscribe
others to accept a list of streams instead of checking each stream one
by one.
2025-02-11 15:09:16 -08:00
Shubham Padia
0f51b029a0 stream: User with just can add permissions should be able to add. 2025-02-11 15:09:16 -08:00
Shubham Padia
9e09a240d7 stream: Pass is_subscribed to check_basic_stream_access.
Earlier, we were passing the whole subscription object to the function
in order to check if the user was subscribed or not. In the future
commits, we want to check that without fetching and passing the complete
subscription object and this commit will help us do that.
2025-02-11 15:09:16 -08:00
Shubham Padia
98c5243c9b stream: Refactor to use functions for administer and add subscribers. 2025-02-11 15:09:16 -08:00
evykassirer
6abc61f91a subscription settings: Collapse header into two rows at narrower screens.
This commit also fixes #29514 by adjusting the height of the
stream list based on which state (one row header or two row
header) is being displayed.
2025-02-11 14:58:17 -08:00
evykassirer
afd30ab4a4 inbox: Position search clear button with em. 2025-02-11 14:57:14 -08:00
evykassirer
020e8d9403 subscription settings: Use em for width and height of channel color. 2025-02-11 14:56:35 -08:00
apoorvapendse
1b11d3c017 composebox_typeahead: Optimize select calls for Escape.
This ensures that select is invoked on pressing `Esc`
only when we are completing the stream+topic typeahead.

Fixes: https://github.com/zulip/zulip/pull/32217#discussion_r1934905517.
2025-02-11 10:18:20 -08:00
Vector73
55f1c2d90f saved_snippets: Fix Enter click on "Create a new saved snippet" button.
Using "Enter" key to click on "Create a new saved snippet" does not work
when the dropdown list is empty. This commit fixes that bug.
2025-02-11 10:17:06 -08:00