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.
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
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.
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>
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.