Commit Graph

60325 Commits

Author SHA1 Message Date
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
evykassirer 6ff793590f bootstrap_typeahead: Fix bug on select with no active item.
This bug was introduced in d9f25d01a1
It's possible that `find(".active")` returns `undefined` here.
2024-08-21 16:07:37 -07:00
Rahul Rajesh Kumar b6597896b0
footer: Open social links in a separate browser tab.
Fixes #31415.
2024-08-21 16:05:45 -07:00
Karl Stolley 562e6d6802 global_times: Allow global times to display inline. 2024-08-21 16:02:33 -07:00
Karl Stolley 02161582fd mentions: Allow mentions to display inline. 2024-08-21 16:02:33 -07:00
Aman Agrawal 580b9e9dae navbar: Remove signup button.
This allows log in button in navbar for spectators to have more space
to be displayed in different languages without being truncated.
Login page already has 2 buttons for user to sign up from.
2024-08-21 12:02:59 -07:00
Tim Abbott f1d828cb7d test_openapi: Remove now-unused blocks.
As we remove uses of the has_request_variables system in favor of
typed_endpoints, parts of this file have lost test coverage.
2024-08-21 11:33:42 -07:00
Tim Abbott 9348b87d73 topic: Remove now-unused REQ_topic. 2024-08-21 11:27:54 -07:00
Kenneth Rodrigues 2483e600a2 message_send: Convert to typed endpoint.
Convert `message_send.py` use `typed endpoint`.

Disable `message_send` endpoint `to` parameter in the `openapi`
`validate_json_schema` check, because it is a special case where the
content type of the parameter is application/json but the
parameter may or may not be JSON encoded since previously we also
accepted a raw string and some ad-hoc bot might still depend on sending
a raw string.

Remove unused validators from `validator.py`.
2024-08-21 11:13:00 -07:00
Prakhar Pratyush 8b3d5a9455 custom_profile_fields: Update transaction to be durable.
This commit updates the db transaction to be durable for
do_update_user_custom_profile_data_if_changed to avoid
addition of any outer atomic block.

While adding any outer atomic block this will raise a runtime error
and we can replace the durable argument with 'savepoint=False'
otherwise we'll have to manually track down the action functions
getting called in that outer atomic block and set the savepoint=False
otherwise it'll lead to creation of savepoints which we don't want.

We can't set savepoint=False before hand to the outermost action
function because it leads to rollback of transaction in tests when
an error is raised in action function.
2024-08-21 10:51:23 -07:00
Prakhar Pratyush e729c51485 custom_profile_fields: Update remove...value to send event on commit.
Earlier, we were using 'send_event' in
check_remove_custom_profile_field_value which can lead to a
situation where we enqueue events but the 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-21 10:51:23 -07:00
Prakhar Pratyush bfe7eb6b2c do_change_full_name: Noop if value isn't really changing.
In do_change_full_name, we shouldn't create RealmAuditLog
entry and sends events if the value isn't changing.
2024-08-21 10:51:23 -07:00
Sahil Batra 6718ff5166 user_groups: Make bottom margin for setting consistent with streams.
This commit increases the gap between group setting elements to make
it same with what we have for stream settings.
2024-08-21 10:30:25 -07:00
Sahil Batra 688def19ab user_groups: Fix showing tooltip for disabled settings.
Preivously, the tooltip was shown only for first element
since initialize_disable_btn_hint_popover only added the
tooltip to first element. And then after d9f25d01a1, there
was an error shown as initialize_disable_btn_hint_popover
asserted that only single element list was passed.

This commit fixes it by calling initialize_disable_btn_hint_popover
for each setting element. Similarly the code to destroy the
tooltip on enabling the setting elements is called for each
element.
2024-08-21 10:30:25 -07:00
afeefuddin be9d879682 settings_bots: Convert module to TypeScript. 2024-08-21 08:28:40 -07:00
afeefuddin 4b89d0ff06 state_data: Add realm_bot_creation_policy type. 2024-08-21 08:28:40 -07:00
afeefuddin 5579700920 list_widget: Make filter_value optional in render_empty_list_message_if_needed. 2024-08-21 08:28:40 -07:00
Alya Abbott 3227a9f35a help: Add a tip to turn off read receipts with invisible mode. 2024-08-21 08:25:44 -07:00
Alex Vandiver 6cc480e2b5 kandra: Ensure that we do not error out creating standby.signal.
Force us to have restored the `/var/lib/postgresql/14/main` directory
before we try to create `standby.signal` in it.
2024-08-20 14:03:51 -07:00