Commit Graph

54057 Commits

Author SHA1 Message Date
Alex Vandiver a21971ceae config_error: Split error pages into their own pages.
This is much easier to maintain than a giant set of if statements.
2023-10-11 17:13:01 -07:00
Alex Vandiver 5506dffa36 config_error: Coalesce redundant dicts. 2023-10-11 17:13:01 -07:00
Alex Vandiver 536aa32255 views: Extract config_error view function. 2023-10-11 17:13:01 -07:00
Aman Agrawal c16d727fd4 stream_settings_ui: Avoid two scrollbars.
Fixes #26823

Fixes user card not displayed on last item in the subscribers list.
This was happening because there wan not enough space below the
user name for the popover to be displayed (as far as I understand this).

Regardless of the fix above, this seems like a nice change.
2023-10-11 16:25:27 -07:00
Sayam Samal 1cf2c4134e tooltips: Add period (.) to last edited/moved notice. 2023-10-11 16:23:16 -07:00
Sahil Batra ea05755431 settings: Live update lock icon on changing bot creation policy.
This commit adds code to live-update the lock icon for "Bots"
panel in organization settings when "Who can add bots" setting
changes.

Fixes #24393.
2023-10-11 16:22:37 -07:00
Sahil Batra 1080da08f0 settings: Fix live-update of text on the bots admin page.
We did not live-update the text on the top of admin bots page
correctly when changing the bot creation policy. This commit
fixes it.
2023-10-11 16:22:37 -07:00
Sahil Batra 4b23ac2743 settings: Update lock icon when "Who can add emoji" setting changes.
This commit adds code to live-update the lock icon for "Custom emoji"
panel in settings when "Who can add custom emoji" setting changes.
2023-10-11 16:22:37 -07:00
Sahil Batra 0bd2d0b6a9 settings: Add code to live-update lock icon on changing role.
This commit adds code to live-update the lock icon in settings
left sidebar when a user's role changes.
2023-10-11 16:22:37 -07:00
Sahil Batra e14b9e368a settings: Use tippy for tooltips on lock icons.
This commit update tooltips shown on lock icons in settings
sidebar to use tippy instead of using html title attribute.
2023-10-11 16:22:37 -07:00
Sahil Batra 17e0b6621b settings: Update tooltip on lock icon shown for custom emoji panel.
This commit updates the tooltip for icon shown for custom emoji panel
to change the text to "You do not have permission to add custom emoji"
instead of just mentioning always that only admins can add them
even when we have other options like "Admins and moderators".

This also fixes the condition of showing or hiding the lock icon
to use the correct setting value and not the old setting
add_emoji_by_admins_only.
2023-10-11 16:22:37 -07:00
Alex Vandiver 50c80c6ff9 test_signup: Use verify_signup helper when possible. 2023-10-11 16:08:43 -07:00
Alex Vandiver e8405c6f7b test_signup: Fix docstring on a test. 2023-10-11 16:08:43 -07:00
Alex Vandiver 2f61a70102 test_signup: Use verify_signup helper. 2023-10-11 16:08:43 -07:00
Alex Vandiver 2952595234 test_signup: Clean up test name and docstring. 2023-10-11 16:08:43 -07:00
Alex Vandiver 89b7f9cbd0 registration: Handle race conditions with duplicate emails.
Two registration requests for the same email address can race,
leading to an IntegrityError when making the second user.

Catch this and redirect them to the login page for their existing
email.
2023-10-11 16:08:43 -07:00
Alex Vandiver b49938265f backup: Only pass --host and --port if non-empty.
This works around the `/usr/bin/pg_dump` failure described in the
previous commit.  Since we are now calling the appropriately-versioned
`pg_dump` binary directly, it is no longer "necessary", but is added
as a defense-in-depth.
2023-10-11 11:50:56 -07:00
Alex Vandiver 3a8b4b0205 backup: Call the pg_dump binary whose version we are running.
`/usr/bin/pg_dump` on Ubuntu and Debian is actually a tool which
attempts to choose which `pg_dump` binary from all of the
`postgresql-client-*` packages that are installed to run.  However,
its logic is confused by passing empty `--host` and `--port` options
-- instead of looking at the running server instance on the server, it
instead assumes some remote host and chooses the highest versioned
`pg_dump` which is installed.

Because Zulip writes binary database backups, they are sensitive to
the version of the client `pg_dump` binary is used -- and the output
may not be backwards compatible.  Using a PostgreSQL 16 `pg_dump`
writes archive format 1.15, which cannot be read by a PostgreSQL 15
`pg_restore`.

Zulip does not currently support PostgreSQL 16 as a server.  This
means that backups on servers with `postgresql-client-16` installed
did not successfully round-trip Zulip backups -- their backups are
written using PostgreSQL 16's client, and the `pg_restore` chosen on
restore was correctly chosen as the one whose version matched the
server (PostgreSQL 15 or below), and thus did not understand the new
archive format.

Existing `./manage.py backups` taken since `postgresql-client-16` were
installed are thus not directly usable by the `restore-backup` script.
They are not useless, however, since they can theoretically be
converted into a format readable by PostgreSQL 15 -- by importing into
a PostgreSQL 16 instance, and re-dumping with a PostgreSQL 15
`pg_dump`.

Fix this issue by hard-coding path to the binary whose version matches
the version of the server we are connected to.  This may theoretically
fail if we are connected to a remote PostgreSQL instance and we do not
have a `postgresql-client` package locally installed which matches the
remote PostgreSQL server's version.  However, choosing a matching
version is the only way to ensure that it will be able to be imported
cleanly -- and it is preferable that we fail the backup process rather
than write backups that we cannot easily restore from.

Fixes: #27160.
2023-10-11 11:50:56 -07:00
Alex Vandiver 9d46b41e25 backup: Use simpler api for server version. 2023-10-11 11:50:56 -07:00
Tim Abbott 66bbf35df4 settings: Adjust label for stream typing notifications setting. 2023-10-11 10:16:24 -07:00
Prakhar Pratyush 43789cac58 stream_typing_indicator: Remove the dev environment guard in settings.
This commit removes the 'page_params.development_environment' guard
for the setting 'send_stream_typing_notifications' and makes it
available outside the development environment.
2023-10-11 10:16:24 -07:00
Aman Agrawal 229dcce217 overlays_modals: Replace with inline use of overlays/modals.any_active. 2023-10-11 09:45:37 -07:00
Aman Agrawal 2aab74049d overlays: Rename is_active to any_active. 2023-10-11 09:45:37 -07:00
Aman Agrawal 089886245d modals: Rename is_open to any_active. 2023-10-11 09:45:37 -07:00
Alex Vandiver cdc3413a4f sentry: Add a circuit-breaker around attempts to report to Sentry.
The goal is to reduce load on Sentry if the service is timing out, and
to reduce uwsgi load from long requests.  This circuit-breaker is
per-Django-process, so may require more than 2 failures overall before
it trips, and may also "partially" trip for some (but not all)
workers.  Since all of this is best-effort, this is fine.

Because this is only for load reduction, we only circuit-breaker on
timeouts, and not unexpected HTTP response codes or the like.

See also #26229, which would move all browser-submitted Sentry
reporting into a single process, which would allow circuit-breaking to
be more effective.
2023-10-11 09:44:18 -07:00
Alex Vandiver 9519945dc0 sentry: Do not report errors tlaking to Sentry, to Sentry.
This prevents failure to submit a client-side Sentry trace from
turning into a server-side client trace.  If Sentry is down, we merely
log the error to our error logs and carry on.
2023-10-11 09:44:18 -07:00
Alya Abbott f2f6f6c48c help: Tighten content on /help/printing-messages. 2023-10-10 18:27:48 -07:00
Anders Kaseorg cac5778e70 stream_edit_toggler: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 18:26:57 -07:00
Anders Kaseorg 97f4847c71 email_log: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 17:41:03 -07:00
Karl Stolley f98570704d compose: Present Start new topic button adjacent the reply button.
Fixes: #24889.

Co-Authored-By: Daniil Fadeev <shameondev@gmail.com>
2023-10-10 17:37:03 -07:00
Karl Stolley 2fac5fb08c compose: Hide New direct message button in DM views.
This avoids the situation where the contextually aware
Start new conversation button duplicates the functionality of the
dedicated New direct message button.

Additionally, it gives a sense of what the UI would be like if
only the Start new conversation button were displayed.
2023-10-10 17:37:03 -07:00
Karl Stolley 1f77e4a892 compose: Enable New conversation contextual function in DM narrows. 2023-10-10 17:37:03 -07:00
Karl Stolley 654469b29f compose: Make DM identifiers align with new conversations. 2023-10-10 17:37:03 -07:00
Karl Stolley 0f084587e0 compose: Make stronger, more readable button-update logic. 2023-10-10 17:37:03 -07:00
Karl Stolley c73de34f32 compose: Introduce 'Start new conversation' button. 2023-10-10 17:37:03 -07:00
Daniil Fadeev 9303339810 compose: Remove the unused span wrapper for buttons. 2023-10-10 17:37:03 -07:00
Daniil Fadeev e861b16911 compose: Show or hide the clear-topic button as needed at compose start. 2023-10-10 17:37:03 -07:00
Karl Stolley 5b830a226c compose: Name triggers for clearing the topic. 2023-10-10 17:37:03 -07:00
Karl Stolley 5b82a62b26 compose: Add button to clear topic box.
Fixes part of #24889.

Co-Authored-By: Daniil Fadeev <shameondev@gmail.com>
2023-10-10 17:37:03 -07:00
Dinesh 61d30b7aef muted_users: Hide muted typists in streams.
Filters muted users in get_topic_typists().
2023-10-10 17:36:55 -07:00
Dinesh fccdc054a1 typing_notifications: Frontend work to display notifs for streams.
Display/hide "X is typing" notification
on receiving start/stop typing event for streams.

Co-authored-by: Prakhar Pratyush <prakhar841301@gmail.com>
2023-10-10 17:36:55 -07:00
Prakhar Pratyush dab92a4ae8 typing_data: Rename 'typist_dct' to 'typists_dict'.
'typists' to represent multiple typists.
'dict' is a better-known abbreviation for dictionary than dct.
2023-10-10 17:36:55 -07:00
Dinesh cb4957fa26 narrow_state: Add stream_id() function.
Returns `stream_id` if narrowed to stream else `undefined`.

Required for displaying stream typing notifications.
2023-10-10 17:36:55 -07:00
Dinesh 3bc448c1e0 refactor: Extract 'get_key' out of functions in 'typing_data.ts'.
These existing typing related functions are re-usable in the
case of stream typing, except that the key differs. So, to make
it possible to re-use the code in these functions, this commit
removes the `get_key` call in those functions and instead passes
the key directly.

Also, renamed `get_key` to `get_direct_message_conversation_key`
to differentiate it from the `get_topic_key` that we'll add later
for stream typing.
2023-10-10 17:36:55 -07:00
Dinesh c453a784e2 typing_data: Rename get_all_typists to get_all_direct_message_typists.
We use this function to show who's typing in the
direct messages narrow.

Renamed it because, with the addition of stream typists to
`typist_dct` in the next commit, this might be confusing.

This commit addresses the discussed issue by renaming
'get_all_typists()' to 'get_all_direct_message_typists'.
2023-10-10 17:36:55 -07:00
Dinesh 91f03e0d38 typing_notifications: Send ajax requests for stream typing too.
For the timing part of sending requests, it will be the same
as DMs, as the code in 'typing_status.ts' is being reused
for that purpose.

As a note, 'state.current_recipient_ids' and 'new_recipient_ids'
of update() in 'typing_status.ts' used to be an array of recipient ids.

Renamed them to 'state.current_recipient' and 'new_recipient' as they
can now be either of:
1) An object of format {stream_id: 2, topic:'hello'}
2) an array of recipient user IDs like previously

Also, made required changes in 'typing_status.ts' and
'typing_status.js.flow', i.e., documenting the new format of
new_recipient.

Co-authored-by: Prakhar Pratyush <prakhar841301@gmail.com>
2023-10-10 17:36:55 -07:00
Anders Kaseorg 820dcc50a0 sent_messages: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 17:18:37 -07:00
Anders Kaseorg 082a291bd1 sent_messages: Remove trivial initialize function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 17:18:37 -07:00
Prakhar Pratyush e23f3ac89b typing_indicator: Update the 'to' parameter to accept stream ID.
When the `type` of the message being composed is "stream",
this commit updates the `to` parameter to accept the ID of
the stream in which the message is being typed.

Earlier, it accepted a single-element list containing the ID
of the stream.

Sending the element instead of a list containing the single element
makes more sense.
2023-10-10 17:15:28 -07:00
Prakhar Pratyush 8b12cc606a request: Extract out methods from 'scheduled_messages' to reuse.
This is a prep commit that extracts the following two methods
from '/actions/scheduled_messages' to reuse in the next commit.
* extract_stream_id
* extract_direct_message_recipient_ids

The 'to' parameter for 'POST /typing' will follow the same pattern
in the next commit as we currently have for the 'to' parameter in
'POST /scheduled_messages', so we can reuse these functions.
2023-10-10 17:15:28 -07:00