Commit Graph

61118 Commits

Author SHA1 Message Date
evykassirer b57f4c05da stream_ui_updates: Convert module to typescript. 2024-10-15 11:54:31 -07:00
Anders Kaseorg f812fee7ac install-node: Upgrade Node.js from 20.17.0 to 20.18.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-15 10:36:01 -07:00
Anders Kaseorg 0206e637e8 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-15 10:31:53 -07:00
Alya Abbott b8dd409d71 help: Update exports documentation.
Document in-app exports with user consent.
2024-10-15 10:15:34 -07:00
Lauryn Menard efc6c70d3b typing: Check for valid user IDs when setting typing recipient.
Before sending typing notifications to the server, make sure that
the user has set at least one valid user pill in the compose box
recipient bar.
2024-10-15 10:14:04 -07:00
Aman Agrawal ad1d8a204f narrow_history: Correctly check for when we can save the narrow state.
Checking `browser_history.state.changing_hash` was not correct since
we were calling `select_id` on message list, which saves the narrow
state, before we set `browser_history.state.changing_hash` to `false`.
That means, it was not reliable to save the narrow state.

Also, it is possible that `save_narrow_state` is called after URL hash
is changed but before we render the new message list. That could result
in us saving the narrow state of the previous message list on the
new URL. That could lead to a weird bug where message list doesn't
change after clicking on a near link but user just gets scrolled
in the current message list as per the wrongly saved narrow state.

We fix it by only saving the narrow state when the URL matches the
filter set in the current message list.
2024-10-15 10:04:15 -07:00
Mateusz Mandera 3ccd53ce20 custom_profile_fields: Make transaction no longer durable.
Fixes ##31935.

do_update_user_custom_profile_data_if_change can't be durable as it's
invoked within `sync_ldap_user_data`, which is already in
transaction.atomic.

This change requires a few additional tweaks to untangle other related
transactions. The top level view functions up the codepath now use
durable=True. check_remove_custom_profile_field_value is called inside
do_update_user, so it no longer can be durable and should be switched to
savepoint=False. In turn, its remaining caller - the view
remove_user_custom_profile_data - gets switched to durable=True.
2024-10-14 16:30:46 -07:00
Aman Agrawal 6af17c2c3f message_events: Remove unnecessary filtering of msg ids to remove.
This is not required since `remove_and_rerender` already is
capable of handling receiving message ids which might not be
part of the list.
2024-10-14 15:43:48 -07:00
Aman Agrawal b448f5c108 message_events: Fix muted msgs not rendered if moved to be not muted.
If a muted message for the currently rendered message list is moved
to a non muted topic, it was not rendered if it is part of
`_all_items` and not `_items` due to it being previously muted.

We fix it by removing all the moved messages from the list and
added them back which allows us filter the messages for muting again.

This overall reduces the amount of rerender calls too since we
are now guaranteed to only call it once now.

Fixes #31977
2024-10-14 15:43:48 -07:00
evykassirer 269066e10a settings_org: Convert module to typescript. 2024-10-14 15:33:01 -07:00
evykassirer 39137e67f7 user_groups: Generate UserGroup type from a schema.
This will be useful for later when we'll need the schema for
converting settings_org to typescript.
2024-10-14 15:33:01 -07:00
evykassirer 5aa5163bbb settings_components: Generate SimpleDropdownRealmSettings type from a schema.
This will be useful for later when we'll need the schema for
converting settings_org to typescript.
2024-10-14 15:33:01 -07:00
evykassirer 897f605acf settings_components: Generate StreamSettingProperty type from a schema.
This will be useful for later when we'll need the schema for
converting settings_org to typescript.

This commit also renames StreamSettingProperty to more accurately
reflect the type of a single property key.
2024-10-14 15:33:01 -07:00
evykassirer c133f7f219 sub_store: Generate StreamSubscription type from a schema.
This will be useful for later when we'll need the schema for
converting settings_org to typescript.
2024-10-14 15:33:01 -07:00
evykassirer 905a234966 settings_components: Generate RealmUserSettingDefaultProperties from schema.
This will be useful for later when we'll need the schema for
converting settings_org to typescript.
2024-10-14 15:33:01 -07:00
evykassirer 67f4866201 settings_components: Generate RealmSettingProperty type from a schema.
This will be useful for later when we'll need the schema for
converting settings_org to typescript.

This commit also renames RealmSettingProperty to more accurately
reflect the type of a single property key.
2024-10-14 15:33:01 -07:00
evykassirer 69db3c422a settings_org: Remove get_widget() call and use equivalent `this`.
Manually verified here: https://github.com/zulip/zulip/pull/31940#discussion_r1798533802
2024-10-14 15:33:01 -07:00
evykassirer 808c24aef2 typescript: Convert some && constructions to optional chains.
Some upcoming changes to how types are constructed are going
to bring up these type linter errors, so fix them now.
2024-10-14 15:33:01 -07:00
evykassirer e5dd75baf0 buddy_list: Differentiate updating and changing to an undefined filter.
Followup to #31960. I forgot to consider the case of a narrow with
an undefined filter. To make sure we fully run render_section_headers
on narrows like Recent Conversations the first time they load, this
commit initializes `current_filter` to the string "unset".
2024-10-14 15:15:26 -07:00
Lauryn Menard 3e3ca26aae docs: Update keyboard shortcuts to always show "Fn" key option.
Previously, these were only shown for Mac OS users and replaced
the "Home", "End", "PgUp" and "PgDn" shortcuts. But as this really
depends on the keyboard the user is using (there are Mac keyboards
with the above keys), we instead show both options in our web app
and help center documentation on keyboard shortcuts.

The tooltip for the "Scroll to bottom" button will now always show
"End" for all users. Previously, it showed a "Fn" key option for
Mac users.

Fixes #31815.
2024-10-14 15:14:10 -07:00
Lauryn Menard 93c172ee3f message-fetch: Add spectator term when building narrow parameter.
Again, since the spectator term is added to the narrow parameter
for all views, then we consolidate that logic when building the
initial narrow data.
2024-10-14 15:11:41 -07:00
Lauryn Menard 7289d43f74 message_fetch: Simplify building narrow data.
If page_params.narrow is defined, then it is added to the narrow
parameter (whether it is the home view or not), so here we
consolidate that logic.
2024-10-14 15:11:41 -07:00
Lauryn Menard 09bce62d98 messsage-fetch: Convert channel operator's operand to integer ID.
The operand for the canoncial "channel" operator can be an ID, but
it must be an integer and not a string, so we take care of that
directly in handle_operators_supporting_id_based_api.
2024-10-14 15:11:41 -07:00
Lauryn Menard 3405e95b6b message-fetch: Use canonical operator for ID based API updates.
Updates handle_operators_supporting_id_based_api to use the
canonical operator when updating the narrow parameter to use
object IDs.
2024-10-14 15:11:41 -07:00
Lauryn Menard 62c2f35995 message-fetch: Refactor handle_operators_supporting_id_based_api.
Instead of updating the object with all of the parameters for the
message fetch, we only update the narrow parameter.
2024-10-14 15:11:41 -07:00
Varun Singh 697e7acaaa scheduled_messages_ui: Convert module to TypeScript. 2024-10-14 13:35:11 -07:00
Shubham Padia b3d75d619a help: Consistently name restrict email setting.
Remove question mark.
See https://chat.zulip.org/#narrow/channel/101-design/topic/name.20permissions.20settings.20consistently/near/1959774
2024-10-14 13:30:01 -07:00
Shubham Padia 588f609a9c help: Consistently name unsubscribe channel setting.
Remove question mark.
See https://chat.zulip.org/#narrow/channel/101-design/topic/name.20permissions.20settings.20consistently/near/1959774
2024-10-14 13:30:01 -07:00
Shubham Padia d7d3da6f9f help: Consistently name channel post setting.
Remove question mark and replace `the` with `this`.
See https://chat.zulip.org/#narrow/channel/101-design/topic/name.20permissions.20settings.20consistently/near/1959774
2024-10-14 13:30:01 -07:00
Shubham Padia 2f7dcfae7b help: Consistently name access channel setting.
Remove question mark and replace `the` with `this`.
See https://chat.zulip.org/#narrow/channel/101-design/topic/name.20permissions.20settings.20consistently/near/1959774
2024-10-14 13:30:01 -07:00
Shubham Padia 065703c779 help: Consistently name mention group setting.
Remove question mark.
See https://chat.zulip.org/#narrow/channel/101-design/topic/name.20permissions.20settings.20consistently/near/1959774
2024-10-14 13:30:01 -07:00
Alya Abbott 95131873cd help: Note that email domain restrictions apply to email changes. 2024-10-14 11:54:12 -07:00
Shubham Padia 797438b0f7 user_groups: Allow setting and changing can_leave_group setting.
Fixes #31951.
2024-10-14 11:44:27 -07:00
Shubham Padia 1862c3b333 user_groups: Use can_leave_group setting to check permisison.
This commit adds code to use can_leave_group setting when
checking permission to leave group in webapp.
2024-10-14 11:44:27 -07:00
Shubham Padia bf46747735 user_groups: Check can_leave_group when removing members. 2024-10-14 11:44:27 -07:00
Shubham Padia 060156fca4 user_groups: Add can_leave_group setting for user group.
This field will be used to control permission for who can
leave a user group.
2024-10-14 11:44:27 -07:00
Sahil Batra 6007630164 user_group_edit: Fix update_group function.
This commit fixes the mistakes made during rebase in
96abf2501a and 9bbd6a7316.
2024-10-14 10:06:17 -07:00
Vector73 6bc8651d22 settings: Remove `add_custom_emoji_policy` setting.
Removed `add_custom_emoji_policy` setting as the permission to
add custom emoji is now controlled by `can_add_custom_emoji_group`
setting.
2024-10-13 16:09:04 -07:00
Vector73 f733ab112c settings: Add `can_add_custom_emoji_group` realm setting.
Added `can_add_custom_emoji_group` setting to replace `add_custom_emoji_policy`.
2024-10-13 16:09:04 -07:00
Mateusz Mandera b95225d071 docs: Minor tweaks to thumbnailing.md.
The first change fixes the incorrect claim that stills of animated
emojis are unused.
Second change just fixes the missing words in the sentence.
2024-10-13 11:43:28 -07:00
Anders Kaseorg ff97788b6e health: Disable RabbitMQ check if not USING_RABBITMQ.
Fixes a spurious error that’s logged and ignored during the Puppeteer
tests, introduced by commit eef65d7e30
(#31438).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-13 11:42:49 -07:00
Prakhar Pratyush 723346b05c settings_exports: Add 'Type' column to data exports table.
This commit adds a 'Type' column to the Data exports table
in the org settings.

It specifies whether it's a public data or standard export.

Fixes part of #31201.
2024-10-11 17:38:17 -07:00
Prakhar Pratyush 6e7cb8a8c4 settings_export: Add modal to select export_type before starting export.
This commit adds a modal which offers a way to select export_type
before making a POST request to start export.

Fixes part of #31201.
2024-10-11 17:38:17 -07:00
evykassirer 478cd9220c buddy_list: Refactor menu popover to support keyboard navigation. 2024-10-11 17:26:57 -07:00
evykassirer 88ae87c10f buddy_list: Use user_sidebar_entry selector instead of li. 2024-10-11 17:26:57 -07:00
Prakhar Pratyush 3314c89288 realm: Add maximum file size upload restriction.
This commit adds a restriction to the maximum file size
that can be uploaded to a realm based on its plan_type.
2024-10-11 17:16:48 -07:00
Prakhar Pratyush 808acc9e47 events: Migrate plan_type & upload_quota to update_dict event format.
'realm_upload_quota_mib` is updated when `plan_type` changes.

Earlier, we were including 'upload_quota' to update
`realm_upload_quota_mib` in extra_data field of 'realm op: update'
event format when property='plan_type'.

This commit migrate those two parameters to `realm op: update_dict`
event format.

* None of the clients processes these fields, so no compatibility
  code required.
* Renamed `upload_quota` to `upload_quota_mib` as it better aligns
  with our goal to encode units in the client-facing API names.
  Also, it helps to avoid extra code to update 'realm_upload_quota_mib`
  in web client, web client simply aligns with
  'realm["realm_" + key] = value'.
2024-10-11 17:16:48 -07:00
Prakhar Pratyush 417d74e032 api-docs: Maintain sorted order for properties in realm/update_dict.
Few of the properties in the data field of 'realm/update_dict'
event format were no longer in sorted order (by alphabet).

This commit rearranges them to maintain the order.
2024-10-11 17:16:48 -07:00
Prakhar Pratyush 276648ef87 realm_settings: Remove 'enable_spectator_access' from update_fields.
In 'do_change_realm_plan_type' function we use 'do_set_realm_property'
to set 'enable_spectator_access' to False.

There is no need to again update that field.

This change was included in d2f2fbf6b9.
2024-10-11 17:16:48 -07:00
Lauryn Menard d3987f611c urls: Generate narrow links in frontend with "channel" operator.
Fixes #30385.
2024-10-11 17:00:23 -07:00