Commit Graph

63435 Commits

Author SHA1 Message Date
Karl Stolley
a889254771 left_sidebar: Allow vdots icon to scale. 2025-01-28 09:02:40 -08:00
Alya Abbott
12bee92674 help: Document group permissions panel. 2025-01-27 18:02:50 -08:00
Alya Abbott
93dfd3dc1e integrations: Retitle Slack integration docs.
The updated titles are anti-pattern, but are much clearer.
2025-01-27 18:02:06 -08:00
PieterCK
e25da08886 integrations: Edit pass on Slack integration doc.
- Add a step to update the bot's API key if using a generic bot
for bidirectional bridging.
- Clarify setup options for how Slack channels are mapped.
- Edit for clarity and succinctness.
2025-01-27 18:02:06 -08:00
Sahil Batra
2ed2fc163b settings: Rename tooltip_text variable in settigns_numeric_input.
We make the variable name consistent with settings_checkbox.
2025-01-27 15:32:15 -08:00
Sahil Batra
50799a1a87 settings: Show assigned group permissions in permissions panel.
Fixes part of #28806.
2025-01-27 15:32:15 -08:00
Sahil Batra
071037c55d settings: Show assigned stream permissions in group permissions panel. 2025-01-27 15:32:15 -08:00
Sahil Batra
893cdc8069 settings: Show realm permissions that group has in permissions panel. 2025-01-27 15:32:15 -08:00
evykassirer
10d7da81a0 copy_and_paste: Don't add code syntax if backtick is already present. 2025-01-27 15:30:15 -08:00
Prakhar Pratyush
9ab6729d41 missedmessage_emails: Show EMPTY_TOPIC_FALLBACK_NAME for topic="".
This commit adds support to display `Message.EMPTY_TOPIC_FALLBACK_NAME`
value (translated) in the missedmessage email body and subject for
topics having the actual value of empty string.

Fixes part of #32996.
2025-01-27 13:08:19 -08:00
Aman Agrawal
dc9422ec81 test_message_summary: Add a basic test. 2025-01-27 12:23:40 -08:00
Aman Agrawal
aceb79ba88 message_summary: Directly use input_token from llm response.
Remove now to help with testing of credit usage.
2025-01-27 12:23:40 -08:00
whilstsomebody
b571f92206 message_edit: Disallow empty topic when mandatory topic is true.
Previously, 'check_update_message' allowed moving messages to
empty topic even with `mandatory_topic=true`.

This commit fixes the bug. We now raise an error in that case.

Co-authored-by: Prakhar Pratyush <prakhar@zulip.com>
2025-01-27 11:45:58 -08:00
whilstsomebody
db7541a770 popovers: Make "popover-menu-user-full-name" text selectable.
In the profile card that pops up when clicking a user's name,
the text of their name was not selectable text previously.
This commit makes the text selectable.
2025-01-27 11:43:58 -08:00
Alex Vandiver
4b8247731e topic: Fix comment to be in the right order.
b747ea285f fixed the code's order, but not the accompanying comment.
2025-01-27 11:43:06 -08:00
Prakhar Pratyush
1f5449a5a9 topic_list_data: Update variable names to avoid confusion.
Earlier, in 'topic_list_data.ts' we were using 'topic_display_name'
variable to represent part of the topic name without resolved_prefix.
This could led to confusion with 'util.get_final_topic_display_name()'
as both represent different things.

This commit updates the code to use 'topic_bare_name' for a better
representation of its meaning.
2025-01-27 11:40:43 -08:00
Shubham Padia
204fa1e9f2 stream: Make documentation for group permission settings simpler. 2025-01-27 11:26:06 -08:00
Shubham Padia
6852142b00 stream: Rename can_administer_channel to reflect what it checks.
We've added a comment highlighting that the function does not check
whether a user has access to the channel or not. Adding `accessible` to
the function name further emphasises that.
2025-01-27 11:26:06 -08:00
Shubham Padia
bf5bdacf51 stream: Use dataclass for filter_stream_authorization return type. 2025-01-27 11:26:06 -08:00
Shubham Padia
218962a83b stream_create: Add enable_or_disable_add_subscribers_elements back.
The code will behave the same before and after this commit, what this
commit helps in is readability. By adding
`enable_or_disable_add_subscribers_elements`, we will no longer be
confused as to why that function appears in stream_edit and not in
stream_create.
2025-01-27 11:26:06 -08:00
Shubham Padia
e912ada51e stream: Rename can_subscribe_others_to_all_streams.
Rename `can_subscribe_others_to_all_streams` to
`can_subscribe_others_to_all_accessible_streams` so it's clear that we
are not attempting to check basic access in this function.
2025-01-27 11:26:06 -08:00
Kislay Verma
32f9ee7a62 topic_link_util: Add [ and ] as characters to escape.
These characters cause the fallback markdown
links produced (#30071) to be broken.

Broken links are not produced when these are present
in `#**channel>topic**` syntax. It is only a problem
with the fallback markdown links.
2025-01-25 11:41:25 -08:00
Anders Kaseorg
f52ec0559c realms: Use modern union syntax for property_types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-24 23:00:21 -08:00
Anders Kaseorg
73783f5519 realms: Remove None for message_retention_days.
The unlimited value for message_retention_days is -1, not null.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-24 23:00:21 -08:00
Anders Kaseorg
235ead6247 event_types: Allow None for EventRealmUpdate.value.
value can be None when property is jitsi_server_url,
message_content_edit_limit_seconds,
message_content_delete_limit_seconds,
move_messages_between_streams_limit_seconds, or
move_messages_within_stream_limit_seconds.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-24 23:00:21 -08:00
Anders Kaseorg
0ba41328fd openapi: Fix misuse of nullable as sibling of oneOf.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-24 23:00:21 -08:00
Anders Kaseorg
3b84dd3b8c stripe_event_handler: Fix UP038.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-24 22:59:58 -08:00
bedo
21199beb73 stream_delete_event: Include only stream IDs in the event.
Fixes #32369

Migrate stream delete event to include only stream ids in the form of
"stream_ids": [1,...], because clients only need the ids.

While keep sending ids in the form of "streams": [{stream_id: 1},...]
for compatibility with all clients other than web.
2025-01-24 17:58:32 -08:00
bedo
7c8a3618bf message_view_header: Change maybe_rerender_title_area_for_stream type.
prep-commit

changed argument "modified_sub: StreamSubscription" to
"modified_stream_id: number", as only ID is used and not the whole object.
2025-01-24 17:58:32 -08:00
PieterCK
a995510f0c worker: Flag messages processed by embedded bot.
This commit updates embedded bots to mark messages they have process as
read. Since the service bots have their own `UserMessage` rows, this
change enables us to track whether the bot has in fact processed the
message by adding the `read` flag to their `UserMessage`.

Fixes #28869.
2025-01-24 17:56:44 -08:00
PieterCK
cacd6bb88c worker: Flag messages processed by outgoing bot.
This commit updates outgoing bots to mark messages they process as read.
Since the service bots have their own `UserMessage` rows, this change
enables us to track whether the bot has in fact processed the message by
adding the `read` flag to their `UserMessage`.
2025-01-24 17:56:44 -08:00
PieterCK
25f64a9a67 message_send: Include service bots as UserMessage eligible.
Previously, service bots don't get UserMessage rows for new messages to
optimize performance. This commit adds UserMessage row for service bots
so that they behave more similarly to generic bots.
2025-01-24 17:56:44 -08:00
Maneesh Shukla
5910bfcaf9 left_sidebar: Rewrite left sidebar navigation area library.
Fixes: #26686.
2025-01-24 17:26:40 -08:00
PieterCK
2d6426100f import-export: Rework how we write migration_status.json.
The current `get_migration_by_app` has a rather naive approach to
compiling the migration status of a realm, which has led to issues like
#32826. Specifically, those flaws are:

- it does not report the complete state of the migration status of the
exporting servers, only the applied migration.
- it shows both the replaced and the squashed migrations. This would be
a problem if we decide to clean up old migration files we've
squashed(replaced) and import a slightly older realm with those still in
disk. `check_migration_status` would complain of incompatibility even
though those migration files don't matter (they are replaced, after
all).
- it does not clean up ancient/stale applied migrations (for reference,
see how `check-database-compatibility` cleans those)

This commit attempts to write a better `migration_status.json` by
parsing the output of `showmigrations` instead.

This is because Django's `showmigrations` has a lot more logic and
validations baked into it than previously thought. Ones that we care
about are:

- it does validations to make sure app names are valid
- it doesn't list replaced migrations and only squashed one
- it takes into account migrations in disk(`MigrationsLoader`) vs
applied migrations (`MigrationsRecorder`)

Which would resolve the first two points highlighted above.
2025-01-24 17:08:37 -08:00
PieterCK
4db7ea2296 migration_status: Add parse_migration_status.
This commit adds `parse_migration_status`, which takes in the string
output of `showmigrations` and parse it into key-value pair of installed
apps and a list of its migration status.

This is a prep commit to rework the check migrations function of
import/export which will parse the output of `showmigrations` to write
the `migration_status.json` file.
2025-01-24 17:08:37 -08:00
PieterCK
68b3ce482a check-database-compatibility: Refactor a STALE_MIGRATIONS.
This consolidates the list of stale migration to
`lib/migration_status.py` as `STALE_MIGRATIONS`.

This is a prep work to make the migration status tool at
`migration_status.py` be able to clean its output of these migrations
too.
2025-01-24 17:08:37 -08:00
PieterCK
0b2f5c638d export_test: Prevent migration status fixtures from going stale.
Currently if for what ever reason one decided to change how
`migration_status.json` is written, the check migrations tests in
`test_import_export.py` will happily just use the old and potentially
stale migration status test fixtures in
`fixtures/applied_migrations_fixtures` against other stale fixtures and
run the check migrations tests in a bubble.

This adds an assertion in `verify_migration_status_json` that makes sure
all the migration status fixtures we use in the tests resembles the
actual `migration_status.json` file our export tool will write.
2025-01-24 17:08:37 -08:00
PieterCK
7a2b91ae97 migration_status: Update ANSI code clean up regex.
in `get_migrations_status`, we clean up the printed output of any ANSI
codes used to format the output. Currently the regex only cleans up bold
ANSI escape code (\x1b[1m) and style reset code (\x1b[0m). So it won't
be able to clean up basic ANSI escape codes such as "\x1b\31;1m" which
is used to format `showmigrations` output for apps with no migrations.
   e.g, "\x1b\31;1m (no migrations)"

This commit updates the regex to catch a wider range of basic ANSI
codes.
2025-01-24 17:08:37 -08:00
PieterCK
5f2286353f migration_status: Move connection.close_all() to test_fixtures.py.
The `get_migration_status` command calls `connections.close_all()` when
its done and it was previously only called when we need to rebuild the
dev or test database and when running the `get_migration_status`
command.

This commit moves the `connections.close_all()` call out of the function
and into `test_fixtures.py` directly, making sure it will only be called
when we are rebuilding the dev/test database. This is a prep work to
refactor the check migration function of import/export later on which
plans to use `get_migration_status`.
2025-01-24 17:08:37 -08:00
PieterCK
dfae02a273 migration_status: Move get_migration_status to a new file.
This moves `get_migration_status` to its own file in
zerver/lib/migration_status.py. This is a prep work to refactor the
check migration function of import/export later on.

Some of the imports are moved into `get_migration_status` because we're
planning to share this file with `check-database-compatibility` which is
also called when one does `production-upgrade`, so we'd want to avoid
doing file-wide import on certain types of modules because it will fail
under that scenario.

In `test_fixtures.py`, `get_migration_status` is imported within
`Database.what_to_do_with_migrations` so that it is called after
`cov.start()` in `test-backend`. This is to avoid wierd interaction with
coverage, see more details in #33063.

Fixes #33063.
2025-01-24 17:08:37 -08:00
Lauryn Menard
6b6142bcf6 help: Update change email address instructions for UI changes. 2025-01-24 16:49:05 -08:00
Jitendra Kumar
f96484eed5 style: Center the ⌘ symbol by replacing it with an icon.
This commit updates the keyboard shortcuts UI by replacing
the ⌘ symbol with a more symmetrically aligned icon.

Fixes: #32926
2025-01-24 16:48:26 -08:00
Mateusz Mandera
f81e514d07 slack: Fetch workspace users from /users.list in the correct manner.
1. Fetching from the `/users.list` endpoint is supposed to use
   pagination. Slack will return at most 1000 results in a single
   request. This means that our Slack import system hasn't worked
   properly for workspaces with more than 1000 users. Users after the
   first 1000 would be considered by our tool as mirror dummies and thus
   created with is_active=False,is_mirror_dummy=True.
   Ref https://api.slack.com/methods/users.list

2. Workspaces with a lot of users, and therefore requiring the use of
   paginated requests to fetch them all, might also get us to run into
   Slack's rate limits, since we'll be doing repeating requests to the
   endpoint.
   Therefore, the API fetch needs to also handle rate limiting errors
   correctly.
   Per, https://api.slack.com/apis/rate-limits#headers, we can just read
   the retry-after header from the rsponse and wait the indicated number
   of seconds before repeating the requests. This is an easy approach to
   implement, so that's what we go with here.
2025-01-24 16:41:53 -08:00
Alya Abbott
3dd3de3efa contributor docs: Describe how to handle follow-ups. 2025-01-24 15:02:18 -08:00
Karl Stolley
7111d429e6 compose: Size help-button icon to match other formatting buttons.
Because button sizes are precisely specified in the area, we set
the buttons as flex items that neither to grow or shrink, which
is essential to right-size the button area for the help button.
2025-01-24 14:57:29 -08:00
Karl Stolley
1d7076a534 channel_modal: Push back against inherited icon styles. 2025-01-24 14:56:41 -08:00
Aman Agrawal
9f71f4578b portico: Replace "Find accounts" link with "Log in".
Fixes #32199

We only need a log in button since that will take users to
"/accounts/go" if we are on a non-realm specific URL.

"/accounts/go" already has link to go to "Find accounts" page.
2025-01-24 14:55:47 -08:00
Sahil Batra
6bb3e6fb38 settings_checkbox: Rename tooltip_text variable. 2025-01-24 14:51:51 -08:00
Sahil Batra
52fbca65ce group-settings: Move functions used for group settings.
This commit moves get_realm_user_groups_for_setting and
get_realm_user_groups_for_dropdown_list_widget functions
from user_groups.ts to group_permission_settings.ts.

This change is needed to avoid import cycles in further
commits to add "Permissions" panel for groups.
2025-01-24 14:51:51 -08:00
Sahil Batra
4ae45763b4 settings: Use a common object for all group setting labels. 2025-01-24 14:51:51 -08:00