Since this file doesn't link any stylesheet, no CSS is applied to
these classes.
Tested change by pasting the content of it in `link_malformed`
and rendering that template using a malformed email confirmation link.
Use user events to update profile tab for a
synchronized experience across all users.
Fixes#26692.
Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
Prevents modal from closing when `Save changes` is clicked
after editing a profile field. Also, disables the `Save changes`
button until at least one field has been edited.
Fixes part of #26692.
Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
In `custom_user_profile_fields.hbs`, the name attribute has been
introduced to profile fields to facilitate the future use of the
`get_current_values` function in retrieving field values.
Fixes part of #26692.
Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
This commit separates the `get_current_values` function from the
`launch` code, allowing it to be exported and utilized independently.
Fixes part of #26692.
Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
When navigating "back" or "forward", the left sidebar state
should be restored.
Earlier, "more topics" expanded was not considered a distinct
state.
This commit makes it possible to correctly place you in the
"more topics" view or not, depending on where you were.
Fixes#29548.
We use "prop-element" class only to handle save-discard widget
and not anywhere else, so there is no need to have this class
for elements that do not use save-discard widget.
This commit refactors code to handle realm authentication methods
in a better way. We remove the get_complete_data_for_subsection
function and instead let populate_data_for_request handle the
request data for authentication methods.
We also remove the "prop-element" class from each authentication
setting checkbox and instead add it to the container div as a
the list of those checkboxes represent a single field, i.e.
the realm_authentication_methods field received from the server
and the authentication_methods field sent to 'PATCH /realm'
endpoint.
Since `onHidden` is only called once tippy is fully hidden, tippy
can fail to call `onHidden` if `onShow` is called before
tippy is fully hidden. This hurts us as we want to call `destroy`
to remove this tippy instance from DOM.
To avoid this, we `destroy` the tippy instance outside of tippy
callbacks which is more reliable since our event handlers call
`hide` without fail.
We still had some code in invite.ts for the textarea element
which was replaced by pill container, so this commit removes
that code.
This commit also removes the CSS for textarea and radion buttons
which are no longer present in the UI.
There is no need to call toggle_invite_submit_button while
changing inputs on the modal, or while selecting all streams
using the "Check all" button as the state of button is only
dependent on the input in email pill container and on which
tab is opened.
Previously, when the invite modal was opened with user having
permission to send email invites, the button at the bottom had
"Generate invite link" text. It should instead be "Invite" with
the button disabled since email invites section is opened by
default.
This was because the toggle_invite_submit_button was called
when the modal was not visible and thus calling `.is(":visible")`
for email pill container element returned false. This commit
changes it to pass the selected tab to toggle_invite_submit_button
to avoid computing which tab is opened by checking the element
visibility, attributes, etc. when the modal is not visible and
the tab container might not be present in the DOM.
This was only being used in one place in compose_closed_ui
to create the label for the closed composebox. But it
only checked if the `channel` and `topic` filters existed,
while `stream_sub` can return `undefined` for a few other
reasons. To ensure that we're catching the undefined sub
while also avoiding duplicate work, it makes sense to just
call `stream_sub()` directly.
Fixes this bug:
https://zulip.sentry.io/issues/5367251929/events/40073ecf007a4a9798e728061a576377/?project=450455688282112
Compose textarea typeaheads don't hide when `Send` button is clicked.
If you type `@` and press send, mention typeahead is still visible.
This happens since the textarea is still focused after sending the
message while other input area trigger a `blur` event which hide
the typeahead for them.
We always call `clear_compose_box` wherever textarea is cleared
as a result of sending message. So, it is the right function to
hide the typeahead in.
The default channels checkbox only exists in DOM if there are default
channels in the realm, so we should make sure that we check whether
there are default channels in the realm before accessing the
checkbox element in set_streams_to_join_visibility.
Reproducer:
* Have some unreads in the Combined feed view.
* Scroll up and select a message that was not part of initial fetch.
* Reload.
* Go a another narrow.
* Come back to combined feed to find your at a random message. This
message is actually last message of the current fetch of
combined feed view which was returned via `first_unread_message_id`.
Some we didn't have a check for if topic is muted here which
resulted in combined feed trying to navigate user to muted
unread message if it was the first unread in the narrow.
We now check if the row exists in the current view, and only then do we
process the submessages in it, instead of letting `Error: Failed to
do_process_submessages` happen.
This commit extracts the method to create and update message
lists in the narrow. This is particularly useful in cases when we
need to update the narrow and view with our own message lists.
This is a preparatory commit to #30114, since it involves
creating a new message list from the messages fetched,
which may be of a different narrow from that of the
initial filter, and updating the view and narrow with it.
This commit fixes the bug when updating
"Restrict email domains of new users?" setting by
adding data-setting-widget-type attribute to the select
element as get_input_element_value now expects every
element to have that attribute after 64c8262eaf.
Due to this change, we also need to update the code in
populate_data_for_request function to not send invalid
parameter in the request. This change resulted in some
refactoring which now helps in not passing in the
"disallow_disposable_email_addresses" and
"email_restricted_to_domains" when these fields are
not changed.
This commit fixes the bug when updating realm default
language setting by adding data-setting-widget-type
attribute to the relevant element with "prop-element"
class as get_input_element_value now expects every
element passed to it to have that attr after 64c8262eaf.
As a result we can now remove the code from
get_complete_data_for_subsection to handle realm
default language and just let get_input_element_value
handle it and it also helps in passing the parameter
unnecessary to request when the setting is not changed.
This commit solves the bug for user notification batching
setting which was introduced during the typescript migration
of settings_components.js due to assertion error in
get_input_element_value.
Add user name in feedback message so that it is more clear
which user is unsubscribed.
With tweaks by tabbott to handle the yourself case.
Fixes#19165.
If the initial fetch pre #29740 fetches all muted messages we don't
have any messages in all message list and hence query for
oldest message is undefined.
This results in us trying to render oldest_message_timestamp
with its value as infinity.
To fix it, we include muted messages in our search for oldest
message in the list and if we still cannot find one, we wait
for the next fetch.
The removePill function of input_pill module uses a for loop
for iterating and finding the required pill.
Replace the for loop with inbuilt findIndex function for efficiency.
Authored-by: Dhruv Chouhan <dc.dhruvchouhan@gmail.com>.
Add 'click' event listener to the pills in stream settings
to toggle the user_group_info_popover.
Fixes#28687.
Co-authored-by: Pieter CK <pieterceka123@gmail.com>.
Refactored hashchanged() so that popover.hide_all()
is executed before checking is_overlay_hash() to close
popovers when the user changes hash but still on overlay.
Add a 'click' event listener to the user pills in
stream and group settings which toggles the
user_card_popover.
Co-authored-by: PieterCK <pieterceka123@gmail.com>.
While rendering input pills in input_pills.create function,
pass in the user_id or group_id accordingly.
Display the id as an html attribute in input_pill.hbs.
Co-authored-by: Pieter CK <pieterceka123@gmail.com>.
When input pills are hovered, the 'x' button is highlighted.
This commit ensures that 'x' button is highlighted only if the
'x' button is hovered, not anywhere else on the pill.
Author: ecxtacy <dc.dhruvchouhan@gmail.com>.
Added new utility function to hash_parser to dynamically
detect the hash category of an URL. This is intended to
reduce the need of adding more adhoc hash_parser utility
functions.
Since #private_message_recipient is a <div contenteditable>,
not an <input> or <textarea>, it doesn’t make sense to call
.val() (it will always give the empty string).
It looks like this line is from over 10 years ago
(09deef9611 (diff-f2b22549dc2fb4824b37e787d964a2c9f4f580e767f86b6d7ded1d0ff37d5a62R291))
and probably before we had pills here. We can just remove this
whole block.
Reproducer:
* Start with empty hash and combined feed as home view.
* Go to any narrow.
* Keep pressing escape key.
You will keep switching between narrow view and home view while
you should just stop at home view. This was due to
`set_hash_to_home_view` not considering empty hash as a valid
home view hash.
This commit refines word wrapping in user profile popovers. It implements 'overflow-wrap: break-word;' for category ‘name’ items (e.g., ‘Email’, ‘User ID’) and 'overflow-wrap: anywhere;' for category ‘value’ segments, ensuring proper line breaks and preventing overflow issues. Additionally, addressed prettier problems to maintain code consistency.
Fixes#22865
Updates instances of default-streams-list to instead be
default-channels-list as the data-section for the organization
settings overlay is part of the URL hash.
Since we were trying to close dialog widget regardless of caller
after marking messages as read, it results in an error if the dialog
widget is not open especially since there was no dialog widget
involved in the process.
So, track the id of the dialog widget which called the `read` `op`
and operate on it based on it's status if there was a dialog
widget involved.
This commit fixes the margins around banner for default stream
subscriptions, shown to users who cannot subscribe others, to
be same as that for other banners like the one shown when
description is not set for the organization.
The bug was due to the element being accessed when not present
in the DOM. This function fixes it by calling the function to
setup streams UI only when the concerned elements are present
in DOM, i.e. when user can subscribe others.
The bug was introduced in 016917679e.
Fixed 2 bugs in the detection of the last message row copied. This fixes
the issue where when the mouse was released on the message header after
copying multiple messages, the pasted text was not formatted correctly.
Follow up to #30091.
This commit adds code to use include_default_realm_subscriptions
when user selects "Subscribe to default streams" checkbox
in the invite modal instead of passing the stream ids of
default streams.
To avoid event handlers being lost when we restore a message edit
form we go through the process of creating the edit form for the
message again. This has the additional benefit of updating the
status of buttons based on org settings like GIF or upload button.
Fixes#30083.
We have used the dark theme color for the left sidebar row hover:
`--color-background-active-narrow-filter`. We are not using that variable
directly since we don't want a change in that color affecting the color in
recent conversations.
We've also used a single color on hover compared to 2 different colors
for unread and read row before. Light mode also uses a single color on
hover.
Relevant CZO conversation:
https://chat.zulip.org/#narrow/stream/101-design/topic/Hover.20color.20in.20Recent.20conversations.20dark.20mode.2E/near/1797727
Adds description in views styled like stream descriptions also adds a
help center link to the appropriate page at the end of each
description.
Fixes#29769.
Change type annotations of get_user_ids and create_item_from_group_name
to accept CombinedPillContainer and InputPillItem<CombinedPillItem>
respectively.
Change type annotations of get_user_ids and create_item_from_stream_name
to accept CombinedPillContainer and InputPillItem<CombinedPillItem>
respectively.
Earlier, the compose textarea and the preview (container) occupied the
same grid area, 1 at a time. Now, they are both children of a common div
which is assigned the same grid area. This allows adding more elements
to the same grid area in the future.
This is purely a code change and should have no visible effects.
This is a prep commit for relocating the compose expand / collapse
buttons to the top right inside corner of the textarea / preview.
Reproducer:
* Go to a stream narrow.
* Scroll up to select a previous message.
* Click on a different stream in the left sidebar.
* Click browser back button, you land at first unread message instead
of your selected message.
Fixed by updating the hash before we render the new message list.
With combined feed no longer cached, this test became flaky as
it took longer for combined feed to load.
Verified that other tests waiting on `.message-list` don't need
this change.
When the request to mark a thread as unread fails, we should use the
value of include_anchor that was sent in the request, not false.
Modified handle_mark_unread_from_here_error to take an object instead of
parameters.
Since there are no rows to set focus in recent view before initial
fetch, we were falling back to set focus on input filter after
rendering recent view.
Waiting for initial fetch to complete helps us set focus on the
table easily while recent view is also open for user to play with
if the load takes longer.
The `margin-bottom` was removed for the last element in the preview in
e55f5a1b59 to remove vertical shifts when
toggling preview mode, but it is not needed for image / video previews,
so now `margin-bottom` is not set to 0 for the last inline preview.
In 61b3c698af we stopped restoring widgets
from the cache, so the only purpose of the cache remaining was to access
the event handler patched onto the widget jquery.
Now instead of the entire jquery object, we cache just the event handler
since that's the only thing we need from the cache, and do not patch it
onto the widget jquery object.
Use the "/json/messages/flags" instead of "/json/messages/flags/narrow"
when we have fully fetched the current view.
Update messages on the basis of id instead of updating the entire
narrow.
Fixes#28945.
Since the reference for these typeaheads is has a fixed position
unlike say message controls which move on scroll and need to be
repositioned, we can use `fixed` position for typeaheads too so
there is no jumps when user is trying to scroll when a typeahead
is active.
This basically replaces the commit where where we remove `fixed`
as an argument to `Typeahead` library. We can add it later if
any of our typeaheads don't need to be fixed positioned.
When compose box is expanded, typeahead overlfows the top of the window.
We move the typeahead to the bottom of the screen and let
preventOverflow shift it into the visible area.
To better make use of server load when fetching message history for
users, we limit how much history we fetch in the initial loading
experience based on how much time in the organization's message
history it corresponds to.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
For more discoverability, the keyboard shortcuts for preview, and bold,
italic and link formatting are now displayed in the tooltips of those
compose buttons.
Earlier we did not activate widgets if their rendered HTML was cached,
and also when narrowing to the combined feed view. This caused bugs with
widgets not being activated, and so not responding to any interactions.
Now we unconditionally render and activate widgets in the current view,
irrespective of the cached HTML or the view being narrowed to.
`source` is expecting a list so `false` doesn't make sense here.
It was working before because the code that calls `source` in
`bootstrap_typeahead` just does falsey checks.
This commit replaces the fontawesome "edit" and "copy-link" icon found
in the user profile modal with the corresponding zulip icons.
It also moves the functional classes like
user-profile-manage-own-copy-link-button from the icon element to its
container, including adding a new div wrapping the icon in
user-profile-manage-others-edit-button.
Attempting to convert .data("draft-id") to .attr mysteriously breaks
draft saving, so I’ll leave that for future work.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
e.target is the wrong element, and even if this were to successfully
add the _full-height-no-scroll class to <body>, that’s not a child of
.portico-hello-page.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Its selector looks like it’s missing a ‘.’, but “fixing” it breaks the
page even more, and trying to decipher this mess of event handlers
that poorly replicate what should be native behavior is making my
brain hurt.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Combined feed always narrowed to the first unread id regardless
of if it was muted or not since we were not actually using the msg_id
that we found after all the hard work of doing all the checks for it.
Originally, we only wanted to do local echo in the current
view. However, now that we're looking at navigating the user to the
conversation that they send a new message to, it's going to be quite
common that we immediately visit a destination different from the
current view, where local echo in that different view would be
valuable.
The most interesting block was added in
af188205cb / #8989. But in
6637f2dbb7, the key logic for checking
`msg_list.data.fetch_status.has_found_newest` was duplicated in the
`add_new_messages` code path, which critically also updates
`update_expected_max_message_id` and thus may close a race with
fetching message history for a view we're being navigated to, where
the locally echoed message might fail to appear at all.
This change does come with a slight regression: If we are looking at a
search view where the filter is one that we cannot apply locally, a
newly sent message will now be locally echoed (returning the compose
box for drafting another) even though it cannot be displayed in the
current view, which means that the message will not appear in either
the compose box or the current view for the brief period before we get
a reply from the server in this scenario. This is a minor detail,
likely not worth troubling ourselves over.
Given our intent to experiment with navigating the user out of the
search view in this scenario, this is likely not important.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
The `at_rendered_bottom` check was incorrect since it includes
bottom whitespace in the calculation to check if we are at the rendered
bottom. This is can cause us to not fetch new messages if user stops
scrolling when bottom whitespace is partially visible leading to
a bad UX.