`zulip_update_announcements_stream` should be set to None when its
channel is deactivated. This commit adds a safeguard to explicitly
raise an error if it is found in a deactivated state, indicating a
potential bug that needs investigation.
Without this commit, we won't face any runtime error but the error
raised would be at a much later stage i.e. while sending message,
with a generic error message i.e. "Not authorized to send to channel "
which would require further investigation to determine the root cause.
This commit helps with an early return and better error message
to debug.
This commit adds test to verify that we skip the update messages
and directly update the `zulip_update_announcements_level` to the
latest level when the configured `zulip_update_announcements_stream`
is deactivated.
When a stream configured for any of these settings is deactivated,
the corresponding realm settings should be set to NULL:
* new_stream_announcements_stream
* signup_announcements_stream
* zulip_update_announcements_stream
* moderation_request_channel
Earlier, we were not updating those realm settings to NULL.
We had helper functions like 'get_new_stream_announcements_stream'
to return None if the configured stream was deactivated.
But it makes more sense to just set them to NULL in DB.
This commit also includes a migration to clear those fields
if the configured channels are deactivated.
This commit updates the docs to specify that when topics are
required in an organization, the `topic` parameter in
`POST /messages` and `PATCH /messages/{message_id}` cannot be
* "(no topic)"
* an empty string
* `realm_empty_topic_display_name`.
We likely added this logic to allow links to be opened in new tab
on ctrl + click and not trigger text selection.
We retain this behaviour but allow selection of empty view text.
This commit updates the wording related to topic-permalink in
`/api/message-formatting` to clarify that the condition applies
when a topic has no messages, not when the topic name is empty.
Also, it reorders examples so that similar input formats are
grouped together, improving readability.
This commit adds support to display `Message.EMPTY_TOPIC_FALLBACK_NAME`
value (translated) in the push notifications for topics having the
actual value of empty string.
Fixes part of #32996.
This commit refactors the code so that we can correctly update the
permissions panel when a group gains permission. The changes done are-
- Extracted templates for subsection for stream and group settings
because we might need to add complete subsection to DOM if group has
no existing permission for a particular stream or group.
- Also, updated get_group_assigned_realm_permissions to return all
subsection objects even when group has no assigned permission for
a subsection because we now have headers for all the subsection
in DOM but just hide them so that order can be maintained when
a setting of a subsection is added during live update.
check_group_permission_settings_data now uses set for the
list of settings defined in data structures in settings_config
which makes the code little efficient when checking if the
data structure contains all the setting names or not.
The 'user-select: none' property was originally added to
prevent users from highlighting images and menu option text
in popovers. However, applying it to the entire
'.popover-menu' unintentionally blocks text selection in
cases where it's useful, such as usernames in user cards.
This commit refines the approach by restricting by adding
'text-select' class to the username in user cards without
affecting the other elements of the popovers.
This commit fixes the bug when clicking on "?" icon in group
setting label by making sure that click handler returns early.
Also, updated the handler to use e.currentTarget instead of
e.target when opening the typeahead and focusing the input
as that is more correct and prevents future unexpected bugs.
This commit fixes a bug introduced in commit `37f2c5bc788`,
where a message in DM is not updated to "(deleted)" when
left empty after editing.
Fixes: #33305
Previously, channel archival event messages were unread in
archived channels, which makes the archived channel accessible
from the inbox view.
This commit fixes this issue by auto-marking the channel archival
event message as read.
Fixes: zulip#33258.
This commit splits the existing deactivation test into two separate
tests — one for realm administrators and one for user group-based
permissions to improve clarity.
This applies to the main settings overlay, the stream/subscription
settings overlay, and user group settings overlay.
@container is necessary because @media queries convert em values
using the browser-wide font size, so it won't change properly at
the user-defined app-wide font size.
These styles were being added to table cells at narrow widths
that weren't yet at the breakpoint to collapse the settings menu
left sidebar, to make sure those columns would stay wide enough
to be readable.
This commit simplifies the media query by keeping this min-width
for all screen widths above the breakpoint. There doesn't seem
to be a downside to this, since we want to keep those cells
readable at wider widths as well, and at wider widths there's
even more space for the other cells.
This commit converts the links generated by the markdown
of the "#-mention" of topics to permalinks -- the links containing
the "with" narrow operator, the operand being the last message
of the channel and topic of the mention.
Fixes part of #21505
Reproducer:
* Mark all messages in a topic as unread.
* Go to recent view.
* Click on topic.
* Scroll
* Message selection is not updated.
To fix this, we don't disable updating message selection unless
we are sure we are going to trigger a scroll event.
The newly added "can_create_write_only_bots_group" and
"can_create_bots_group" were not added in "Permissions" panel
of groups UI if the group has that permission and this commit
fixes it.
We also add a function called in ui_init.ts to make sure that
the settings data defined in settings_config.ts used for
"Permissions" panel contains all the group settings.
Value for "can_administer_channel_group" passed in stream
creation event was incorrect when there was no value passed
for the setting while creating the stream and thus the setting
was set to anonymous group containing stream creator as default.
This was because code for creating setting_groups_dict, which
is used to send setting values in the stream creation event,
incorrectly assumed that defaults for all settings is a system
group.
This was not noticed before because we pass all the settings
when creating streams using webapp, but can be reproduced
by creating streams using API without passing any value for
"can_administer_channel_group".