Commit Graph

6178 Commits

Author SHA1 Message Date
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
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
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 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 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
Lauryn Menard d3987f611c urls: Generate narrow links in frontend with "channel" operator.
Fixes #30385.
2024-10-11 17:00:23 -07:00
Aman Agrawal 592afffab4 message_events: Fix messages missing in combined feed.
When combined feed is cached, moving messages can cause some
messages to be missing.

This can be reproduced by moving messages from a muted stream to
non muted stream.

Fixed by updating all rendered message lists for the messages
that were moved.
2024-10-11 16:38:44 -07:00
Shubham Padia c9d5276031 user_groups: Set can_manage_all_groups to administrator group.
Earlier we use to restrict admins, moderators or members of a group to
manage that group if they were part of the realm wide
`can_manage_all_groups`. We will not do that anymore and even
non-members of a group regardless of role can manage a group if they are
part of `can_manage_all_groups`.

See
https://chat.zulip.org/#narrow/stream/101-design/topic/Group.20add.20members.20dropdown/near/1952902
to check more about the migration plan for which this is the last step.
2024-10-11 16:31:18 -07:00
Shubham Padia 9bbd6a7316 user_groups: Check can_add_members_group when adding members.
Fixes #25942.
Users with permission to manage the group (either on the group level or
realm level) should be able to add members to the group without being
present in can_add_members_group.
2024-10-11 16:31:18 -07:00
Shubham Padia 8a2a8b64aa user_groups: Add can_add_members_group field to group create/edit. 2024-10-11 16:31:18 -07:00
Sahil Batra 553409c1ca settings_profile_fields: Move computations out of ListWidget code.
This commit moves the code to compute the profile field order and
the number of fields shown is user card, out of the list_widget
functions just to maintain the code readability and keeping code
easy to understand.
2024-10-11 16:17:06 -07:00
tnmkr 8af4366cc0 custom_profile_fields: Update admin table empty placeholder message.
Fixes #27250.
2024-10-11 16:17:06 -07:00
tnmkr 2c8b1adc5f custom_profile_fields: Migrate admin table to use ListWidget.
ListWidget will allow us to use our standard structure for empty table
placeholder.

This is a prep commit for #27250.
2024-10-11 16:17:06 -07:00
Prakhar Pratyush 55f97cd06f realm_export: Add support to create full data export via /export/realm.
Earlier, only public data export was possible via `POST /export/realm`
endpoint. This commit adds support to create full data export with
member consent via that endpoint.

Also, this adds a 'export_type' parameter to the dictionaries
in `realm_export` event type and `GET /export/realm` response.

Fixes part of #31201.
2024-10-11 13:20:42 -07:00
evykassirer 2367c46455 buddy_list: Fix bug where headers weren't being updated often enough.
`$(".buddy-list-subsection-header").children()` has length more often
than I had thought. Using the narrow filter is more direct way of
managing this state.
2024-10-11 13:16:45 -07:00
evykassirer d61ec2a0cc settings: Remove unused realm_create_private_stream_policy.
This was replaced with realm_can_create_private_channel_group in
e19524b and wasn't fully removed.
2024-10-11 13:15:36 -07:00
evykassirer 87835b81cb state_data: Flesh out types for realm_schema. 2024-10-11 13:02:45 -07:00
Karl Stolley 979e8ff5d2 inbox: Use plural for Direct messages header. 2024-10-11 12:54:21 -07:00
Kislay Udbhav Verma 8b7820ca71 resolve_topic: Change dialog button text.
We replace the comma in the buttons to an em dash.
This is a follow up to #31312.
2024-10-11 11:49:18 -07:00
Sahil Batra 7db6de340f settings: Clean schemas and types used for group settings.
Removed "type"/"Type" from schema and type names used
for group settings because we want to use "type"/"Type"
only for "type of a type" cases.

So, this commit renames-
- anonymous_group_type => anonymous_group_schema
- group_setting_type_schema => group_setting_value_schema
- GroupSettingType => GroupSettingValue

We also had duplicate definitions for GroupSettingType, in
state_data.ts and in settings_components.ts. So, removed it
from settings_components.ts.
2024-10-11 11:22:47 -07:00
Sahil Batra 96abf2501a user_groups: Handle live-update of group settings like other settings.
This commit updates live-update of group settings like we do for
stream and realm settings.

Current behavior is -
- If the save discard buttons are visible, meaning that the current
user was in the middle of changing a setting, then all the settings
elements are synced to the original value irrespective of whether
that setting was actual updated, including the setting which the
current user was changing.
- If the save discard buttons are not visible, then only the
element of updated setting is synced as it is not needed to
reset the UI for other settings.

We make the change similar to what we did for realm and stream
settings in 5da1e57fc2. 5da1e57fc2 did not had the changes
for group settings since we had only one group setting then
but now we have multiple settings.
2024-10-11 11:21:56 -07:00
Sahil Batra d7ad951172 settings_components: Compare group setting values correctly.
Since group setting value can be an object containing
direct_members and direct_subgroups fields, this code
updates check_group_property_changed function to use
isEqual to compare the setting values instead of using
"===".

This makes sure that save-discard widget is shown and
hidden as expected.
2024-10-11 11:21:56 -07:00
evykassirer 36183761f8 settings_notifications: Add specificity to select classname to justify type. 2024-10-10 14:36:07 -07:00