Commit Graph

1600 Commits

Author SHA1 Message Date
Maneesh Shukla
e856294da6 compose: Open the compose box with channel picker.
This commit changes the code in such a way that the
"Start new conversation" button open the compose box with the channel
picker open, as we do when no channels is selected.

Fixes #28410.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>
2024-12-16 10:50:12 -08:00
Karl Stolley
75a82fa8a2 user_circles: Introduce circle icons to typeahead. 2024-12-13 14:33:24 -08:00
Karl Stolley
67a67897f9 user_circles: Introduce status-based hyphenated classes. 2024-12-13 14:33:23 -08:00
Kislay Udbhav Verma
a2c6c11296 timerender: Track browser time zone.
We add a variable `browser_time_zone` to track the same
separately from `display_time_zone`.

This is used to check whether the user profile time zone matches
the browser's time zone, as a part of #16957, and will later be
used in #16958.

We also add methods to check whether a given timezone is the same
as that of the browser, making use of the browser's own
canonicalization process.

Tests are added to ensure that the time zone comparison
logic works for timezones observing DST.

Fixes part of #16957
2024-12-13 12:58:09 -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
Vector73
143ca5065e api: Remove user object from reactions objects in the API.
Removes deprecated `user` object from reactions objects returned by
the API as it is redundant because of the presence of `user_id` field in
the API and is not used by any clients now.
2024-12-13 09:58:25 -08:00
apoorvapendse
5787a11b53 typeahead: Increase token limit to scan '#'.
This commit prepares for a future change where the logic
will switch from returning "topic_jump" in
`tokenize_compose_str`, which causes the typeahead to close,
to returning the sliced token starting from '#'.

A test has been updated to validate the change.

To accommodate typeahead triggers for long stream and
topic names, the token limit is increased from 25 to 40
characters.
2024-12-12 17:35:46 -08:00
Aman Agrawal
a97b3c7e41 conversation_participants: Track participants data in with message data.
This will help us accurately track participants in every narrow
to be used buddy list and other components.
2024-12-12 09:09:30 -08:00
Gunnar Samuelsson
876dd7ca60 popover: Fix misleading time description in right side-bar.
In the right side-bar, the popover states "Active x minutes ago",
even though the user could have been idle before going offline.
In that case we are stating something false, as the user was not
"Active x minutes ago", they were "Idle x minutes ago". Always
prioritizing the active_timestamp if possbile rather than taking
the max of active_timestamp and idle_timestamp fixes this issue.
2024-12-11 12:17:41 -08:00
Anders Kaseorg
26aa19db43 click_handlers: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 12:12:07 -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
Anders Kaseorg
666ce4519d hashchange: Convert module to TypeScript. (#32670) 2024-12-11 09:15:18 -08:00
Shubham Padia
f147e4dd4a Group invalid inputs (#32647)
* css: Extract invalid input outline and shadow colors to variables.

We will use these colors in future for input pills and it would be
convenient to have them in a variable.

* group_setting_pill: Show outline on invalid input.

We could have manipulate the class directly from user_group_pill. But
it felt better to have `show_outline_on_invalid_input` as a param for
the input_pill prototype since we can have a consistent error state for
other pill input boxes if we want to.

* input_pill: Widget should not show as pending after pill creation.

* group_settings: Disable save changes button if pill widget is pending.

This will disable the button for group, realm and stream group settings.

* user_group_create: Don't go to next step with pending group widget.

We just show the red outline and shaking animation as an indication that
a group widget setting is pending when the user tries to go to the add
members step.

* stream_create: Don't go to next step with pending group widget.

Fixes #32113.
We just show the red outline and shaking animation as an indication that
a group widget setting is pending when the user tries to go to the add
subscribers step.
2024-12-10 16:57:48 -08:00
Aman Agrawal
91714b5f1b user_topics: Extract method to check if topic is visible in-home. 2024-12-08 18:34:28 -08:00
Emil Grehn
06aab30133 message_forwarding: Make forward message keep original topic by default. 2024-12-06 11:59:44 -08:00
Anders Kaseorg
7466ee977f empty_feed_notice: Update “stream” to “channel”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-05 16:54:38 -08:00
Sahil Batra
cbada036a9 user-groups: Live update membership status text.
This commit adds code to live update the membership status text
when a user is added or removed from a group that is subgroup
of the group opened in the right panel of groups UI.
2024-12-05 10:35:41 -08:00
Sahil Batra
ded36004bb group-settings: Show membership details in right panel.
We now mention if user is member of the group in the "Members"
tab, also including the details about whether the user is direct
member or is member by being direct member of one of the subgroups.
2024-12-05 10:35:41 -08:00
Emil Grehn
f9b95bd4f3 message_quoting: Add a "Forward message" option below "Quote message".
Forward message starts a new message with the quoted context
(message or selection).
The compose box opens with then channel picker open and no topic.

Also added documentation about this feature in the help center.

Fixes part 2 of #31953
2024-12-04 22:25:14 -08:00
Emil Grehn
8e9d581746 message_quoting: Rename 'quote_and_reply' to 'quote_message'.
To be consistent with the new naming in the app
'quote_reply' was also renamed to 'quote_message'

Fixes part of #31953
2024-12-04 22:25:14 -08:00
Emil Grehn
58d91dacd5 message_quoting: Rename 'Quote and reply' to 'Quote message'.
'Quote message' is a more accurate decription, as this option inserts
the quoted text into whatever message you're composing or editing;
it does not necessarily start a new reply.

Fixes first part of #31953.
2024-12-04 22:25:14 -08:00
Shubham Padia
173c09e32b stream_events: Loop over stream group settings for update_property. 2024-12-04 12:26:16 -08:00
opmkumar
5eb51e2df6 message_edit: Add message length limit indicator in edit message UI.
Adds a message length limit indicator similar to the one in the compose box.
The tooltip message for the disabled save button now appears dynamically
based on whether the message exceeds the length limit or the editing time
has expired.

Fixes #25271.
2024-12-04 11:44:51 -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
Sahil Batra
367a0bdbff groups: Remove id_field_name field from GroupPermissionSetting.
id_field_name was being used only to set the initial dummy
values for realm settings. We can directly add "_id" to the
setting name instead of having an extra id_field_name field.
2024-12-04 11:15:17 -08:00
Sahil Batra
121df45cc4 groups: Remove allow_owners_group field from GroupPermissionSetting.
As we now allow anonymous groups and settings can be set to any
set of users, there is no benefit in not allowing a setting to
be set to "Owners" group.
2024-12-04 11:12:28 -08:00
Shubham Padia
7e92c2ad16 streams: Use can_administer_channel_group to administer channel.
Fixes #31959.
2024-12-03 18:38:25 -08:00
Kislay Verma
dfc1ea785f markdown: Support message link syntax in local echo.
This is a followup to #31965 where we added
support for a new syntax for message links.
The frontend markdown processor didn't local
echo the syntax properly, resulting in a
rendering glitch in the messages.
2024-12-03 10:41:37 -08:00
Shubham Padia
bf73e1711d user_group: Disable leave checkmark if user isn't a direct member.
If the user is not a direct member, but a member via a subgroup, we will
show the list of subgroups beloging to that group which the current user
is a direct member of in a tooltip. The cursor on the checkmark will be
default in this case instead of a pointer.
2024-12-02 17:59:18 -08:00
Shubham Padia
8a28b31be3 user_group: List groups that a user is associated via subgroups.
In `Group settings` -> `Your groups` and `User Profile Popover` -> `User
groups`, we only listed groups that a user was a direct member of. Now,
we will also list groups that a user is not a direct member of, but
associated via a subgroup.
Fixes #32486.
2024-12-02 17:59:18 -08:00
Sahil Batra
da02135f88 group-settings: Use new setting for controlling removing members. 2024-12-02 17:38:46 -08:00
Sahil Batra
7e6a02b82d user_groups: Add setting to control who can remove members.
This commit adds a new setting to control who can remove
members from the group.
2024-12-02 17:38:44 -08:00
Sahil Batra
3c97fbd646 tests: Refactor tests for group permission settings.
This commit refactors test such that we can test functions
used for different group permissions without duplicating
too much code.
2024-12-02 17:29:56 -08:00
Sahil Batra
819ab3989e groups: Enable joining group if user can add members.
We already allow a user to join the group if they can add members
to that group in the API, but it was not allowed in the UI. This
commit fixes the UI.
2024-12-02 17:29:56 -08:00
Aman Agrawal
e5db6ac557 filter: Fix check for is personal filter. 2024-12-02 16:41:36 -08:00
Shubham Padia
940b7e38f8 stream: Use existing group declarations for can_unsubscribe_others.
The test was declaring all groups again and creating them, this commit
ensures that it uses the share-able code.
2024-12-01 19:32:22 -08:00
Shubham Padia
dbf9f2d181 stream: Use generic update_stream_permission_group_setting.
We will not have to create a new function for every setting that we add
in the future.
2024-12-01 19:32:22 -08:00
Aman Agrawal
1aee0ef98b stream: Use is_recently_active to check active status. 2024-11-27 17:31:06 -08:00
Anders Kaseorg
cf7e420847 templates: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-27 13:52:21 -08:00
Pratik Chanda
fb0ae31206 typeahead: Remove empty user groups from typeahead suggestion.
Earlier, user groups with deactivated users or empty groups would
show up in the typeahead suggestion.

This commit removes empty user group while iterating over each group
items.

Fixes: zulip#30890.
2024-11-27 10:26:44 -08:00
Anders Kaseorg
cac3bca409 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-27 09:54:56 -08:00
sujal shah
771d3b1434 invites: Enable adding users to user groups during invitations.
This commit allows users to be assigned to custom groups when
inviting them to join Zulip, similar to how channels are handled.
The implementation follows a similar pattern for adding pills,
ensuring consistency, as user groups and channels are parallel
in nature.

Fixes #24365.
2024-11-26 11:26:34 -08:00
evykassirer
8fff2fcd3c stream_events: Assume mark_unsusbscribed sub is defined.
THere's only one call to this function, which should have
a defined `sub`, so we can enforce this through typescript
instead of doing an `undefined` check.
2024-11-26 09:18:12 -08:00
evykassirer
12c18a026b stream_events: Remove error for undefined sub, enforce through typescript. 2024-11-26 09:18:12 -08:00
evykassirer
64c8884487 stream_events: Convert module to typescript. 2024-11-26 09:18:12 -08:00
bedo
bf05694e59 message_list_view: Move "is_search_view" to narrow_state.
This helper function is only ever used to describe the current view,
so it might as well be in the module for such views.

Also added the test coverage for "is_search_view".
2024-11-25 09:47:10 -08:00
Shubham Padia
7cfa110934 settings: Realms with limited plans cannot change can_create_groups.
We do not allow realms on a limited plan to create groups. This commit
adds a banner to upgrade to the can_create_groups org setting and
disables editing it on the backend.
This commit also adds a new method called
`disable_group_permission_setting` to easily disable similar settings.
2024-11-22 13:42:59 -08:00
Sahil Batra
7a6159eee2 streams: Do not show archived streams in dropdown.
Dropdown widget in compose box and in message move modal should
not show archived streams in dropdown as we do not allow sending
messages or moving messages to archived streams.

We need a more focused audit of code for fixing other things
where archived streams are shown.
2024-11-22 10:40:59 -08:00
Sahil Batra
d1e76a9281 streams: Allow admins to unsubscribe others irrespective of setting. 2024-11-21 11:28:54 -08:00