Commit Graph

64450 Commits

Author SHA1 Message Date
Mateusz Mandera
1eecbad381 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-04-28 17:44:56 -07:00
Mateusz Mandera
4dd1826532 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-04-28 17:44:56 -07:00
Aman Agrawal
645850ccfa hotkey: Fix warning about unused login_to_access import. 2025-04-28 16:10:49 -07:00
Karl Stolley
142d1958a0 url_previews: Post-process embed links for performant CSS. 2025-04-28 16:10:13 -07:00
Karl Stolley
80f101016e url_previews: Clamp title, description to two lines.
This also increases the size of the preview area's
height to accomodate two lines of both title and
description at a +2 line-height setting.
2025-04-28 16:10:13 -07:00
Karl Stolley
1184905a6b url_previews: Remove basically invisible text-shadow. 2025-04-28 16:10:13 -07:00
Karl Stolley
f20aed49d4 page_loader: Correct hard-coded pixel values. 2025-04-28 16:08:53 -07:00
Varun-Kolanu
4f8263cd7f integrations: Update example screenshot for JotForm.
This commit updates the screenshot for the JotForm
integration to better demonstrate its utility
in enhancing business workflows for Zulip users.
2025-04-25 15:34:00 -07:00
Varun-Kolanu
e8364d8edd integrations: Fix jotform integration to receive files.
This supports receiving files through jotform.

Fixes #32460.
2025-04-25 15:34:00 -07:00
Alya Abbott
83396562eb help: Expand organization profile description. 2025-04-25 15:14:31 -07:00
Sayam Samal
a4549ffaf5 alert_words: Update label in the alert words removal status banner.
This commit displays the removed alert word in the error banner, and
bolds the alert word in both success and error banners.
2025-04-25 12:26:02 -07:00
Sayam Samal
3974ddf548 alert_words: Use banner to indicate alert words removal status.
This commit converts the alert words removal status alert to a banner
component.
2025-04-25 12:26:02 -07:00
Sayam Samal
4dff40a5d1 banners: Fix banner grid layout for medium and small variants.
The banner grid layout for the medium and small variants has 4 rows,
while the previously described `grid-template-areas` only had the
placement information for the first 3 rows.

This commit adds the spatial description of the banner elements in the
the final row, fixing the alignment of the banner elements in the cases
where there are no action buttons and only the banner label.
2025-04-25 12:18:43 -07:00
Sahil Batra
31175752a0 people: Fix is_active_user_for_popover for inaccessible users.
We consider all inaccessible users as active so this commit
fixes is_active_user_for_popover accordingly.

This fixes deactivated icon showing in message avatar for
inaccessible users even when they are active.
2025-04-25 12:13:33 -07:00
Karl Stolley
41968e2871 url_previews: Use em for title offset.
Removing `line-height` here also allows for the title
to assume the app-wide user-selected line height.
2025-04-25 11:52:12 -07:00
Karl Stolley
05e4a2f6ac url_previews: Rewrite message embeds in CSS Grid. 2025-04-25 11:52:12 -07:00
Aman Agrawal
e579f88d54 inbox: Remove underline on recent conversation text.
The blue color make it evident enough that the text is a link.
Added hover effect to make it more evident.
2025-04-25 11:49:17 -07:00
Aman Agrawal
6f4fee37e4 inbox: Remove stale CSS.
We stopped using `#reload-lnk` element in #26116 and since we
were satisfied with the reload link styling in that PR, this
CSS is no longer needed.
2025-04-25 11:49:17 -07:00
Alya Abbott
6988f51426 help: Document option to add the members of a group to a group. 2025-04-25 11:48:26 -07:00
Aman Agrawal
92bcfe9f42 message_view_header: Allow showing HTML as navbar title.
This will be used show channel icon in title in the text
"All topics in # channel".
2025-04-24 16:22:13 -07:00
Aman Agrawal
001c16ef86 inbox: Handle keyboard navigation for read topics.
Since inbox only has unread topics visible, rows having no
unread counter was not handled. Added that support so that
inbox style channel view can use it.
2025-04-24 16:22:13 -07:00
Aman Agrawal
c7eca03b68 inbox_ui: Use same type of item in cols_to_focus.
Instead of a mix of jQuery and HTMLElement, we only use
HTMLElement as item type for `cols_to_focus`.
2025-04-24 16:22:13 -07:00
Aman Agrawal
0676e2db57 topic_list: Allow subclasses to override class name if required.
To avoid styles for left sidebar topics list from applying to
inbox view style channel view, we need to be able to use different
classes for the topic list wrapper element.
2025-04-24 16:22:13 -07:00
Aman Agrawal
82ec451a19 topic_list: Rename function to specify where it works.
This function only works to scroll topic in left sidebar.
2025-04-24 16:22:13 -07:00
Sayam Samal
6f672298b2 banners: Improve banner layout dimensions.
This commit makes some fine adjustments to the layout of the banners,
- The padding of the banner label is adjusted such that the height of
  the banner label is equal to the height of the banner action button.
  This ensures that these banner children elements are vertically
  aligned while allowing for multi-line banner labels.
- Removes the extra margin used previously for aligning the banner
  action buttons.
- The padding of the banner close button is also adjusted to match the
  height of the banner, as a result of the other padding adjustments.
2025-04-24 16:06:00 -07:00
okGus
e45fec9395 rest_api: Add logging for use of the deprecated method parameter.
This will help audit the usage of this legacy feature.

Fixes part of #1403.
2025-04-24 13:10:52 -07:00
Karl Stolley
1e61ec00b7 left_sidebar: Align muted unreads with correct em value.
Fixes: #34472
2025-04-24 12:25:04 -07:00
bedo
da8428c133 mention: Add sender_can_mention_group & clean up comments. 2025-04-24 12:21:31 -07:00
bedo
215cc632bc mention: Skip fetching group membership for silent-mentioned groups.
Fixes: #32934

Follow up to PR zulip#33097

Also add test cases to make sure a silent mention alone doesn't fetch
group membership, but non-silent mention does and always takes precedence.
2025-04-24 12:21:31 -07:00
Sahil Batra
53cdfddf5b groups-ui: Add option to copy membership from group.
Instead of adding group as a subgroup, we now provide option
to add direct members and direct subgroups of a group to a
user group by providing an expand button in the group pill.

Fixes #32335.
2025-04-24 11:36:49 -07:00
Sahil Batra
592ee2de1c groups-ui: Fix order of members typeahead.
We previously showed "Everyone except guests" group at the
top for group members and stream subscribers typeahead. It
makes sense for stream subscribers typeahead but not for
group members typeahead, so this commit fixes that.
2025-04-24 11:36:49 -07:00
Sahil Batra
b63b484f8d typeahead_helper: Rename functions used for sorting.
d11537a8cd modified how we sort options in typeahead for stream
subscribers and group members. The function names added in that
commit were confusing since the names included "settings" when
the function is used to sort the typehead for adding and updating
stream subscribers and group members. This commit fixes the names
of these functions.

This commit also renames sort_setting_options since that function
is now used for adding and updating stream subscribers and group
members apart from being used for sorting typeahead for group
settings.
2025-04-24 11:36:49 -07:00
Sahil Batra
9ebc877bbe pill_typeahead: Refactor code for set_up_combined.
Since set_up_combined was only being called with
is_stream_subscriber_input as true, there is no
need to have this variable in opts as we use same
sorting function for all the cases.
2025-04-24 11:36:49 -07:00
Karl Stolley
bd4d172408 dev_docs: Better present images in tables. 2025-04-24 11:23:38 -07:00
Lauryn Menard
79061c08d2 demo-orgs: Disable invite user modal before owner sets email.
Until the owner of a demo organization sets an email, the submit
button on the invite user modal is now disabled.

The input div for email addresses is also disabled, which wasn't
disabled before because it's not an input element on the form.
2025-04-24 09:48:38 -07:00
Lauryn Menard
9a2f4c7e15 demo-orgs: Hide setup tips in invite modal if email not set.
In the invite users modal, if the demo organization owner hasn't
yet added an email to their account, hide the banners with tips
for setting up organization information before inviting users.
2025-04-24 09:48:38 -07:00
Aman Agrawal
9d3279caf4 models: Add request_timestamp field to ScheduledMessage table.
This just records the time when the user created the
request to schedule a message or set a reminder.

This would be unused but is future-proofing against a world
where we decide to edit the strings or UI to show when you
asked for the thing.
2025-04-24 09:43:58 -07:00
Mohammad Reza Kianifar
7907c5f846 refactor: Rename huddle to direct_message_group in email templates.
The huddle database table was renamed to direct_message_group.
This commit updates all references to huddle in the missed_message
email templates and locale files.
2025-04-23 17:45:03 -07:00
Alex Vandiver
49d2c1010a thumbnail: Add a tool to re-thumbnail spinners, or process old images. 2025-04-23 17:41:51 -07:00
Tim Abbott
4bab0538fd attachments: Use early return and improve comments. 2025-04-23 17:34:09 -07:00
Alex Vandiver
eae18738a6 signup: Add optional Altcha to realm registration. 2025-04-23 17:18:40 -07:00
Karl Stolley
f434c9d913 dev_docs: Add instructions for preparing icon files. 2025-04-23 17:06:35 -07:00
Karl Stolley
025ead514b dev_docs: Finesse language on icons guidance. 2025-04-23 17:06:35 -07:00
Shubham Padia
700da670cf 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
2025-04-23 12:43:54 -07:00
Shubham Padia
6baa106460 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.
2025-04-23 12:43:54 -07:00
Shubham Padia
ca50b5dac7 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.
2025-04-23 12:43:54 -07:00
Karl Stolley
a7996c1bd6 thumbnails: Remove right-to-left rules obviated by flexbox. 2025-04-23 10:53:05 -07:00
Karl Stolley
bcddd71cca thumbnails: Add minimal flexbox definition. 2025-04-23 10:53:05 -07:00
Karl Stolley
ad75ab590a thumbnails: Structure adjacent images into galleries. 2025-04-23 10:53:05 -07:00
Lauryn Menard
4d1bfe6537 demo-orgs: Disable corporate upgrade and sponsorship pages.
Use a shared error template for demo organizations when rendering
the upgrade or sponsorship pages.

Demo organizations must be converted into a permanent organization,
i.e., not be automatically scheduled for deletion, to either apply
for a sponsorship/discount or upgrade to a paid plan.
2025-04-23 09:23:24 -07:00