Commit Graph

54584 Commits

Author SHA1 Message Date
Sahil Batra aedb9b23b4 models: Pass "realm__can_access_all_users_group" to select_related. 2023-11-13 08:04:45 -08:00
Sahil Batra c82bb3ec76 models: Add can_access_all_users_group setting.
This commit adds new setting for controlling who can access
all users in the realm which would have "Everyone" and
"Members only" option.

Fixes part of #10970.
2023-11-13 08:04:45 -08:00
Sahil Batra f20d427a4d users: Remove unnecessary comment.
This comment can be removed as the code was updated in 2ab71fb67d.
2023-11-13 08:04:45 -08:00
Sahil Batra df01d0725c message_send: Remove select_related call for stream.
We do not access any related field from the stream object,
so there is no need for select_related.
2023-11-13 08:04:45 -08:00
Aman Agrawal 060b94b71f inbox: Fix search icon position on narrow widths.
Due to filters dropdown's variable width, the search icon was
incorrectly positioned, we fix it by positioning it relative to
the filter dropdown.
2023-11-10 18:20:26 -08:00
Lalit b86022ea52 ts: Convert `activity.js` module to TypeScript. 2023-11-10 16:37:44 -08:00
Alya Abbott 0ca6d58e23 help: Document worflows for followed topics. 2023-11-10 16:29:55 -08:00
Alya Abbott 3d874367fe help: Fix tab label in starred message documentation. 2023-11-10 16:29:55 -08:00
Alya Abbott 72fbcfb5f6 help: Document topic status dropdown in Inbox view. 2023-11-10 16:29:55 -08:00
BrandonAWong 6edf24b0f7 search: Remove "All messages" typeahead
Previously, the "All messages" typeahead would be shown whenever
the search bar had an empty input. This change removes that typeahead
completely in favor of using other filters such as -is:muted.

Fixes #27358

Co-authored-by: Heran Zhang & Wei-Cheng Sung
2023-11-10 16:27:32 -08:00
Mateusz Mandera 48db4bf854 counts: Add new mobile_pushes RemoteRealmCount stats.
This requires a bit of complexity to avoid a name collision in
COUNT_STATS with the RemoteInstallationCount stats with the same name.
2023-11-10 16:09:11 -08:00
Mateusz Mandera 2512e66c06 counts: Don't allow syncing mobile_pushes_forwarded::day count.
6819ecee92 forgot to add this.
2023-11-10 16:09:11 -08:00
Mateusz Mandera 8a6d5b4997 counts: Add new Add new mobile_pushes_sent::day LoggingCountStat.
This is a CountStat for tracking how many mobile notifications the
server requested.
1. On a self-hosted server, that means requesting from the push bouncer.
2. On a server that's its own push bouncer, that's just the number
   directly sent.

This number has room for inaccuracy due to incrementing by the number of
user devices on a self-hosted server, as it doesn't account for errors
that may occur in the GCM/APNs low-level sending codepaths on the bouncer.

Also tests that a server that's its own push bouncer correctly
increments its mobile_pushes_sent::day CountStat, by basing it on the
values returned from the send_apple/android_push_notification functions
which tell us the actual number of successfully sent notifications.

Since the return values of send_..._push_notification are now
used in those codepaths, we need to tweak our mocks in some unrelated
tests to set up some return value to avoid errors.
2023-11-10 16:09:11 -08:00
Alya Abbott 1e08c5f3c6 help: Add a note about how notifications work in muted streams.
Note matches the string used in the settings UI.
2023-11-10 16:00:26 -08:00
Alya Abbott fbbf626e8c help: Update "Mute a stream" help page to reflect UI tweak. 2023-11-10 16:00:26 -08:00
N-Shar-ma c3c72cda6d compose: Completely remove style elements when pasting HTML as markdown.
Turndown would strip `<style>` tags, but retain the content enclosed.
This resulted in unwanted content being pasted, like the comment nodes
inside the `<style>` tag when pasting cell/s copied from Google Sheets.
2023-11-10 13:56:51 -08:00
N-Shar-ma e15f518ccc compose: Always retain `ul` tag when pasting content enclosed by it.
This functionally makes no difference, but we add it along with `ol`
for consistency.
2023-11-10 13:56:51 -08:00
N-Shar-ma db9ac4b674 commit: Disable automatic numbering / bulleting when inside code block. 2023-11-10 13:56:51 -08:00
N-Shar-ma 602d1d7323 compose: Do not paste formatted markdown when inside a code block.
We usually default to pasting formatted markdown (unless the Shift key
is used to paste plainly instead), but when we're inside a code block,
we always want to paste plainly.
2023-11-10 13:56:51 -08:00
N-Shar-ma f5bcf5d608 compose: Add a function checking whether the cursor is in a code block.
This is a prep commit for the following 2 commits, so we can opt out of
the formatted paste and automatic bulleting / numbering behaviors when
inside a code block.
2023-11-10 13:56:51 -08:00
Prakhar Pratyush 2f469ff830 hotkey: Give feedback when no unreads left in followed topics.
When navigating to the next unread followed topic using
the Shift+N hotkey, we notify the user when there are no more
unread messages in followed topics.

Earlier, the hotkey simply did nothing in such a case.

We use feedback_widget to do so.

Fixes #27604.
2023-11-10 13:33:13 -08:00
Joelute 4d1ade1f88 compose: Automatically change @ mentions to silent mentions in 1:1 DMs.
It is common for users in other chat tools to start off a direct message
with @ mentioning the addressee. However, this results in potentially
unexpected behavior in Zulip, where the message is highlighted and shows
up in @ mentions in addition to DMs. We want to prevent this behaviour by
automatically changing the @ mentions to silent @ mentions for the user.
These changes only apply to 1:1 DMs and not group chats.

Fixes: #17998.
2023-11-10 12:59:44 -08:00
Lauryn Menard 928cb7e09e corporate: Pass plan_tier parameter to process_initial_upgrade.
Updates `process_initial_upgrade` to take a plan_tier parameter,
so that information can be specific to the type of BillingSession.

Note that ideally the plan tier would be passed as metadata to the
stripe.checkout.Session, but in order to do so, we need to be able
to update the generated stripe fixtures for tests. So for now, we
set the plan tier directly in the stripe event handler code.
2023-11-10 11:26:18 -08:00
Lauryn Menard 3e550364c6 corporate: Use plan.name for stripe.Invoice statement descriptor.
Instead of hard coding the string for the stripe.InvoiceItem and
stripe.Invoice statement_descriptor, we use the name of the plan
that was just created.
2023-11-10 11:26:18 -08:00
Lauryn Menard d29c454e80 corporate: Make BillingSession abstract method for changing plan type.
Creates `do_change_plan_type` as a BillingSession abstract method
as an alias for updating the plan_type for a realm (and eventually
remote server).

This removes the last direct reference to a customer's realm in
`process_initial_upgrade`.
2023-11-10 11:26:18 -08:00
Lauryn Menard 26ad2e29c6 corporate: Make BillingSession alias for latest seat count.
Creates `current_count_for_billed_licenses` as an abstract method
in BillingSession class, to get the latest seat count for the realm
(and eventually remote server) connected to the customer.
2023-11-10 11:26:18 -08:00
Prakhar Pratyush c597de6a1d topic_mentions: Rename wildcard_mentioned to stream_wildcard_mentioned.
Rename the existing 'wildcard_mentioned' flag to
'stream_wildcard_mentioned'.

The 'wildcard_mentioned' flag is deprecated and exists for
backwards compatibility.

We have two separate flags for stream and topic wildcard mentions,
i.e., 'stream_wildcard_mentioned' and 'topic_wildcard_mentioned',
respectively.

* stream wildcard mentions: `@all`, `@everyone`, and `@stream`
* topic wildcard mentions: `@topic`

The `wildcard_mentioned` flag is included in the events and
API response if either `stream_wildcard_mentioned` or
`topic_wildcard_mentioned` is set.
2023-11-10 11:06:26 -08:00
Prakhar Pratyush 24fa361f40 migration: Clear old data for unused usermessage flags.
In c37871ac3a, we renamed the
two unused and historical bits of the 'flags' bitfield of
the 'UserMessage' table:

* 'summarize_in_home' to 'topic_wildcard_mentioned'
* 'summarize_in_stream' to 'group_mentioned'

This commit clears out the old data for those bits.

Additionally, we are clearing 'force_expand' and 'force_collapse'
unused flags to save future work.
2023-11-10 11:06:26 -08:00
Aman Agrawal a7f02c89d7 inbox_view: Move filters dropdown to the left of search box. 2023-11-10 10:22:18 -08:00
Aman Agrawal 69d59acc5a inbox: Focus currently selected option in dropdown. 2023-11-10 10:22:18 -08:00
Aman Agrawal f191efce1b inbox: Add dropdown to filter topics.
Fixes #27522

Replace `Include muted` checkbox with a dropdown to filter displayed
topics.

Also, adds a new filter to display only followed topics.
2023-11-10 10:22:18 -08:00
Aman Agrawal 03dcb9c0e4 dropdown_widget: Add option to hide search box. 2023-11-10 10:22:18 -08:00
Karl Stolley 2557f90c01 left_sidebar: Set extra-long hover delay for Views, DMs tooltips. 2023-11-10 09:22:07 -08:00
Karl Stolley f3887f1fa7 left_sidebar: Add a Views expand/collapse tooltip. 2023-11-10 09:22:07 -08:00
Karl Stolley f8ce278e76 left_sidebar: Include DM expand/collapse tooltip on arrow. 2023-11-10 09:22:07 -08:00
Karl Stolley 5f1c9ca107 left_sidebar: Center Streams tooltip over heading text. 2023-11-10 09:22:07 -08:00
Akarsh Jain d8d70d9e43 compose_banner: Display time for messages with < 5 mins scheduled time.
This commit addresses the issue where scheduling a message for a
time less than 5 minutes in the future resulted in the confirmation
banner not displaying the scheduled time, which should have actually
been 5 minutes in the future, as enforced at the UI level by the
MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS variable.

We remove the `is_send_later_timestamp_missing_or_expired` method along
with it's tests since `selected_send_later_timestamp` is already set to
the minimum of 5 minutes in the future through the `minDate` option of
the flatpickr.

Fixes: #26784.

Co-authored-by: Sayam Samal <samal.sayam@gmail.com>
2023-11-10 09:20:15 -08:00
Prakhar Pratyush 31f048d054 stripe: Move `setup_upgrade_checkout_session_and...` to BillingSession.
Moves the 'setup_upgrade_checkout_session_and_payment_intent'
function to the 'BillingSession' abstract class.

This refactoring will help in minimizing duplicate code while
supporting both realm and remote_server customers.
2023-11-10 09:15:10 -08:00
Karl Stolley f2e8d2dc07 left_sidebar: Set border radius on rows for all states. 2023-11-09 17:39:26 -08:00
Karl Stolley 34475bf867 left_sidebar: Establish filter-handling grid on Streams, DM headers.
Fixes part of #27559.
2023-11-09 17:39:26 -08:00
Karl Stolley 2235413c15 left_sidebar: Establish grid on Direct Messages header. 2023-11-09 17:39:26 -08:00
Karl Stolley 12bf754a8a left_sidebar: Consolidate left-sidebar-title styles. 2023-11-09 17:39:26 -08:00
Karl Stolley 3f36c52f41 sidebars: Structurally separate left- and right-sidebar headings. 2023-11-09 17:39:26 -08:00
Karl Stolley ee32654723 sidebars: Express heading colors as CSS variables. 2023-11-09 17:39:26 -08:00
Aman Agrawal df703f847c billing: Fix free trial billing page end plan button not working. 2023-11-10 05:17:52 +05:30
Aman Agrawal 0f31f18744 populate_billing_realms: Add a realm on free-trial. 2023-11-10 05:17:52 +05:30
Aman Agrawal b0fb5c33e9 test_stripe: Fix tests related to text changes on billing page. 2023-11-10 05:17:52 +05:30
Aman Agrawal 9a186ac8d5 billing_page: Redirect users on free plan to `/plans`.
Fixes #27379
2023-11-10 05:17:52 +05:30
Aman Agrawal 56eec2734c billing_page: Add capitalization format of various common cards. 2023-11-10 05:17:52 +05:30
Aman Agrawal f85bd0234a billing: Minor changes. 2023-11-10 05:17:52 +05:30