This should greatly reduce the symptoms of a bug where a stale
realm_users cache (missing a newly created user) results in the web
client missing the new user and throwing exceptions.
This commit adds support for unarchiving archived channels
by introducing the `is_archived` parameter to the
`PATCH /streams/{stream_id}` API endpoint. Sending a PATCH
request with `is_archived: false` will unarchive the specified
channel.
This commit reorganizes the code in enable_or_disable_save_button
method, and improves its readability. It also replaces the previous
tooltip logic for the disabled save button in the save/discard widget
with the more standardized methods to handle the same from ui_util.ts.
Work towards #34244.
We can guarantee this because the add subscriber typeahead (and the
rest of the subscribers tab) is only visible once subscribers have
been loaded.
Work towards #34244.
Now that we're supporting partial subscriber data, we might need
to fetch the full list of subscribers when opening the subscribers
tab of the edit channel modal.
This commit handles a slow load with a loading spinner while we fetch
the data, and also makes sure to ignore the data if it's received after
it stops being relevant (in case the user has another stream's data open).
Both of these handlers immediately hide the banner, so the difference
between .on() and .one() doesn’t matter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
For channel dropdowns in move messages and move topic modals
only subscribed channels are included.
To fix it, a new function is made to include subscribed
and unsubscribed channels to which the acting user has
content access. Each group is sorted respectively with
subscribed channels followed by unsubscribed channels.
To avoid unsubscribed channels from getting included in the
compose box dropdown and saved snippets UI, a separate function
get_stream_for_move_messages_widget is made. This function
is used to include unsubscribed channels in move selector
dropdown only.
Fixes#33670.
It doesn't make sense that there would be no compose pill user ids
if there were compose pill emails, and there needs to be permission
to send a direct message or the message won't successfully send.
This was working before because `user_ids_string` ended up empty
in `validate_private_message`, which incorrectly returned true
for `check_dm_permissions_and_get_error_string`.
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.
Changes done here are -
- Previously the pill input, "Add" button and tooltip shown
when user did not have permission were not live updated when
updating can_add_subscribers_group and can_subscribe_group
stream level settings or can_add_subscribers_group realm
level setting. This commit fixes that.
- Also, when the UI was live updated to give user permission
to subscribe others, "Add" button was enabled even when
input was empty. This is also fixed in this commit.
Work towards #34244.
Note that this doesn't show the right counts when the counts appear, because
yet. We can double check functionality after that change is complete.
We have added an ability to partially load subscribers,
and this function name makes it more clear what it returns,
in contrast to an upcoming `get_full_subscriber_set`.
This was added in b387ca4, before we had
`buddy_list.update_empty_list_placeholders`
Now it's not only duplicating that functionality, but will soon
maybe run at the wrong time once the buddy list `populate` starts
making `void` calls to `async` empty list placeholder code.
This commit
- Replace the blank option with an italicized option that's the current
default language, if there is one selected with "default" label.
- Make the "text" option more informative by adding (no highlighting)
to the label.
- Remove the hint for "text".
- Prioritize as left to right, before start typing:
blank/default language, text, quote, spoiler, math, everything else...
fixes: #33682