This commit updates the logic for migrating user_topic rows
during the move-messages operation when the target topic
already has messages.
Previously, the target_topic's visibility_policy was simply
set to the original_topic's visibility_policy,
and the original_topic's visibility_policy was set to INHERIT.
This commit updates the move-messages code path to determine
the new visibility_policy depending on the visibility policies
of the original and target topics.
The target_topic's visibility_policy is then updated.
The number of db queries has increased by two:
One query corresponds to determining if 'target_topic_has_messages'.
Another query corresponds to 'get_users_with_user_topic_visibility_policy'
to determine 'target_topic_user_profile_to_visibility_policy'.
This prep commit updates the lib function
'topic_has_visibility_policy' to add support for the case
when visibility_policy=INHERIT.
Previously, it had support for all the visibility policies
except INHERIT.
This commit refactors the move user_topic records
code block in 'do_update_message', resulting in
clean code.
We directly iterate over the dictionary items
instead of looping over the keys and fetching
values if the key exists.
This commit changes the way compose box responds to a file drop or paste.
Currently, the compose box expands only after the file is uploaded to the
server, which can cause confusion if the upload fails and there is also no
progress bar. With the update, the compose box will expand immediately upon
drop or paste events showing the status of upload. Also it was opening
the stream compose box even if we are in a direct message, now it starts
a reply.
Fixes#24654.
Moves jwt_fetch_api_key endpoint to v1_api_mobile_patterns so
that tools/test-api detects it as an API endpoint that is pending
documentation.
Fixes#24982.
For endpoints with a `type` parameter to indicate whether the message
is a stream or direct message, `POST /typing` and `POST /messages`,
adds support for passing "direct" as the preferred value for direct
messages, group and 1-on-1.
Maintains support for "private" as a deprecated value to indicate
direct messages.
Fixes#24960.
Refactors instances of `message_type_name` and `message_type`
that are referring to API message type value ("stream" or
"private") to use `recipient_type_name` instead.
Prep commit for adding "direct" as a value for endpoints with a
`type` parameter to indicate whether the message is a stream or
direct message.
There are four icons in the recipient bar that have tooltips, and
each of them shows a second appearance if we click on a button of
the topic menu that is just over the area of the icon. To prevent
the second tooltip, we have used the
'hide_tooltip_if_reference_removed' function to observe changes in
the DOM and hide the tooltip if the reference is removed.
With the recent migration of the topic_menu popover to Tippy,
some tooltips have been impacted. If we click on a popover menu
and then click on any button where the area is above the tooltip
icon, two tooltips appear. The first one is expected to appear over
the reference element, but the second tooltip appears on the top
left corner of the screen because the associated reference element
is hidden.
This commit fixes this issue for the view_user_card tooltip with
the help of the 'hide_tooltip_if_reference_removed' function.
We have set the attributes config to be 'true', since when the
tooltip appears, the parent div with classname
'message_row include_sender' is added with the value
'sender_name_hovered' in its className. We just need to observe
this classname change to hide the tooltip.
So far, we've used the BitField .authentication_methods on Realm
for tracking which backends are enabled for an organization. This
however made it a pain to add new backends (requiring altering the
column and a migration - particularly troublesome if someone wanted to
create their own custom auth backend for their server).
Instead this will be tracked through the existence of the appropriate
rows in the RealmAuthenticationMethods table.
We previously showed "Mark as unresolved" or "Mark as resolved"
option in topic sidebar popover only is user was allowed to
move messages between streams. This commit fixes it to show
if user is allow to move within stream, or in other words edit
the topic, since resolving or unresolving topics is essentially
topic ediitng only.
Note that we still cannot show or hide the option as per the time
limit setting (since client may not have the first message of the
topic locally), so we just show or hide it as per
move_messages_within_stream_policy setting.
This commit adds "Rename topic" option in topic sidebar popover
which will be shown when user is only allowed to edit topics and
not streams.
Note that we still cannot show or hide the option as per the time
limit setting (since client may not have the first message of the
topic locally), so we just show or hide it as per
move_messages_within_stream_policy setting.
Fixes#19886.
This commit adds 5 seconds buffer when checking the permission to edit
stream and topic for disabling the inputs in "Move message" and
"Move topic" modal.
We already do this for the message content edit UI.
As part of #24678, this code was accidentally removed. We just
add it back to fix the broken user profile dropdown in the navbar
of non corporate pages.
This commit renames ID of the container element of group
settings overlay to group_overlay_container. We also
rename the variables used for this element. This makes
it consistent with the container element of settings overlay.
This commit renames ID of the container element of stream
settings overlay to streams_overlay_container. This makes
it consistent with the container element of settings overlay.
Previously, popovers scrolled oddly along with the content in the
Recent Conversations tab; copy our approach in the message feed of
closing them on scroll.
If the sticky recipient bar hides the date separator completely,
the recipient bar needs to show the correct date for the message
next to it, otherwise the user will see the wrong date for the
message.
To fix this, we show the date on the date separator as soon as
the sticky message header starts to overlap with the date separator.
This is a preparatory work for #24360.
'DIRECT MESSAGES' are completely collapsed in the 'more topics' view.
Clicking on 'DIRECT MESSAGES' exits the 'more topics' view and
scrolls to it from that state. One wouldn't be able to open
'DIRECT MESSAGES' without leaving the 'more topics' view.
Fixes: #25035.
Signed-off-by: Ishaan Singh <asishaan.191cs124@nitk.edu.in>
We now show the stream privacy type icon for the option
selected in dropdown list widget.
This commit also includes a minor CSS change to make the
web-public better aligned in the dropdown list widget
"Move topic" and "Move message" modal. There is no visible
change for other pages and other icons due to this CSS
change.
Fixes part of #22355.
Renamed toggle_topic_mute function to toggle_topic_visibility_policy.
In toggle_topic_visibility_policy function if topic is either muted or
unmuted it will set the topic's visibility_policy to Inherit else, if
stream is muted or unmuted topic's visibility_policy will be set to
unmuted and muted respectively.
Updated set_user_topic_visibility_policy to only show feedback widget
in case of muting topics with hotkey.
Fixes#25125
Because unsubscribing from welcome emails cannot be undone, it is
confusing that the unsubscribe success page suggests that the user
can. Makes the second sentence about undoing the unsubscribe action
conditional on the `subscription_type` not being "welcome".
Updates the first sentence to specifically note the Zulip realm
that has been updated for the unsubscribe action so that it is
clear for which Zulip organization the user's settings have been
updated/changed, since the user might have accounts with various
Zulip organizations (via Zulip Cloud or self-hosted servers) that
use the same email account.
The logic to avoid first unread message with a date row to not
have an unread marker works purely based on `z-index` and seems
to be working nicely.
This avoids a bug where the background color of the date row
of the first unread message is different from others.
We show a modal if user is not allowed to resolve or unresolve
topics due to time limit. The modal just contains the text
mentioning user cannot resolve topic without stating the
count of messages that are within the time limit as we do
not recommend partial resolving of topics.
This commit does not include any changes for resolving or
unresolving topic using "Move topic" or "Move message" modals,
as we will still consider them as simple topic move and show
the same modal that is shown in general for moving message.
If the ID of the scheduled message is passed by the client, we
edit the existing scheduled message instead of creating a new one.
However, this will soon be moved into its own API endpoint.
This will help up achieve 2 things:
* Have a lot of common CSS for drafts and scheduled messages.
* Have common JS for things like keyboard navigation between drafts
and scheduled messages.
After some discussions in CZO, it was decided that we should reduce the
increment of minutes to one because the up/down arrow isn't very helpful
at all. Most of the time, users would manual type their desired time and
micro adjust with the arrow keys if needed.
This change also solves the issue where the time picker only counts
multiples of 5s as valid time as it was tied to the increment of minutes.
Previously, `place_caret_at_end` was only used for HTMLElement with
contenteditable="true", updated it so it takes HTMLElement as
argument and use logic to place cursor at end as per type of
element passed(i.e HTMLElement or HTMLInputElement).
This commits changes the placement of "Add streams" tooltip
and "Filter streams" tooltip to "bottom" when the
"Add streams" popover menu is opened and changes its back
to "top" when the popover menu is closed.
It makes use of the "id" attribute that has been assigned
to those tooltips in commit 01e6121e5a.
Fixes: #20675.