Commit Graph

49034 Commits

Author SHA1 Message Date
Sahil Batra 2451002e3b popovers: Use can_move_message function.
We can now directly use `can_move_message` function instead
of checking topic and stream edit permission. This helps us
in avoid duplication of code.
2022-10-19 12:02:22 -07:00
Sahil Batra ad3fe2c0db keyboard_shortcuts: Fix description for "e" shortcut.
This commit updates the description for "e" shortcut so
that it at least fits in one line in english.

Fixes #23112.
2022-10-19 12:02:22 -07:00
Sahil Batra 693a36d680 popovers: Add "(e)" shortcut to "View message source" option. 2022-10-19 12:02:22 -07:00
Sahil Batra eed728fb59 hotkey: Use "m" hotkey for moving messages.
Fixes #23113.
2022-10-19 12:02:22 -07:00
Sahil Batra 10668b080e message_edit: Remove NO_LONGER from editability_types.
Previously, NO_LONGER type was just used to display
the text in the bottom-right of message edit form
which we have removed now, so we can remove `NO_LONGER`
type now.
2022-10-19 12:02:22 -07:00
rixant 3c238c7b19 portico: Change deafult width of dropdowns to fit-content.
We seem to override this setting for most of the dropdowns, so this
common CSS only applies to the smaller dropdown shown to logged-in
users, where it was weirdly wide.
2022-10-19 11:59:34 -07:00
David Rosa 84ce917e9f help: Add "Edit a custom profile field" section.
Adds a section on editing to the Custom profile fields help article.

Fixes part of #23170.
2022-10-19 11:58:00 -07:00
David Rosa 64c31b7cb9 help: Rename "Add custom profile fields" -> "Custom profile fields".
Renames the help article on custom profile fields to reflect that
its content is not just about adding fields.

Adds a redirect from the old URL to the new URL and updates internal
links, linking to #add-a-custom-profile-field where appropriate.

Fixes #23170.
2022-10-19 11:58:00 -07:00
Aman Agrawal eec294b257 css: Fix color of filter buttons being changed on hover for spectators.
We don't want the color to change at all on hover since these buttons are
disabled. This only needed a fix for the dark theme.
2022-10-19 06:42:11 -07:00
Alya Abbott abccc483f4 help center: Clean up documentation on sending messages.
- Consolidate /help/starting-a-new-private-thread and /help/private-messages.
- Tweak the wording on compose-and-send-message.md.
- Use compose-and-send-message.md where appropriate (and not otherwise).
2022-10-18 22:20:45 -07:00
David Rosa c0f534ff79 help: Fix "Reply mentioning user" documentation.
Corrects "Reply mentioning user" option which is available in the
user menu if accessed from a message.

Documents "Copy mention syntax" option which is available from the
right sidebar.

Fixes: #23202.
2022-10-18 22:18:47 -07:00
Aman Agrawal 169f777b36 use_info_popover: Fix long words overflowing out of container.
The text will now break at the overflowing points. A hyphen maybe
inserted but is dependent on language and browser support.
2022-10-18 22:13:04 -07:00
Aman Agrawal a29009b4d9 realm_user_settings: Fix user status with emoji preview.
Fixed to reflect how user status with emoji will be displayed
in the right sidebar.
2022-10-18 22:13:04 -07:00
Aman Agrawal 5a5ec5518c right_sidebar: Fix full name overflowing its container.
User's name with status emoji was overflowing its container,
resulting in overflown text to not be converted into ellipsis
and pushing status emoji out of visible area.
2022-10-18 22:13:04 -07:00
Mateusz Mandera f6f7e4c53f migrations: Remove bugged Recipients in 0419. 2022-10-18 20:50:10 -07:00
Aman Agrawal 8883b64388 recent_topics: Handle page up/down manually.
Fixes #23078.

Instead of relying on browser, we handle the page up/down keys
to ensure we take care of some rows being hidden due to compose
box and table header.
2022-10-18 17:34:42 -07:00
Joseph Ho 551c6899be
compose: Stop selecting compose box content after topic change.
Previously, the on_topic_change handler for the compose system would
focus the compose box after a topic change, and also select all content in 
the compose box. Selecting that content makes sense if we think the user's
intent is likely to be deleting that content; but there's no clear reason we
should expect that intent, and it's not particularly consistent with our drafts
model to risk accidentally losing partially composed message content this way.

After some discussion, we've concluded that in both cases reaching this code path
(either the previous topic being "" or the compose box content being entry), it'd
be better to skip the `.select()`.

Fixes #23146.
2022-10-18 17:20:52 -07:00
Lauryn Menard 8089910dcb narrow: Update browser title when in a narrow search view.
Sets a default value of "Search results" for complicated narrow search
views and updates logic to use `filter.get_title` as a helper to
generate better titles for some common search views.

Does not update the existing behavior for narrow searches that have
"pm-with" or "group-pm-with" operators.

Note as of this change, the default search title and titles generated
from `filter.get_title` will be translated into the user's preferred
language.

Fixes #22952.
2022-10-18 17:13:51 -07:00
Lauryn Menard 857324a164 filter: Return 'undefined' title for narrows with search operator.
Updates `filter.get_title` to return 'undefined' for any narrow
with a search operator. Previously it would return a title if
the search operator was paired with a common narrow, but those
results were not being used when building the message view
header and will not be used for setting the browser title.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 099acc3c60 narrow: Split out logic for `group-pm-with` in `update_narrow_title`.
Fixes a subtle bug in the browswer title that occured if the user
input a keyword or another vaild search operator before `pm-with`
or `group-pm-with`.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 107fdc8955 narrow: Translate browser title for default views.
Translates browser titles for "All messages" and "Recent topics"
views.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard f3e118f241 filter: Add stream name that was searched for to unknown stream title.
When the narrow/search for a stream is undefined because either the
stream does not exist or the user is not subscribed to the private
stream, format the title that's used in the message view header to
include the stream name that was searched for.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 5f42425982 filter: Update default title for `streams:public` narrow.
Updates default title for `streams:public` narrow to be
"Messages in all public streams".

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard c1b430d602 filter: Add titles for messages with alerts and unread messages.
In `filter.get_title`, add cases for the two missing "is" operators,
"alerted" and "unread".

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Aman Agrawal abec99fe0c tippy: Check if reaction still exists in DOM before showing tooltip.
This avoids an error being triggered if `instance.reference` gets
remvoed from the DOM and `rows.get_message_id` is called on it in
`onShow` later.

This is an untested bug fix since I was not able to reproduce
this on live server or locally.
2022-10-18 16:04:55 -07:00
Aman Agrawal 59e7741055 recent_topics: Fix typo.
This was an unintentional change in #20890, which resulted in
reply to topics not working.
2022-10-18 12:26:20 -07:00
David Rosa d9dd272a78 help: Update documentation on bots.
Adds new tab to `zerver/lib/markdown/tabbed_sections.py` to document
managing bots from both personal settings and organization settings.

Documents adding bots from the organization settings Bots panel.

Separates instructions for deactivating and reactivating a bot from
both personal settings and organization settings.

Fixes a few formatting issues such as missing bold formatting and
heading level.

Fixes: #23066.
2022-10-18 10:16:42 -07:00
Rixant Rokaha 24f344dc40 settings_ui: Change org profile icon to same as custom profile fields. 2022-10-18 08:25:13 -07:00
rixant c15e202155 settings_ui: Change icons in organization settings sidebar. 2022-10-18 08:25:13 -07:00
David Rosa a94b13cfb0 help: Fix "Click on the ellipsis" formatting and use of macros.
Adds bold formatting to **ellipsis** for consistency and replaces
duplicate instructions with the appropriate macro across help
center docs.
2022-10-18 08:23:59 -07:00
David Rosa 7af9d43d6a help: Update documentation for "Mute this user" and "Manage this user".
This documents how to access the options from the three-dot menu in a
user's profile summary.

Refactors and updates the steps for muting a user into a single set of
instructions. Updates instructions for the "Manage this user" option.

Fixes #23204.
2022-10-18 08:23:59 -07:00
David Rosa fc85f88529 help: Add macros to document access to three-dot menu in profile summary.
Fixes part of #23204.
2022-10-18 08:23:59 -07:00
Alex Vandiver 0fc8c6c16f message_fetch: Switch to exponential backoff with jitter. 2022-10-18 08:20:22 -07:00
Alex Vandiver 3bb13a1f58 message_fetch: Switch to using show_error, which is equivalent. 2022-10-18 08:20:22 -07:00
Alex Vandiver 2d406aa9d0 message_fetch: Improve retry logic for matches_narrow re-checks.
Previously, we retried all failed requests to
`/json/messages/matches_narrow` forever, with a fixed 5s retry.  This
meant infinite retries even on 4xx responses, for instance on invalid
narrows -- and _each_ new message would add another infinite every-5s
retry.

Skip retries on 400 responses, and put an upper limit on the number of
retries.  At the same time, change the retries to be
exponential-backoff with full jitter, to be more responsive in the
event of a one-off failure, and more forgiving in response to a longer
outage.

Failures that exhaust the 5 attempts are silent to the user -- since
this is likely an uncommon edge case (requiring Tornado to be serving
events to the client, Django to be unresponsive, and the client to be
narrowed to a filter it cannot apply locally), and the failure mode is
not bad (it will simply fail to live-update with new matching
messages).

Fixes: #20165.
2022-10-18 08:20:22 -07:00
madrix01 550a32bb20 recent_topics: Add Private message to recent_topics.
This commit adds private messages to the Recent topics view, to make
it an all-encompassing overview of recent activity visible to the user.

We add a filter "Include PM" to toggle whether PMs should be shown in
recent topics.

Fixes #19449.
2022-10-17 15:02:01 -07:00
Lauryn Menard a3f6220fe4 analytics: Add summary statistic for guest users in realm.
Adds the count of users with the role of guest to the stats view
`page_params` via a database query. This information is then added
to the summary statistics section of the analytics page after being
formatted by `stats.js`.

Creates Bassanio as a guest user in the database for the analytics
realm.

Fixes #20162.
2022-10-17 11:53:59 -07:00
Florian Pritz f37ac80384 import_realm: Speed up first_message_id calculation.
On my data (about 10 million messages in 1600 streams) this used to take
about 40 hours, while the improved statement completes in roughly 30
seconds.

The old solution had postgres go through the entire table until the
first match for each stream. Thus, the time spent scanning the table
got longer and longer for each stream because postgres always started at
the beginning (and somehow it did not use any indices) and had to skip
over all rows until it found the first message from the stream that is
was looking for each time.

This new statement just performans a bulk operation, scanning the table
only once and then inserts the results directly into the destination
table.

Slightly more verbose inforation about this change can be found in:
https://chat.zulip.org/#narrow/stream/31-production-help/topic/Import.20Rocketchat.20data/near/1408867

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2022-10-17 11:43:21 -07:00
David Rosa ebd4181ae0 help: Update message menu documentation.
Updates all help center documentation according to the latest changes to
the three-dot message menu and the UI for moving and editing messages.

Fixes #23217.
2022-10-17 11:37:03 -07:00
Zixuan James Li 46329a2710 test_classes: Create a dedicate helper for query count check.
This adds a helper based on testing patterns of using the "queries_captured"
context manager with "assert_length" to check the number of queries
executed for preventing performance regression.

It explains the rationale of checking the query count through an
"AssertionError" and prints the queries captured as assert_length does,
but with a format optimized for displaying the queries in a more
readable manner.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-17 11:32:52 -07:00
Zixuan James Li 9117db8887 test_helpers: Tighten type annotation for queries_captured.
This adds CapturedQueryDict to provide a more accurate type annotation
for the return value of queries_captured. We also replace "Generator"
with "Iterator" because the latter two type parameters were unused.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-17 11:32:52 -07:00
Aman Agrawal a351d34462 portico_signin: Fix signup text overflowing to icon in Russian.
This is not the right fix for this, but a temporary adjustment
to make it look good with minimal impact on other languages and
other pages.

Right fix would require changing the structure of the button, which
was not easy to do and make it look similar to how it looks now.
2022-10-17 11:09:16 -07:00
Aman Agrawal e14e62c24c templates: Remove unused `no-slide` class. 2022-10-17 11:08:16 -07:00
Sahil Batra cebf43903c settings: Fix height of left sidebar for short screens.
It was not possible to scroll to the bottom of the list on
narrow-width when only single column was displayed on the
settings overlay. This commit fixes the height of the sidebar
and set to "100% - height of header - height of tab-container"
which fixes the scroll behavior.

This is not a issue for two-column overlay where height is set
to "100% - height of header" (the tab-container is already
inside the header).

This duplicates some CSS to avoid using "!important". While doing
this duplication, we remove "margin: 0" and "display: block" since
these are already set as default values.

Fixes #22876.
2022-10-16 19:16:53 -07:00
evykassirer 84aeb3a59a compose: Use consistent hover color for buttons in dark mode.
There is some old CSS that was only being applied to some buttons
and not others. This deletes those lines so that only the opacity
changes on hover and not also the color.

Following up from #23059.
2022-10-16 19:05:25 -07:00
PIG208 7db221c8dc
migrations: Remove noop realm filters operations.
We followed a same approach as in #22611 to mark migrations as noops. We
might eventually squash them.

Migration operations that only change the validators should be removed
as they are essentially noops that do not affect the database schema.

However, ./manage.py makemigration still generates a new migration for
validators change regardless. So we still have to keep one migration
that updates the validators to the latest state. We prefer to keep the
earliest one for this purpose.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-14 17:52:28 -07:00
Alex Vandiver f5f6a3789b restart-server: Default to running config and database checks.
If there is a syntax error in `settings.py`, `restart-server` should
provide a reasonable message about this.  It did so prior to
af08bcdb3f, becausde any invocation `./manage.py` without
`--skip-checks` will verify `settings.py`, among several other checks.
After af08bcdb3f, there are no `./manage.py` calls in most restarts,
which fa77be6e6c took further.

Add an explicit `./manage.py check` in the default case.
upgrade-zulip-stage-2 overrides this by passing `--skip-checks`, for
performance.  This also means that `upgrade-zulip-from-git` itself
picks up the same `--skip-checks` flag, since it inherits the same
flag parsing, though that is perhaps of dubious utility.
2022-10-14 13:10:46 -07:00
Yogesh Sirsat e0838ecf93 user_info_popover: Change text of "View private messages to myself". 2022-10-14 13:08:34 -07:00
Mateusz Mandera 9ee7ed7ce3 portico_signin: Tweak .alert to add a bit of bottom space.
That looks a bit better with extra space.
2022-10-14 13:07:58 -07:00
Mateusz Mandera 61de767967 login page: Show form-independent errors even if email auth disabled.
These used to only be shown conditional on the
{% if password_auth_enabled %} in the template. Meaning that if you had
an org with email auth disabled and a deactivated user tried to log in,
they wouldn't see the error shown and get confused.

This switches the position of where these error will be shown (above the
login+password form instead of below it), but it looks fine.
2022-10-14 13:07:58 -07:00