Commit Graph

61546 Commits

Author SHA1 Message Date
Tim Abbott d8cf3ff2e9 ci: Run production suite when changing storage.py. 2024-10-25 10:59:57 -07:00
Tim Abbott 71d81484ad storage: Simplify system bot avatar logic. 2024-10-25 10:59:57 -07:00
PieterCK c3017e55d2 storage: Rework static avatar files hashing logic.
Previously, the hashing logic for static avatar files hashed the default
and medium files separately, which didn’t match how user-uploaded
avatars work—where you just add the "-medium.png" suffix to get the
medium version. Since we don’t have clear documentation for avatars yet,
this caused some issues for the mobile apps.

This commit makes sure the default and its medium variation share the
same hash.
2024-10-25 09:36:52 -07:00
Sahil Batra 2109d3d1ab user_group_popover: Remove period after members count. 2024-10-25 08:23:14 -07:00
Shubham Padia fe9952eab5 groups: Rename test to state that it checks allow_system_group.
We also remove the default group check which is already being checked in
do_set_realm_permission_group_setting_to_anonymous_groups_test.
2024-10-24 14:42:21 -07:00
Shubham Padia 1f0906aef7 groups: Remove list specifying group settings with new API format.
All the groups are now following the new API format, making the list
redundant.
2024-10-24 14:42:21 -07:00
Shubham Padia 9f9d5b2f98 groups: Accept anonymous groups for can_access_all_users_group.
On the frontend, the selection is still a dropdown of system groups but
on the API level, we have started accepting anonymous groups similar to
other settings
We've kept require system groups true for now until we switch to group
picker on the frontend.
2024-10-24 14:42:19 -07:00
Shubham Padia ceb0197c1b groups: Accept anonymous groups for create_multiuse_invite_group.
On the frontend, the selection is still a dropdown of system groups but
on the API level, we have started accepting anonymous groups similar to
other settings.
We've kept require system groups true for now until we switch to group
picker on the frontend.
2024-10-24 14:41:09 -07:00
Tim Abbott 3310aed462 send_custom_email: Support specifying sender email address. 2024-10-24 14:36:48 -07:00
Mateusz Mandera 481ef24b53 auth: Tweak invalid credentials error message.
We decided this is the better string to use.
2024-10-24 14:35:31 -07:00
Shubham Padia 94a86d4ac2 help: Use an emoji that does not vary in design.
The octopus emoji varies in design based on the user's device/browser,
while thumbs up emoji is more consistent in that regards.
2024-10-24 13:01:50 -07:00
Shubham Padia d98446491d help-beta: Add support for images.
Partially fixes #31255. We'll need to copy images to src/ at the time of
cutover. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/Handling.20images.20in.20help.20center.20starlight.20migration.2E/near/1915130
for more details.

We've also copied over css relevant to markdown images, while making
some small changes to it so that it works better with existing
starlight styling.
2024-10-24 13:01:50 -07:00
Shubham Padia a4d9c2e2c9 help: Convert emoji images to unicode emoji.
We had inconsistencies in the documentation where we were using emojis
directly in help documentations and sometimes we were using an img tag
for it. This commit aims to standardise it to just using emojis
directly.
See https://chat.zulip.org/#narrow/stream/19-documentation/topic/help.20center.20-.20emojis.20in.20markdown.20files/near/1954272
on more details on the decision.
2024-10-24 13:01:50 -07:00
Lauryn Menard 44a25e00b7 remote-activity: Show remote realm mobile user and push data.
Updates the main query and logic for building the remote activity
table to use remote server mobile user/push data for server rows
and remote realm mobile user/push data for realm rows.
2024-10-24 12:51:53 -07:00
Niloth P bd83dbfb42 git webhooks: Handle assignment events better.
With the introduction of `assignee_updated` parameter in the library,
- Github, Gitea, Gogs can display the assignee in assignment events.
- Github can display the user unassigned in unassignment events.

Fixes https://chat.zulip.org/#narrow/channel/127-integrations/near/1965136
2024-10-24 12:46:39 -07:00
Karl Stolley 8e85972a03 empty_titles: Set line-height to match font size. 2024-10-24 12:40:43 -07:00
Karl Stolley 5b96769739 right_sidebar: Correct line-height by decoupling .filters class. 2024-10-24 12:39:49 -07:00
sanchi-t aa48a0e3ee css: Refactor theme colors for `input_pill`.
This change moves the light and dark theme colors for
`input_pill` to CSS variables.
2024-10-24 11:09:39 -07:00
sanchi-t 9b5accdb43 css: Refactor theme color for kbd. 2024-10-24 11:09:39 -07:00
Kislay Udbhav Verma 327647f4f8 copy_and_paste: Paste fallback md link if syntax link will be broken.
If we paste a stream-topic URL that can be formatted as per #29302,
we now generate a normal markdown link if the stream topic syntax
could result in a broken link.

Fixes #31904
2024-10-24 11:07:31 -07:00
Mateusz Mandera da4443f392 thumbnail: Make thumbnailing work with data import.
We didn't have thumbnailing for images coming from data import and this
commit adds the functionality.

There are a few fundamental issues that the implementation needs to
solve.

1. The images come from an untrusted source and therefore we don't want
   to just pass them through to thumbnailing without checking. For that
   reason, we cannot just import ImageAttachment rows from the export
   data, even for zulip=>zulip imports.
   The right way to process images is to pass them to maybe_thumbail(),
   which runs libvips_check_image() on them to verify we're okay with
   thumbnailing, creates ImageAttachment rows for them and sends them
   to the thumbnailing queue worker. This approach lets us handle both
   zulip=>zulip and 3rd party=>zulip imports in the same way,

2. There is a somewhat circular dependency between the Message,
   Attachment and ImageAttachment import process:

- ImageAttachments would ideally be created after importing
  Attachments, but they need to already exist at the time of Message
  import. Otherwise, the markdown processor doesn't know it has to add
  HTML for image previews to messages that reference images. This would
  mean that messages imported from 3rd party tools don't get image
  previews.
- Attachments only get created after Message import however, due to the
  many-to-many relationship between Message and Attachment.

This is solved by fixing up some data of Attachments pre-emptively, such
as the path_ids. This gives us the necessary information for creating
ImageAttachments before importing Messages.

While we generate ImageAttachment rows synchronously, the actual
thumbnailing job is sent to the queue worker. Theoretically, the worker
could be very backlogged and not process the thumbnails anytime soon.
This is fine - if the app is loaded and tries to display a message with
such a not-yet-generated thumbnail, the code in `serve_file` will
generate the thumbnails synchronously on the fly and the user will see
the image preview displayed normally. See:

1b47134d0d/zerver/views/upload.py (L333-L342)
2024-10-24 10:32:51 -07:00
Mateusz Mandera a6b0385229 tests: Extract upload_image helpers from test_markdown_thumbnail.
These are pretty general and can be useful utils for other tests.
2024-10-24 10:32:51 -07:00
Sahil Batra b593f6a881 user_group_popover: Fix icon alignment.
This commit fixes alignment of icons for the group members
and subgroups list shown in the popover.
2024-10-24 08:24:14 -07:00
Sahil Batra 7fe927c61b user_group: Show subgroups in popover.
Previously, all members of the group, including members of
recursive groups, were shown in the the popover. Now only
direct members are shown along with the direct subgroups
of the group.

Fixes #32088.
2024-10-24 08:24:14 -07:00
Sahil Batra f6db00bfb5 user_group_popover: Show members count in popover.
This count includes direct members as well as members of
all the recursive subgroups.
2024-10-24 08:24:14 -07:00
Mateusz Mandera af9b44ed02 auth: Fix invalid credentials message in login form.
Email is not case-sensitive. And password is obviously case-sensitive,
so no point mentioning that.
2024-10-24 08:23:16 -07:00
Prakhar Pratyush 30ada20ece dialog_widget: Fix stale comment.
The 'settings_user_groups' file which the comment refers
to no longer exists.

This commit updates the comment.
2024-10-24 08:22:08 -07:00
Prakhar Pratyush fd66c08221 onboarding_steps: Fix blueslip error message.
This commit fixes the blueslip error message displayed
when marking an onboarding step as read fails.
2024-10-24 08:22:08 -07:00
Prakhar Pratyush 3e13914f4a attachments_ui: Remove unused 'id' from 'Delete file' dialog widget.
The 'id' field in a dialog widget is used to add custom id to
the container element to modify styles.

We were not using this id anywhere, so this commit removes it.
2024-10-24 08:22:08 -07:00
klarabratteby ab03c74314 user_topic_popover: Convert module to TypeScript. 2024-10-23 15:26:46 -07:00
klarabratteby a601715e37 user_topic_popover: Remove all occurrences of instance.context. 2024-10-23 15:26:46 -07:00
Aditya Chaudhary ac652ffab6
stream_settings: Place the cursor automatically in channel name.
When the user opens channel create settings from left sidebar, now the focus
is set on the channel name input.

The logic was already there, but not properly placed inside the overlay code path.

Fixes #32034.
2024-10-23 15:06:21 -07:00
Aditya Chaudhary c1fc8e6331 channel_feed: Configure click event for channel name.
This commit configures the click event on the channel name so that
when the user is narrowed to a topic within a channel, clicking the
same channel will navigate the user to the general channel feed. This
improves the user experience by allowing easy access to the full
channel feed when a user is focused on a specific topic.

Fixes #32032.
2024-10-23 15:03:39 -07:00
Anders Kaseorg 2671a5c32c stylelint: Enable stylelint-high-performance-animation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg f023fa6fc0 styles: Be specific about which properties are transitioned.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg 7878b80934 comparison_table: Remove dead CSS for th.sticky.
We do not have a "sticky" class.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg f8f511aded footer: Remove unused CSS transition for #footer li.
This doesn’t transition anything.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg dfc311ae96 landing_page: Remove CSS transition from .for-education-pricing-model.
If this was doing anything, it was probably just slowing down page
resizes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg 75d834dcc3 styles: Remove ineffective animation of display.
It’s not possible to animate or transition the `display` property, at
least until `transition-behavior: allow-discrete` lands in all
browsers.  We already take care of applying `display: none` in a
JavaScript setTimeout (see alert_popup.ts, hide_error in
ui_report.ts).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Aman Agrawal eab9a3e552 message_events: Refresh `is-followed` narrow on topic visibility update.
This adds live update support for `is-followed` narrow. We need
to render the narrow again instead of just adding the relevant
messages from the updated topic since it not easy to determine
which message we need to add based on the selected message of the
user and which messages to ask from the server.
2024-10-23 11:50:25 -07:00
Aman Agrawal 93006ac4cf realm_redirect: Change bottom text.
Fixes #32042
2024-10-23 11:47:45 -07:00
Tim Abbott 29aad5c940 user_groups: Clean up members field comment. 2024-10-23 11:24:02 -07:00
Sahil Batra 9a72d6e72e user_groups: Do not show invalid subgroups in typeahead.
We do not show groups that will break the DAG constraint
on being added to a group as subgroups in the typeahead
shown in the members edit UI.

Fixes #32087.
2024-10-23 11:24:02 -07:00
Karl Stolley 625245af50 left_sidebar: Maintain Channels hover state while showing popover. 2024-10-23 11:01:25 -07:00
Aman Agrawal 70d9d8c09e message_scroll: Remove unnecessary `setTimeout` call.
Since `scroll_finished` is already called post render and we
don't have to wait for anything rendering before calling
`unread_ops.process_visible`, we can just directly call it.
2024-10-23 10:56:11 -07:00
Anders Kaseorg 6a4c4195f5 ci: Enable Python warnings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 10:55:55 -07:00
Anders Kaseorg 14db6e8c14 capitalization: Avoid bs4.MarkupResemblesLocatorWarning.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 10:55:55 -07:00
Anders Kaseorg ec437fb770 settings: Replace deprecated STATICFILES_STORAGE.
https://docs.djangoproject.com/en/4.2/releases/4.2/#custom-file-storages
https://docs.djangoproject.com/en/5.1/releases/5.1/#features-removed-in-5-1

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 10:55:55 -07:00
PieterCK 433968cbb6 storage: Reformat hashed medium static avatar files.
This commit reformats hashed medium static avatar files("-medium.png"
files). Unlike user-uploaded avatar files, avatars served alongside
static files are hashed by Django. To implement the URL patterns for
finding medium-size avatar URLs that are hardcoded into current
versions of the mobile apps, the medium avatar files need to be
adjusted to include the "-medium" string just before the file type.

For example, the URL format will now be:

    Before: welcome-bot-medium.123123321.png
    After: welcome-bot.123123123-medium.png
2024-10-23 10:35:42 -07:00
PieterCK 068ab6e11e avatar: Add checks to make sure system bot avatar exists.
This commit introduces an assertion to verify that the avatar file for
system bots exists and findable.

In development, it'll assert that the avatar file exists in the static
directory. This isn't done in production environment to avoid
unnecessary overhead. It helps verify that the protocol to fetch system
bot avatars still works when making changes during development.

In production it'll check if the avatar file exists in the STATIC_ROOT
and return a default avatar png if it doesn't.
2024-10-23 10:35:42 -07:00