Commit Graph

60564 Commits

Author SHA1 Message Date
Alex Vandiver cec0942b4b users: Allow zero-width-joiners in user names.
Partially fixes: #20128.
2024-09-03 16:34:55 -07:00
evykassirer 58bc98afb5 util: Use blueslip error for util.the instead of an assert. 2024-09-03 13:49:30 -07:00
Aman Agrawal 240c870815 typeahead: Fix compose topic typeahead partially hidden.
The `flip` popper function is not working properly here since
we migrated to use Simplebar (Can be verified by removing
`data-simplebar`).

To fix it, we need to force trigger the function as soon as tippy
is attached to DOM.
2024-09-03 12:37:33 -07:00
Tim Abbott ca406288d9 webhooks: Fix strange joining code in greenhous webhook. 2024-09-03 12:31:36 -07:00
Anders Kaseorg 91ade25ba3 python: Simplify with str.removeprefix, str.removesuffix.
These are available in Python ≥ 3.9.
https://docs.python.org/3/library/stdtypes.html#str.removeprefix

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-03 12:30:16 -07:00
Shubham Padia 1ec4539550 css: Rename .icon to .sidebar-item-icon for the name to be unique.
See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1901490
for more details.
2024-09-03 12:20:42 -07:00
Shubham Padia 2f120d2572 settings: Make show more tab look similar to other tabs.
Fixes https://chat.zulip.org/#narrow/stream/101-design/topic/org.20settings.20-.20show.20more.20-.20icon.20alignment/near/1935512
Also renames `.collapse-settings-btn` to `.collapse-settings-button`.
2024-09-03 12:20:42 -07:00
Shubham Padia 4a7983fad3 css: Use a class for spoiler header text.
Having the :not() rule there affected the performance, see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1920156
for more details.
2024-09-03 10:24:40 -07:00
Shubham Padia 28d9c02479 css: Have `move-handle` for every movable row instance.
The original motivation was to remove the `+ i` instances because of
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1934360.
But it seemed better to have similar html structure and css across all
movable rows.
2024-09-03 10:22:44 -07:00
Shubham Padia 77ebdfac77 css: Use classname for show_my_user_profile_modal icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia a764e80a1b css: Use classname for scroll-to-bottom icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia fe44ce3e24 css: Use classname for all-messages-search-caution icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia 82b68e9bdb css: Use classname for play_notification_sound icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
Also does some refactoring to account for the fact that
.setting_notification_sound does not have any icons as children.
2024-09-03 10:22:44 -07:00
Shubham Padia 6ec1b89502 css: Use classname for navbar_icon_and_title icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia ea60fee0ac css: Use classname for subscribe-to-more-streams icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia 9de064dc3e css: Use classname for setting-disabled-option icon.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:18:29 -07:00
Vector73 b2a07971ec dropdown_widget: Allow more than one click on dropdown.
The new saved replies feature requires removing saved replies by clicking on
trash icon on dropdown item. So dropdown widget should allow more than
one click without closing it to delete multiple saved replies.
2024-09-03 09:20:27 -07:00
Aditya Kumar Kasaudhan b2ab77746b compose: Fix disabled buttons after exiting preview mode in edit UI.
This commit fixes the issue by ensuring that the `clear_preview_area` function is called within the `end_message_row_edit` method. This ensures that when the edit UI is reopened, it resets to the correct state, with all buttons enabled and functioning as expected.

Fixes #31503.
2024-09-03 09:19:10 -07:00
Prakhar Pratyush 1e7468bbe5 dev_settings: Fix landing page not accessible on root domain.
The ROOT_DOMAIN_LANDING_PAGE boolean setting is set based on
whether the root domain is a landing page or can host a realm.

We set it to False by default as we don't expect it to be used
by someone outside zulip.com (mentioned in 3173db37f7).

But the development environment uses the root domain 'zulipdev.com'
as landing page and the default realm is hosted at the subdomain
'zulip.zulipdev.com'.

So, this commit overrides the default value in 'dev_settings.py'.

Earlier, the zulip.com equivalent landing pages, including the
help center pages were not accessible in the dev environment.
This commit fixes those bugs.

Fixes #30750.
2024-09-03 09:18:11 -07:00
Prakhar Pratyush a2ff4f52c4 actions: Use 'durable=True' in outermost transaction.atomic block.
We used 'savepoint=False' in #31169 which was prior to our discussion
in CZO to use 'durable=True' instead.

This commit makes changes to use 'durable=True' in the outermost
transaction.atomic block.
2024-09-03 09:17:38 -07:00
Alya Abbott d7761f7163 help: Add a guide on moving to Zulip. 2024-09-01 16:16:04 -07:00
Alya Abbott 7df0db142b help: Document how to invite users in imported organizations. 2024-09-01 16:16:04 -07:00
bedo 3da91e951c auth: Migrate to @typed_endpoint.
Since this is the last has_request_variables endpoint outside tests,
more test_openapi code needs to be deleted in this transition.
2024-08-30 16:56:14 -07:00
Karl Stolley a8ecba8ab8 settings: Remove .new-style, unused .button ul selector. 2024-08-30 14:06:27 -07:00
Karl Stolley 7a94d484ff settings: Remove unused or unnecessary center classes from .new-style cluster. 2024-08-30 14:06:27 -07:00
Karl Stolley f98551f128 settings: Remove unnecessary .block from .new-style cluster. 2024-08-30 14:06:27 -07:00
Karl Stolley 0cfddc9874 settings: Remove .w-200 class from .new-style cluster.
All elements that use this have their width already superseded by
other selectors.
2024-08-30 14:06:27 -07:00
Karl Stolley 2e6a34042f settings: Remove unnecesary inline-block div.
This also removes the need for any min-width declarations on the
labels, which will behave as block elements and take up the
containing block's available width.
2024-08-30 14:06:27 -07:00
Karl Stolley 668660bc71 settings: Remove unused .warning from .new-style cluster.
This seems to have been used with the `password_warning()` function
in `password_quality.ts`, but that function does not appear to be
called in the app--only in the portico.
2024-08-30 14:06:27 -07:00
Alex Vandiver 9497f23307 puppet: Make restart-server cron use standard day-of-week.
Using 7 makes this fail when run under the Sentry cron wrapper.
2024-08-30 13:13:05 -07:00
Shubham Padia 619a19a63b help-beta: Add grouping to the left sidebar.
Fixes #31251.
All these values have been taken from `sidebar_index.md`. We will worry
about syncing that file and the starlight sidebar config option later on
during the `help-beta` migration.
Instead of using `.home-link` class to insert the black left-pointing
triangle, we are just using the unicode character directly in
astro.config.mjs.
We've also added a class because we wanted a section header in sidebar
for `Zulip Administration` without it acting as a group for all the
links below it. It is bit of a hacky approach but workable for now
considering we only have 1 instance where we are using it. `rem` was
used as the unit for font-size since that is the unit being used by
starlight for it's font size too.
2024-08-30 11:42:02 -07:00
Aman Agrawal f0668fbaf6 stripe: Remove numeric variation from normalized fixture data.
We only make `id` and `timestamp` field of the fixture unique whose
uniqueness matters to us in the tests. Other fields don't matter, so
we normalized them completely with a constant so that they don't
have different values when generating fixtures repeatedly.
2024-08-30 11:38:47 -07:00
Karl Stolley 35f84e5381 message_row: Allow moved/edit markers to scale. 2024-08-30 10:45:39 -07:00
Karl Stolley 776a90d9ba left_sidebar: Render brackets only on non-empty channels. 2024-08-30 10:34:07 -07:00
sujal shah 2c4596d990 settings_users: Fix for filter search text issue in settings users.
This commit addresses an issue where the search query applied in
one tab was inadvertently affecting all tabs
(Users, Deactivated, Invitations).

Now, the search functionality is properly isolated to the active tab,
ensuring that users can filter results without interference
from other tabs.

(One change needed for this was included in the previous commit).
2024-08-30 10:31:07 -07:00
Shubham Padia dad40eb296 settings_users: Show previously entered text in search filter. 2024-08-30 10:30:44 -07:00
Shubham Padia 548c583cf9 settings_users: Show previously selected value in role code dropdown.
Fixes
https://chat.zulip.org/#narrow/stream/9-issues/topic/filters.20are.20not.20working.20properly/near/1923794.
This commit also changes the datatype used for the dropdown to number
which is more suitable for our case.
2024-08-30 10:30:44 -07:00
Shubham Padia f38fe78e53 css: Use classnames for settings page .sidebar li items.
Having the > ul selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-08-30 10:23:19 -07:00
Shubham Padia 3afc34050b css: Use classnames for settings page .sidebar li items.
Having the `*` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
We've used `sidebar` instead of `sidebar-wrapper` for the rules in
dark-theme also, since that is the rule being followed for light theme.
We've introduced a new class called `sidebar-item`.
2024-08-30 10:23:19 -07:00
Jaimin Godhani c1755e3d94 settings: Rename display_settings.hbs to preferences.hbs.
Fixes part of zulip#26874.
2024-08-30 10:20:06 -07:00
Aman Agrawal 6d2cda4308 typeahead: Remove patch for IME enter events.
Key value for IME enter keypress is "Process", so we
don't need to patch it here.
2024-08-29 16:32:31 -07:00
Aman Agrawal 04aada3589 typeahead: Migrate to use `key` instead of `keyCode`.
`keyCode` is deprecated and those values are not readable.
2024-08-29 16:32:31 -07:00
Anders Kaseorg 8b147d92a8 apt-repos: Use PGroonga binaries on Ubuntu 24.04.
These did not exist when we first added Ubuntu 24.04 support; now they
do.  Fixes #31261.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-08-29 16:04:44 -07:00
Sayam Samal e4f1156bea condense: Dynamically render content for message length toggle.
This moves the content inside `message_length_controller` to a new
handlerbars template `message_length_toggle.hbs`, and dynamically
renders the content based on the message length.

Since the majority of the messages aren't collapsed/condensed, this
change should improve the initial rendering of the message list.

Fixes #31133.
2024-08-29 15:52:08 -07:00
Prakhar Pratyush 656c65c74c edit_history: Remove 'prev_rendered_content_version' field.
This commit removes the 'prev_rendered_content_version'
field from:

* the 'edit_history' object within message objects in the
API response of `GET /messages`, `GET /messages/{message_id}`
and `POST /zulip-outgoing-webhook`.
* the 'update_message' event type

as it is an internal server implementation detail not used
by any client.

Note: The field is still stored in the 'edit_history' column
of the 'Message' table as it will be helpful when making
major changes to the markup rendering process.
2024-08-29 15:37:12 -07:00
Sayam Samal c51bd1eab8 message_list: Conditionally render message edit form container element.
This commit moves the placeholder elements for the message edit form,
to `message_edit_form.hbs`, so they are conditionally rendered only
when a message is being edited, rather than being present for every
message in the list.

Fixes #31134.
2024-08-29 13:32:28 -07:00
Alex Vandiver b8e4bdccd8 postprocess_content: Un-URI-escape filename in title.
The filename contains URI-escaped characters, which do not need to be
escaped for safety -- they only make the filename in the tooltip less
readable.
2024-08-29 13:29:33 -07:00
Alex Vandiver 6c1a8185aa setup_path: Ensure that the right venv is activated.
`setup_path()` previously only checked that some `zulip-py3-venv` was
the `sys.prefix`, not that it was the one associated with this
deployment.  When `uwsgi` is started, it is started from `bin/uwsgi`
within a `zulip-py3-venv` virtualenv, and as such sets
`sys.executable` to that, resulting in uwsgi workers picking up the
library path of that virtualenv.  On first start, `sys.path` thus
already matches the expected virtualenv, and the `setup_path` in
`zproject.wsgi` does nothing.

If a rolling restart was later done into a deployment with a different
virtualenv, the `zproject.wsgi` call to `setup_path()` did not change
`sys.path` to the new virtualenv, since it was already running within
_a_ virtualenv.  This led to dependency version mismatches, and
potentially even more disastrous consequences if the old (but still
erroneously in use) virtualenv was later garbage-collected.

PR #26771 was a previous attempt to resolve this, but failed due to
not thinking of the uwsgi binary itself as possibly providing a
virtualenv path.  We leave the `chdir` hooks from that in-place, since
it cannot hurt for the "master" uwsgi process to be chdir'd to `/`,
and the `hook-post-fork` `chdir` is reasonable as well.

Resolve the virtualenv in `setup_path()`, and activate it if it
differs from the one that is currently active.  To be sure that no
other old virtualenvs are used, we also filter out any paths which
appear to be from other Zulip virtualenvs.
2024-08-29 12:42:13 -07:00
Alex Vandiver 674ca1a95d restart-server: Wait until chain reload has completed.
We should not proceed and send client reload events until we know that
all of the server processes have updated to the latest version, or
they may reload into the old server version if they hit a Django
worker which has not yet restarted.

Because the logic controlling the number of workers is mildly complex,
and lives in Puppet, use the `uwsgi` Python bindings to know when the
process being reloaded is the last one, and use that to write out a
file signifying the success of the chain reload.  `restart-server`
awaits the creation of this file before proceeding.
2024-08-29 12:12:34 -07:00
Alex Vandiver 3efc5ae1fd docs: Update docs about number of uwsgi processes that are run. 2024-08-29 12:12:34 -07:00