Commit Graph

58376 Commits

Author SHA1 Message Date
Sayam Samal f4129aa9df popovers: Rename and move drafts_sidebar_action.hbs. 2024-05-20 09:10:36 -07:00
Aman Agrawal 44fa39c4c4 recent_view: Fix error on initial fetch being all muted messages.
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.
2024-05-19 23:27:14 -07:00
Prakhar Pratyush c798d192dc message_send: Update do_send_messages codepath to send event on commit.
Earlier, we were using 'send_event' & 'queue_json_publish' in
'do_send_messages' which can lead to a situation where we enqueue
events but the transaction fails at a later stage.

Events should not be sent until we know we're not rolling back.
2024-05-19 23:18:43 -07:00
Mateusz Mandera 27c4e46b30 do_deactivate_realm: Add deactivation_reason kwarg.
It's going to be helpful in the future to record the reason for realm
deactivation.
- For information tracking
- For making a distinction between cases where we can allow realm owners
  to reactivate their realm via a self-serve flow (e.g.
  "owner_request") vs where we can't (ToS abuse).
2024-05-19 23:07:28 -07:00
ecxtacy 6af748fa77 pills: Optimize removePill function.
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>.
2024-05-17 10:47:22 -07:00
ecxtacy ac7dd6fa08 settings: Show user_group_popover when pill is clicked.
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>.
2024-05-17 10:47:22 -07:00
PieterCK 82a817aaab hashchange: Fix popover not disappearing on overlay hash URL.
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.
2024-05-17 10:47:22 -07:00
ecxtacy 35248c1920 settings: Show user_card_popover when pill is clicked.
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>.
2024-05-17 10:47:22 -07:00
ecxtacy 30ede1cc80 input_pill: Pass user_id and group_id to render pill.
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>.
2024-05-17 10:47:22 -07:00
PieterCK 3b46d0e53c settings: Refactor UserGroupPill to improve consistency.
Changed UserGroupPill's 'id' key to 'group_id' because
UserPill uses 'user_id' instead of only id.
2024-05-17 10:47:22 -07:00
ecxtacy ad177a8b48 css: Show 'x' button hover styling when hovered over 'x'.
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>.
2024-05-17 10:47:22 -07:00
PieterCK d882d90857 hash_parser: Add utility function to dynamically detect hash.
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.
2024-05-17 10:47:22 -07:00
Alya Abbott 6ca52628ad portico: Mention website previews instead of Tweet previews. 2024-05-17 10:41:58 -07:00
evykassirer 71a5d46de2 typeahead_helper: Clean up current_stream check.
Followup for
https://github.com/zulip/zulip/pull/29650/files#r1569209419
2024-05-17 10:41:32 -07:00
evykassirer 43a6873c57 composebox_typeahead: Clean up initalize method to take JQuery object. 2024-05-16 19:49:46 -07:00
evykassirer 96c9950115 composebox_typeahead: Convert module to typescript. 2024-05-16 14:53:26 -07:00
evykassirer 7f9361a865 composebox_typeahead: Filter and sort candidates within get_candidates.
This simplifies some of the logic and will make it easier to
convert to TypeScript.
2024-05-16 14:51:28 -07:00
evykassirer 96abc52d97 composebox_typeahead: Return mentions from get_candidates. 2024-05-16 14:51:28 -07:00
evykassirer 19a4810d53 composebox_typeahead: Remove DM blur handler.
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.
2024-05-16 14:51:28 -07:00
evykassirer e08c7548af composebox_typeahead tests: Create user_or_mention items directly. 2024-05-16 14:51:28 -07:00
evykassirer 7a9a445088 emoji: Restrict reaction_type for compatibility with typeahead.Emoji. 2024-05-16 14:51:28 -07:00
evykassirer 297fd2654d emoji: Restructure EmojiDict for compatibility with typeahead.Emoji. 2024-05-16 14:51:28 -07:00
evykassirer bccdec8971 typeahead: Create new EmojiSuggestion type.
This will be used for when we suggest emojis in
the composebox typeahead.
2024-05-16 14:51:27 -07:00
Sahil Batra aa83812b1b user_groups: Rename are_both_setting_values_equal function.
This commit renames are_both_setting_values_equal function
to are_both_group_setting_values_equal to make it clear
that this function is used to compare value of group
settings.
2024-05-16 12:58:20 -07:00
Sahil Batra 7db7b3f94d groups: Move functions for updating settings to "lib.user_groups".
This commit moves validate_group_setting_value_change,
are_both_setting_values_equal and parse_group_setting_value
functions, which are used for updating the group settings, to
"zerver.lib.user_groups" as these functions will also be used for
group based realm and stream settings and "zerver.lib.user_groups"
file seems a better place to place such functions which are used
at multiple places.

For same reasons, we also move GroupSettingChangeRequest dataclass
to "zerver.lib.user_groups" file.
2024-05-16 12:58:20 -07:00
Aman Agrawal b8cec0ff2a message_edit: Restore focus to the message being edited.
When user is editing a message and we rerender it, we should always
set focus back to the textarea.
2024-05-16 09:59:22 -07:00
Tomas Fonseca 753b8e1f6f markdown: Added error handling for invalid time zones.
If an invalid timezone (such as +32h) was provided, the
timestamp.astimezone call would throw an exception, causing the
message send to fail. Replace that with a user-facing error.

Fixes #19658.
2024-05-16 09:38:25 -07:00
Aman Agrawal 2035305b89 recent_view_ui: Filter out DMs as per search query.
We use the filter we use in buddy list for consistency.
2024-05-16 09:20:43 -07:00
Aman Agrawal b2dc6f4039 people: Split search terms inside the search function.
This helps other views calling this function to not do a separate
split of the terms.
2024-05-16 09:20:43 -07:00
Aman Agrawal 2a8174baa3 recent_view: Rename filters_should_hide_topic.
Since we also filter DMs using this function, the name is
misleading.
2024-05-16 09:20:43 -07:00
Aman Agrawal aa31f9ae8d server_events: Fix infinite loading indicator on page load.
Hiding the loading indicator was based on us adding some messages
into the view which was no always the case.
2024-05-16 09:10:07 -07:00
Aman Agrawal 62c682b2e1 hashchange: Fix infinite home view <-> narrow loop on escape keypress.
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.
2024-05-16 08:59:05 -07:00
Anders Kaseorg 507eb4913c tsconfig: Enable exactOptionalPropertyTypes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-16 08:58:20 -07:00
Anders Kaseorg 08a50cf74b dependencies: Patch @types/plotly.js for exactOptionalPropertyTypes.
Submitted upstream:
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69621

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-16 08:58:20 -07:00
Aman Agrawal 47414d1e4a zerver: Use correct flags to check if this is a self hosted server.
`is_self_hosting_management_page` is used to check if user is
on `selfhosting.ORG_URL` domain which is not what we want for
these pages.
2024-05-16 08:55:51 -07:00
Aman Agrawal 7203661d99 support: Set discounted price instead percentage for customers.
This allows us to set the price of a plan exactly as discussed with
the customer.
2024-05-16 02:18:43 -07:00
Bedo Khaled ed5e0fa141 docs: Remove manual flush memcached advice.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-05-15 17:32:34 -07:00
AfonsoOrmonde b42cd1022b
streams: Close color picker when scrolling stream settings.
Fixes #17451.
2024-05-15 17:22:03 -07:00
Isabela Pereira fee0470a97 popovers: Refine word wrapping in user profile.
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
2024-05-15 17:20:21 -07:00
Alex Vandiver b3115fd7c3 Revert "ci: Temporarily upgrade postgresql-client-common before upgrading."
This reverts commit 2ec288a983.
Debian fixed this in
7df2322ef5,
and it was released as version 257:
https://metadata.ftp-master.debian.org/changelogs//main/p/postgresql-common/postgresql-common_257_changelog
2024-05-15 15:25:51 -07:00
Tim Abbott 1d52d08803 api_examples: Fix failing invitation links test.
This system is too fragile with hardcoded IDs; we should be asserting
that the preparatory requests succeeded to make these easier to debug.
2024-05-15 15:01:08 -07:00
mk0904 f54605e290 Updated 'Private messages' to 'Direct messages' in the translation style guides 2024-05-15 14:52:26 -07:00
Lauryn Menard 7a61044a03 org-settings: Update tab for default channel settings.
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.
2024-05-15 12:18:36 -07:00
Vector73 431beae96f api_documentation: Document "/invites/multiuse/{invite_id}" endpoint. 2024-05-15 12:05:40 -07:00
Aman Agrawal 1c7c8cede8 recent_view: Fix marking topic as read resulting in error.
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.
2024-05-15 12:02:57 -07:00
Aman Agrawal e51962d6ac dialog_widget: Assign each dialog widget a unique id.
This makes it easy to check if the correct dialog widget is open
and to perform actions based on the state of dialog widget in
async callbacks.
2024-05-15 12:02:57 -07:00
Lauryn Menard ab0fc402e0 api-docs: Update feature level 261 documentation.
The original changes for this feature level are in
commits a6be1d101 and 7b42c802b.
2024-05-15 21:01:05 +02:00
tnmkr 51635c81fc streams: Set creator for some initial streams in populate_db.
This is a follow-up to #29425. It assigns creator to three streams
that are used in tests and another two that aren't. For tests,
we assign a guest, an admin and an owner as creator.
2024-05-15 11:21:46 -07:00
Prakhar Pratyush e264b12066 zulip_updates: Send an introductory message before the first update.
To help users focus on the onboarding experience, we no longer
send the introductory "Zulip updates" message as a part of
onboarding.

Now, we send the introductory message just before the first
update message.

Fixes #30053.
2024-05-15 11:19:03 -07:00
Sahil Batra f73f27b45f invite: Replace "streams" with "channels" in default subs banner.
This commit replaces "streams" with "channels" in the banner for
default channel subscriptions shown to user user who cannot
subscribe others.
2024-05-15 10:59:05 -07:00