Commit Graph

14215 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Lauryn Menard 171da34546 events: Send empty list for custom_profile_fields in spectator view.
Send an empty list of `custom_profile_fields` in `page_params` for
spectators, rather than not sending the field at all.

Also, updates the user info popover to not show the manage user
three-dot menu when in a spectator view.
2022-10-14 13:05:35 -07:00
Ganesh Pawar 4df8c6610f gear menu: Add organization info.
Fixes #22205
2022-10-13 23:45:25 -07:00
Sahil Batra de257d434f settings: Set min width of role column.
We set minimum width for role column in users list,
deactivated users list and bots list such that role
value always fits in one line.

Fixes #23218.
2022-10-13 10:05:20 -07:00
Tim Abbott ad90157ec0 Revert "modal: Make the modal content scrollable instead of the whole modal."
This reverts commit c439b9d3af.
2022-10-12 17:20:33 -07:00
Tim Abbott eb60e30c9a Revert "modals: Add `data-simplebar` to `login` and `api key` modal."
This reverts commit 4c32972274.
2022-10-12 17:20:33 -07:00
Julia Bichler 97fd4436da stream settings: Show stream header in narrow view.
This changes the streams overlay so that the header with the stream name or
with 'Create stream' is also visible in a narrow window.

Resolves #22963
2022-10-12 17:01:04 -07:00
Sahil Batra 6b59c3242d settings_panel_menu: Open first section if hash is invalid.
When trying to open settings overlay with invalid hash or
hash of a section which the user cannot view, for example
non-admins cannot view custom profile field section, then
we open the first section by default.

While if a user changes to a invalid hash by typing when
the overlay is already opened, then the previous section
remains open.

Fixes #23163.
2022-10-12 11:07:28 -07:00
Sahil Batra 6867235011 message_edit: Show error, if any, in move topic modal itself. 2022-10-12 10:50:05 -07:00
Sahil Batra 35aab1efed message_edit: Set width to auto for propagate mode dropdown.
This commit sets the width to auto for propagate mode dropdown
in the move message modal such that width is enough to fit
all the options.
2022-10-12 10:50:05 -07:00
Sahil Batra dd939bbbb8 message: Rename "Un-collapse" option to "Expand message".
This commit also update the collapse message help page.
2022-10-12 10:50:05 -07:00
Sahil Batra 6f1d5a29aa stream_popover: Disable topic or stream input in move message modal.
We now disable the topic or stream input in move message modal if
user is not allowed to edit them. Topic input can be disabled only
in the modal opened from message actions popover since permission
to edit topic depends on message and we do not have any message
when we open topic from left sidebar since the message is fetched
from server while submitting.

This commit also does some changes to call ".trim()" on new_topic_name
only when it is undefined. new_topic_name can be undefined when
the new topic input is disabled because "serializeArray" only
considers enabled inputs.
2022-10-12 10:50:05 -07:00
Sahil Batra cdc7183a01 hotkey: Update description for "e" shortcut.
This commit updates description for "e" shortcut to
"Edit selected message or view message source" in
shortcuts menu and to "Edit message or view message source"
in help docs.
2022-10-12 10:50:05 -07:00
Sahil Batra bb2ab065b2 message_edit: Show "Move message" icon on hover if only moving is allowed.
Previously, we showed "View source" icon if content editing was not
allowed, now we show the move message icon instead if moving message
is allowed but content editing is not. We remove the hotkey from
tooltip for now and would add a different hotkey for moving
messages in further commits.

We also add a common class for all the three icons in this commit
to avoid duplication and use different class if required for click
handlers.
2022-10-12 10:50:05 -07:00
Sahil Batra d63f9c8686 message_edit: Use a modal to move message instead of edit UI.
Previously, we allow moving message (both topic and streams) in
the message edit UI and we opened message edit UI when clicked
on "Move message" option in message three-dot menu. Now, we open
the "Move topic" modal (that is opened when using "Move topic"
from topic sidebar) on clicking "Move message" option in
message three-dot menu.

We remove the hotkey "e" from "Move message" option for now since
both edit and move UIs are different now. We will instead add
new hotkey in further commits.

We pass stream_id as undefined when stream is not changed. This is
required for case when only topic editing is allowed. It worked
previously because we show "Move topic" option in left sidebar
only when stream editing is allowed.
2022-10-12 10:50:05 -07:00
Sahil Batra 0fc19732bc message_edit: Allow only content edit in message_edit_form.
We now allow only content edit in message_edit_form which can
be opened by pencil icon in the message row, "Edit message"
option in popover and by using e hotkey.

As a result of this change, we also do not show topic and stream
edit options when using "View source" options.

We would instead support changing stream and topic from the modal
which will be opened from the "Move message" option in message
actions popover.
2022-10-12 10:50:05 -07:00
Sahil Batra 0b67cf0071 stream_popover: Remove unused variable from build_move_topic_to_stream_popover. 2022-10-12 10:50:05 -07:00
Sahil Batra 5883416b14 popovers: Organize message actions popovers into sections.
This commit reorders the options in message actions popover
and divides the options into sections as per #23076.

Fixes #23076.
2022-10-12 10:50:05 -07:00
Sahil Batra 1dd3a7e2c8 settings: Uncheck display_in_profile_summary checkbox if hidden.
We should uncheck the display_in_profile_summary checkbox in the
custom field creation form if the checkbox is hidden, like for
LONG_TEXT or USER type fields which are not allowed to be
displayed in profile summary.

This solves the bug where a user initially checks the
display_in_profile_summary field and then changes the type
to LONG_TEXT or USER where the checkbox is hidden but it
still remains checked and thus the request to server is made
with display_in_profile_summary=true for which server returns
error.

Fixes #23171.
2022-10-12 09:42:32 -07:00
Julia Bichler 4bb381fc80 message_edit: Support sending notifications with topic changes.
Previously we did not send notification for topic-only edits.
Now, we add backend support for sending notification to topic-only
edits as well.

We would add support for this in webapp in further commits since
message edit UI will be updated as well. We just make sure that no
notifications are sent when editing topic using pencil icon in
message header.

We also change the API default for moving a topic to only notify the
new location, not the old one; this matches the current defaults in
the web UI.

Includes many tests.

We also update the puppeteer tests to test only content edit as
we are going to change the UI to not allow topic editing from
message edit UI. Also fixing the existing tests to pass while
doing topic edits is somewhat complex as notification message
is also sent to new topic by default.

Fixes #21712.

Co-authored-by: Aman Agrawal <amanagr@zulip.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2022-10-11 11:35:41 -07:00
Anders Kaseorg 762a2d8da4 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-10-11 10:50:57 -07:00
Anders Kaseorg 19110b80de message_list_data: Replace lodash with standard Array methods.
Array#findLastIndex is new in ES2023, but is polyfilled with core-js ≥
3.16 and supported in Node.js 18.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-10-11 10:50:57 -07:00
Aman Agrawal 5fc5aa8625 communities: Add more space between realm rows. 2022-10-11 10:49:33 -07:00