Commit Graph

61509 Commits

Author SHA1 Message Date
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
PieterCK 516d1ab82b avatar: Ensure system bots' avatar URLs follow convention.
Previously, requesting system bots URLs did not return any -medium.png
variants and SVG file was also used for notification bots' avatar, which
was problematic.

In this commit, the -medium.png variants is added for the avatars of
system bots and zulip-icon-square.svg is also converted into
notification-bot.png for the notification bot. The get_avatar_url method
has been updated to return the "medium" file variants for the system
bots.

Additionally, the system bots' avatar files is moved to a dedicated
directory to simplify the hashing logic for these files. Now, all files
in the "images/static_avatars/" directory will be hashed.
2024-10-23 10:35:42 -07:00
Kislay Udbhav Verma 81c4e45d01 topic_link_util: Use different escape sequence for backticks.
Instead of "&grave;", we use "&#96;" to prevent an lxml parsing bug.
2024-10-22 17:36:59 -07:00
Kislay Udbhav Verma 6956947a73 topic_link_util: Add `&` as a character which can produce broken links.
`&` in topic names like `&copy;` can result in broken stream topic
links. So we generate fallback markdown links for them too.

This is a follow up to #30071.
2024-10-22 17:36:59 -07:00
Sayam Samal f7750a07a2 modals: Fix focus advancement in move topic modal.
Previously, when selecting a new channel in the "move topic" modal using
the keyboard, focus failed to advance to the topic input automatically.
Users had to press the tab key an extra time to move focus to the topic
input, which was not the intended behavior.

This commit modifies the `move_topic_on_update` function in
`web/src/stream_popover.js` to explicitly set focus on the topic input
field after a channel is selected.
2024-10-22 17:34:01 -07:00
Mateusz Mandera e04e8c3019 update_user_backend: Add API changelog entries. 2024-10-22 16:36:38 -07:00
Mateusz Mandera 77e7a2d30f users: Add API endpoint to update_user_backend by real email.
The old endpoint for updating a user worked only via user id. Now we add
a different entry to this functionality, fetching the user by
.delivery_email.

update_user_backend becomes the main function handling all the logic,
invoked by the two endpoints.
2024-10-22 16:36:38 -07:00
Mateusz Mandera 389b851f81 update_user_backend: Allow authorized org owners to change user emails.
This adds a new special UserProfile flag can_change_user_emails(disabled
by default) and the ability for changing the email address of users in
the realm via update_user_backend. This is useful for allowing
organizations to update user emails without needing to set up a SCIM
integration, but since it gives the ability to hijack user accounts, it
needs to be behind this additional permission and can't be just given to
organization owners by default. Analogical to how the
create_user_backend endpoint works.
2024-10-22 16:36:38 -07:00
evykassirer 8e9c592ce3 search: Only move cursor to end of selection if cursor is there already.
Fixes bug reported here:
https://chat.zulip.org/#narrow/channel/9-issues/topic/Broken.20links.20to.20previous.20messages.3F/near/196462
2024-10-22 16:25:26 -07:00
bedo 5686233699 message_header: Add date on every recipient bar in search_results.
Fixes #31958
2024-10-22 15:24:21 -07:00
Aman Agrawal 3ff6a89fe6 message_scroll: Fix last message not marked as read on `end` keypress.
Since we removed `unread_ops.process_visible` on system initiated
scrolling in #32038, this is important to take care of separately.

Reproducer: Go to a topic with a lot of unread messages and press
`end` key. Last message is not marked as read.
2024-10-22 12:21:45 -07:00
Aman Agrawal 49c2836605 message_scroll: Mark message as read after blue box moves past it.
Fixes #31833

Quoting from the issue:

Some of the reasoning behind that proposal was:

We want the first unread message to be what gets highlighted by the
blue box, since that's what you should read first.
It's bad to eat one unread message when entering a
message feed via N or otherwise.
A consistent algorithm would be that messages get marked as read when
you move the blue box past them ... except that there'd be no way to
mark the last message that way.
Because the bottom being visible marks things as read, it should be
fine to make this change now, even though there wouldn't currently
be a way to use the location of the blue box to mark the last message
in the current view as read.
2024-10-22 12:21:45 -07:00
Varun Singh ee52a7b155 scheduled_messages_overlay_ui: Convert module to TypeScript. 2024-10-22 10:43:58 -07:00
Varun Singh 9aa897b8e2 scheduled_messages_overlay_ui: Return early if msg-id is undefined. 2024-10-22 10:43:58 -07:00
Varun Singh f7f6f8703e scheduled_messages_overlay_ui: Refactor function to not mutate object.
Instead of mutating `message_render_context` object with fields,
we declare the object once depending on msg_type. This is a
prep-commit for migrating the module to TS.
2024-10-22 10:43:58 -07:00
Sahil Batra 5816dda2c9 user_group_create: Support adding subgroups while creating groups. 2024-10-22 10:23:36 -07:00
Sahil Batra 89d0ad1d60 user_group_edit: Add support to update subgroups of existing groups. 2024-10-22 10:23:36 -07:00
Sahil Batra a3b7d956bc user_groups: Allow adding users who are members of subgroups.
This commit updates the code, which checks if user is member of
the group before adding them to the group, to consider only
direct members and now allows members of subgroups to be added
as direct members of the group.
2024-10-22 10:23:36 -07:00
Sahil Batra aa2c7bf1d1 user_group_create_members: Remove buggy code.
Having this code resulted in pills being deleted on
clicking enter in the pill container as this was
needed before ad11561d31, when we cleared the pill
container after adding users to the list of members.
2024-10-22 10:23:36 -07:00
Sahil Batra 330aa25647 user_groups: Remove unused html_selector passed to ListWidget.create.
html_selector is only used when rendering a single item in the list
using insert_rendered_row and render_item, which are not used for
group members list in group creation form.
2024-10-22 10:23:36 -07:00
Sahil Batra 0a77f06163 test_user_groups: Fix comments in group creation tests.
One comment did not mention the correct thing that was
being tested and one comment had a typo.
2024-10-22 10:23:36 -07:00
Anders Kaseorg ac2b1cd45d worker: Address sentry_sdk deprecations.
https://docs.sentry.io/platforms/python/migration/1.x-to-2.x#scope-configuring
https://github.com/getsentry/sentry-python/releases/2.0.0
https://github.com/getsentry/sentry-python/releases/2.15.0

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-22 10:05:01 -07:00
Anders Kaseorg 08db41660a python: Avoid deprecated cgi module, removed in Python 3.13.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-22 10:05:01 -07:00
Sahil Batra 006ac58a4b stream_edit: Fix code being called for wrong subsection.
"update_default_stream_and_stream_privacy_state" function
should be called only when changing or discarding settings
in "Stream permissions" subsections and not when changing
settings in "Advanced configurations" subsection, since
the behavior of stream privacy and default stream options
does not depend on settings in "Advanced configurations".

This also fixes the bug of trying to access "checked"
property on undefined value of $default_stream.find("input"),
since there is no such input in "Advanced configurations"
section.
2024-10-22 10:02:07 -07:00
Maneesh Shukla 81836303d4 settings: Fix email notification permission.
Added `message_content_in_email_notifications` to the
`disabled_notification_settings` object to keep track of the setting.
Also added a tooltip message to display when the checkbox is disabled,
indicating that the setting is controlled by the organization.

Fixes: #27262.
2024-10-22 09:55:40 -07:00
Maneesh Shukla 9771528e28 settings: Rename show_push_notifications_tooltip.
This commits renames the `show_push_notifications_tooltip` object to
`disabled_notification_settings` as mentioned in the
https://github.com/zulip/zulip/pull/27543/files#r1438156860 review.

Fixes part of #27262.
2024-10-22 09:55:40 -07:00
Saubhagya Patel 34de7b7839 settings: Update confirmation modals(invite) to show server errors.
This commit includes the following changes:
 - Errors returned from the server when resending or
   revoking invitations are now shown inside the
   confirmation modal, keeping the modal open.
 - We no longer display errors in place of the Resend
   and Revoke buttons (in case of server errors), as
   they are now handled within the confirmation modal.
 - The "Working..." button text is no longer displayed
   for the Resend and Revoke buttons, which was displayed
   while the request was being processed.
 - The confirmation modals now show a loading spinner,
   while request is being processed.

Fixes part of #31395.
2024-10-22 09:52:09 -07:00
Saubhagya Patel 57f2194a1c settings: Update confirm modals(invite) to show unequal field errors.
This commit includes the following changes:
 - Display errors due to non-matching fields encountered
   during resending or revoking invitations within
   the confirmation modal, keeping the modal open.
 - Each modal is now associated with a specific ID.
 - Modify the error text for the above-mentioned errors.
 - Stop the process of revoking or resending invitations
   if an error due to non-matching fields occurs.

Fixes: #31395.
2024-10-22 09:52:09 -07:00
Alya Abbott bc7b2e9c2e contributor docs: Link to new guide on continuing prior work. 2024-10-21 18:33:28 -07:00
Vishesh Singh 7e1962dea5 compose: Show bot icon after bot name in recipient picker.
Bot icon shown in the typeahead recipient list which pops up
in the compose box while typing.
On typeahead hover, bot icon takes the color of the font
for better contrast.
2024-10-21 18:09:50 -07:00
Alya Abbott 649103a795 contributor docs: Add a page on taking over prior work. 2024-10-21 17:44:59 -07:00
Prakhar Pratyush d1be8f9b50 realm_export: Fix '#allow_private_data_export_stats' not live-updated.
Earlier, the count of total users and users who consented in the
'#allow_private_data_export_stats' text were not being live updated.

This commit fixes that behavior.

The counts are now live-updated when:
* a new user joins
* a user is removed
* a user is deactivated
* a user is reactivated
* a user toggles their 'allow_private_data_export' personal setting.

Fixes #31201.
2024-10-21 17:42:52 -07:00
Prakhar Pratyush b8e0e08f01 realm_export: Add 'Export permissions' table.
This commit adds a "Export permissions" table
in the 'Data exports' setting panel.

The table lists the active human users and their
configuration of 'allow_private_data_export' setting.

Fixes part of #31201.
2024-10-21 17:42:52 -07:00
Aman Agrawal a1aa52cff4 message_scroll: Don't mark message read on system animated scroll.
This avoids us marking new messages as read when they arrive without
user activity. Specifically, we don't mark all messages in the narrow
as read when the last message is visible and the scroll was
initiated without user input.
2024-10-21 15:53:28 -07:00
Aman Agrawal 32030a7548 activity: Don't read new messages without user activity.
We have a bug where we can mark messages as read as a result of a
desktop left open with the Zulip window focused. To avoid it,
we only mark new messages as read if there is some user activity.

Note that we scroll to bring new messages into view which can
mark them as read.
2024-10-21 15:53:28 -07:00
Aman Agrawal 72caf5641e activity: Use the defined function to set `new_user_input` value.
This helps us call additional functions when `new_user_input` value
is modified.
2024-10-21 15:53:28 -07:00
Shubham Padia ad11561d31 user_groups: Add users to members preview list without add button.
This makes the behaviour of this screen similar to the create channel
screen where the user does not need to click `Add` button to add users
to members preview. This follows most of the logic from that flow for
soft removal, syncing between members preview list and the input pills,
etc. The current user will have a pill in this case unlike channel
creation since a user can create a group without them in it.
2024-10-21 15:46:11 -07:00
Aman Agrawal 4768294bc0 navbar: Remove `:visited` color effect on button text.
The `:visited` color effect doesn't look good is not intentional.
2024-10-21 15:44:43 -07:00