Commit Graph

201 Commits

Author SHA1 Message Date
bedo
21199beb73 stream_delete_event: Include only stream IDs in the event.
Fixes #32369

Migrate stream delete event to include only stream ids in the form of
"stream_ids": [1,...], because clients only need the ids.

While keep sending ids in the form of "streams": [{stream_id: 1},...]
for compatibility with all clients other than web.
2025-01-24 17:58:32 -08:00
bedo
7c8a3618bf message_view_header: Change maybe_rerender_title_area_for_stream type.
prep-commit

changed argument "modified_sub: StreamSubscription" to
"modified_stream_id: number", as only ID is used and not the whole object.
2025-01-24 17:58:32 -08:00
Sahil Batra
255eee255b events: Pass group in functions called for updating the group.
We now pass group in functions called while handling group update
events, instead of fetching the groups in those function as we
will need the old setting value in future commits.
2025-01-24 14:51:51 -08:00
Shubham Padia
3bf87228a2 settings: Use can_add_subscribers_group instead of realm policy.
We are using `can_add_subscribers_group` instead of
`invite_to_stream_policy` to check whether a user can subscribe other
users.
We've removed `invite_to_stream_policy` from the frontend wherever
applicable.
2025-01-22 12:33:58 -08:00
Shubham Padia
34ade0d9a2 realm: Add ability to set can_add_subscribers_group in frontend.
The setting is not used anywhere yet either on the frontend or the
backend, we are just adding the ability to change the value of the realm
setting. We have also removed the ability to set
`invite_to_stream_policy` in this commit while it continues being used
to check permissions.
We have changed the label of the setting from `Who can add users to
channels` to `Who can subcribe users to channels` and label_parens_text
as `in addition to organization administrators` as discussed in
https://chat.zulip.org/#narrow/channel/101-design/topic/Can.20subscribe.20other.20users.20on.20user.20profile/near/2039825
2025-01-22 12:33:58 -08:00
Prakhar Pratyush
469cc53187 export: Add banner if admin's private data export setting is disabled.
This commit introduces a banner on the "Start Export" modal
to notify the admin that their personal setting to export
private data is not toggled ON.

The banner is shown when the 'Export type' is 'Standard' and
admin's personal setting to export private data is not toggled ON.

The banner ensures admins are aware their private data will
not be exported unless they enable the respective setting.
2025-01-02 16:40:33 -08:00
Anders Kaseorg
b19a556982 stream_types: Remove email_address from ApiStreamSubscription.
Commit 432001656e removed this from the
backend.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-30 09:42:26 -08:00
Kislay Verma
a817671809 settings_ui: Add checkbox for toggling field.
Added a checkbox to toggle the option to automatically offer
to update the time zone with the browser time zone,
which is handled by the user profile field
"web_suggest_update_timezone".

A tooltip is also attached explaining the feature.

Fixes part of #16957
2024-12-13 12:58:09 -08:00
Anders Kaseorg
77f97762c6 eslint: Fix unicorn/explicit-length-check. (#32666)
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 09:19:46 -08:00
Anders Kaseorg
d446b0d672 user_events: Convert module to TypeScript (#32658) 2024-12-11 09:18:52 -08:00
Varun Singh
010e2b9867 user_group_edit: Convert module to TypeScript. 2024-12-10 12:07:46 -08:00
evykassirer
7bd4016254 message_events: Convert module to typescript. 2024-12-10 10:52:01 -08:00
Aman Agrawal
276e547824 user_topics_ui: Rerender combined feed to make unmuted topics visible.
Since combined feed no longer contains a continuous history of
muted messages, we need to rerender it display the newly visible
messages.
2024-12-08 18:34:28 -08:00
Shubham Padia
cbcd631afe user_group: Live update on subgroup edit.
Also adds a condition to handle_member_edit_event to only update the
group checkmark when the current user id is part of the member ids
affected by the event.
2024-12-04 16:02:20 -08:00
Anders Kaseorg
bb174e9b64 gear_menu: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-27 09:34:49 -08:00
evykassirer
64c8884487 stream_events: Convert module to typescript. 2024-11-26 09:18:12 -08:00
Vector73
4e89b4a88c settings: Add can_invite_users_group realm setting.
Added `can_invite_users_group` realm setting to replace
`invite_to_realm_policy`.
2024-11-20 13:35:05 -08:00
evykassirer
60763763b2 stream_settings_ui: Convert module to typescript. 2024-11-19 14:01:10 -08:00
Anders Kaseorg
e82b7641c6 giphy: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 11:56:57 -08:00
Anders Kaseorg
ec3177c834 web: Add explicit extensions to imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Aman Agrawal
e6113b0dd4 message_events: Discard message list that cannot be live updated.
Since we cannot cheaply live update `is-followed` narrow, we
discard any message list or data with that narrow if we
received a message event that changes topic visibility
from or to `FOLLOWED`.
2024-11-05 12:25:28 -08:00
Sahil Batra
dce229ba17 settings: Use new pills UI for DM permission settings.
We now use pills UI for direct_message_initiator_group
and direct_message_permission_group setting.
2024-10-30 12:03:36 -07:00
Sahil Batra
891e58bb1a settings: Fix live-update of setting elements.
Some of the group setting elements were not live-updated
correctly since they were not present in realm_settings
dict and sync_realm_settings is only called for settings
present in that dict.
2024-10-30 12:03:36 -07:00
Vector73
ed5638ec3c settings: Add can_move_messages_between_topics_group realm setting.
Added `can_move_messages_between_topics_group` realm setting to replace
`edit_topic_policy`.
2024-10-29 16:27:04 -07:00
evykassirer
35424adcc3 settings_account: Convert module to typescript. 2024-10-29 14:50:25 -07:00
sanchi-t
a29b6485d6 delete_sub: Do not remove archived stream when deactivated.
Stream is simply marked as `archived: true` instead of removing
the stream from `sub_store` and `stream_info`.

A check in `subscribe_myself` is added before subscribing to a
stream.
2024-10-25 16:06:42 -07:00
sanchi-t
fa268877d3 stream: Show (archived) at the end of deactivated stream names.
When a stream is deactivated the title area and messages are
re-rendered to update the stream name with `(archived)` suffix.
2024-10-25 16:06:42 -07:00
Aman Agrawal
eab9a3e552 message_events: Refresh is-followed narrow on topic visibility update.
This adds live update support for `is-followed` narrow. We need
to render the narrow again instead of just adding the relevant
messages from the updated topic since it not easy to determine
which message we need to add based on the selected message of the
user and which messages to ask from the server.
2024-10-23 11:50:25 -07:00
Sahil Batra
89d0ad1d60 user_group_edit: Add support to update subgroups of existing groups. 2024-10-22 10:23:36 -07:00
Prakhar Pratyush
b8e0e08f01 realm_export: Add 'Export permissions' table.
This commit adds a "Export permissions" table
in the 'Data exports' setting panel.

The table lists the active human users and their
configuration of 'allow_private_data_export' setting.

Fixes part of #31201.
2024-10-21 17:42:52 -07:00
Vector73
1be0cb1b75 settings: Add can_move_messages_between_channels_group realm setting.
Added `can_move_messages_between_channels_group` realm setting to replace
`move_messages_between_streams_policy`.
2024-10-16 14:26:18 -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
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
Shubham Padia
b7764eb6f0 settings: Remove user_group_edit_policy from the frontend. 2024-10-01 17:35:14 -07:00
Vector73
66113365a5 saved_snippets: Add new feature for saved snippets.
Fixes #31227.
2024-10-01 11:48:15 -07:00
Anders Kaseorg
2440c6d244 electron_bridge: Harden against hypothetical DOM clobbering attacks.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-30 16:31:27 -07:00
Sahil Batra
5f3a8334be user_groups: Do not allow deleting user groups. 2024-09-18 13:41:13 -07:00
Sahil Batra
6482f0c2ea user_groups: Pass correct group object for adding new group to UI.
We previously passed the UserGroupRaw type object received in
the user group creation event to user_group_edit.add_group_to_table
instead of the UserGroup type object.

The add_group_to_table function is called after receiving creation
event only, but other functions called later in the flow are called
at other times as well like when opening edit panel for a particular
group and they expect UserGroup type object, so this commit fixes it.
2024-09-16 16:28:52 -07:00
Prakhar Pratyush
764083d31b settings: Add 'allow_private_data_export' user setting.
This commit adds a user-setting to allow users to decide
whether to let administrators export their private data.

Fixes part of #31201.
2024-09-16 15:48:40 -07:00
Vector73
0cd51f2fea settings: Remove delete_own_message_policy realm property.
Removed `delete_own_message_policy` realm property as the permission
to delete own messages is controlled by `can_delete_own_message_group`
setting.
2024-09-12 09:36:02 -07:00
Vector73
28c7a04734 settings: Add can_delete_own_message_group realm setting.
Added `can_delete_message_group` realm setting to replace
`delete_own_message_policy` property.
2024-09-12 09:36:02 -07:00
Aman Agrawal
8763d55911 message_events: Fix live update for views based on message property.
Fixes #31208
Fixes #14510
2024-09-10 17:28:04 -07:00
Prakhar Pratyush
00fb8f3014 settings: Move the user-privacy settings related code at one place.
This commit makes small refactoring to place all the user-privacy
settings code in 'server_events_dispatch.js' at one place and use
a common function 'settings_account.update_privacy_settings_box' to
update the UI.

This also helps in early return instead of executing a lot
of `if` statements related to user-preferences settings.
2024-09-10 09:34:24 -07:00
Prakhar Pratyush
75f6ae6d20 settings: Fix live-update bug for privacy settings.
The following three privacy settings weren't being live
updated across multiple browser tabs/windows:
* send_stream_typing_notifications
* send_private_typing_notifications
* send_read_receipts

This commit fixes the bug.
2024-09-10 09:34:24 -07:00
Prakhar Pratyush
340140954b settings: Use the generic code block to set 'enter_sends' value.
This commit performs a minor code restructuring to use the
generic code block for updating all the user_preferences
settings values.

No need to use a separate code block for 'enter_sends' setting.
2024-09-10 09:34:24 -07:00
Sanchit Sharma
671946351c settings: Improve visibility of "Enter Sends Message" setting.
Addresses user research feedback by duplicating the "Enter Sends
Message" setting in the Settings > Preferences menu, specifically within
the General section, ensuring users can easily locate and configure
this option.

server_events_dispatch: Remove break statement.
The settings page needs to be updated when
`enter_sends` property is updated.

css: Update vertical-align to middle for the checkbox element.

Co-authored-by: Akarsh Jain<akarsh.jain.790@gmail.com>.
2024-09-06 11:47:04 -07:00
sanchi-t
a8acd0ce25 compose_box: Remove non-existent classes.
The .enter_sends_true and .enter_sends_false classes were originally
removed in commit b4b71880e1.
2024-09-06 11:47:04 -07:00
Jaimin Godhani
243b57154b settings: Rename user_display_settings to user_preferences.
Fixes part of zulip#26874.
2024-08-28 11:01:02 -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