Commit Graph

56955 Commits

Author SHA1 Message Date
N-Shar-ma b4d53c7930 compose: Fix bug where inserted content would not be scrolled into view.
On chromium browsers, the scroll position is not restored when the text
in a textarea is replaced. So instead of directly replacing the text,
we call the `insert_and_scroll_into_view` function with `replace_all`
set to true.
2024-03-04 17:14:11 -08:00
N-Shar-ma ef0be22899 compose: Add parameter `replace_all` to `insert_and_scroll_into_view`.
We refactor the `insert_and_scroll_into_view` function to accept a new
parameter, `replace_all`, defaulting to false, that when set to `true`,
will replace all existing content of the textarea with the new content,
instead of inserting the new content at the current cursor position.

This is a prep commit for the next commit, which will set this new flag.
2024-03-04 17:14:11 -08:00
Aman Agrawal ad2e176625 help: Link mark as read in conversation banner to help page.
Fixes #29115
2024-03-04 16:55:59 -08:00
tnmkr 25cca93bc9 stream_settings: Show relevant streams in left panel.
We want to make the default stream listing more relevant. To do this,
we always show "All streams" tab when stream is opened from another
user's profile. From other places, we show "Subscribed" if the user
is subscribed to the stream they are trying to edit otherwise
"All streams" are shown.
2024-03-04 16:52:57 -08:00
tnmkr 9275a8ded4 group_settings: Show relevant groups in left panel.
We want to make default group listing in left panel more relevant.
Thus "All groups" are shown when group is opened from another user's
profile. From other places, "Your groups" are shown if the user is in
the group they are trying to edit otherwise "All groups" are shown.
2024-03-04 16:52:57 -08:00
tnmkr ca6e0ce8c8 user_profile: Add links to group settings.
This commit adds links to open group settings from "User groups" tab
of user profile. These links are not shown to guests as they cannot
view `#groups` urls.

Fixes #25214.
2024-03-04 16:52:57 -08:00
Alex Vandiver 352dbf9387 caches: Only take the realm_id, not the Realm, as a cache key function.
This saves a hit to the database to fetch the Realm of a UserProfile
that we are trying to flush.
2024-03-04 16:35:57 -08:00
Prakhar Pratyush 6630981de8 inbox: Remove 'default' visibility policy indicator.
We no longer show the 'default' visibility policy in
the inbox view. 'Unmute', 'Follow', and "Mute' are
still shown.

For topics with 'default' visibility policy, it is
still possible to change the visibility policy via the
three-dot menu.

The motivation is not to have the default state so
prominently called out.
2024-03-04 14:07:59 -08:00
Anders Kaseorg e46c3bf116 dev-vagrant-docker: Upgrade docker-systemctl-replacement to 1.5.8066.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-04 15:34:10 -05:00
Aman Agrawal a97ac07a13 sponsorship: Add basic plan option for self hosted orgs.
Fixes #29068
2024-03-04 10:01:18 -08:00
Anders Kaseorg aaa6f16538 web: Use Zod z.discriminatedUnion more.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 15:39:04 -05:00
Anders Kaseorg a03a26151c onboarding_steps: Depluralize OnboardingStep type name.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 15:39:04 -05:00
Anders Kaseorg f39675f061 rows: Make errors fatal in id, local_echo_id.
This lets us simplify their types and remove dead error-handling code.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 07:30:44 -08:00
Anders Kaseorg 398c63566e rows: Fix get_message_id type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 03:50:11 -05:00
Anders Kaseorg 6f50ed4ca3 user_status_ui: Fix input_field() type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 03:48:26 -05:00
Varun Singh bda6470951 user_status_ui: Convert module to TypeScript. 2024-03-01 18:02:20 -08:00
Varun Singh 063287d459 user_status_ui: Extract repetitive conditional logic into a function.
The function 'emoji_status_fields_changed' separates the conditional
logic into two parts. Now, we compare 'selected_emoji_info' and
'old_emoji_info' only when both of them have the fields necessary for
comparison.This helps with upcoming type inference and we no longer have
to write same conditional logic twice.
2024-03-01 18:02:20 -08:00
Varun Singh 70c14d0d3f user_status_ui: Refractor to satisfy '.trim()' function.
'.val()' function returns 'string','string[]' and 'number' type
whereas '.trim()' only accepts a 'string' type argument.
2024-03-01 18:02:20 -08:00
Varun Singh da18350b5b user_status_ui: Replace logical OR with null coalescing operator.
While || targets null, undefined, false, NaN, 0, -0, 0n, "",
and document.all, ??(null coalescing) specifically targets
null and undefined,which we are looking for here.
2024-03-01 18:02:20 -08:00
Varun Singh 0a7bdfaa1c user_status_ui: Add missing argument. 2024-03-01 18:02:20 -08:00
Anders Kaseorg 066ea3ebf9 install: Support Ubuntu 24.04.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 17:38:08 -08:00
Anders Kaseorg 59b0548433 timezone: Only look up canonical time zones from the system.
Legacy time zone aliases were removed from the Debian tzdata package
in tzdata 2023c-8.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040997

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 17:38:08 -08:00
Anders Kaseorg 119900120e requirements: Patch pip 20 to run on Python 3.12.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 17:38:08 -08:00
Anders Kaseorg 55954c9819 build-pgroonga: Upgrade PGroonga from 3.1.0 to 3.1.8.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 17:38:08 -08:00
Tim Abbott c1269f1038 docs: Better document backup/export tool tradeoffs.
- More consistent export/import vs backup bullets at the top.

- Remove misleading documentation regarding the `zulip_org_id` reuse
  problems. This documentation was written for Zulip 2.1.0 in
  c6fe6cf0a4 and largely made obsolete
  in d800ac33a0 (Zulip 5.0).

- Light editing for readability/crispness.

Fixes #28925.
2024-03-01 16:17:20 -08:00
nimishmedatwal 3d30fcd10a onboarding: Improve placeholder message for dm with yourself.
Fixes #29078
2024-03-01 16:09:54 -08:00
evykassirer c60cc07605 drafts: Convert module to typescript. 2024-03-01 15:49:53 -08:00
evykassirer e26b4bbd3e drafts: Reimplement handlers for buggy drafts using zod. 2024-03-01 15:49:53 -08:00
evykassirer bd4da24086 drafts: Create formatted draft all at once.
Instead of partially creating it and then adding
more attributes, this commit creates the return
value (formatted draft) in a single assignment.
This is needed for typescript work, in an upcoming
commit.
2024-03-01 15:49:53 -08:00
evykassirer e8d5241c0d drafts: Return updatedAt timestamp in snapshot_message.
It was always being set after the fact, and it will
be easier to manage types for the conversion to
Typescript if we just set this when setting the
rest of the data for the draft message.
2024-03-01 15:49:53 -08:00
evykassirer 97c46a7375 stream_data: Allow undefined stream_id in get_color.
Sometimes get_color is called with undefined
stream ids. This change makes more clear
what was already happening, and allows
for smoother conversion of other files
to typescript, including an upcoming
conversion of the drafts module, which
can call `get_color` with a draft with
undefined stream_id.

This keeps the color logic contained in
the `get_color` function, which seems
cleaner than the alternative of exporting
DEFAULT_COLOR to be used wherever sream_id
might be undefined.
2024-03-01 15:49:53 -08:00
evykassirer 8784fd9944 drafts: Remove unused localstorage version.
It's been present since 1929cc5 and clearly is intended
to be part of a never-implemented format conversion
system. We can add a version if/when we actually need
such a feature.
2024-03-01 15:49:53 -08:00
evykassirer 34b6be668e util: Add test coverage for lower_same. 2024-03-01 15:49:53 -08:00
Tim Abbott 1efe8ba74b team: Link to page explaining methodology. 2024-03-01 14:57:46 -08:00
Tim Abbott 3c708edb2c team: Add more repositories and rename tabs.
Based on an audit of all repositories in the zulip organization.
2024-03-01 14:57:46 -08:00
Lauryn Menard 666041e480 remote-support: Show deactivated servers in search results.
The remote support view now returns results for deactivated remote
servers with those results sorted to the end and formatted to
visually stand out.

Forms to change sponsorship and discount fields on the customer
for the remote server or realm are not shown, but the data stored
on the customer object is shown, including any sponsorship request
information (if the customer had a sponsorship request pending when
it was deactivated).

Forms to schedule a plan are also not shown for deactivated servers
and their associated remote realms.

Forms and information for any current plan or scheduled plan, for
either the deactivated remote server or its associated remote
realms, are shown so that support staff can update those plans if
necessary.
2024-03-01 14:11:19 -08:00
Prakhar Pratyush a513489f38 corporate: Fix invoicing of plans on free-trial with changed schedule.
Earlier, the 'next_invoice_date', 'invoiced_through', and
'invoicing_status' fields in 'do_change_schedule_after_free_trial'
were not set correctly.

It resulted in invoicing the ENDED plan and the ledger we create
in this function.

Multiple invoices were created depending on the number of times the
billing frequency was changed for customers who started free-trial
& changed their billing frequency.

This commit sets those fields correctly leading to create only one
invoice.
2024-03-01 10:47:55 -08:00
Alex Vandiver 3480d204de reload-clients: Log how many reload events were actually sent. 2024-03-01 09:31:20 -08:00
Alex Vandiver 2d59e07e58 reload-clients: Only sleep between batches.
This avoids an unnecessary sleep at the end of all of the Tornado
shards.
2024-03-01 09:31:20 -08:00
Lauryn Menard 26e305e27d remote-support: Show remote realm matches if deactivated.
As a follow-up to commit d66b7ad853, where we send internal emails
when an active paid plan is on a locally deleted remote realm, we
need search queries in the remote support view to return results
for these deactivated remote realms, instead of excluding them.
2024-03-01 09:30:31 -08:00
Anders Kaseorg 7b1bb984b3 ruff: Fix RUF022 `__all__` is not sorted.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg dbb20d636d ruff: Fix E721 Use `is` and `is not` for type comparisons.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg 0e71f52e86 ruff: Fix E203 Whitespace before ','
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg 869d9d9a79 ruff: Fix RUF025 Unnecessary dict comprehension for iterable.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg 3b114c516c ruff: Fix PLR2044 Line with empty comment.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg 87992b8b29 ruff: Fix PERF403 Use a dictionary comprehension instead of a for-loop.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg 82a9fd927b ruff: Fix E226 Missing whitespace around arithmetic operator.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg d748ec8d52 ruff: Fix PLW0108 Lambda may be unnecessary.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg 553f268b04 ruff: Fix RUF027 Possible f-string without an `f` prefix.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00
Anders Kaseorg 865febb307 ruff: Fix RUF021 Parenthesize when chaining `and` and `or` together.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 09:30:04 -08:00