Commit Graph

27 Commits

Author SHA1 Message Date
Shubham Padia
3a728aea6f user_profile: Use can_subscribe to show streams in subscribe widget.
We were just checking the realm wide setting before to determine whether
to show the subscribe widget or not. `can_subscribe` of
`get_streams_for_user` had already been using `can_subscribe_others`,
so it was aleady following the new logic to determiner whether a user
can subscribe others to a channel. So there was no change needed there.
We were using the realm wide permsision to determiner whether to show
the widget or not, but now we use the number of subscribe-able
unsubscribed channels to determine whether the widget should be shown
or not.
2025-01-22 14:27:06 -08:00
Shubham Padia
2ccfe36f01 settings_data: Rename user_can_subscribe_other_users.
Rename it to `can_subscribe_others_to_all_streams` to accurately reflect
what it does.
2025-01-22 14:27:06 -08:00
whilstsomebody
14d96bf932 user_profile: Fix incorrect rendering of groups and channels list.
It was found that adding or removing an item from a group
or channel list updated the list correctly initially.
However, when revisiting the group or channel list tab, the
removed item was still present. The item was only removed
after closing and reopening the user profile menu popover.

This commit fixes the bug by correctly fetching the data
and live-updating the list.
Also, we used to re-render the groups and channels list
everytime we opened the groups or channels tab. Now, we
render the list only once when the corresponding tab is
opened for the first time.

Fixes: #33071
2025-01-22 09:29:32 -08:00
Sahil Batra
638670dc94 user-groups: Use get_display_group_name consistently.
We use user_groups.get_display_group_name consistently in
all the places where group name is showed, even when we
know that the UI won't display system groups to maintain
consistency.
2025-01-13 09:33:52 -08:00
Saubhagya Patel
aa8f47774f settings: Validate the Name input field while editing a user or a bot.
This commit adds a validation step that disables the Submit
button in the Manage user tab and the Manage bot tab
when the Name input field is empty.

Fixes #22904.
Co-authored-by: Alessandro Campagna <alecostacamp@gmail.com>
2025-01-07 09:52:48 -08:00
Saubhagya Patel
2991ed03e0 user_profile: Hide error when receiving a successful response.
When editing a user or bot profile via the Manage User or Manage
Bot overlay, an error was not hidden after receiving a successful
response from the server. This commit ensures the error is hidden
upon a successful response.
2025-01-06 15:04:49 -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
Sahil Batra
c4058ffc22 user_profile: Use grid layout for stream search input.
This commit updates CSS to use grid layout for stream
search input in user profile modal so that we can have
clean CSS and do not have different values for padding,
right and margin properties at different places.

This also fixes the alignment of "x" button.

Also, the heading and search input were not aligned
perfectly, so changed the CSS to they align better.
2024-12-10 09:47:01 -08:00
Pratik Chanda
44b498f96b user_profile: Add tooltip to user group remove button when disabled.
This commit adds a tooltip to disabled buttons which lists subgroups
user is part of.

Fixes: zulip#32487.
2024-12-03 17:18:27 -08:00
Pratik Chanda
16e9099015 user_profile: Add remove button to each group row in groups tab.
Earlier, only group name were shown in user profile groups tab.

This commit adds a remove button to each group row if current user
has permissions to remove the user from groups.

Fixes part of zulip#32487.
2024-12-03 17:18:27 -08:00
Pratik Chanda
6635b0edf6 user_profile: Update user_groups_list_widget on member_edit events.
This commit stores and updates user_groups_list_widget on member
edit events on any group member updates.
2024-12-03 17:18:27 -08:00
Anders Kaseorg
ee11d73c1f user_card_popover: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-27 22:05:38 -08:00
evykassirer
919cebe0f9 components: Let toggle label be optional.
`stream_settings_ui` has only `label_html` and no `label`,
so we need fix this type to be able to convert that module
to typescript.
2024-11-19 14:01:10 -08:00
Sayam Samal
e9e009bc9a user_profile: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
2024-11-14 12:03:36 -08:00
Sayam Samal
f529c992f5 settings_components: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
2024-11-14 12:03:36 -08:00
Anders Kaseorg
ec3177c834 web: Add explicit extensions to imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Maneesh Shukla
158cb6c747 settings: Extract common logic for hide_spinners.
Move the redundant code for hiding spinners and re-enabling buttons into
a common `hide_spinner` function inside `loading.ts`. This reduces
duplication between `hide_button_spinner` and `hide_dialog_spinner`.

Fixes #26691.
2024-11-01 12:10:28 -07:00
Maneesh Shukla
666e7bf433 settings: Extract common logic for show_spinner.
Consolidate the repeated logic for showing spinners into a shared
`show_spinner` function in `loading.ts`. This eliminates code
duplication between `show_button_spinner` and `show_dialog_spinner`,
streamlining spinner initialization and button disabling.

Fixes part of #26691.
2024-11-01 12:10:28 -07:00
evykassirer
35424adcc3 settings_account: Convert module to typescript. 2024-10-29 14:50:25 -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
joseph
89d29ae569 user_setting: Correct selector for channel input filter.
Previously, we were selecting the wrong input element, which caused an
unexpected undefined type error. This change corrects the selector to
properly select the input element.
2024-09-22 22:15:42 -07:00
Sayam Samal
b57a261035 user_profile: Fix faulty custom profile field copy buttons.
This bug was introduced in 7232ff6, which while adding the
copy-to-clipboard support for the custom profile field links, removed
the ClipboardJS reference to the ".copy-custom-field-url" class.
2024-09-20 15:44:20 -07:00
Sahil Batra
5c7756e1ef user_profile: Update stream dropdown option value to be of "number" type.
It is better to have stream dropdown option value, which is the ID
of the stream, to be of "number" type.

This fixes the assertion error which occurred when someone tried to
subscribe the user to a stream from user profile modal.
2024-08-23 09:12:43 -07:00
evykassirer
d9f25d01a1 web: Use util.the for accessing element of single-item lists. 2024-08-20 09:48:15 -07:00
afeefuddin
e746c8899b user_profile: Set original_values in show_user_profile. 2024-08-19 10:16:15 -07:00
afeefuddin
19b85eb600 user_profile: Convert module to TypeScript. 2024-08-12 09:40:33 -07:00