Commit Graph

60344 Commits

Author SHA1 Message Date
Tim Abbott a56e5079fd migrations: Squash zilencer migrations.
Created using manage.py squashmigrations with a couple changes:
- Patched Django to optimize AddConstraints/RemoveConstraints properly.
- Used the StateOperations from the
  migrations.SeparateDatabaseAndState section in migration 0060, so
  that the constraint changes could be optimized properly.
- Removed dependencies on zerver, since this project does not actually
  have any dependencies on zerver migrations.
2024-08-23 17:15:35 -07:00
Tim Abbott eaa02a10a4 migrations: Squash most confirmation migrations.
Generated using the squashmigrations tool, with:

- A tiny Django patch to avoid special handling of the temporary
  EmailChangeStatus proxy model.
- Switching AddIndexConcurrently to AddIndex to help squashing. This
  may not have been necessary.

Migration 0015 was not squashed because of its dependency on newer
zerver migrations.
2024-08-23 17:15:35 -07:00
Tim Abbott 6cdf938602 migrations: Tweak realm foreign key dependency.
As best I can tell, this dependency is important only to ensure that
we have a Realm table to link to.
2024-08-23 17:15:35 -07:00
Tim Abbott d71742b7fe confirmation: Move zerver dependency to correct migration.
It's the foreign key relationship that needs to be synchronized with
the BigInt state of the releavnt zerver tables.
2024-08-23 17:15:35 -07:00
Tim Abbott afecb2eca6 migrations: Add missing elidable tags on RunPython/RunSQL steps.
This helps the squashmigrations tool know that it can squash these.
2024-08-23 17:15:35 -07:00
Tim Abbott 5188cf3d8e migrations: Remove RunPython block from initial migration.
Since it's the initial migration, this can't have any useful effect.

I'm pretty sure the backstory is we did a manual squash of migrations
during the process of open-sourcing Zulip, and incorrectly didn't
remove this code.
2024-08-23 17:15:35 -07:00
Tim Abbott 547377a295 zerver: Remove now-unnecessary dependency in migration 0383.
It's not possible to directly upgrade from pre-5.3 versions to main,
since they do not have any supported OSes in common. Thus, this
dependency on the confirmation model, which risks creating a circular
dependency if we squash migrations, can be removed.
2024-08-23 17:15:35 -07:00
Alex Vandiver 73e5364838 import: Use inspection to determine sequence names. 2024-08-23 17:15:35 -07:00
Tim Abbott 31623911d1 test_message_fetch: Avoid assumptions about fixture data set. 2024-08-23 17:15:35 -07:00
Lauryn Menard d708c3c039 support: Add ability to update max daily invitations for realm.
Adds some validation for changing the realm's max invites via the
support view so that it is not set below the default max for the
realm's plan type, and so that if it's currently set to the default
max it's not reset to that same value.
2024-08-23 16:08:30 -07:00
opmkumar 8911347cdb hotkey: Add keyboard shortcut to navigate to starred messages view.
This commit adds '*' as a keyboard shortcut to navigate to the starred messages view and the shortcut is documented in various required locations accordingly.
Fixes #31397.
2024-08-23 15:49:31 -07:00
Aman Agrawal 5f6045c878 typeahead: Change icon for wildcard mentions. 2024-08-23 15:43:44 -07:00
Anders Kaseorg 62e8261e63 Merge tag '10.0-dev'
The 10.0-dev tag was created on the wrong commit, and force-pushing
it would break upgrade-zulip-from-git.  Merge it into main so that
cache-zulip-git-version detects the right version.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2024-08-23 14:06:27 -07:00
afeefuddin f013eb1037 message_fetch: Convert module to TypeScript. 2024-08-23 13:34:13 -07:00
afeefuddin ec19a34089 message_fetch: Pass msg_list_data explicitly to load_messages. 2024-08-23 13:34:13 -07:00
afeefuddin afe405e0ab message_fetch: Avoid variable reuse in narrow transformation logic. 2024-08-23 13:34:13 -07:00
afeefuddin b41a17a1d0 message_lists: Add is_combined_feed_view to MessageList type. 2024-08-23 13:34:13 -07:00
afeefuddin 8741fe92be message_list_data: Update callback parameter types.
Correct the type annotations for the callback function parameter in
set_add_messages_callback.
2024-08-23 13:34:13 -07:00
afeefuddin 17e2d46760 message_store: Rewrite RawMessage type using Zod.
This commit rework RawMessage and it's related type to use
Zod for parsing the data received from the server.
2024-08-23 13:34:13 -07:00
Varun Singh f148a7a3ed popover_menus_data: Convert module to TypeScript. 2024-08-23 13:10:50 -07:00
Varun Singh d86e5eab78 user_topics: Add `AllVisibilityPolicies` to type. 2024-08-23 13:10:50 -07:00
Varun Singh 118c53dfc3 state_data: Type `realm_enable_read_receipts` field. 2024-08-23 13:10:50 -07:00
Varun Singh df395e99eb settings_config: Add type ColorSchemeDetails. 2024-08-23 13:10:50 -07:00
Varun Singh 1ce76e5fbd message_lists: Add field `message_containers` to `MessageListView` type. 2024-08-23 13:10:50 -07:00
Varun Singh 79dbb8dc79 base_page_params: Add `show_remote_billing` field to schema. 2024-08-23 13:10:50 -07:00
Varun Singh fcb9c7be26 widgetize: Fix type of `data` field. 2024-08-23 12:30:27 -07:00
Varun Singh 2cf09602df todo_widget: Convert module to TypeScript. 2024-08-23 12:30:27 -07:00
Varun Singh 9cd41e1c5b poll_widget: Amalgamate 'outbound_data' types for poll-widgets.
This will help in migration of downstream JS code.
2024-08-23 12:30:27 -07:00
roanster007 c6a06d4684 direct_message_group: Add new `group_size` field.
This commit adds a new `group_size` field to the `DirectMessageGroup`
model, and backfills its value to each of the existing direct message
groups.

Fixes part of #25713
2024-08-23 11:09:41 -07:00
Alya Abbott 8b7d9edecc portico: Update organized conversations image on /for/business. 2024-08-23 10:20:24 -07:00
Sahil Batra 5c7756e1ef user_profile: Update stream dropdown option value to be of "number" type.
It is better to have stream dropdown option value, which is the ID
of the stream, to be of "number" type.

This fixes the assertion error which occurred when someone tried to
subscribe the user to a stream from user profile modal.
2024-08-23 09:12:43 -07:00
Shubham Padia df38639cfd dev_tools: Improve instructions for running help-beta.
Clarify when developers and reviewers will want to use the two
different flags for the beta help center migration on the dev
server.
2024-08-23 09:11:56 -07:00
Prakhar Pratyush 3ea6ba97c0 users: Send event on commit in do_change_is_billing_admin.
Earlier, we were using 'send_event' in 'do_change_is_billing_admin'
which can lead to a situation, if any db operation is added after
the 'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-23 09:10:56 -07:00
Prakhar Pratyush 2b6c5260a5 users: Send event on commit in do_update_outgoing_webhook_service.
Earlier, we were using 'send_event' in
'do_update_outgoing_webhook_service' which can lead to a
situation, if any db operation is added after the 'send_event'
in future, where we enqueue events but the action function fails
at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-23 09:10:56 -07:00
Prakhar Pratyush 30edd1a3b0 users: Add transaction.atomic decorator to do_update_bot_config_data.
The db operations in do_update_bot_config_data should be atomic.
2024-08-23 09:10:56 -07:00
Prakhar Pratyush 8f2727fcea realm_settings: Send event on commit in do_set_push_notif...timestamp.
Earlier, we were using 'send_event' in
'do_set_push_notifications_enabled_end_timestamp' which
can lead to a situation, if any db operation is added after the
'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-23 09:10:56 -07:00
Prakhar Pratyush 5af6c04a9e realm_settings: Update do_set_realm_stream to send event on commit.
Earlier, we were using 'send_event' in 'do_set_realm_stream' which
can lead to a situation, if any db operation is added after the
'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-23 09:10:56 -07:00
Prakhar Pratyush c0dc005d05 realm_settings: Send event on commit in do_set...authentication_methods.
Earlier, we were using 'send_event' in
'do_set_realm_authentication_methods' which can lead to a situation
where we enqueue events but there's an error at a later stage in
the codepath using this function.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-23 09:10:56 -07:00
Prakhar Pratyush 63064e926b realm_settings: Update do_set...default_setting to send event on commit.
Earlier, we were using 'send_event' in do_set_realm_user_default_setting
which can lead to a situation, if any db operation is added after
the 'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-23 09:10:56 -07:00
Prakhar Pratyush 8ddaa949fc user_settings: Send event on commit in do_regenerate_api_key.
Earlier, we were using 'send_event' in 'do_regenerate_api_key'
which can lead to a situation, if any db operation is added after
the 'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-23 09:10:56 -07:00
Prakhar Pratyush 7e03569495 user_settings: Send event on commit in do_change_full_name.
Earlier, we were using 'send_event' in 'do_change_full_name'
which can lead to a situation, if any db operation is added after
the 'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-23 09:10:56 -07:00
Sahil Batra d2c7e7e94c user_groups: Fix live updating user groups UI.
This commit updates code to live update the groups UI if
realm or group level setting to manage groups is changed.

This commit also does some refactoring to better organize the
code in different functions.

And also, the code to hide/disable the UI if the user does not
have permission to manage the group in JS such that the same code
is used for live-updating as well.
2024-08-23 09:09:03 -07:00
Sahil Batra 03ec0e1f14 stream-settings: Live update subscribers list correctly.
This commit fixes the live update of subscribers list
on changing can_remove_subscribers_group setting.

Previously, whole members panel, including the pill container
to add subscriebrs, is re-rendered. But the click and input
handlers for the add subscribers UI is not added again after
re-rendering and thus they do not work.

This commit updates the code to just re-render the subscribers
list which is only needed to update the "Unsubscribe" button.
2024-08-23 09:09:03 -07:00
Karl Stolley 27bf68637b global_times: Correct malformed closing tags in overlay. 2024-08-22 09:12:20 -07:00
Alya Abbott 06ba9710a7 help: Fix up message deletion permissions documentation. 2024-08-22 09:11:52 -07:00
Shubham Padia 24061cfc3b dependencies: Upgrade @astrojs/starlight to 0.26.1. 2024-08-22 09:11:14 -07:00
Mateusz Mandera 9cad9644e7 import_util: Fix file extensions of emoji files downloaded from Slack.
The Slack API when returning the emoji records, returns the record for
its thumbsup_all emoji with the url ending with .png, even though the
file is a gif.

For that reason, we have to make that code correct file extensions based
on the response content-type. Emojis are the smallest set of images to
download, so for simplicity of implementation, we remove the
parallelization of the downloads in favor of just processing them
serially.
2024-08-21 16:30:19 -07:00
Mateusz Mandera 669e0a3e47 import: Fix export->import of emojis from Slack.
Ideally this would besplit up into two commits, but it's hard to split
into self-contained, atomic chunks now that this segment of the
import/export system is generally kind of broken after thumbnailing
system changes.

1. 3rd party export converters don't make .original image files.
Insteadthey provide a single file, which the import should treat as if
it's .original.

2. 3rd party converters create all the records with is_animated=False.
That's an issue, because without setting that correctly on the
RealmEmoji objects, Zulip doesn't know that it should use the "still"
thumbnail when the emoji is being used in a user's status. Which leads
to incorrectly displaying the user status with the distracting
animation.
2024-08-21 16:30:19 -07:00
Mateusz Mandera 5476340b52 import: Export and import .original emoji files correctly.
The export tool was only exporting the already-thumbnailed emoji file,
omitting the original one. Now we make sure to export the .original file
too, like we do for avatars, and make the import tool process it
directly, to thumbnail it directly and generate a still in the case of
animated emojis.

Otherwise, the imported realm wouldn't have the <emoji>.png.original
file that we generally expect to have accessible, and stills for
animated emojis were completely missing.
2024-08-21 16:30:19 -07:00
Mateusz Mandera 2a1da859ea auth: Update AzureADAuthBackend to use the newer Microsoft API.
As detailed in the comment in the code:

The upstream implementation uses the outdated /oauth2/authorize
API (instead of the v2.0 API), which doesn't allow us to authenticate
users with just a personal Microsoft account. v2.0 API is required.
This requires us to override the default URLs to use it as well
as adjust the requested scopes, to match this new API.

The backend in its previous state was only able to authenticate users
that were tied to an organizational directory, even if the application
settings in Azure were set up to also allow personal accounts. Users
trying to use a personal account would face an error from Microsoft:

AADSTS500200: User account 'xxxx@example.com' is a
personal Microsoft account. Personal Microsoft accounts are not
supported for this application unless explicitly invited to an
organization

https://github.com/python-social-auth/social-core/issues/723 is a
related upstream issue.
2024-08-21 16:16:30 -07:00