Commit Graph

1241 Commits

Author SHA1 Message Date
Lauryn Menard be3ac06cf4 invite-user-modal: Add validation on custom time input.
Disables the submit button on the invite user modal if the custom
time input value is a negative number or if the number is not an
integer.

Also updates the text for when the invite expires so say that the
custom time value is invalid.
2024-10-16 15:21:40 -07:00
Lauryn Menard 7d5a715ddf settings-input: Move time input check helper to web/src/util.
Moves the helper function for converting a time input into a
number so that it can be reused in both modals and settings
components.
2024-10-16 15:21:40 -07:00
Lauryn Menard b8888d2c33 invite-user-modal: Generalize converting custom input into minutes.
Moves custom time input helper to `web/src/util.ts` so that it
can be reused for other modals where users can select a custom
time duration.

Co-authored by: Ujjawal Modi <umodi2003@gmail.com>
2024-10-16 15:21:40 -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
Lauryn Menard b70fb4a082 typing: Check empty topic string if realm has mandatory topics.
Before sending typing notifications to the server, if the realm
requires topics for channel messages, make sure that the topic
string is not an empty string in the compose box.
2024-10-16 09:41:55 -07:00
Aditya Kumar Kasaudhan 3b1877ea99 invite: Add guest visibility note with live-updating user count.
Previously, when the guest role was selected in the Invite modal and
guests were restricted from viewing all other users, there was no
indication of how many users the invited guests would be able to see
once they joined.

This commit resolves that issue by adding a note in the Invite modal
that dynamically informs users of the number of visible users.

Fixes #31159.
2024-10-15 16:19:00 -07:00
evykassirer 55f97c6559 narrow_banner: Differentiate between unknown channel and new topic. 2024-10-15 13:08:52 -07:00
evykassirer 2c9d4eaeee narrow_banner: Update invalid/private channel empty narrow copy.
Decided here:
https://chat.zulip.org/#narrow/channel/6-frontend/topic/unknown.20channel.20ID.20-.20empty.20feed.20banner/near/1956965
2024-10-15 13:08:52 -07:00
evykassirer 269066e10a settings_org: Convert module to typescript. 2024-10-14 15:33:01 -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
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
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
Lauryn Menard d3987f611c urls: Generate narrow links in frontend with "channel" operator.
Fixes #30385.
2024-10-11 17:00:23 -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
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 0dedd00112 buddy_list: Add span for search section of header.
This is in preparation for adding a three-dot menu to the header,
which we don't want to be a click/hover target in the way the
search parts are.
2024-10-10 14:34:11 -07:00
Karl Stolley bef66b7c40 starred_messages: Match header to left-sidebar icon. 2024-10-10 11:26:46 -07:00
Anders Kaseorg ca8d25f830 tests: Unmock realm_user_settings_defaults.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 16:33:38 -07:00
Anders Kaseorg a2c4e3a220 tests: Use override for realm_user_settings_defaults.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 16:33:38 -07:00
Anders Kaseorg ddf0fafab7 tests: Use override more for realm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 16:20:50 -07:00
Anders Kaseorg e84bb9ff2c tests: Unmock state_data.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 15:34:58 -07:00
Anders Kaseorg 95153b3f0c tests: Use override for realm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 15:34:58 -07:00
Anders Kaseorg 9cd2408e0d tests: Use override for current_user.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 15:34:58 -07:00
Anders Kaseorg 8e49ca163b tests: Unmock user_settings.
We previously auto-mocked this out of expediency, but that made it
impossible to test anything that uses the Zod schemata in the same
module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 15:34:58 -07:00
Anders Kaseorg 4d74ecccf3 tests: Use override for user_settings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 15:34:58 -07:00
evykassirer efe8c4754b settings_org: Use this instead of e.target.
This should work because all the events are either `change` events or
`click` events on elements without children. This change is being made
to make typescript migration easier, ecause we can type `this` more
easily than `e.target`.
2024-10-08 17:52:15 -07:00
evykassirer 4adf6e6c1e buddy_list: Don't rerender whole header when toggling sections.
This will be necessary to get the triangle to rotate when toggled.
2024-10-08 17:41:30 -07:00
Anders Kaseorg ba8b9a445b eslint: Fix unicorn/prefer-node-protocol.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-08 16:54:15 -07:00
Sahil Batra 701e391def user_groups: Use can_join_group setting to check permisison.
This commit adds code to use can_join_group setting when
checking permission to join group in webapp.

Fixes part of #25938.
2024-10-08 12:18:13 -07:00
Sahil Batra 1033230b52 user_groups: Include "can_join_group" field in user group objects.
Fixes part of #25938.
2024-10-08 12:18:13 -07:00
Aman Agrawal 787a37176d message_view: Update date on sticky header after rendering narrow.
On a fresh render of a narrow if the view doesn't scroll,
`update_sticky_recipient_headers` is not called. So, we need call
it after we have scrolled to the message we want to select.
2024-10-07 11:02:13 -07:00
Aditya Kumar Kasaudhan 8994266137 left-sidebar: Use -, _, :, and / as additional topic word separators.
Previously, only spaces were used as word separators when searching
for topics. This meant that searching for "support" would not find a
topic named "topic_support" or "topic/support," which could lead to
unexpected results.

To address this, hyphen (-), underscore (_), colon (:), and slash (/)
have been added as additional word separators for topic filtering in
the left sidebar, as these characters are commonly used as separators
in topic names.

Fixes: #31844
2024-10-04 14:18:43 -07:00
Sayam Samal b09dfb782d reactions: Optimize DOM cost of message reactions via dynamic rendering.
Before, the message reactions section along with the add reaction button
was being rendered for every message even when there were no reactions
present - this led to additional DOM cost.

This commit adds the message reactions section only when there is
at least a single reaction on the message, and follows up with a cleanup
of the message reactions section when there are no reactions.

Fixes #31137.

Co-authored-by: Anmol-dev45 <basnetanmol2020@gmail.com>
2024-10-04 11:09:43 -07:00
Anders Kaseorg a8304fb324 sentry: Address Sentry JavaScript 7.x deprecations.
https://docs.sentry.io/platforms/javascript/migration/v7-to-v8/

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-03 16:09:48 -07:00
Anders Kaseorg 9c2da46966 filter: Fix unparse to round-trip Unicode whitespace operands.
Previously [{operator: "topic", operand: "one\xa0two"}] would be
unparsed to "topic:one\xa0two" which parses as [{operator: "topic",
operand: "one"}, {operator: "search", operand: "two"}], leading to
exceptions in the search pill system.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-03 09:14:31 -07:00
roanster007 81efecf463 stream_topic_history: Update history to only store acked message ids.
Previously, the "stream_topic_history" used to store unacked float
message ids as well in its "max_message_id" of stream and
"message_id" of topic histories.

This commit updates it to rather store only the acked message ids
here, and rather use the "echo_state" module so as to look up
for unacked messages in case of looking for recent topics, or
max message id in functions.
2024-10-02 18:31:32 -07:00
roanster007 da75fed5be echo: Start tracking local messages before updating sidebars.
Previously, when `insert_local_message` was called, the
data structures in the `echo_state` are updated with the new
local messages after calling `insert_new_message`. This would
update the stream sidebar before even updating the `echo_state`
with the new local messages.

This commit introduces `track_local_message`, which basically
updates the `echo_state` data structures with the local
message before actually updating the stream sidebar.

This is a preparatory commit to update stream_topic_history
to only contain acked message ids.
2024-10-02 18:31:32 -07:00
roanster007 359ebfc6c8 filter: Refactor code path which adjusts the narrow containing `with`.
This commit refactors the `ensure_channel_topic_terms` of filter.ts.
Previously, this method used to add channel and topic terms, with
operands as placeholders in case the `with` narrow doesn't have
channel-topic terms.

This commit updates it to rather correct the narrow with the right
terms in case the channel-topic terms are missing in the `with`
narrow, but leave it as it is in case the channel-topic terms are
present, so that it can later be corrected if the channel-topic
terms are not pointing to the right conversation.
2024-10-02 16:22:59 -07:00
evykassirer 9c8cc8c333 buddy_data: Add participants to the top of sorted user list.
This was causing a bug where the participants weren't necessarily
all getting rendered, specifically when there were many subscribers
to a channel, because we render users in batches as buddy list
scrolls, and those users would only show up after some scrolling.

This fix makes sure we always load the participants first.
2024-10-02 09:33:48 -07:00
Shubham Padia 12ebd97f1f settings: Add group_creator as default for can_manage_group.
We create an unnamed user group with just the group creator as it's
member when trying to set the default. The pattern I've followed across
most of the acting_user additions is to just put the user declared
somewhere before the check_add_user_group and see if the test passes.
If it does not, then I'll look at what kind of user it needs to be set
to `acting_user`.
2024-10-01 17:35:14 -07:00
Shubham Padia 91edf59873 settings: Rename can_edit_all_user_groups to use `manage`.
Having both `manage` and `edit` terminologies was confusing, so
this commit ensures that we use `manage` wherever applicable.
2024-10-01 17:35:14 -07:00
Shubham Padia f0b9d610a5 settings: Use `can_manage_all_groups` to control who can manage groups.
We also add the exception for the group creator to be able to edit their
group in this commit. This exception was added in the backend in earlier
commits.
2024-10-01 17:35:14 -07:00
Shubham Padia a9e14a184c settings: Use `can_create_groups` to control who can create user groups. 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