Commit Graph

39 Commits

Author SHA1 Message Date
Evy Kassirer
10a815cae7 stream_data: Rename add_sub to add_sub_for_tests. 2025-09-30 12:52:47 -07:00
Anders Kaseorg
40a022dcc3 zephyr: Remove Zephyr mirroring support.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-16 11:18:18 -07:00
Kislay Verma
67ca49488f tests: Use make_realm to create type-correct realm objects.
Another step in the direction of improving node tests
and using type-correct organic data as much as possible.
2025-08-28 11:35:07 -07:00
Kislay Verma
c134cc398f tests: Add library function to create user groups.
This is done to ensure the objects exactly match
the schema/types during tests.

Fixes part of #32326.
2025-08-11 11:57:49 -07:00
Evy Kassirer
55634c8fcc peer_data: Use sub.subscriber_count for get_subscriber_count. 2025-07-16 13:11:56 -07:00
Vector73
71342169ff stream_settings: Update organization default dropdown labels.
Updates labels for organization default options in "topics policy"
and "message retention policy" channel settings.

Fixes #35212.
2025-07-11 12:31:03 -07:00
Vector73
b612351e48 stream_setting: Add setting for who can move messages out of channel.
Adds `can_move_messages_out_of_channel_group` channel-level
permission for who can move messages out of the channel.

Fixes #34243.
2025-06-24 16:52:53 -07:00
Vector73
703601a5d5 stream_setting: Add setting for who can move messages within channel.
Adds `can_move_messages_within_channel_group` channel-level
permission for who can move messages within the channel.
2025-06-24 16:52:53 -07:00
Vector73
43dcc6e3fd bug: Fix incorrect topic resolution check.
Previously, when sending messages to resolved topics, the warning
suggesting to resolve that topic used wrong check to verify if the
user is allowed to resolve the topic. This commit fixes that.
2025-06-24 16:52:53 -07:00
Vector73
6094bbe8a5 stream_settings: Add new topics_policy setting.
Added `topics_policy` channel setting to configure sending
messages in the empty topic.

Fixes #33549.
2025-06-17 17:05:58 -07:00
Vector73
62c67eae8e settings: Add a new topics_policy realm setting.
Added a new realm setting, `topics_policy` and deprecated
`mandatory_topics` setting as it now replaced by `topics_policy`.

Fixes part of #33549.
2025-06-17 17:05:58 -07:00
Anders Kaseorg
f3cb557fb2 compose_validate: Avoid jQuery sizzle extension :visible.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-18 16:22:15 -07:00
Anders Kaseorg
7c6d040fd8 compose_recipient: Avoid jQuery sizzle extension :visible.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-18 16:22:15 -07:00
Evy Kassirer
464b7f4540 compose_state: Rename private_message_recipient to clarify it stores emails.
This will add clarity as we move towards using ids more and emails
less.
2025-05-16 10:51:29 -07:00
Evy Kassirer
8fab9a23ce compose_validate: Fetch all subscribers before private channel warning.
Work towards #34244

This is the only call to `peer_data.is_subscriber_subset`, so after
this commit all calls to that function work with our new model for
partial subscriber data.
2025-05-06 10:26:36 -07:00
Evy Kassirer
768f8bc968 compose_validate: Fetch subscribers before unsubscribed user mention warning.
Work towards #34244.
2025-05-06 10:09:36 -07:00
Evy Kassirer
4b9515e181 compose_validate: Remove invalid email messaging.
This should no longer be possible because we validate emails
before creating user pills.
2025-05-06 09:53:47 -07:00
Sahil Batra
4f80823191 settings: Fix opening settings for guests who cannot access all users.
Opening settings and stream settings UI was not working for guests
if they could not access all users. This was because is_person_active
did not handle inaccessible users correctly, if they were not added in
the users data, when being called in get_group_members to render
group pills.
2025-04-14 11:44:11 -07:00
Aman Agrawal
ad0b616bbd compose: Remove old style compose send disable.
We now use `disabled-message-send-controls` class to control
the disabled status of send button. So, this is not required.
2025-03-25 11:28:43 -07:00
Prakhar Pratyush
f8bedf3e3a compose_validate: Fix topic required error message not shown.
Earlier, with `realm_mandatory_topics=true` the topic required
error message was shown only when topic="".

The error message was missing for other topic names which are
also considered empty:
* "(no topic)"
* realm_empty_topic_display_name

This commit fixes the bug to show the error message for the
other two topic names too.
2025-03-18 11:18:37 -07:00
Tim Abbott
a6c5ddf102 compose_validate: Fix buggy separated handling of empty compose box.
When I adjusted 4fbf91c135 to no longer
do a full re-validation on every character typed, that unmasked bugs
in how the compose_setup handler code and compose_validate split
responsibility for validating 0-length messages.

The user-facing result was the send button not enabling properly when
starting to type.

Fix this by moving the 0-length message validation into
compose_validate, where we already handle issues of too-long messages,
sharing the same basic logic for determining when to do a full
validate() call.

A benefit of this reworking is now all of the logic for handling the
`invalid` class is in one place in validate, rather than split with
the compose_setup module.
2025-03-17 14:15:12 -07:00
Aman Agrawal
4fbf91c135 compose: Fix buggy tooltip on validation.
Compose send tooltip was not correctly displayed when the compose
box was in an invalid state.

We significanlty improve the logic for displaying the tooltip here
to provide a more robust experience to the user.
2025-03-17 11:35:56 -07:00
Karl Stolley
cae48d3faa compose: Rename placeholder update function for clarity. 2025-02-26 13:59:02 -08:00
Sahil Batra
166d9282b8 streams: Use can_subscribe_group setting for checking permission.
This commit adds code to use can_subscribe_group setting in webapp.

Fixes part of #33417.
2025-02-25 13:17:15 -08:00
Apoorva Pendse
2b250e7e64 compose_validate: Refactor conditionals for existing errors.
Pre commit for #32115.
2025-02-23 23:11:18 -08:00
Apoorva Pendse
979b4203c7 compose_banner: Reword no channel selected banner error.
Preparatory commit for #32115.
2025-02-23 23:11:18 -08:00
apoorvapendse
6a443c0418 compose_banner: Update message for no private recipient.
This commit updates the error banner message when no
private recipient is specified.
2025-02-23 23:11:18 -08:00
Anders Kaseorg
4e04eed745 typos: Fix typos caught by typos and mwic.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-18 19:44:02 -08:00
Vector73
2ef9695ef0 settings: Migrate wildcard_mention_policy to group-based permission.
Added new group-based permission setting
`can_mention_many_users_group` to replace `wildcard_mention_policy`.
2025-02-12 23:21:33 -08:00
Vector73
cb6f0fd63c realm: Add setting to notify user on DMing guest.
Added `enable_guest_user_dm_warning` setting to decide whether
clients should show a warning when a user is composing to a guest
user in the organization.

Fixes #30078.

Co-authored-by: adnan-td <generaladnan139@gmail.com>
2025-02-06 12:15:41 -08:00
Shubham Padia
1b8115d8e7 compose: Use can_subscribe_others to check permissions. 2025-01-22 14:27:06 -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
Prakhar Pratyush
de78864b8c compose: Add support to send channel message with empty topic name.
Previously, the client tweaked messages sent in a channel with
an empty topic box to use the topic "(no topic)".

This commit updates the behavior to stop applying that tweak.
Messages will now be sent with an empty string as the topic
as we now support the empty string as a valid topic name.
2025-01-10 14:32:55 -08:00
Steve Howell
a1217fbc5a compose_validate test: Use FakeComposeBox for size limits.
This commit simplifies a compose_validate test by
using FakeComposeBox.

It also exposes $send_message_form to the callers.
(The general idea here is that for any individual
test, we don't want the developer to have to
switch between thinking about low-level zjquery
idioms and higher-level abstractions.)

This commit also removes the use of mock_template,
since the template in question generates trivially
easy html to deal with (and we verify the actual
effects to the DOM).
2025-01-09 15:08:17 -08:00
Steve Howell
a6f2197091 node tests: Broaden what FakeComposeBox.reset does.
I moved some existing code into reset, as well as
making sure a common banner has zero length.
2025-01-09 15:08:17 -08:00
whilstsomebody
569b07477b compose: Rename over_limit to textarea-over-limit.
According to the current naming convention, underscores are used
instead of hypens in class names, and this is more globally unique for
its meaning.
2025-01-07 17:49:31 -08:00
Sahil Batra
bbf43a2866 stream-settings: Use new "can_send_message_group" setting. 2025-01-07 12:17:36 -08:00
opmkumar
88727862b4 compose: Refactor functions for handling max length limits.
Refactors `check_overflow_text` and `validate_message_length` functions.
This commit ensures that there won't be any change in the existing UI
of the compose box with the refactoring of the above functions.
2024-12-04 11:44:51 -08:00
Anders Kaseorg
687f1b1651 tests: Rename the Node tests to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00