Commit Graph

58391 Commits

Author SHA1 Message Date
Sahil Batra 4ef3117191 invite: Fix comment mentioning textarea.
We no longer use textarea element to take emails in the invite
modal and instead use a pills.
2024-05-25 17:48:48 -07:00
Sahil Batra 5e347e971d invite: Remove code for old UI.
We still had some code in invite.ts for the textarea element
which was replaced by pill container, so this commit removes
that code.

This commit also removes the CSS for textarea and radion buttons
which are no longer present in the UI.
2024-05-25 17:48:48 -07:00
Sahil Batra 41409b7c4c invite: Remove unnecessary calls of toggle_invite_submit_button.
There is no need to call toggle_invite_submit_button while
changing inputs on the modal, or while selecting all streams
using the "Check all" button as the state of button is only
dependent on the input in email pill container and on which
tab is opened.
2024-05-25 17:48:48 -07:00
Sahil Batra 52ec8a0c2b invite: Fix button state when initially opening invite modal.
Previously, when the invite modal was opened with user having
permission to send email invites, the button at the bottom had
"Generate invite link" text. It should instead be "Invite" with
the button disabled since email invites section is opened by
default.

This was because the toggle_invite_submit_button was called
when the modal was not visible and thus calling `.is(":visible")`
for email pill container element returned false. This commit
changes it to pass the selected tab to toggle_invite_submit_button
to avoid computing which tab is opened by checking the element
visibility, attributes, etc. when the modal is not visible and
the tab container might not be present in the DOM.
2024-05-25 17:48:48 -07:00
Anders Kaseorg 8364cbe26d user_settings: Fix initialize_user_settings type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:24:22 -07:00
Anders Kaseorg dbfc980c82 realm_user_settings_defaults: Fix initialize type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:24:22 -07:00
Anders Kaseorg a5995a69f3 people: Fix get_custom_profile_data type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:23:00 -07:00
Tim Abbott 3bce9fd293 muted_users_ui: Rename misleading variable name. 2024-05-24 15:18:35 -07:00
afeefuddin 8a13bbd953 muted_users_ui: Convert module to TypeScript. 2024-05-24 15:18:35 -07:00
Alex Vandiver b7bf9e41c7 markdown: Catch urllib3 exceptions which are raised during streaming.
requests transforms the base urllib3 exceptions into
requests.RequestExceptions -- but only within code that it is
running.  When parsing the streaming body in fetch_open_graph_image,
the read itself (inside lxml) may trigger urllib3 to raise its own
timeout error -- which escapes the current catch of
requests.RequestExceptions.

Catch both requests and urllib3 exceptions.
2024-05-24 14:54:53 -07:00
Alex Vandiver c98bf184bb postfix: Increase the max message size to 25MB.
The default is 10MB[^1]; increasing this to 25MB aligns it with the
email mirror's internal limit.

[^1]: https://www.postfix.org/postconf.5.html#message_size_limit
2024-05-24 14:54:29 -07:00
Alex Vandiver c7f42de8ba cron: Monitor "command"s with sentry, now that they are one command.
These no longer involve any shell, so are safe to prepend with the
sentry wrapper.
2024-05-24 11:31:25 -07:00
Alex Vandiver f246b82f67 puppet: Factor out pattern of writing a nagios state file atomically. 2024-05-24 11:31:25 -07:00
Alex Vandiver 230040caa9 puppet: Remove check_postgresql_backup.
We have replaced this monitoring with the black-box wal-g monitoring,
which is more accurate.
2024-05-24 11:27:59 -07:00
Vector73 fef31614d3 zerver: Replace occurrences of uri with url in other templates.
This commit replaces occurrences of realm_uri with realm_url in
"context_processors.py" and related templates.

With by-hand translation updates for German (also updated in
Transifex) to avoid breaking the i18n system tests that use some
modified strings.

Co-authored-by: Junyao Chen <junyao.chen@socitydao.org>
2024-05-24 11:18:35 -07:00
Vector73 93262e03ad emails: Replace occurrences of uri with url in email templates.
This commit replaces occurrences of realm_uri with realm_url in email templates
and other related backend files.

Co-authored-by: Junyao Chen <junyao.chen@socitydao.org>
2024-05-24 11:18:35 -07:00
Alex Vandiver cb2a105de2 message: Respect first_visible_message_id when computing unreads.
This prevents unread counts for messages which the web UI does not
display, and does not let you mark as unread via "mark all as read."
2024-05-24 10:50:19 -07:00
Alex Vandiver e73e44402a export_search: Support --dm with one user, for all their DMs. 2024-05-24 10:49:52 -07:00
Alex Vandiver 2218de0399 management: Disable Sentry for management commands run interactively.
This adds `--automated` and `--no-automated` flags to all Zulip
management commands, whose default is based on if STDIN is a TTY.
This enables cron jobs and supervisor commands to continue to report
to Sentry, and manually-run commands (when reporting to Sentry does
not provide value, since the user can see them) to not.

Note that this only applies to Zulip commands -- core Django
commands (e.g. `./manage.py`) do not grow support for `--automated`
and will always report exceptions to Sentry.

`manage.py` subcommands in the `upgrade` and `restart-server` paths
are marked as `--automated`, since those may be run semi-unattended,
and they are useful to log to Sentry.
2024-05-24 10:30:16 -07:00
Alex Vandiver 88be3246a0 management: Move commands to all use ZulipBaseCommand. 2024-05-24 10:30:16 -07:00
Anders Kaseorg a68bc645ed filter: Don’t parse dm-including operand as a list.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 10:25:46 -07:00
evykassirer 825fa6f0e1 narrow_state: Remove narrowed_to_topic function.
This was only being used in one place in compose_closed_ui
to create the label for the closed composebox. But it
only checked if the `channel` and `topic` filters existed,
while `stream_sub` can return `undefined` for a few other
reasons. To ensure that we're catching the undefined sub
while also avoiding duplicate work, it makes sense to just
call `stream_sub()` directly.

Fixes this bug:
https://zulip.sentry.io/issues/5367251929/events/40073ecf007a4a9798e728061a576377/?project=450455688282112
2024-05-24 10:24:16 -07:00
Karl Stolley 852637d3b3 left_sidebar: Convert stream-privacy icon sizes to ems. 2024-05-24 10:23:41 -07:00
Karl Stolley d5a5044ecd left_sidebar: Improve icon alignment in stream rows. 2024-05-24 10:23:41 -07:00
Karl Stolley 0818aa759d icons: Correct whitespace around lock, vdots icons.
This fixes a perennial problem with a droopy lock icon, and better
situates the vdots in the box created in the SVG-to-font
conversion.
2024-05-24 10:23:41 -07:00
Karl Stolley dda75a56bc left_sidebar: Consolidate .stream-privacy styles. 2024-05-24 10:23:41 -07:00
Alex Vandiver 174ae2b409 zulip_update: Catch and carry on if a realm fails.
It is better to log the exception and _try_ all realms, than to fail
early due to a bad realm and fail to notify the rest.
2024-05-24 10:21:45 -07:00
Alex Vandiver 5c2fd1de5a docs: Update Django links to our current version. 2024-05-24 10:18:37 -07:00
Prakhar Pratyush 0ce79c8c50 message_edit: Update do_update_message codepath to send event on commit.
Earlier, we were using 'send_event' in 'do_update_message'
which can lead to a situation where we enqueue events but
the transaction fails at a later stage.

Events should not be sent until we know we're not rolling back.
2024-05-24 10:17:35 -07:00
Prakhar Pratyush bca8338ee1 do_update_embedded_data: Change send_event to send_event_on_commit.
Earlier, we were using 'send_event' which can lead to a situation
where we enqueue events but the transaction fails at a later stage.

Events should not be sent until we know we're not rolling back.
2024-05-24 10:17:35 -07:00
Aman Agrawal 29048bf19a compose: Prevent lingering textarea typeahead after sending message.
Compose textarea typeaheads don't hide when `Send` button is clicked.
If you type `@` and press send, mention typeahead is still visible.
This happens since the textarea is still focused after sending the
message while other input area trigger a `blur` event which hide
the typeahead for them.

We always call `clear_compose_box` wherever textarea is cleared
as a result of sending message. So, it is the right function to
hide the typeahead in.
2024-05-24 10:12:17 -07:00
Alex Vandiver e5a0b3b3c5 zilencer: Disambiguate no MX records from the domain not existing.
This switches to dnspython, since it offers the higher-level
`resolve_name` method to look up both A and AAAA records, and set
timeouts.
2024-05-24 09:34:31 -07:00
Alex Vandiver 9388805471 zilencer: Fix typo in variable name. 2024-05-24 09:34:31 -07:00
Alex Vandiver 9d66a8eb73 zilencer: Give a better error message for foo@example.com emails. 2024-05-24 09:34:31 -07:00
Anders Kaseorg a1895683b2 message_list_data: Fix _next_nonlocal_message type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 19:18:46 -07:00
Anders Kaseorg 24904f32bb message_list: Remove ids_greater_or_equal_than.
It’s unused since commit c876e12b86
(#23579).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 19:08:08 -07:00
Anders Kaseorg 9cee037f2a message_list: Remove nth_most_recent_id.
It’s unused since commit 748e5b6da6.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 18:56:59 -07:00
Anders Kaseorg 8f0dda3d4b e2e-tests: Fix check_compose_state arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 16:51:36 -07:00
Anders Kaseorg 931f515207 message_list_data: Fix type of first, first_including_muted.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 16:41:50 -07:00
Anders Kaseorg 26fd6be88f billing helpers: Add missing $ prefix to jQuery object parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 15:41:18 -07:00
evykassirer 27b5c61399 composebox_typeahead: Allow for undefined topic in PersonSuggestionOpts.
Fixes this error, which occured when editing DM messages and bringing
up the mention typeahead with "@"

https://zulip.sentry.io/issues/5389123227/events/46ab6c6ca68344ac89af7444fa0f8c39/?project=4504556882821120
2024-05-23 14:55:40 -07:00
Alex Vandiver 5f3d6ac983 sentry: More gracefully handle a value of 0.
If the value at runtime is actually an int, not a float, we should not
try to treat it as a dict.
2024-05-23 14:09:19 -07:00
Sahil Batra 959c78e1e1 invite: Fix rendering invite modal for realms without default channels.
The default channels checkbox only exists in DOM if there are default
channels in the realm, so we should make sure that we check whether
there are default channels in the realm before accessing the
checkbox element in set_streams_to_join_visibility.
2024-05-23 11:32:09 -07:00
Aman Agrawal e6c074e206 recent_view: Fix no topic found at center of recent view.
The bug is hard to reproduce, but I was able to reproduce with #30134
and used the same strategy to fix it here.
2024-05-23 10:39:27 -07:00
Aman Agrawal e530af5013 narrow: Fix combined feed selecting random messages on narrow.
Reproducer:

* Have some unreads in the Combined feed view.
* Scroll up and select a message that was not part of initial fetch.
* Reload.
* Go a another narrow.
* Come back to combined feed to find your at a random message. This
  message is actually last message of the current fetch of
  combined feed view which was returned via `first_unread_message_id`.
2024-05-23 10:37:29 -07:00
Aman Agrawal b22adc1d5f filter: Fix combined feed navigating to muted unread message.
Some we didn't have a check for if topic is muted here which
resulted in combined feed trying to navigate user to muted
unread message if it was the first unread in the narrow.
2024-05-23 09:17:40 -07:00
Vector73 62dfd93a83 api: Add "users/<int:user_id>/status" endpoint.
The documentation Creates a shared UserStatus schema that's used for
the return value of this new endpoint and for the existing user_status
objects returned by the register queue endpoint.

Co-authored-by: Suyash Vardhan Mathur <suyash.mathur@research.iiit.ac.in>

Fixes #19079.
2024-05-22 18:07:22 -07:00
Vector73 d6672c57ff user_status: Rename `get_user_status_dict` function.
Renames `get_user_status_dict` function to `get_all_users_status_dict`
to distinguish it from new `get_user_status` function.
2024-05-22 18:07:22 -07:00
Karl Stolley 20d6dd110a left_sidebar: Align more-topics indicator on topic grid. 2024-05-22 17:24:35 -07:00
Karl Stolley 50a7e3cf2c left_sidebar: Flatten renamed .sidebar-topic-name selector. 2024-05-22 17:24:35 -07:00