Commit Graph

51323 Commits

Author SHA1 Message Date
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
Alex Vandiver e5ae55637e install: Remove PostgreSQL 11 support.
Django 4.2 removes this support, so Zulip has not installed with
PostgreSQL 11 since 2c20028aa4.
2023-05-05 13:35:32 -07:00
Alya Abbott fd233bd33d help: Add numbers to single-step "Mesage drafts" instructions. 2023-05-05 13:30:51 -07:00
Alya Abbott 301e4c922d help: Add "Schedule a message" help center page.
Fixes #25407.
2023-05-05 13:30:51 -07:00
Alya Abbott 312912b535 help: Use standard formatting for button labels on /custom-emoji.md. 2023-05-05 13:30:51 -07:00
Aman Agrawal 36cb0f8a61 scheduled_messages: Don't narrow to recipient on "Undo".
Fixes #25401

We no longer try to narrow to the recipient of the scheduled
message when processing `Undo`. This does not affect editing
via scheduled messages overlay.
2023-05-05 12:54:35 -07:00
sbansal1999 2a3d4041e0 integrations: Improve GitHub force push notifications.
Previously, we didn't explicitly display something special for force-pushes.

Fixes #21969.
2023-05-04 14:31:25 -07:00
sbansal1999 dba6f84b97 integrations: Add force push fixtures for GitHub Integration.
One fixture is just removing commits; the other removes some commits
but adds others.
2023-05-04 14:31:25 -07:00
Karl Stolley 715fa3aff6 scheduled_messages: Extract options logic from popover.
This commit extracts date-based logic from the popover menu file and
puts it in with the scheduled-messages logic.

The aim is for greater testability, with some initial tests now
presented on the date-based logic.
2023-05-04 13:52:22 -07:00
Karl Stolley ac0bd7bb7d scheduled_messages: Show Monday option on Fridays and Saturdays.
On Fridays and Saturdays, users will be presented with the option
to schedule a message to send on Monday at 9:00 am.

Fixes: #25402.
2023-05-04 13:52:22 -07:00
Tim Abbott 2084a91af9 message_list: Don't show empty narrow message unless certain. 2023-05-03 18:40:59 -07:00