Commit Graph

64129 Commits

Author SHA1 Message Date
Sayam Samal
2e4fca6daa settings: Prevent save discard widget override.
This commit prevents the save button in the save discard widget from
showing the "Saved" label when the user has made some other changes
in the settings while the saving process was in action — which resulted
in the "Save changes" label in the save button, and thus shouldn't be
replaced with "Saved".

This commit also fixes the failing puppeteer tests in
`web/e2e-tests/admin.test.ts` which was introduced in #34081.

(cherry picked from commit 7b45ff50ba)
2025-05-07 15:38:22 -07:00
Sayam Samal
c1be1e0116 settings: Remove unused "saved" state in save discard widget.
(cherry picked from commit f496bd6350)
2025-05-07 15:38:22 -07:00
Sayam Samal
de42b4d1ad settings: Remove unused success callback in save_organization_settings.
(cherry picked from commit fbd28f1349)
2025-05-07 15:38:22 -07:00
Sayam Samal
819b16b11e settings: Fix save discard widget closing before saved state.
Sometimes, in slower connections, Tornado long-polling callback can
reach the client at almost exactly the same time as the success
response, making the prediction of which arrives first
non-deterministic. Due to this, the server event call responsible for
syncing the realm settings across multiple users would sometimes take
over and hide and the save discard widget before the success callback
from `/json/realm` could show the "saved" state in the button.

This commit fixes this issue by blocking the "discarded" state from
hiding the save discard widget when the save button is already in the
"saving" or "succeeded" state, since in those conditions the visibility
of the save discard widget would anyways be handled by a "failed" or
"succeeded" state.

(cherry picked from commit 83c5733144)
2025-05-07 15:38:22 -07:00
Sayam Samal
8276dcdb30 settings: Update save button style when "Saved" is shown.
This commit updates the save button style in the settings component to
ensure that the button appears as a borderless attention + success
intent action button alongside the "Saved" label, when an updated
setting is saved.

(cherry picked from commit b115368a81)
2025-05-07 15:38:22 -07:00
Sayam Samal
087a89b2f4 components: Restructure component type declarations.
This commit moves the ComponentIntent type to types.ts since it is
common across all the components, and also moves the ActionButton type
from banners.ts to buttons.ts since it is specific to the button
component.

On top of that, the commit also updates the type declarations to be
based off of array declarations to make it easier to modify them
programmatically.

(cherry picked from commit 203ca08446)
2025-05-07 15:38:22 -07:00
Sayam Samal
d41dc8eeae settings: Fix alert notification indicator styling in settings.
(cherry picked from commit b43d3dc1d4)
2025-05-07 15:38:22 -07:00
Sayam Samal
91da77d4e8 settings: Improve subsection header styling.
This commit makes all the subsection header as flex boxes, and improves
it's CSS styling.

(cherry picked from commit 616a957842)
2025-05-07 15:38:22 -07:00
Sayam Samal
dbfe4ddee4 settings: Update save and discard buttons to redesigned button styles.
This commit updates the save and discard buttons in the setting modals
to use redesigned button styles along with the new loading indicator.

(cherry picked from commit 6bf2887991)
2025-05-07 15:38:22 -07:00
Pratik Chanda
fb083bafec stream_edit: Org permission not reflecting in channel permission.
Earlier, permission in edit panel of channel settings was not the
same as that of org permission, specifically for public channel
option.

This commit fixes that by updating the privacy option state.

Fixes:zulip#34526.
(cherry picked from commit fdf7bc0888)
2025-05-07 15:38:22 -07:00
Karl Stolley
15fbcafed8 page_loader: Correct clipped logo circle.
(cherry picked from commit a9e3331fcc)
2025-05-07 15:38:22 -07:00
Jitendra Kumar
a04dd1bb92 message_feed UI: Update logo dimensions for better scalability.
Change 'z' logo dimensions so that it scales according to chosen font
size.

Fix: #34266
(cherry picked from commit 8682db5573)
2025-05-07 15:38:22 -07:00
Prakhar Pratyush
859cc29657 unread_data: Ensure deterministic ordering of unread message rows.
Earlier, in `get_raw_unread_data` the ordering was applied inside
the CTE.

Once we leave the CTE scope and do a join, SQL makes no promise
about preserving the row order unless we re-specify ORDER BY in
the outer query.

Since, there was no ORDER BY clause in the outer query it was
resulting in a random ordering of the entries. This bug was caught
by `test_unreads_case_insensitive_topics` failing in a flaky way.

This commit fixes the bug.

(cherry picked from commit ccc82976dc)
2025-05-07 15:38:22 -07:00
Alex Vandiver
7ee999917f thumbnail: Add a tool to re-thumbnail spinners, or process old images.
(cherry picked from commit 49d2c1010a)
2025-05-07 15:38:22 -07:00
Shubham Padia
d6fadeec77 attachments: Allow seeing attachments to users with content access.
Fixes https://chat.zulip.org/#narrow/channel/9-issues/topic/Can't.20view.20images.20in.20private.20channel.2E

(cherry picked from commit 700da670cf)
2025-05-07 15:38:22 -07:00
Shubham Padia
9bb9c20c88 test_subs: Add check_subscription_exists helper.
Fetching a subscription and then checking if it exists was taking too
much space in a test and making it feel convoluted. We're planning to
check it more in future commits.

(cherry picked from commit 6baa106460)
2025-05-07 15:38:22 -07:00
Shubham Padia
69ac1c0724 attachments: Do not fetch complete owner object.
We just need to compare the user profile id and the owner id, we will
save 1 query call this way.

(cherry picked from commit ca50b5dac7)
2025-05-07 15:38:22 -07:00
Tim Abbott
e97d532811 version: Update version after 10.2 release.
This should have been pushed before backporting the first commits for
10.3, but better late than never.
2025-05-07 12:59:58 -07:00
Mateusz Mandera
fea421b54d ldap: Add migration to fix incorrect system group memberships.
In #34510 we fixed the underlying bug in the ldap integration, which
would cause users to end up with their system group memberships not
matching their .role value. However, users who may already be in that
state still need to be fixed through a migration. We implement that
here.

There are two things we fix here:
1. Group memberships. The user should have a direct group membership
   for the specific system group implied by their .role.
2. We want to also add the missing RealmAuditLog entry.
2025-05-07 12:56:53 -07:00
Mateusz Mandera
4cb838168f populate_analytics_db: Create missing system group memberships. 2025-05-07 12:56:53 -07:00
Mateusz Mandera
6ea67a7df2 ldap: Fix the syncing of user role via AUTH_LDAP_USER_FLAGS_BY_GROUP.
This was broken, due the mechanism simply using our
is_guest/is_realm_admin/etc. role setters, but failing to adjust system
group memberships - resulting in corrupted database state.
We need to ensure that change_user_role is called for setting user role.

There are two relevant codepaths that run the sync based on
AUTH_LDAP_USER_FLAGS_BY_GROUP and thus need to get this right:
1. manage.py sync_ldap_user_data
2. Just-in-time user creation when a user without a Zulip account logs
   in for the first using their ldap credentials. After
   get_or_build_user returns, django-auth-ldap sees that the user
   account has just been created, and proceeds to run ._populate_user().

Now that both user.save() and do_change_user_realm will be getting
called together, we need to ensure this always happens atomically.

This imposes the need to override _get_or_create_user to put it in a
transaction. The troublesome consequence is that this new
`atomic(savepoint=False)` causes the usual type of issue, where tests
testing error get their transaction rolled back and cannot continue
executing.

To get around that, we add a test helper
`artificial_transaction_savepoint` which allows these tests to wrap
their problematic blocks in an artificial transaction which provides a
savepoint, thus preventing the full test transaction rollback derailing
the rest of the test.
2025-05-07 12:56:53 -07:00
Mateusz Mandera
03ebeb10ab ldap: Fix dev/test-specific bugs with AUTH_LDAP_USER_FLAGS_BY_GROUP.
Without these overrides, we cannot test the functionality in DEVELOPMENT
and TESTING.

There are two codepaths that we're covering here:
1. The sync which happens via `sync_ldap_user_data`.
2. The sync which happens during just-in-time user creation upon first
   login via ldap.

Both codepaths end up triggering ldap_user._get_or_create_user().
2025-05-07 12:56:53 -07:00
Tim Abbott
c65cc48215 Release Zulip Server 10.2. 10.2 2025-04-15 17:23:30 -07:00
Alex Vandiver
25d1491999 tusd: Update development version.
This update was missed in 21eff33875.

(cherry picked from commit 826c643401)
2025-04-15 16:48:14 -07:00
Tim Abbott
bc3753d859 docs: Add upgrade note for S3_SKIP_CHECKSUM. 2025-04-15 11:19:23 -07:00
Mateusz Mandera
33f4cd1ad4 realm_creation: Disable open realm creation if no password backend. 2025-04-15 11:19:23 -07:00
Mateusz Mandera
4bc70f7c04 signup: Don't run password_strength form validator in ldap signup mode.
When an ldap user is signing up via the registration form, they are
required to enter their ldap password. This is in contract to "regular"
password signup, where the user sets the password for their new account.

Checking password strength makes sense in the latter case, but not in the
ldap case - the password is already set at the ldap level after all.

In any case, the password_strength validator is not even added to the
form field with `id="ldap-password"`, so this was bugged throwing errors
such as

```
TypeError: $.validator.methods[method] is undefined. Exception occurred when checking element ldap-password, check the 'password_strength' method. at http://localhost:9991/webpack/vendors-node_modules_pnpm_jquery-validation_1_21_0_jquery_3_7_1_node_modules_jquery-validatio-b912f7.js:810
at check .pnpm/jquery-validation@1.21.0_jquery@3.7.1/node_modules/jquery-validation/dist/jquery.validate.js:803
at element .pnpm/jquery-validation@1.21.0_jquery@3.7.1/node_modules/jquery-validation/dist/jquery.validate.js:510
at onfocusout .pnpm/jquery-validation@1.21.0_jquery@3.7.1/node_modules/jquery-validation/dist/jquery.validate.js:310
at delegate .pnpm/jquery-validation@1.21.0_jquery@3.7.1/node_modules/jquery-validation/dist/jquery.validate.js:441
at dispatch .pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.js:5145
at ../node_modules/.pnpm/jquery jquery/dist/jquery.js?1d73/</add/elemData.handle@http://localhost:9991/webpack/vendors-node_modules_pnpm_error-stack-parser_2_1_4_node_modules_error-stack-parser_error-stac-967546.js:16502
at trigger .pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.js:8629
at simulate .pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.js:8698
at focusMappedHandler .pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.js:5574
```

when interacting with the form.
2025-04-15 11:19:23 -07:00
Mateusz Mandera
b5ab90aaa4 signup: Prevent unauthorized signup for realms without EmailAuthBackend.
Zulip supports a configuration where account creation is limited solely
by being able to authenticate with a single-sign on authentication
backend, such as Google Authentication, SAML, or LDAP (i.e., the
organization places no restrictions on email address domains or
invitations being required to join, but has disabled the
EmailAuthBackend that is used for email/password authentication).

A bug in the Zulip server meant that Zulip allowed users to create an
account in such organizations by confirming their email address, without
having an account with the SSO authentication backend.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-04-15 11:19:23 -07:00
Sahil Batra
9423f213a7 settings: Fix opening settings for guests who cannot access all users.
Opening settings and stream settings UI was not working for guests
if they could not access all users. This was because is_person_active
did not handle inaccessible users correctly, if they were not added in
the users data, when being called in get_group_members to render
group pills.

(cherry picked from commit 4f80823191)
2025-04-14 16:02:26 -07:00
Sahil Batra
6abbbc190c typeahead: Fix typeahead showing for disabled inputs.
When user cannot type in the input, because of contenteditable
being set to "false", typeahead should not be shown when clicking
on the input element.

(cherry picked from commit 3739081792)
2025-04-14 16:02:26 -07:00
Sahil Batra
b61da7d944 streams: Don't show confirmation modal if user can subscribe.
Previously, we showed confirmation modal when user was unsubscribing
themselves from the private stream from "Unsubscribe" button in
subscribers list, even when user had the permission to subscribe
to the stream again.

This commit fixes it to not show the confirmation modal if user
has permission to subscribe again. We already have same behavior
when user tries to unsubscribe from the button present at the
right of tabs.

(cherry picked from commit 722d501107)
2025-04-14 16:02:26 -07:00
Sahil Batra
73669ff7f0 streams: Fix warning shown when unsubscribing from private stream.
We no longer archive the stream when private stream becomes
vacant, so removed that part from the warning.

When a private stream becomes vacant, everyone in the organization
can lose content access to it if no one has permission to subscribe
themselves or others to the stream. So, the warning is updated to
mention this.

(cherry picked from commit d3c06234e2)
2025-04-14 16:02:26 -07:00
Alex Vandiver
ed5fc4cc19 tusd: Use GCS upload backend when the endpoint matches.
This works around tus/tusd#322, which in turn is caused by
aws/aws-sdk-go-v2#1816.  This requires separate authentication via
service account key.

Fixes: #34186.
(cherry picked from commit e1aa8b1cb0)
2025-04-14 16:02:26 -07:00
Anders Kaseorg
85b2e6a1e9 install: Support PostgreSQL 17.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 818742c62b)
2025-04-14 16:02:26 -07:00
Tim Abbott
f4279a2a7f help: Document copy-pasting LaTeX.
Fixes: https://chat.zulip.org/#narrow/channel/9-issues/topic/.E2.9C.94.20.F0.9F.93.82.20pasting.20LaTeX/near/2129200.

Co-authored-by: Apoorva Pendse <apoorvavpendse@gmail.com>
(cherry picked from commit 70e36ef16a)
2025-04-14 16:02:26 -07:00
Shubham Padia
7fd018d82a settings: Exclude nobody from channel and group settings typeahead.
We have filtered the group in the get_user_groups argument of
set_up_pill_typeahead. We could have done it in `set_up_combined` but
that would have made that function non-generic and specific to these two
settings. We could also have filtered it in get_all_realm_user_groups by
adding an argument on whether to exclude it or not, but that would have
been very hard to read and track. This seemed like the better of the
options we had.

Fixes https://chat.zulip.org/#narrow/channel/9-issues/topic/.22Nobody.22.20group.20in.20UI.20to.20add.20subscribers.2Fgroup.20members

(cherry picked from commit 349e88adc6)
2025-04-14 16:02:26 -07:00
Alex Vandiver
4a35e00d1c tusd: Reject tusd terminations after we insert them into our database.
The tusd protocol allows DELETE requests ("terminations") at any
point, including after a file has successfully been uploaded.  This
can allow tusd to remove a file from the bucket, out from under Zulip.

We use the new-in-2.7.0 pre-terminate hook to look up the file which
the client is requesting to terminate, and reject the termination if
it is a file that the Zulip database is already aware of.

(cherry picked from commit cf51013bb7)
2025-04-14 16:02:26 -07:00
Alex Vandiver
e44108edb2 puppet: Upgrade tusd to 2.8.0.
(cherry picked from commit 21eff33875)
2025-04-14 16:02:26 -07:00
Alex Vandiver
d7293735e1 smokescreen: Move metrics port from the default 9810, to 4760.
This prevents errors if Smokescreen is running on a host with more
than 10 Tornado shards.

(cherry picked from commit b11cbbab01)
2025-04-14 16:02:26 -07:00
Alex Vandiver
da72e9447e kandra: Add a grok exporter to parse nginx logfiles.
This provides access logging metrics to Prometheus.  For cardinality
reasons, we cannot (nor would we want to) put every request path into
its own label value -- but we do separate out the most-frequent access
paths (as well as some low-frequency but high-interest ones) into
their own label values.

In order to differentiate accesses to https://zulip.com/ from
https://example.zulipchat.com/ (both of which appear at path `/`), we
use a `grok_exporter.realm_names_regex` value in `zulip.conf`, which
is expected to be set to match the hostname of all possible realms.

(cherry picked from commit 840fa74854)
2025-04-14 16:02:26 -07:00
Alex Vandiver
c357eb8225 kandra: Update prometheus configuration.
This pulls in the more complete production Prometheus configuration.

(cherry picked from commit bd54f0363e)
2025-04-14 16:02:26 -07:00
Aman Agrawal
03feb5a546 message_overlay: Fix restore tooltips detached with message content.
To avoid restore tooltip of message from being displayed outside
the overlay, we define a boundary, outside which the tooltip
cannot exist. Popper library is smart enough to render the tooltip
correctly by respecting the provided boundary and flipping the
tooltip placement if required.

(cherry picked from commit cd439c0232)
2025-04-14 16:02:26 -07:00
Sanchit Sharma
bcd88fdb68 streams: Return archived web-public channels.
(cherry picked from commit d5c83e02c3)
2025-04-14 16:02:26 -07:00
Anders Kaseorg
e6291a540c narrow: Fix get_base_query_for_search access restrictions.
The type_id is the id of a UserProfile, Stream, or DirectMessageGroup,
not the id of a type.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit ad31ef22f2)
2025-04-14 16:02:26 -07:00
Tim Abbott
f539147446 i18n: Update translations from Transifex. 2025-04-10 17:42:48 -07:00
Niloth P
45f30a19e1 invite: Update email pill widget's usage.
- Rename the variable "pills" to "email_pill_widget". To conform better
with other pill widgets.
- Re-use the email pill creation function.
- Directly access `item.email`, skipping function call.

(cherry picked from commit cabea0ea9a)
2025-04-10 17:42:48 -07:00
Niloth P
f131269395 app_variables: Rename background color of pill containers.
Pill containers that do not use placeholders.

(cherry picked from commit 2b7961f30f)
2025-04-10 17:42:48 -07:00
Niloth P
d8501197ee integration-url-modal: Use input pills for branch names.
(cherry picked from commit dafef91c8c)
2025-04-10 17:42:48 -07:00
Karl Stolley
3a89ca6b46 message_row: Better flexibly align hover controls.
(cherry picked from commit a1bba7a453)
2025-04-10 17:42:48 -07:00
Karl Stolley
a906bd4b33 message_row: Restore padding to senderless content box.
(cherry picked from commit 11fdd5f005)
2025-04-10 17:42:48 -07:00