Commit Graph

61067 Commits

Author SHA1 Message Date
Lauryn Menard 240c4d85ae docs: Update existing links to use "channel" operator. 2024-10-11 17:00:23 -07:00
Aman Agrawal 592afffab4 message_events: Fix messages missing in combined feed.
When combined feed is cached, moving messages can cause some
messages to be missing.

This can be reproduced by moving messages from a muted stream to
non muted stream.

Fixed by updating all rendered message lists for the messages
that were moved.
2024-10-11 16:38:44 -07:00
Tim Abbott 3554afde36 api docs: Document can_manage_all_groups final semantics.
This also does the feature level 305 stamp.
2024-10-11 16:31:18 -07:00
Shubham Padia 2b6df48ebb user_groups: Split update members test into add/remove tests. 2024-10-11 16:31:18 -07:00
Shubham Padia c9d5276031 user_groups: Set can_manage_all_groups to administrator group.
Earlier we use to restrict admins, moderators or members of a group to
manage that group if they were part of the realm wide
`can_manage_all_groups`. We will not do that anymore and even
non-members of a group regardless of role can manage a group if they are
part of `can_manage_all_groups`.

See
https://chat.zulip.org/#narrow/stream/101-design/topic/Group.20add.20members.20dropdown/near/1952902
to check more about the migration plan for which this is the last step.
2024-10-11 16:31:18 -07:00
Shubham Padia 9bbd6a7316 user_groups: Check can_add_members_group when adding members.
Fixes #25942.
Users with permission to manage the group (either on the group level or
realm level) should be able to add members to the group without being
present in can_add_members_group.
2024-10-11 16:31:18 -07:00
Shubham Padia 8a2a8b64aa user_groups: Add can_add_members_group field to group create/edit. 2024-10-11 16:31:18 -07:00
Shubham Padia f134662312 user_groups: Check can_add_members_group before adding members.
Removing members will be controlled by `can_manage_group` until we add
`can_remove_members_group` in the future.

Users with permission to manage a group can add members to that group by
default without being present in `can_add_members_group`.
2024-10-11 16:31:18 -07:00
Shubham Padia b305ca14dd user_groups: Add add_can_members_group to user group.
The default value for this field that we wanted to have was that group
itlself. But we are deferring that to later in order to reach the point
of switching over to the groups system sooner. Till then, we will use
`group_creator` as the default. See
https://chat.zulip.org/#narrow/stream/101-design/topic/Group.20add.20members.20dropdown/near/1952904
for more details.

For migration plan details, see
https://chat.zulip.org/#narrow/stream/101-design/topic/Group.20add.20members.20dropdown/near/1952902

The increase in query count from 7 to 9 in the query count test for
creating a user group is because of group_creator being the default for
the new field.
2024-10-11 16:31:18 -07:00
Sahil Batra 553409c1ca settings_profile_fields: Move computations out of ListWidget code.
This commit moves the code to compute the profile field order and
the number of fields shown is user card, out of the list_widget
functions just to maintain the code readability and keeping code
easy to understand.
2024-10-11 16:17:06 -07:00
tnmkr 8af4366cc0 custom_profile_fields: Update admin table empty placeholder message.
Fixes #27250.
2024-10-11 16:17:06 -07:00
tnmkr 2c8b1adc5f custom_profile_fields: Migrate admin table to use ListWidget.
ListWidget will allow us to use our standard structure for empty table
placeholder.

This is a prep commit for #27250.
2024-10-11 16:17:06 -07:00
Prakhar Pratyush 55f97cd06f realm_export: Add support to create full data export via /export/realm.
Earlier, only public data export was possible via `POST /export/realm`
endpoint. This commit adds support to create full data export with
member consent via that endpoint.

Also, this adds a 'export_type' parameter to the dictionaries
in `realm_export` event type and `GET /export/realm` response.

Fixes part of #31201.
2024-10-11 13:20:42 -07:00
evykassirer 2367c46455 buddy_list: Fix bug where headers weren't being updated often enough.
`$(".buddy-list-subsection-header").children()` has length more often
than I had thought. Using the narrow filter is more direct way of
managing this state.
2024-10-11 13:16:45 -07:00
evykassirer d61ec2a0cc settings: Remove unused realm_create_private_stream_policy.
This was replaced with realm_can_create_private_channel_group in
e19524b and wasn't fully removed.
2024-10-11 13:15:36 -07:00
evykassirer 87835b81cb state_data: Flesh out types for realm_schema. 2024-10-11 13:02:45 -07:00
Karl Stolley 979e8ff5d2 inbox: Use plural for Direct messages header. 2024-10-11 12:54:21 -07:00
Kislay Udbhav Verma 8b7820ca71 resolve_topic: Change dialog button text.
We replace the comma in the buttons to an em dash.
This is a follow up to #31312.
2024-10-11 11:49:18 -07:00
Sahil Batra 7db6de340f settings: Clean schemas and types used for group settings.
Removed "type"/"Type" from schema and type names used
for group settings because we want to use "type"/"Type"
only for "type of a type" cases.

So, this commit renames-
- anonymous_group_type => anonymous_group_schema
- group_setting_type_schema => group_setting_value_schema
- GroupSettingType => GroupSettingValue

We also had duplicate definitions for GroupSettingType, in
state_data.ts and in settings_components.ts. So, removed it
from settings_components.ts.
2024-10-11 11:22:47 -07:00
Sahil Batra 96abf2501a user_groups: Handle live-update of group settings like other settings.
This commit updates live-update of group settings like we do for
stream and realm settings.

Current behavior is -
- If the save discard buttons are visible, meaning that the current
user was in the middle of changing a setting, then all the settings
elements are synced to the original value irrespective of whether
that setting was actual updated, including the setting which the
current user was changing.
- If the save discard buttons are not visible, then only the
element of updated setting is synced as it is not needed to
reset the UI for other settings.

We make the change similar to what we did for realm and stream
settings in 5da1e57fc2. 5da1e57fc2 did not had the changes
for group settings since we had only one group setting then
but now we have multiple settings.
2024-10-11 11:21:56 -07:00
Sahil Batra d7ad951172 settings_components: Compare group setting values correctly.
Since group setting value can be an object containing
direct_members and direct_subgroups fields, this code
updates check_group_property_changed function to use
isEqual to compare the setting values instead of using
"===".

This makes sure that save-discard widget is shown and
hidden as expected.
2024-10-11 11:21:56 -07:00
Sahil Batra 5a55735ecb users: Fetch user groups ordered by ID to send events.
The user groups, fetched to send events when deactivating or
reactivating a user, are ordered by ID so that we can avoid
flaky behavior in tests when verifying event details in
test_do_deactivate_user and test_do_reactivate_user tests in
test_events.py.
2024-10-11 11:20:45 -07:00
evykassirer 36183761f8 settings_notifications: Add specificity to select classname to justify type. 2024-10-10 14:36:07 -07:00
evykassirer 9dc0e55835 settings_notifications: Convert module to typescript. 2024-10-10 14:36:07 -07:00
evykassirer daf9954c8b notifications: Add specificity to notification_sound_elem.
This will help justify upcoming types in settings_notifications.ts
2024-10-10 14:36:07 -07:00
evykassirer 52b33868f1 settings_notifications: Pass currentTarget instead using e.target.
This function only uses `e` for its `target`, so it could instead be
passed the `HTMLInputElement` instead of the `JQuery.ChangeEvent`. The
caller is an event handler for the selector `"input, select"` and
`<input>` has no children, so there’s no difference here between
`.target` and `.currentTarget`.

This will be helpful for typescript, because `currentTarget` has
clearer typing.
2024-10-10 14:36:07 -07:00
evykassirer b5352df782 ui_util: Fix elem type in play_audio to match how it's called. 2024-10-10 14:36:07 -07:00
evykassirer faeee04472 settings_notifications: Initialize user_settings_panel to undefined instead of {}.
This will make the conversion to typescript easier.
2024-10-10 14:36:07 -07:00
evykassirer 9ee489700b buddy_list: Move invite users link to inside scrollable section.
Fixes #31653 (second half).
2024-10-10 14:34:11 -07:00
evykassirer 33cbaf598a buddy_list: Add three dot menu beside search button, with invite link.
Fixes part of #31653.
2024-10-10 14:34:11 -07:00
evykassirer 0dedd00112 buddy_list: Add span for search section of header.
This is in preparation for adding a three-dot menu to the header,
which we don't want to be a click/hover target in the way the
search parts are.
2024-10-10 14:34:11 -07:00
evykassirer 17252a70ed buddy_list: Un-nest menu icon styles, for ease of sharing. 2024-10-10 14:34:11 -07:00
Lauryn Menard 517b15dc8d help: Create "Configure send message keys" article.
Document setting the keys that will send a message or create a new
line when composting a message via the compose box and via the
personal settings overlay.

Updates links and redirect from former help center article about
this feature.

Fixes #31620.
2024-10-10 14:33:38 -07:00
Varun Singh f4de1c4313 personal_menu_popover: Convert module to TypeScript. 2024-10-10 14:07:57 -07:00
Varun Singh 9d2a82d477 personal_menu_popover: Remove unused field from function call.
The API structure does not contain the `user_id` field.
2024-10-10 14:07:57 -07:00
Aman Agrawal ec23f5e77b hello: Add interactive block showing basic usage.
Co-Authored-By: Vlad Korobov <terpimost@gmail.com>
2024-10-10 11:42:29 -07:00
Tim Abbott 3001f59d00 api docs: Clarify text about deactivated users and groups.
This should make it easier for client developers to understand
how to correctly implement the updated protocol.
2024-10-10 11:37:44 -07:00
Sahil Batra 7b27948518 user_groups: Live update members list if a member is deactivated. 2024-10-10 11:37:44 -07:00
Sahil Batra 4fe12c1860 user_group_settings: Remove redundant is_person_active check.
The "members" field for user groups sent by servers only include
active users, so there is no need for is_person_active check to
filter out the deactivated users.
2024-10-10 11:37:44 -07:00
Sahil Batra 4784c71bf9 user_groups: Do not allow updating memberships of deactivated users.
This commit updates backend code to not allow adding deactivated
users to groups including when creating groups and also to not
allow removing deactivated users from groups.
2024-10-10 11:37:44 -07:00
Sahil Batra 320081ccd6 mention: Do not include deactivated users in group mention data.
There is no behavioral changes to deactivated users as we do
not create UserMessage rows or call the notification code path
for deactivated users in a user group mention. But it is better
to not include the deactivated users in fields like
"mention_user_ids", so this commit updates the code to not
include deactivated users in the computed mention data.
2024-10-10 11:37:44 -07:00
Sahil Batra 0b58820294 user_groups: Do not include deactivated users in anonymous group settings.
This commit updates code to not include deactivated users in the
anonymous group settings data sent to clients, where the setting
value is sent as a dict containing members and subgroups of the
anonymous group.
2024-10-10 11:37:44 -07:00
Sahil Batra 9292ad8186 user_groups: Do not include deactivated users in members list.
This commit updates code to not include deactivated users in
members list in the user groups object sent in "/register"
and "GET /user_groups" response and also in the response
returned by endpoint like "GET /user_groups/{group_id}/members".

The events code is also update to handle this -
- We expect clients to update the members list on receiving
"realm_user/update" event on deactivation. But for guests
who cannot access the user, "user_group/remove_members"
event is sent to update the group members list on deactivation.
- "user_group/add_members" event is sent to all the users on
reactivating the user.
2024-10-10 11:37:44 -07:00
Sahil Batra b5732b90d6 create_user: Do not send reactivation event for inaccessible users. 2024-10-10 11:37:44 -07:00
Sahil Batra a7c534b1b8 events: Fix updating subscribers list when deactivating user.
We previously did not update the subscribers list for unsubscribed
and never subscribed streams when a user is deactivated or a
guest user loses access to some user.
2024-10-10 11:37:44 -07:00
Lauryn Menard 229212106f api-docs: Centralize history of realm message edit/move settings.
For the six realm settings mentioned in the main description of
the /api/update-message endpoint, link back to that page in the
/api/register-queue and /api/get-events endpoints. This way we
can maintain a centralized point of documentation for how these
settings work for message content edits and moving messages.

The descriptions in the events and register pages focuses on the
specifics for each realm setting, e.g., when a value is added or
changed for a particular realm setting.
2024-10-10 11:28:58 -07:00
Karl Stolley bef66b7c40 starred_messages: Match header to left-sidebar icon. 2024-10-10 11:26:46 -07:00
Kislay Udbhav Verma a787c7ff80 topic: Add a first-time explanation for "Resolve topic".
We show a confirmation dialog explaining the "resolve topics"
feature when the user marks a topic resolved for the first time.
If the user confirms the action, we mark the
topic resolved, else we don't.

We don't show anything the first time a topic is marked
unresolved.

Fixes #31242
2024-10-09 18:12:55 -07:00
Sayam Samal e0d685ce92 message: Improve the copy codeblock and playground buttons.
This commit improves the copy codeblock button and playground button
in the codeblocks to improve their visibility, particularly when on
top of some code.

Previously, the text under these buttons was difficult to select, as the
buttons would block the selection. This commit now hides these buttons
when a user clicks on any part of the codeblock, allowing to view the
code without any distractions, as well as, allowing the user to select
any part of the code.
2024-10-09 17:37:08 -07:00
Anders Kaseorg ca8d25f830 tests: Unmock realm_user_settings_defaults.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 16:33:38 -07:00