Commit Graph

51533 Commits

Author SHA1 Message Date
Hardik Dharmani 3a358a9a11 tooltips: Shift all tooltip templates to tooltip_templates.hbs.
Refactored all tooltip templates with static content to be in
tooltip_templates.hbs to avoid duplicate IDs and DOM element.

Fixes #25324
2023-05-09 11:10:58 -07:00
Lauryn Menard df17a1bf28 test-events: Test do_delete_message with no messages specified.
Test coverage for `zerver/actions/message_delete.py`.

Both callers of this function would already return if there were
no Messages specified to delete, which is why existing tests did
not cover this.
2023-05-09 09:58:33 -07:00
Hardik Dharmani 7ccfed65e8 tables: Fix table column dimensions on hover. 2023-05-09 09:41:34 -07:00
PALASH BADERIA f93cf330d4
mailmap: Add entry for Palash Baderia. 2023-05-09 09:39:46 -07:00
Alex Vandiver 89d4737ab2 message_edit: Do not reuse user_profile variable in "for" loop.
Doing so causes the "username resolved this topic" or "this topic was
moved by username" notifications to be attributed to a random user who
had a visibility policy on the topic.
2023-05-09 09:38:38 -07:00
Tim Abbott cce0c57a04 test-backend: Actions files should target full coverage.
We neglected to add this pattern when we split actions.py into a
directory.
2023-05-09 08:09:17 -07:00
Satyam Bansal 7f7c447d73 mailmap: Add entry for Satyam Bansal. 2023-05-09 07:47:44 -07:00
Tim Abbott f6b7d8e561 mailmap: Add many mailmap entries. 2023-05-09 07:46:03 -07:00
Joelute 591ac8570c mailmap: Add entry for Joseph Ho. 2023-05-09 07:38:10 -07:00
Ujjawal Modi 71bc4e831f mailmap: Add entry for Ujjawal Modi. 2023-05-09 07:36:24 -07:00
Lauryn Menard 02fafb0376 models: Update the references for API dicts for scheduled messages. 2023-05-09 07:36:05 -07:00
Mateusz Mandera 682a4d6f9e import_realm: Improve comment about sequencing of imported models.
The comment was outdated, currently we import UserProfiles before
realm_tables - because some models in realm_tables have a dependency on
UserProfile.

Also makes sense to elaborate a bit more in the comment that it's just
an outline of the ordering, not an exhaustive list.
2023-05-08 15:55:06 -07:00
Mateusz Mandera 0abf60fd01 scheduled_message: Make export/import work.
Closes #25130 by addressing the import/export part of it.
2023-05-08 15:55:06 -07:00
Mateusz Mandera 780ef71891 export: Fix typo in variable name. 2023-05-08 15:55:06 -07:00
Joelute 245c855376 user_setting: Update wording for "Mark messages as read on scroll" setting.
Previously, the user setting "Mark messages as read on scroll" sounded
quite awkward and possibly confusing at times. We should update the text
to something more clear and concise. This change will change "Mark messages
as read on scroll" to "Automatically mark messages as read".

The help center article is also fixed to name which setting is being
adjusted.
2023-05-08 15:49:47 -07:00
Tim Abbott 9e5c1eff4b scheduled messages: Fix incorrect mapping of 4PM to 16:00 hours. 2023-05-08 15:10:52 -07:00
Karl Stolley 466422800a scheduled_messages: Allow Today scheduling thru :54 past the hour.
This PR allows users to schedule Today messages from the modal opts
thru 8:54am (8:54) for sending at 9:00am, and thru 3:54pm (15:54) for
sending at 4:00pm. (That's including up to :59 seconds, of course, on
:54 after. So, XX:54:59.)

We also correct tests that were verifying incorrect logic of expecting
a 2PM cutoff, when we intended 4PM.

Fixes first part of #25451.
2023-05-08 15:10:52 -07:00
Karl Stolley a318e7cbf4 scheduled_messages: Don't offer to reschedule in the past.
This introduces a function that checks for both the existence and the
expiration of the `selected_send_later_timestamp`.

The logic it supports prevents users from scheduling a message to send
in the past or less than five minutes into the future at the level of
the UI (specifically the popover on the \vdots component of the Send
button). That can happen if a user attempts to edit a previously
scheduled message.

Fixes #25439.
2023-05-08 15:10:52 -07:00
Joelute 90bf36887a unread_banner: Update link on unread banners to direct users to setting.
Previously, the link on the unread banners redirected users to the help
center, instead we should change it so that it opens the display settings
up.
2023-05-08 15:00:20 -07:00
Joelute 9cabdf2033 dark_theme: Add dark themed colors to notice/info banners.
Previously, infomational banners didn't have any dark theme stylings which
resulted in a messy and terrible contrast with the dark themed app. These
changes adds those missing styles and uses the same stylings and colors
as the compose banners. Thus, making a definite improvement then before.
2023-05-08 15:00:20 -07:00
Hardik Dharmani 877c72add8 mailmap: Add entry for Hardik Dharmani. 2023-05-08 14:46:25 -07:00
Joelute 17252cc526 popover: Allow message actions menu to support larger max-width.
Previously, the option texts were split into 2 lines due to the lack of
space in the message menu. We want to fix this by increasing the max-width
of the menu so it can support the entire text in 1 line while also providing
additional space for longer text.

Since, 320px is the maximum supported supported width for mobile, we will
allow the max-width value to flex from 320px to 350px depending on the
window_width
2023-05-08 11:28:45 -07:00
Tim Abbott a97c4708e8 message_list: Fix incorrect fetch_status check.
Fixes a typo introduced in 2084a91af9.
2023-05-08 10:48:54 -07:00
Mateusz Mandera 414658fc8e scheduled_message: Handle attachments properly.
Fixes #25414.

We add Attachment.scheduled_messages relation to track ScheduledMessages
which reference the attachment.

The import bits can be done after merging this, by updating #25345.
2023-05-08 09:56:02 -07:00
Mateusz Mandera 4598607a46 test_uploads: Fix two typos. 2023-05-08 09:56:02 -07:00
Aman Agrawal c756e950c7 tippyjs: Hide recipient bar tooltips on msg_list rerender.
I noticed a floating "Go to direct message ..." on chat.zulip.org,
and then found out that these don't use message_list_tooltip.
2023-05-08 09:47:38 -07:00
Karl Stolley 2f1dd27eeb mailmap: Add entry for Karl Stolley. 2023-05-08 09:47:08 -07:00
Karl Stolley 8447aa747c scheduled_messages: Explicitly pass date to compute_send_times(). 2023-05-07 11:57:20 -07:00
Karl Stolley 3e2422c8fe scheduled_messages: Prepare proper sending timestamps in Node test.
This corrects the scheduled message test to ensure that each relative
day (today, tomorrow) has the correct GMT timestamp for 9am and 4pm.
2023-05-07 11:57:20 -07:00
Trident Pancake 4c3a6c7bb2 mailmap: Add entry for Danny Su 2023-05-06 09:07:55 -07:00
Hardik Dharmani b9611489ca node_tests: Extend unread.test.js to catch private message mentions bug.
In the "mentions" test, an additional unread message with the type
"private" and directly mentioning me has been added. This test case
checks for the scenario when the stream_id is null during the
reverse_lookup, which would have caused the test to fail before the
bug fix was implemented which now passes after the fix is applied.
2023-05-05 16:27:03 -07:00
Akarsh Jain b063779800 settings: Hide "Add a new emoji" button for unauthorized users.
This commit fixes the issue where the "Add a new emoji" button
was being displayed for users who did not have the necessary
permissions to add emojis. With this fix, the button will no
longer appear for unauthorized users, aligning with the
current behavior for bots and user groups.

Fixes #24918.
2023-05-05 16:22:24 -07:00
Tim Abbott 4566695b9d message_events: Clarify moved_message variable name. 2023-05-05 16:18:36 -07:00
Tim Abbott f9f68de0ac messages_events: Rename messages_to_rerender. 2023-05-05 16:18:36 -07:00
Sahil Batra 3992db5a19 message_edit: Editing topic from message header should move all messages.
Editing topic from message header should now move all the messages in
the topic and not just the messages below the recipient bar.
2023-05-05 16:18:36 -07:00
Sahil Batra 146f78a83d message_fetch: Return "first_unread" as backfill anchor for empty list.
We now return "first_unread" as anchor from get_backfill_anchor in
case when the message list is empty instead of throwing an error.
Doing this, would just result in fetching the messages normally like
it happens when a user narrows to a stream by clicking on it from
sidebar.

This also helps us handling the case, when all messages in the
current stream narrow are removed due to moving them, by fetching
the other messages from server for that stream narrow.
2023-05-05 16:18:36 -07:00
Sahil Batra 168680af23 message_events: Update code to handle messages not available locally.
Previously, if the client recieved an "update_messages" event with
"message_id" not present locally, then the event was completely
ignored. But, this can happen when moving messages especially
when doing a partial move due to time limit error.

This commit updates the code to have the code which requires the
message to be present locally run only if it is present instead
of just ignoring the event completely such that the updates for
moving the messages can be done.
2023-05-05 16:18:36 -07:00
Tim Abbott 57a89e5228 message_events: Fix buggy reuse of msg local variable.
The loop through the event_messages list, as well as a few smaller
loops, used this same variable name.
2023-05-05 16:18:36 -07:00
Alex Vandiver 94495bef18 log-search: Filter out /error_tracing endpoints. 2023-05-05 14:45:46 -07:00
Karl Stolley 5113f4e2e9 scheduled_messages: Render localized, streamlined modal opts.
This commit ensures that user-locale and 24-hour preferences are
respected in the message-scheduling modal. It also simplifies the
translation of text strings in the scheduling modal.

Available scheduling options and their time values, including whether
the options are allowed, are now calculated every time a user opens
the scheduling modal.

In order to achieve those things, additional interrelated fixes here
accomplish the following:

1. Modal-scheduling opts now have data- attributes containing
timestamps for the time a message will be scheduled to send.

2. With those timestamps in place, the logic for setting the
scheduled send-time is simplified.

3. There are no more `send_later_xxx` global variables in the
`schedule_send` module.

Fixes #25403.
2023-05-05 14:00:46 -07:00
Daniil Fadeev 96680e95fb message_edit: Display the error banners in the correct place.
Fixes: #25412.
2023-05-05 13:43:10 -07:00
Daniil Fadeev 0756ac9250 channel: Refactor xhr_error_message to accept message optionally. 2023-05-05 13:43:08 -07:00
Lauryn Menard a93598c22e narrow: Do not mark as read when narrowing by topic or recipient.
Previously, we've been assuming that when a user narrows to a topic
or recipient, that the target message would be marked as read in
resulting view. This is no longer a safe assumption because a user
can have their personal display settings to never mark messages as
read, even in conversation views.

Removes the call to `unread_ops.notify_server_message_read` in
both `narrow.by_topic` and `narrow.by_recipient` in the web app.
2023-05-05 13:36:31 -07:00
Alex Vandiver 65c552e55a ci: Rename focal job to describe all it does. 2023-05-05 13:35:32 -07:00
Alex Vandiver 4a9424b207 ci: Stop trying to pull out the default extra-args.
This was preventing the 20.04 install from actually happening, as
GitHub was folding the two into one configuration.
2023-05-05 13:35:32 -07:00
Alex Vandiver 7e637786b3 upgrade-postgresql: Only try to start new cluster if it is stopped.
pg_upgradecluster will start the cluster if the old cluster was
started before it ran, or if there are post-upgrade scripts to run.
Because neither of those are fully under our control, only attempt to
start the new cluster if it isn't already.
2023-05-05 13:35:32 -07:00
Alex Vandiver 40e5a12e3c upgrade-postgresql: Use jq rather than grep to check cluster status. 2023-05-05 13:35:32 -07:00
Alex Vandiver dffbd91452 ci: Test that the installed PostgreSQL was what was asked for. 2023-05-05 13:35:32 -07:00
Alex Vandiver 787c74d0b8 ci: Reduce number of places that hardcode Ubuntu and PostgreSQL versions. 2023-05-05 13:35:32 -07:00
Alex Vandiver f32e6543be ci: Install PostgreSQL 12 on focal.
The previous commit removed support for PostgreSQL 11, and PostgreSQL
10 support was removed in 11a86ec328.
2023-05-05 13:35:32 -07:00