Commit Graph

1853 Commits

Author SHA1 Message Date
Sahil Batra 1de3a9f4a3 bots: Extract code for showing integration url modal in new file.
This commit creates a new file integration_url_modal.js which
now contains the code for showing integration url modal.

Since show_generate_integration_url_modal is used in multiple
places, this change helps us in avoiding import cycles.
2023-09-26 09:15:20 -07:00
Sahil Batra f3c17b8d4f users: Extract code for showing deactivation modal in new file.
This commit creates a new file user_deactivation_ui.js which
now contains the code for showing deactivation modal for user
and bots.

Since confirm_deactivation and confirm_bot_deactivation functions
are used in multiple places, this change helps us in avoiding
import cycles.
2023-09-26 09:15:20 -07:00
Sahil Batra 8852c4b7af settings_data: Rename type_id_to_string to bot_type_id_to_string.
This commit renames type_id_to_string to bot_type_id_to_string
which is a much better name and explains the use of function
in a better way.
2023-09-26 09:15:20 -07:00
Aman Agrawal ede7f62781 inbox: Call update from unread_ui.update_unread_counts.
Fixes #26687

This seems work correctly after manually testing all the events
for which inbox_ui.update was previously called.
2023-09-25 13:28:13 -07:00
Aman Agrawal 61f602ed73 inbox: Sort muted streams lower than others. 2023-09-25 13:16:25 -07:00
Aman Agrawal ffb944de8e hashchange: Call hide inbox and recent view in show_default_view.
We call show_default_view in various places which didn't use to
check if the other views are hidden. This can cause multiple views
to be visible at the same time.

For example: If inbox is the default view and you press escape
from recent topics, both recent topics and inbox will be visible.
2023-09-25 13:16:25 -07:00
Aman Agrawal e0ff125116 views: Write a common show and hide function.
Fixes #26688
2023-09-25 13:16:25 -07:00
Aman Agrawal 2f7a260f3a inbox: Hide empty inbox notice when inserting a stream. 2023-09-25 13:16:25 -07:00
Aman Agrawal 4fcc488db5 inbox: Show group pms without status icons. 2023-09-25 13:16:25 -07:00
Aman Agrawal 1bd50e60ec inbox: Amend comment to clarity placement of scrollTop. 2023-09-25 13:16:25 -07:00
Aman Agrawal 386d3e7001 inbox: Fix renamed topics not rerendered correctly.
Marking a topic as resolved and then unresolved makes removes the
topic from inbox list. This was caused by previous unresolved topic
data acting as false data for the new unresolved topic.
2023-09-25 13:16:25 -07:00
Aman Agrawal 1f0ed948b4 inbox: Match margin between mention indicator and unread count. 2023-09-25 13:16:25 -07:00
Sahil Batra c7cbdd3741 custom_fields: Extract some code in custom_profile_fields_ui.js.
This commit moves initialize_custom_pronouns_type_fields,
initialize_custom_user_type_fields, initialize_custom_date_type_fields
and append_custom_profile_fields functions to the new file
custom_profile_fields_ui.js from settings_account.js since
they are used for both showing custom profile fields in
"Profile" settings panel and "Edit user" form shown in
user profile modal. This change also helps us in avoiding
import cycles.
2023-09-25 13:14:49 -07:00
Sahil Batra 749af058a4 settings_users: Move show_edit_user_info_modal to user_profile.js.
Since the user-edit form is opened inside user profile modal,
user_profile.js is a better place for show_edit_user_info_modal
function and would help us in removing import cycles as well.
2023-09-25 13:14:49 -07:00
Sahil Batra f0a265c363 settings_bots: Move show_edit_bot_info_modal to user_profile.js.
Since the bot-edit form is opened inside user profile modal,
user_profile.js is a better place for show_edit_bot_info_modal
function and would help us in removing import cycles as well.
2023-09-25 13:14:49 -07:00
Sahil Batra 46ab3031a3 settings_bots: Move type_id_to_string to settings_data.js. 2023-09-25 13:14:49 -07:00
Prakhar Pratyush 8df42a729d message_header: Remove the widget to change the visibility policy.
This commit removes the widget to change the visibility policy
for topics in unsubscribed streams.

Earlier, users were able to change the visibility policy in an
unsubscribed stream, which can lead to confusion.

For example, a person might think that they would get notifications
about new messages in the topic of the unsubscribed stream,
which of course they wouldn't.
2023-09-25 12:39:06 -07:00
Prakhar Pratyush e1d867c05e unread_msgs: Fix the unread count in muted streams.
In the muted stream, the unreads from followed topics were not
adding up to the total unread count of the stream if both unmuted
and followed topics had unreads.

This commit fixes the incorrect behavior.
2023-09-25 11:43:21 -07:00
Anders Kaseorg 6d5a25170a help: Restore scroll target styling.
This restores the styling previously added by commit
ceec61ba10 (#25573).  The .scroll-target
class of commit b852da6eed (#25573) was
removed by commit 8dba4cbba6 (#15713,
merged later) and is unnecessary.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-25 11:42:04 -07:00
Tim Abbott 7585f87c64 css: Remove dark theme overrides for removed Bootstrap CSS. 2023-09-25 06:29:47 -07:00
Tim Abbott 872f2c6f85 bootstrap: Remove most now-unused popovers/tooltip CSS.
What remains needs to be audited as we appear to still declare some of
those classes.
2023-09-25 06:29:47 -07:00
Tim Abbott 1664b06926 bootstrap: Remove duplicate copy of popover/tooltip CSS.
The copy we've been actually using is the one in the separate
bootstrap-tooltip.css file.
2023-09-25 06:29:47 -07:00
Tim Abbott c0708a892a bootstrap: Remove tooltip/popovers JS modules.
Apparently, we had two copies -- the one in bootstrap.js being
overridden by the one in the separate module.

We can't yet remove all the CSS, since some of it appears to still be
in use in some of the popovers.
2023-09-25 06:29:47 -07:00
Tim Abbott 35bc34186e popovers: Remove tracking for Boostrap popovers.
In theory we no longer have any of these.
2023-09-25 06:29:47 -07:00
Tim Abbott 3397627a28 popovers: Move initialize logic to popover_menus.js. 2023-09-25 06:29:47 -07:00
Tim Abbott 573c77a9eb popovers: Move scroll handler to popover_menus module.
Part of cleaning out the original legacy popovers system.
2023-09-25 06:29:47 -07:00
Tim Abbott eb26dc6ecd popovers: Move keyboard UI functions to modern module. 2023-09-25 06:29:47 -07:00
Tim Abbott 8eba95e556 popovers: Move manage menu hackery to user_card_popover.
This helps localize the logic to where it's used, simplifies the main
function, and helps with fixing some import cycles.
2023-09-25 06:29:47 -07:00
Tim Abbott c379d0bad6 right_sidebar_ui: Extract new module.
This UI is not actually a popover, and so there is no need for it to
live in popovers.js.
2023-09-25 06:29:47 -07:00
Daniil Fadeev 8de397b37f user_card_popover: Migrate all user card popovers to Tippy. 2023-09-25 06:29:47 -07:00
Tim Abbott 10400f15d6 tests: Delete user_card_popover test.
This test did extensive mocking and didn't feel like it either fully
tested the module or did a good job of testing the logic; and will
break with the migration to tippy. I think it's better to remove the
test and plan to write a new one testing just
get_user_card_popover_data, the actual interesting part for node tests
of this module.
2023-09-25 06:29:47 -07:00
Daniil Fadeev c961ff2665 recent_view_ui: Change event target to avoid Tippy collision.
We can't use Tippy for both popover and tooltip on the same HTML
element. This change will prevent such issues in the future.
2023-09-25 06:29:47 -07:00
Tim Abbott 1a89d49aba people: Add direct coverage of unknown user case. 2023-09-25 06:29:47 -07:00
Tim Abbott 454b3542ec tests: Rename unknown_user in people tests. 2023-09-25 06:29:47 -07:00
Aman Agrawal bdf6b210b8 copied_tooltip: Remove tippyjs import cycle by extracting it.
Moving show_copied_confirmation to a new library breaks the
dependency cycle of popover_menus and tippyjs.
2023-09-24 15:16:27 -07:00
Tim Abbott 458a0b3f3a user_groups: Move can_edit to settings_data module.
This fixes an import cycle.
2023-09-22 17:46:45 -07:00
Tim Abbott 3edf347f89 user_group_edit: Fix a live-update import cycle. 2023-09-22 17:46:45 -07:00
Prakhar Pratyush f8f9a800e6 navbar_alerts: Improve info for users having at least 50K unreads.
This commit improves the alert message to clearly state that
"You have at least 50,000 unread messages."

In the other case, i.e., when unread_msgs_count > 500 and the user
hasn't read the messages for more than 2 days, the alert message
states,"You have {unread_msgs_count} unread messages."

Fixes #17469.
2023-09-22 17:18:49 -07:00
Tim Abbott 1c1d31deec hotspots: Move compute_placement to only module using it.
Previously, this function was used by other bootstrap popovers, but
such popovers have all been migrated to Tippy.

Hotspots uses some of that machinery but I think doesn't actually use
the Bootstrap popovers system.
2023-09-22 17:17:16 -07:00
Anders Kaseorg d6884399b2 invite: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 17:10:51 -07:00
Anders Kaseorg eefd7feafa global: Specialize jQuery .val() for elements with known value types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 17:10:51 -07:00
Anders Kaseorg 06e8d1fb16 popovers: Remove click handler for .flatpickr-calendar.
It exists to prevent the $(document) click handler from seeing the
event and closing the compose box, but we could also just not close
the compose box.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 17:08:17 -07:00
Anders Kaseorg 35568ec4d6 flatpickr: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 17:08:17 -07:00
Anders Kaseorg 21edae876e Revert "markdown: Fix 3+ digit marker lists retaining alignment for 2 digits."
This reverts commit d899c03da6 (#25094).
It broke the display of list items with inline formatting.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 15:23:29 -07:00
evykassirer 30c6b26f3b stream view: Show "start a conversation" for a topic with no messages.
Previously we showed "no search results".

CZO conversation:
https://chat.zulip.org/#narrow/stream/9-issues/topic/.22no.20search.20results.22.20in.20topic.20view/near/1637289
2023-09-22 11:42:24 -07:00
Sahil Batra 4fb5dee5a4 settings: Fix live-update bug when changing user names.
When changing name of users, the name was updated corectly
in the "Users", "Deactivated users" and "Bots" list but
it removed the "<a>" element, used to open the user
popover, and instead changed it to plain text.

This commit updates the code to just update the text inside
"<a>" tag so that the popover can still be opened by clicking
on the name.
2023-09-22 09:58:29 -07:00
N-Shar-ma db86a2e79b typeahead: Improve tests for multi word match's highlighting.
We refactor the tests to check if a multi word query's result is
correctly highlighted (multi word highlighting fixed in
e2c23b656e).

The test case was already present, but the setup was not correct, and
has been corrected now to safeguard against regression in the future.
2023-09-22 09:58:04 -07:00
evykassirer 356c16553e search: Move search code from message_view_header to search.js. 2023-09-22 09:55:50 -07:00
Anders Kaseorg c2c0429dd1 markdown_config: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:32:21 -07:00
Anders Kaseorg fcb212721a list_cursor: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:31:24 -07:00