Commit Graph

61553 Commits

Author SHA1 Message Date
evykassirer b826143537 buddy_list: Fix bug where header didn't show correct participant count. 2024-10-29 16:06:41 -07:00
evykassirer 3db32f1416 buddy_list: Rename all_participant_ids.
This helps avoid confusion with `participant_user_ids`
which is a property of the buddy list and describes
the currently visible participants, whereas
`all_participant_ids` describes all participants,
even those hidden due to search.
2024-10-29 16:06:41 -07:00
evykassirer 2b168a9936 buddy_list: Show empty placeholder for participants section in search.
This was overlooked when we added this section because it usually
can't have an empty placeholder, but it actually still can in search.
2024-10-29 16:06:41 -07:00
evykassirer f157bfe181 buddy_list: Simplify logic to update empty list placeholders.
Because we regularly change what we want the placeholder
text to be, as the user enters and exits search, it's simpler
to just not use `data-search-results-empty` and set up the
placeholder from the buddy list code directly. Previously we
were trying to sometimes use `data-search-results-empty` and
sometimes set it directly, which is more confusing and complex.
2024-10-29 16:06:41 -07:00
evykassirer d0dc33d8da buddy_list: Move fill_screen call to the end of populate().
Sometimes we might want to re-fill the screen after collapsing
or uncollapsing a section, so it's better to fill the screen
just once after determining if we should collapse the "other
users" section. Also, this commit removes a call to
`render_section_headers()` because that's always called at the
end of `fill_screen_with_content()`.
2024-10-29 16:06:41 -07:00
evykassirer b335c19d1c buddy_list: Refactor section collapse logic to be shared. 2024-10-29 16:06:41 -07:00
evykassirer ec1b265ff8 buddy_list: Refactor section toggle to not need custom classname. 2024-10-29 16:06:41 -07:00
Sahil Batra f29083f2ef settings: Disable save button if nobody group is not allowed.
This commit adds code to disable the save button if there no
pills selected for the setting and the setting cannot be set
to "Nobody" group.
2024-10-29 15:06:16 -07:00
Sahil Batra 8fa225d885 settings: Use new pills UI for group related realm settings.
This commit updates the code to use new UI for can_create_groups
and can_manage_all_groups settings.
2024-10-29 15:06:16 -07:00
Sahil Batra c8e906d49e settings: Use pills UI for channel creation settings.
We now use new pills UI for public and private channel
creation settings. The UI for web-public channel
creation setting is still a dropdown as we allow only
system groups for that.
2024-10-29 15:06:16 -07:00
Sahil Batra 60b12367cc settings: Use new settings UI for create_multiuse_invite_group. 2024-10-29 15:06:16 -07:00
Sahil Batra d370499557 settings: Refactor create_group_setting_widget.
This commit updates create_group_setting_widget code
to not accept setting type as a a parameter as we
would use separate function for realm settings.
2024-10-29 15:06:16 -07:00
evykassirer 35424adcc3 settings_account: Convert module to typescript. 2024-10-29 14:50:25 -07:00
evykassirer 8eb0ca3a7c settings_account: Move async call into ui_init. 2024-10-29 14:50:25 -07:00
evykassirer 7431d87d0c settings_account: Fix type for failure_msg_html (undefined). 2024-10-29 14:50:25 -07:00
evykassirer a6850410a8 settings_account: Use `this` instead of event target.
The first two are equivalent because they call `closest`
and the last one is directly equivalent. We're making these
changes to aid with the conversion to typescript.
2024-10-29 14:50:25 -07:00
evykassirer adf3280f1e settings_acount: Standardize type passed to update custom fields. 2024-10-29 14:50:25 -07:00
Sahil Batra caf919fca2 user_groups: Don't allow adding deactivated groups as subgroups in UI.
We already have the code to ignore the deactivated groups before
sending the request and show appropriate message. This commit
just adds code to not show them in the typeahead and also not
create its pill if user types the full group name.
2024-10-29 11:02:03 -07:00
Sahil Batra 69c0a772cc user_groups: Do not allow manually entering pills of invalid subgroups.
Even though we do not show groups that cannot be used as subgroups
in typeahead, user can still type the complete to get the pill
and make the request to the server which currently returns not so
good error message. This commit fixes it to not create the pill for
such cases and hence not making any request to server.
2024-10-29 11:02:03 -07:00
Sahil Batra 98ed8d8f49 add_subscribers_pill: Extract function for enabling/disabling the button.
This function will be used to handle the add button in group members
UI as well.
2024-10-29 11:02:03 -07:00
Sahil Batra 98255677d7 user_groups: Extract function to check if group can be used as subgroup.
We would use the same function in further commit to not add pills
for invalid subgroups by typing the full group name.
2024-10-29 11:02:03 -07:00
Aman Agrawal 5cdd17a7f1 unread_ops: Fix channel narrow not marked unread.
Mark as unread from here was not working in a channel feed when
we don't have all the messages fetched locally since the
channel ID was incorrectly passed as a string.

Copied the correction code from bulk_update_read_flags_for_narrow.
2024-10-29 10:48:48 -07:00
Aman Agrawal 4e00fb1d67 unread_ops: Remove unused parameters. 2024-10-29 10:48:48 -07:00
Mateusz Mandera d708a1bea5 tests: Fix order of mock.patch in use_s3_backend.
This is a somewhat hacky and fragile fix. Due to the order in which
imports seem to happen, the original ordering breaks
RealmImportExportTest: if one of the `use_s3_backend` tests runs before
test_import_realm, the latter will fail while processing thumbnailing,
as S3UploadBackend ends up leaking and
zerver.worker.thumbnail.upload_backend is still set to S3.

By making that mock.patch the first one that gets entered, and thus the
last one to get cleaned up, we fix the leak and upload_backend is set
back to LocalUploadBackend as it should.
2024-10-29 10:43:10 -07:00
Karl Stolley eb31fdbe3c buttons: Shore up styles on a.button instances. 2024-10-29 10:41:32 -07:00
Karl Stolley aaaa52c5c0 buttons: Ensure active buttons take .button:active background color. 2024-10-29 10:41:32 -07:00
Sahil Batra 6264d59ea7 help: Add tip mentioning who can join the group. 2024-10-29 10:38:52 -07:00
Alya Abbott de5a9d13c1 channel settings: Remove extraneous channel name from modal. 2024-10-27 22:03:30 -07:00
Alya Abbott 29b2eeb3b3 help: Improve documentation about starting a new conversation.
Document new ways to do it from the left sidebar.
2024-10-25 16:41:29 -07:00
Aman Agrawal 1de1570a0c narrow_state: Extract cannot compute response. 2024-10-25 16:33:00 -07:00
sanchi-t 88082bc25b help: Basic update to archiving channels. 2024-10-25 16:06:43 -07:00
sanchi-t 1577d45575 compose_validate: Show error banner for archived streams. 2024-10-25 16:06:43 -07:00
sanchi-t c73038edea streams: Restrict access to archived streams. 2024-10-25 16:06:43 -07:00
Sanchit Sharma 795b2ba14e do_deactivate_stream: Remove unnecessary mutations.
Streams should not be marked as private, and subscribers
of the deactivated stream should not be removed.

Update the confirmation message when archiving a stream.
2024-10-25 16:06:42 -07:00
sanchi-t f04fb937a3 narrow: Remove blueslip error code line.
When clicking on a message from an archived
stream, the `adjusted_terms` may be null since
archived streams are not sent back to the client.
This results in an error for the user.
2024-10-25 16:06:42 -07:00
sanchi-t e60711f871 stream_create: Add functionality to rename archived streams.
Users with appropriate permissions will now have the option
to rename archived streams.
2024-10-25 16:06:42 -07:00
sanchi-t 5dfa8ac9fe popover_menus_data: Hide actions user can't take for archived channels. 2024-10-25 16:06:42 -07:00
sanchi-t e8bb9e2de1 get_invite_stream_data: Do not display archived channels.
User should not be able to sent invite for archived channels.
2024-10-25 16:06:42 -07:00
sanchi-t dbc90ba2e5 stream_list: Prevent archived channels to show up in left sidebar. 2024-10-25 16:06:42 -07:00
sanchi-t 4b90741f91 can_post_messages_in_stream: Add condition check for archived streams.
Prevents users from sending any message in an archived stream.
2024-10-25 16:06:42 -07:00
sanchi-t 7e97358c35 home: Update `client_capabilities` for viewing of archived streams. 2024-10-25 16:06:42 -07:00
sanchi-t f257188ab5 sub_store: Remove unused function `delete_sub`.
Function `delete_sub` was exclusively called by `stream_data.delete_sub`.
With the change in the approach where we no longer remove subscriptions
from `stream_info` and `subs_by_stream_id`, the `delete_sub` function is no
longer needed.
2024-10-25 16:06:42 -07:00
sanchi-t 5ce2b307c4 stream_info: Remove now-unused function `delete`.
Previously, when archiving a stream `delete` function was used to
remove stream from `stream_info`. However, with the current
approach, we don't remove stream instead  we use the `set_false`
function to mark streams as false, making the `delete`
function unnecessary.
2024-10-25 16:06:42 -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
sanchi-t 616e39c290 stream_data: Make `Subscribe` button not visible for archived streams. 2024-10-25 16:06:42 -07:00
sanchi-t a917215292 get_subs_for_settings: Exclude archived streams from `All Streams` menu.
Don't display stream settings for archived channels.
2024-10-25 16:06:42 -07:00
sanchi-t ca9ac293f3 sub_store: Add `is_archived` field to `Stream` type. 2024-10-25 16:06:42 -07:00
sanchi-t af7ebde9e4 subscription: Include archived channels in streams list.
`is_archived` field is added to the stream and types.

Include a new `archived_channeels` client capability, to allow clients
to access data on archived channels, without breaking
backwards-compatibility for existing clients that don't know how to
handle these.

Also, included `exclude_archived` parameter to `/get-streams`,
which defaults to `true` as basic clients may not be interested
in archived streams.
2024-10-25 16:06:40 -07:00
sanchi-t c6fc25e5df do_deactivate_stream: Do not rename streams during archiving.
Functions related to archived streams are also updated.
2024-10-25 15:56:04 -07:00