Commit Graph

61443 Commits

Author SHA1 Message Date
Alex Vandiver ed8058d060 message: Do not differentiate topics by case when aggregating. 2024-10-03 16:35:45 -07:00
Anders Kaseorg a8304fb324 sentry: Address Sentry JavaScript 7.x deprecations.
https://docs.sentry.io/platforms/javascript/migration/v7-to-v8/

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-03 16:09:48 -07:00
Shubham Padia e9b031c003 help: Refer to group settings for create/manage group at org level.
Right now, we are referring to the roles instead of groups since we have
not enabled that UI for these settings.
2024-10-03 15:18:40 -07:00
Aman Agrawal 1b47134d0d sponsorship: Fix `#organization-type` not found.
The sponsorship form is not visible once user submits the form,
hence we don't to call these functions.
2024-10-03 09:25:47 -07:00
Lauryn Menard 1e7f2fe6dd docs: Add missing links to web-public channels in dev community. 2024-10-03 09:15:51 -07:00
Anders Kaseorg 9c2da46966 filter: Fix unparse to round-trip Unicode whitespace operands.
Previously [{operator: "topic", operand: "one\xa0two"}] would be
unparsed to "topic:one\xa0two" which parses as [{operator: "topic",
operand: "one"}, {operator: "search", operand: "two"}], leading to
exceptions in the search pill system.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-03 09:14:31 -07:00
roanster007 81efecf463 stream_topic_history: Update history to only store acked message ids.
Previously, the "stream_topic_history" used to store unacked float
message ids as well in its "max_message_id" of stream and
"message_id" of topic histories.

This commit updates it to rather store only the acked message ids
here, and rather use the "echo_state" module so as to look up
for unacked messages in case of looking for recent topics, or
max message id in functions.
2024-10-02 18:31:32 -07:00
roanster007 da75fed5be echo: Start tracking local messages before updating sidebars.
Previously, when `insert_local_message` was called, the
data structures in the `echo_state` are updated with the new
local messages after calling `insert_new_message`. This would
update the stream sidebar before even updating the `echo_state`
with the new local messages.

This commit introduces `track_local_message`, which basically
updates the `echo_state` data structures with the local
message before actually updating the stream sidebar.

This is a preparatory commit to update stream_topic_history
to only contain acked message ids.
2024-10-02 18:31:32 -07:00
Tim Abbott 3f307f5941 message_view_header: Remove unnecessary complexity.
The narrow_state module has a function that returns what this needs.

This does remove a log statement, but I don't think it was useful; we
don't need to or have a useful way to colorize a channel that doesn't
exist.
2024-10-02 17:42:02 -07:00
roanster007 359ebfc6c8 filter: Refactor code path which adjusts the narrow containing `with`.
This commit refactors the `ensure_channel_topic_terms` of filter.ts.
Previously, this method used to add channel and topic terms, with
operands as placeholders in case the `with` narrow doesn't have
channel-topic terms.

This commit updates it to rather correct the narrow with the right
terms in case the channel-topic terms are missing in the `with`
narrow, but leave it as it is in case the channel-topic terms are
present, so that it can later be corrected if the channel-topic
terms are not pointing to the right conversation.
2024-10-02 16:22:59 -07:00
Sayam Samal 0a9ae964fe send_later_popover: Improve on-focus styling of enter send choices.
Previously, no custom styling was being applied to the enter send
choice options, which led to uneven styling from the other popover
options, as well as the outline ring being cut-off from the edges of
the popover. This commit fixes these issues by adding custom styling
for the outline ring when the enter send choice options are focused.
2024-10-02 14:35:37 -07:00
Sahil Batra e19f4ed2a8 user_groups: Do not allow click events on disabled pill container.
The typeahead should not open on clicking the pill container when
the container is disabled when the user is not allowed to change
the setting.
2024-10-02 14:23:37 -07:00
Alex Vandiver b4b1551b81 tusd: Do not delete the .info files.
These files are necessary for the protocol to verify that the file
upload was completed successfully.  Rather than delete them, we update
their StorageClass if it is non-STANDARD.
2024-10-02 13:21:04 -07:00
Tim Abbott 1ff14fd0f1 analytics: Pass subgroup=None to improve indexing.
Because the main indexes on end_time either don't include realm_id or
do include subgroup, passing an explicit subgroup=None for
single-realm queries to read CountStats that don't use the subgroups
feature greatly improves the query plans.
2024-10-02 14:11:44 -04:00
evykassirer 9c8cc8c333 buddy_data: Add participants to the top of sorted user list.
This was causing a bug where the participants weren't necessarily
all getting rendered, specifically when there were many subscribers
to a channel, because we render users in batches as buddy list
scrolls, and those users would only show up after some scrolling.

This fix makes sure we always load the participants first.
2024-10-02 09:33:48 -07:00
Aman Agrawal 8e5672dd98 message_view: Fix narrow to compose recipient rerenders in same narrow.
We don't rerender if we are already narrowed to the compose recipient.
2024-10-02 09:32:18 -07:00
opmkumar ee70cd8af3 saved_snippet: Prepopulate new saved snippet content.
Fixes #31827.
2024-10-02 09:30:18 -07:00
Tim Abbott 2807d7fbb8 dropdown_widget: Use CSS variable for disable color. 2024-10-01 18:21:33 -07:00
Tim Abbott 119fa699a7 message_view: Fix invalid target message assumption.
The target_message is just whatever message has the ID in a /near/ or
/id/ link; there's no guarantee it's a channel message.
2024-10-01 17:59:59 -07:00
Tim Abbott 0fa4cd9d09 message_view: Remove incorrect assert for p keyboard shortcut.
This happens routinely when the current view is not a DM view.
2024-10-01 17:47:45 -07:00
Shubham Padia b4d377a2fa settings: Test named and anonymous groups for org level group settings. 2024-10-01 17:35:14 -07:00
Shubham Padia 12ebd97f1f settings: Add group_creator as default for can_manage_group.
We create an unnamed user group with just the group creator as it's
member when trying to set the default. The pattern I've followed across
most of the acting_user additions is to just put the user declared
somewhere before the check_add_user_group and see if the test passes.
If it does not, then I'll look at what kind of user it needs to be set
to `acting_user`.
2024-10-01 17:35:14 -07:00
Shubham Padia 91edf59873 settings: Rename can_edit_all_user_groups to use `manage`.
Having both `manage` and `edit` terminologies was confusing, so
this commit ensures that we use `manage` wherever applicable.
2024-10-01 17:35:14 -07:00
Shubham Padia 4d06626b6f realm: Remove user_group_edit_policy from the backend.
Fixed #25929.
2024-10-01 17:35:14 -07:00
Shubham Padia b7764eb6f0 settings: Remove user_group_edit_policy from the frontend. 2024-10-01 17:35:14 -07:00
Shubham Padia f0b9d610a5 settings: Use `can_manage_all_groups` to control who can manage groups.
We also add the exception for the group creator to be able to edit their
group in this commit. This exception was added in the backend in earlier
commits.
2024-10-01 17:35:14 -07:00
Shubham Padia 6e9d56eaf4 user_groups: Check permission to manage groups based on group setting.
We also add exception for the group creator to manage groups. See
https://chat.zulip.org/#narrow/stream/3-backend/topic/Group.20creation.20-.20who.20can.20change.20the.20setting.2E/near/1943861
for more details. For the tests, wherever possible, we've just added an
acting_user when creating a group to test.
We've also added an acting_user argument to create_user_group_for_test.
We will not remove `user_group_edit_policy` yet. That will be removed
once we have introduced this setting to the frontend.
2024-10-01 17:35:14 -07:00
Shubham Padia 91953eca28 realm: Only owners should be able to configure `can_manage_all_groups`. 2024-10-01 17:35:14 -07:00
Shubham Padia 2b6414acfb settings: Add can_manage_all_groups setting to realm.
This commit does not add the logic of using this setting to actually
check the permission on the backend. That will be done in a later
commit.
Only owners can modify this setting, but we will add that logic in a
later commit in order to keep changes in this commit minimal.
Adding the setting breaks the frontend, since the frontend tries to find
a dropdown widget for the setting automatically. To avoid this, we've
added a small temporary if statement to `settings_org.js`.
Although, most lists where we insert this setting follow an unofficial
alphabetical order, `can_manage_all_groups` has been bunched together
with `can_create_groups` since keeping those similar settings together
would be nicer when checking any code related to creating/managing a
user group.
2024-10-01 17:35:14 -07:00
Shubham Padia a9e14a184c settings: Use `can_create_groups` to control who can create user groups. 2024-10-01 17:35:14 -07:00
Shubham Padia 17276e95a1 dropdown_widget: Allow passing is_setting_disabled in the template.
This is a preparatory commit to allow disabling
dropdown_widget_with_label for `can_create_groups` and
`can_manage_all_groups` for non-owners.
2024-10-01 17:35:14 -07:00
Shubham Padia 16389a2ab5 user_groups: Check permission to create groups based on group setting.
We will not remove `user_group_edit_policy` yet. That will be removed
once we have introduced a user group setting to manage edit permissions
to groups.
2024-10-01 17:35:14 -07:00
Shubham Padia 4a1b67804f realm: Default can_create_groups to moderators for education realms. 2024-10-01 17:35:14 -07:00
Shubham Padia d7d03628d0 realm: Only owners should be able to configure `can_create_groups`.
We might introduce a generic testing function similar to
do_test_changing_settings_by_owners_only later, but not right now, since
there is only 1 setting at the moment needing that test.
2024-10-01 17:35:14 -07:00
Shubham Padia fc46673f23 settings: Add can_create_groups setting to realm.
This commit does not add the logic of using this setting to actually
check the permission on the backend. That will be done in a later
commit.

Adding the setting breaks the frontend, since the frontend tries to find
a dropdown widget for the setting automatically. To avoid this, we've
added a small temporary if statement to `settings_org.js`.
2024-10-01 17:35:14 -07:00
Alya Abbott 2798b64b09 contributor docs: Clarify how to ask for an issue to be assigned. 2024-10-01 17:01:53 -07:00
Vector73 66113365a5 saved_snippets: Add new feature for saved snippets.
Fixes #31227.
2024-10-01 11:48:15 -07:00
Lauryn Menard 8301dcd421 compose-recipients: Resize compose box text area for placeholder.
When adding or removing recipients for a direct message, the
placeholder text may cause a change in the size of the compose box,
so this adds a call to `compose_ui.autosize_textarea` when setting
that placeholder attribute.
2024-10-01 10:29:16 -07:00
Lauryn Menard 4283207f6f help-relative: Add option for "Not subscribed" tab of channels overlay.
Updates the relative help link for "Browse and subscribe to channels"
in help center "Introduction to channels" article.

Fixes #31605.
2024-10-01 10:28:30 -07:00
Tim Abbott 2f8e2f77aa user_group_edit: Fix use of stream in user-facing string. 2024-10-01 10:25:59 -07:00
sanchi-t 84f9765b18 css: Remove non-existent class selctor. 2024-10-01 10:24:16 -07:00
sanchi-t 0f506eaf91 css: Refactor theme colors for `kbd`.
This change moves the light and dark theme colors for `kbd` to
CSS variables.
2024-10-01 10:24:16 -07:00
bao-qian d4b30e9e9d backup: Dereference symlinks when building tarball.
In docker-zulip installs, /etc/zulip/zulip.conf,
/etc/zulip/zulip-secrets.conf, and /home/zulip/uploads are all
symlinks into the `/data` directory which is mounted as a Docker
Volume.  By default, `tar` does not dereference symlinks, leading to
backups that are missing these critical pieces.

Add `-h` to the `tar` invocation, to follow symlinks, so backups in
Docker have all of their pieces.  Since none of the contents of the
backup intentionally use symlinks, this is safe.

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2024-10-01 09:51:54 -07:00
Sahil Batra f97da983cf user_groups: Handle inaccessible streams in group deactivation error.
If the user group being deactivated is used as a setting for a stream
which cannot be accessed by the user trying to deactivate the group,
we show "Unknown stream" in the banner mentioning where the group
is used.
2024-10-01 09:45:37 -07:00
Sahil Batra 58ab97a0b4 user_groups: Show details for group deactivation error.
This commit adds code to list the groups and streams
where the group is being used as settings in a banner.

The banner also mentions if the group is being used for
realm settings.
2024-10-01 09:45:37 -07:00
Sahil Batra b8a039ee99 user_groups: Include settings and supergroups in error response.
The error response when a user group cannot be deactivated due
to it being used as a subgroup or for a setting includes details
about the supergroups, streams, user groups as well the settings
for which it is used.
2024-10-01 09:45:33 -07:00
sanchi-t 19ba94b946 css: Refactor theme colors for `app_components`.
This change moves the light and dark theme colors for
`app_components` to CSS variables.
2024-10-01 09:41:22 -07:00
sanchi-t a8e809e63f css: Refactor theme colors for `.table-striped`.
This change moves the light and dark theme colors for
`.table-striped` to CSS variables.
2024-10-01 09:40:47 -07:00
sanchi-t 72971cda8e css: Refactor theme colors for `.demo-organization-warning`.
This change moves the light and dark theme colors for
`.demo-organization-warning` to CSS variables.
2024-10-01 09:40:47 -07:00
Sahil Batra c1973d2263 user_groups: Add access_user_group_to_read_membership.
This commit adds access_user_group_to_read_membership function
so that we can avoid calling get_user_group_by_id_in_realm with
"for_read=True" from views functions, which is better for security
since that function does not do any access checks.
2024-10-01 09:36:01 -07:00