Commit Graph

59461 Commits

Author SHA1 Message Date
Kenneth Rodrigues 07b54e986b topic: Focus on confirm dialog when merging topics.
Earlier `focus_submit_on_open` was set to `false` so even when the
`confirm_dialog` is open the `topic_edit_save` button is still in focus.
Therefore pressing enter causes the `topic_edit_save` button to be
pressed causing multiple `confirm_dialog` modals to be created.

This commit sets `focus_submit_on_open` to `true` so that the
`confirm_dialog` is in focus when it is opened and pressing enter
will cause the `confirm_dialog` to be closed.
2024-07-07 21:34:52 -07:00
roanster007 02d0566dc5 refactor: Rename `Huddle` Django model class to `DirectMessageGroup`.
This commit renames the "Huddle" Django model class to
"DirectMessageGroup", while maintaining the same table --
"zerver_huddle".

Fixes part of #28640.
2024-07-07 21:31:30 -07:00
Alex Vandiver 79f858b4b8 upload: Pass bytes to create_attachment.
This will be used to analyze the bytes for image metadata.
2024-07-07 14:40:07 -07:00
Alex Vandiver f97a30f240 upload: Reorder arguments to parallel upload_message_attachment. 2024-07-07 14:40:07 -07:00
Alex Vandiver f52a93bc14 upload: Stop requiring callers pass in the file size.
This can be calculated because we have the contents.
2024-07-07 14:40:07 -07:00
Alex Vandiver 58a9fe9af1 upload: Drop unused parameters to upload_message_attachment. 2024-07-07 14:40:07 -07:00
Alex Vandiver 0a296b2a6e upload: Start storing content-type for new uploads. 2024-07-07 14:40:07 -07:00
Alex Vandiver 45afdc2d35 attachment: Add a nullable content-type.
This will be backfilled in a future commit, to prevent walking the
Attachments more than once.
2024-07-07 14:40:07 -07:00
Alex Vandiver e29a455b2d avatars: Encode version into the filename.
Hash the salt, user-id, and now avatar version into the filename.
This allows the URL contents to be immutable, and thus to be marked as
immutable and cacheable.  Since avatars are served unauthenticated,
hashing with a server-side salt makes the current and past avatars not
enumerable.

This requires plumbing the current (or future) avatar version through
various parts of the upload process.

Since this already requires a full migration of current avatars, also
take the opportunity to fix the missing `.png` on S3 uploads (#12852).

We switch from SHA-1 to SHA-256, but truncate it such that avatar URL
data does not substantially increase in size.

Fixes: #12852.
2024-07-07 14:40:07 -07:00
Alex Vandiver feca9939bb s3: Support setting a cache-control on uploads. 2024-07-07 14:40:07 -07:00
Alex Vandiver 6258817bfd s3: Stop setting empty Content-Disposition header. 2024-07-07 14:40:07 -07:00
adnan-td 54be4443ae typeahead: Fix typeahead position not updating on pill remove.
Calls popper instance update method to refresh the position
of the typeahead menu.
2024-07-07 12:50:40 -07:00
Pedro Almeida ddfc2d230f resolve_topic: Prevent incorrect notification during message move.
This commit fixes the bug where the "topic unresolved" notification
is wrongly triggered when moving a message between a resolved and
unresolved topic, except for when the topics have the same name.

To resolve this issue, the commit ensures that resolved/unresolved
notifications are not sent if a message has been moved to a new
topic. This is achieved by comparing the names of the old and new
topics without considering the "resolved prefix".

The commit also accounts for the scenario where `new_topic_name`
has been truncated, indicating that it was resolved and the name
had to change to accommodate the "resolved prefix".

This solution does not try to specially handle the possible case that
a stream has two topics with the same name, even if one is resolved
and another unresolved.

Fixes #29007.
2024-07-07 11:38:14 -07:00
Pedro Almeida f4ca8025da move_stream: Trigger only move notification.
This commit updates the code so that only the moved notification is
triggered when moving a message between a resolved and unresolved
topic in different streams or when moving a topic itself.

This change takes place even when both stream change and resolve
or unresolve a topic takes place in the same API request, as we
now consider it only a move operation.

This fixes a case where a message is moved between topics that
have the same name, but one resolved and another unresolved and
in different streams. Previously a resolved or unresolved
notification would also be sent. Now, this will not happen,
ensuring only the move operation is notified.

Fixes part of #29007.
2024-07-07 11:38:14 -07:00
Varun Singh 8236ed8205 emoji_picker: Convert module to TypeScript. 2024-07-07 11:36:38 -07:00
Tim Abbott eee7c8a436 emoji_picker: Remove unused parameter to toggle_emoji_reaction.
This has been unused since it was introduced in
5bb10036b57bca36d531a74e8b03188d43ec7862; presumably leftover from a
previous version of the original PR.
2024-07-07 11:34:13 -07:00
Varun Singh a7b3dbfdd7 typeahead: Rework `sort_emojis` function.
When `sort_emojis` function was called from emoji_picker
module, the passed arguments did not contain `reaction_type`
field. As a result the first conditional of `is_popular` function
inside `sort_emojis` always failed -- hence the array
`popular_emoji_matches` was always empty`[]`. This compromised
search especially the order of filtered emojis.

Instead of checking for `reaction_type` === "unicode_emoji" -- we
check `is_realm_emoji` field is false. Since `is_realm_emoji`
field in always present and also results in easier types, this
should be prefered over adding `reaction_type` field to the passed
arguments.

Fixes zulip#30439
2024-07-07 11:33:41 -07:00
roanster007 99a80639f4 recipient_row: Remove extra whitespace around recipient full name.
This commit removes the whitespaces between "You and" and the
user full names, thus fixing the puppeteer flake.
2024-07-06 21:20:09 -07:00
Tim Abbott 0ea162c5fb migrations: Fix a duplicate migration number. 2024-07-05 17:26:27 -07:00
Shashank Singh 4cce94b667 invites: Add option to receive notification on accepted invitations.
Previously, when a referrer's invitation to Zulip was accepted,
they got a notification from notification-bot indicating
their invitation has been accepted.

This commit adds an option for referrer to decide
whether he wants to receive the direct notification
from the notification-bot.

Fixes: #20398
2024-07-05 17:14:45 -07:00
Pratik Chanda 5da629895f docs: Update locations for topic notification status.
This commit documents the updated location for topic notification
status and its icons in the help center docs.
2024-07-05 16:36:49 -07:00
Pratik Chanda a7703e9f5f left_sidebar: Open topic menu when clicking on follow topic icon.
Earlier, in left sidebar, clicking on followed topic icon would narrow
to the topic.

This commit introduces the ability to open topic status menu from
left sidebar from followed topic icon.

Fixes: zulip#28941.
2024-07-05 16:36:49 -07:00
Pratik Chanda 72f0695e34 tooltip: Fix topic status tooltip not showing on hovering.
Earlier, in recents view and inbox view, hovering over
`topic status button` didnot show `click to change notifications for this
topic` tooltip as it was supposed to.

This commit fixes the behaviour of tooltip not showing by adding a
tooltip for `recent_view` and `inbox-view` elements.
2024-07-05 16:36:49 -07:00
Pratik Chanda 3d8fac370e tooltip: Refactor recipient_bar_icon tooltip tooltip in message feed.
This commit refactors the `message_list_tooltip` for `recipient_bar_icon`
tooltip in message feed and scope it to `message_feed_container` class.

This is a preparatory commit for PR #30313.
2024-07-05 16:36:49 -07:00
PieterCK 0587855210 integration-docs: Update Grafana for new doc format.
Reformatted Grafana doc into 3 part sections. One for
creating the Zulip bot and webhook URL. One for setting
up Grafana version 8.3 and above and the last one for
setting up Grafana version 8.2 and below.

Part of #29592.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2024-07-05 16:22:19 -07:00
Kenneth Rodrigues fe2097fd26 zerver: Migrate several small files to typed_endpoint.
Migrate "submessage.py", "thumbnail.py", "tutorial.py", "zephyr.py" and
"dev_login.py" to `typed_endpoint`.
2024-07-05 16:18:57 -07:00
Kenneth Rodrigues defd6748d6 integrations: Convert to typed endpoint.
Migrate `integrations.py` and `webhooks` to typed_endpoint.
2024-07-05 16:18:27 -07:00
afeefuddin 5ff32c7ad0 user_group_create: Convert module to TypeScript. 2024-07-05 16:17:59 -07:00
afeefuddin 549e7db551 user_group_create: Don't return unused channel request object. 2024-07-05 16:17:59 -07:00
afeefuddin a01fcd3d94 user_group_components: Fix inaccurate parameter types in functions. 2024-07-05 16:17:59 -07:00
Varun Singh 48360291b0 user_group_edit_members: Initialise `users` data as empty arrays. 2024-07-05 16:15:17 -07:00
Varun Singh e03778141d stream_edit_subscribers: Initialise `users` data as empty arrays. 2024-07-05 16:15:17 -07:00
Pratik Chanda 897852f130 typeahead: Remove highlight for suggestions with empty query.
Earlier in typeaheads, empty query suggestions would highlight all
the available suggestions for person name and channel name.

This commit changes the behaviour so that empty query doesn't give
highlighted suggestions.
2024-07-05 16:13:58 -07:00
Lauryn Menard 601125e1ca help: Document "Unstar all messages" feature. 2024-07-05 16:07:03 -07:00
Karl Stolley d3b13cf15c message_controls: Reduce control button width to match padded icon. 2024-07-05 15:53:50 -07:00
Karl Stolley 79a2e0a1c4 message_controls: Scale on :active without disturbing clickable space. 2024-07-05 15:53:50 -07:00
Prakhar Pratyush ed605328fb onboarding: Mark a few onboarding messages as starred.
To improve onboarding experience following onboarding
messages are marked as starred:
* First message in each onboarding topic.
* Initial DM sent by Welcome bot

Note: The onboarding topic messages needs to be tracked
in 'OnboardingUserMessage' model to get starred.

Fixes #29298.
2024-07-05 15:39:32 -07:00
Prakhar Pratyush 3c5dc73f50 create_user: Mark only tracked onboarding topic messages as unread.
We give the user some messages in their feed, so that they can
learn how to use the home view in a realistic way.

For realms having older onboarding messages, we mark the very
most recent messages as unread.

This commit updates the logic to ONLY mark the tracked onboarding
messages (if present) i.e. messages tracked in 'OnboardingUserMessage'
as unread.

Fixes part of #29298.
2024-07-05 15:39:32 -07:00
Prakhar Pratyush ffc95204be create_user: Send initial realm messages before process_new_human_user.
This prep commit reorders code blocks in 'do_create_user'
to call the function 'send_initial_realm_messages' before
'process_new_human_user'.

This is required because for the first user (who creates realm)
we need to send the onboarding messages before adding message
history (performed by process_new_human_user) otherwise messages
won't be starred as required.

This commit also takes care of NOT marking the onboarding
messages as 'historical' for the realm creator.
2024-07-05 15:39:32 -07:00
Prakhar Pratyush 1fd6b09598 onboarding: Create OnboardingUserMessage rows during realm creation.
This commit updates the 'send_initial_realm_messages' function
to create OnboardingUserMessage rows corresponding to the
initial realm messages we send.

It helps to distinguish new onboarding messages from the
onboarding messages in the old realms.
2024-07-05 15:39:32 -07:00
Prakhar Pratyush fb836a4f0a onboarding: Add 'OnboardingUserMessage' model.
This prep commit adds a new OnboardingUserMessage model
that will be used to mark the new onboarding messages
for new users as unread and the first message of each
onboarding topic as starred.

This table won't include the old onboarding messages.
2024-07-05 15:39:32 -07:00
Prakhar Pratyush 485a8a1421 add_new_user_history: Add missing historical flags.
This commit adds the missing historical flag to recent
messages added in a new user's feed.

Reason:
* User didn't receive when they were sent, so semantically
the 'historical' flag should be present.
* It helps to avoid the "You (un)subscribed to.." bookend
while reading older messages.
The bookend appears whenever the historical flag flips
between adjacent messages. Earlier, the bookend was visible
between 'recent messages' and 'older messages'. This makes
sure that the bookend is visible only at the moment new
message is sent by the user after account creation.
2024-07-05 15:39:32 -07:00
Prakhar Pratyush f5a0755f16 create_user: Rename constants used in 'add_new_user_history'.
This commit renames the constants:
MAX_NUM_ONBOARDING_MESSAGES to MAX_NUM_RECENT_MESSAGES
MAX_NUM_ONBOARDING_UNREAD_MESSAGES to MAX_NUM_RECENT_UNREAD_MESSAGES
ONBOARDING_RECENT_TIMEDELTA to RECENT_MESSAGES_TIMEDELTA

The term 'onboarding' is preffered to be used for the
new messages sent during realm creation or new user creation.
These constants are related to already present recent messages.
2024-07-05 15:39:32 -07:00
Lauryn Menard 77d1d5cbe1 dev-tools: Add comma to use of "e.g." in populate_db description. 2024-07-05 15:36:24 -07:00
Lauryn Menard 3410584094 linter: Add check for comma after "e.g." in md files.
Adds a linter rule for markdown files so that new cases of "e.g."
without a comma wont be introduced to user-facing documentation.

Fixes the remaining cases of "e.g." in markdown files that are not
followed by a comma.
2024-07-05 15:36:24 -07:00
Lauryn Menard 6dfe063c91 integration-docs: Add comma to all uses of "e.g." in integration docs. 2024-07-05 15:36:24 -07:00
Lauryn Menard 2fab09639f templates: Add comma to all uses of "e.g." in corporate templates. 2024-07-05 15:36:24 -07:00
Lauryn Menard 62d452f983 docs: Add comma to all uses of "e.g." in contributor docs. 2024-07-05 15:36:24 -07:00
Lauryn Menard 2bb037f2a0 api-docs: Add comma to all uses of "e.g." in API docs. 2024-07-05 15:36:24 -07:00
Lauryn Menard f325a7667a help: Add comma to all uses of "e.g." in help center docs. 2024-07-05 15:36:24 -07:00