Commit Graph

50434 Commits

Author SHA1 Message Date
Anders Kaseorg 5d7da7e537 settings_bots: Avoid Handlebars iteration with block parameters.
The fix at https://github.com/handlebars-lang/handlebars.js/pull/1855
is not released yet.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-22 17:10:28 -07:00
Aman Agrawal f5f79048fe notifications: Handle exception when trying to play audio.
Safari denies user from playing audio without an interactive
trigger like a button by default. So, when user received a
notification in Zulip via Safari, it triggers an error when
trying to play the notification sound.

Our goal for this commit is to simply handle the error.
2023-03-22 12:27:20 -07:00
Alex Vandiver 95bdfa8ff8 help: Improve and extend "Export your oganization" documentation.
- Document compliance exports.
- Make structure of all the sections consistent.
- Make other tweaks to improve clarity.

Co-authored-by: Alya Abbott <alya@zulip.com>
2023-03-22 11:56:14 -07:00
Aman Agrawal dbc2b2a839 recent_conversations: Fix unread topics navigation behaviour.
When marking an unread topic as read with `unread` filter selected,
we don't need to move user a row down since removing the selected row
will automatically move the user down.

Without this, the user goes down twice which is not intended.
2023-03-22 11:53:41 -07:00
N-Shar-ma 83e182a6fa typeahead: Fix stream typeahead flashing before topic typeahead.
Removed a redundant call to bootstrap typeahead's `lookup` function when
the `automated` function returns true, which was causing the streams
typeahead to show up briefly before the topic typeahead on pressing `>`
immediately after a stream name.
2023-03-22 11:43:21 -07:00
Anders Kaseorg afa218fa2a semgrep: Detect some unsafe uses of markupsafe.Markup.
Use the built-in HTML escaping of Markup("…{var}…").format(), in order
to allow Semgrep to detect mistakes like Markup("…{var}…".format())
and Markup(f"…{var}…").

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-22 11:23:27 -07:00
Alex Vandiver f66d952c57 log-search: Support HTTP method limits. 2023-03-22 11:20:47 -07:00
Alex Vandiver b2666bf054 log-search: Compare lowered terms to lowered log line.
This allows us to search for upper-case things.
2023-03-22 11:20:47 -07:00
Lauryn Menard 90205a490d account-settings: Pass delivery email to change email modal.
When we converted the change email form to a dialog widget modal,
in commit f43d3b9986, the page_params value for delivery email
that was being referenced in the handlebars template
`change_email_modal.hbs` was not set, so instead an empty string
was the initial input value. Because the email change dialog
widget post_render callback sets the input value to the same
delivery email, the fact that the email was not being set when
the template was initially rendered was not noticable.

Passes the page_params.delivery_email to the html parameter in
dialog_widget.launch so that the template has the initial value
set when the form is initially rendered. Removes the now redundant
post_render callback, which resets the initial input value to the
same delivery email.
2023-03-22 11:18:49 -07:00
Lauryn Menard 25fb810d81 account-settings: Pass password page params to dialog widget.
When the password change form was converted to a dialog widget
modal, in commit f5fbf5f0e0, the page_params values for
password_min_length and password_min_guesses that were referenced
in the handlebars template `dialog_change_password.hbs` had no
value to set, which meant the password quality bar was no longer
checking the input value against those organization settings.

Passes the page_params values for password_min_length and
password_min_guesses to the html parameter in dialog_widet.launch
for the password change modal so that those values are available
and set when the template is rendered.
2023-03-22 11:18:49 -07:00
Anders Kaseorg 126f3b5f47 node_cache: Work around pnpm install issue in Docker for Mac.
On Docker for Mac with the gRPC FUSE or VirtioFS file sharing
implementations, we nondeterministically get errors like this from
pnpm install:

    pnpm: ENOENT: no such file or directory, copyfile '/srv/zulip/.pnpm-store/v3/files/7d/6b44bb658625281b48194e5a3d3a07452bea1f256506dd16f7a21941ef3f0d259e1bcd0cc6202642bf1fd129bc187e6a3921d382d568d312bd83f3023979a0' -> '/srv/zulip/node_modules/.pnpm/regexpu-core@5.3.2/node_modules/_tmp_3227_7f867a9c510832f5f82601784e21e7be/LICENSE-MIT.txt'

    Subcommand of ./lib/provision.py failed with exit status 1: /usr/local/bin/pnpm install --frozen-lockfile
    Actual error output for the subcommand is just above this.

Work around this using --package-import-method=copy.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-21 19:52:17 -07:00
Sahil Batra 627adf8465 create_realm: Tag import string for translation.
The string "Or import from Slack, Mattermost, Gitter, or
Rocket.Chat." in create_realm.html was not tagged for
translation before. This commit fixes it to tag the string
for translation.
2023-03-21 16:34:23 -07:00
Alya Abbott 6585cb0717 portico: Link to new End Point Dev case study. 2023-03-21 16:20:30 -07:00
Alya Abbott e660ffbe07 portico: Add End Point Dev case study page. 2023-03-21 16:20:30 -07:00
Alya Abbott fd703a9ee4 help: Clarify alert words documentation. 2023-03-21 15:49:16 -07:00
Tim Abbott 35440672a7 message_list: Rename confusing hide-date CSS class.
The previous hide-date CSS class had a semantic meaning of "this
recipient row has the same date as the previous one"; since we're now
having logic read that value, it's worth giving it a semantic name
that makes that code easier to understand.
2023-03-21 12:55:13 -07:00
Aman Agrawal 404f6a404a message_list: Fix duplicate date headers at the top of message feed.
Hide the date on date separator when it is above a sticky header; see
the comments for the full algorithm.
2023-03-21 12:55:13 -07:00
Joseph Ho c8d043e12c
popovers: Fix tooltip partially hidden by recipient bar when selected.
Previously, when a user view the message source of a message at the
very top with the blue box around, the tooltip for the button will
be partially hidden by the recipient bar. Ths cause is some legacy 
CSS from, for example, 3cd33c0fea,
which increased the z-index for the bodies of selected messages.

The intent of that code appeared to be something around handling overlaps
between unread indicators and the blue selected message box. It's logically
incorrect, and testing demonstrates that the blue box works fine next to unread
messages without this change, so we can safely remove these z-index values.
2023-03-21 12:47:47 -07:00
Anders Kaseorg 730eda60bc webpack: Disable webpack-dev-server overlay for runtime errors.
webpack-dev-server 4.12.0 introduced a global handler that shows a
full-screen overlay for all runtime errors, but it’s redundant with
our blueslip_stacktrace handler and less functional at this time.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-21 12:36:37 -07:00
Anders Kaseorg 6db1e75fb9 test_classes: Don’t spew BAN_CONSOLE_OUTPUT errors over failed tests.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-21 12:27:32 -07:00
Anders Kaseorg 34d7876cfd README: Update Ruff badge.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-21 11:46:20 -07:00
Alex Vandiver 8ad4ecb3a2 management: Add a command to send initial welcome bot messages. 2023-03-21 11:40:37 -07:00
palashb01 ac45a3f20d narrow_banner: Add a period at the end of the default banner.
This commit adds a period ('.') at the end of the default banner
in the narrow empty search for multiple filters. This is required
to maintain consistency among all banners, as for most banners, we
use punctuation at the end of the banner to create complete and
meaningful sentences.
2023-03-21 11:23:43 -07:00
palashb01 ce11657204 narrow_banner: Display title only for empty search with multiple filters.
This commit improves the display of the narrow banner when there are
multiple filters used in a narrow search and no results are found.
The banner will now only display the title 'No search results'
The node tests have been updated to reflect this change.
2023-03-21 11:23:43 -07:00
Hardik Dharmani e07bb82704 js: Fix dependency cycle in overlays.js.
Removing browser_history.js import in overlays.js
helps to completely solve the dependency cycle issue for
importing dialog_widget.js in upload_widget.ts in PR #24426.

Removed the only use of browser_history in overlays.js
which was 'browser_history.exit_overlay()'cin open_settings
function by defining open_settings_overlay function in settings.js
and calling 'browser_history.exit_overlay()' in settings.js.

also removed overlays.js import in admin.js as the only use of
overlays was to call open_settings function which is now shifted
to settings.js and is called as settings.open_settings_overlay.
2023-03-21 11:22:11 -07:00
Hardik Dharmani b722cf31cb js: Move popover.initialize to end of file.
Moved the initialize function in popover.js at end of file to
follow 'no-use-before-define' for function 'hide_all' being called
in initialize function and to follow convention to put
initialize at the end of the file.
2023-03-21 11:22:11 -07:00
Hardik Dharmani 2c30bbbf74 js: Fix dependency cycle in unread.js.
The import of recent_topics_ui.js from unread.js generates an import
loop. To remove this, we need to move the logic for rerendering recent
topics after update_message_for_mention out of the low-level unread.js
data module.

Since the logic was conditional on `content_edited` being true, and
that parameter is only passed in the message_events.js code path, we
can do this by just making the function return a boolean for whether
this rerender may be required, and moving the rerender logic to that
calling module.
2023-03-21 11:22:11 -07:00
Alya Abbott b46e7ef78e help: Update "Trying out Zulip" documentation.
- Link to the new /try-zulip/ page instead of directly to CZO.
- Link to the communities directory.
- Tweak wording about creating a new organization.
2023-03-21 11:20:45 -07:00
Alya Abbott b411c1bcf1 portico: Link to new /try-zulip page from /development-community. 2023-03-21 11:20:45 -07:00
Aman Agrawal 00505e9903 pm_list: Fix tooltips mutation handler.
The mutation handler was correct for user list in the right
sidebar but was incorrect for pms list in the left sidebar.

Since the left sidebar is updated differently, we need to
check for mutations on the element actually being updated.

This also required using a target node that is always present
for the pms list which otherwise throws an exception.
2023-03-21 10:53:25 -07:00
Aman Agrawal 05674f3ab5 pm_list_item: Convert pm_user_status to a class.
Since there are multiple elements that use pm_user_status, it
makes sense to have it as a class.
2023-03-21 10:53:25 -07:00
Lauryn Menard 611d36a8d1 help: Revert changes to "pm-with" and "group-pm-with" search filters.
In commit f3a67f0e31, we updated the documented search filters
for direct messages, but these had not been changed in the backend
or the frontend of the codebase and therefore the newly documented
filters do not work. Reverts the documentation to the previous
search filters.
2023-03-21 13:26:41 -04:00
Alex Vandiver 66de81425e portico: Use jQuery better to select the first integration.
The `.integration-lozenges` children may contain
non-`.integration-lozenge` elements; if there were no matching
integrations, attempting to fetch the css `display` property of those
failed.

Switch to using jQuery to find the full set of visible lozenges
directly; this does the right thing if there are no such elements.
2023-03-21 08:50:06 -07:00
Lauryn Menard 41ac95fe52 docs: Update "How it works" section in Documenting REST API endpoints.
Updates this section to use the shared `api-doc-template.md` as a
guide, as well as the current documentation for the `render-message`
endpoint. Previously, this section referred to a file that had been
removed with the transition to a shared template file.

Fixes #24485.
2023-03-20 17:42:04 -07:00
Joelute 4d55192e21 compose_typeahead: Add hint text to topic typeahead dropdown.
With the autocomplete dropdown, some users face trouble or uncertainty
while selecting topics. The autocomplete dropdown may encourage users
to find and select an existing topic rather than starting a new topic.
The changes adds a hint text to the topic typeahead dropdown to
encourage users to either start a new topic or select an existing
topic.

Fixes #23295.
2023-03-20 16:28:28 -07:00
Alya Abbott 13680651c5
docs: Rewrite guidelines for writing commit messages.
The focus is on making the instructions more specific and organized,
so that they are easier to follow.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2023-03-20 16:25:20 -07:00
Anders Kaseorg 3a27b12a7d dependencies: Switch to pnpm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg b3f9fdf99a dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg 577d41023d dependencies: Remove unused postcss-mixins plugin.
Commit 7fc191d816 added this as
preparation for #19927, but we already have @extend from
postcss-extend-rule and don’t need both.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg bd272149e6 dependencies: Add missing direct dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg 61f91f8503 tests: Mock autosize.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg d5b2a667c5 message_view_header: Remove unused value for absent i18n placeholder.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg 13066e6406 styles: Fix dark-theme mixin in zulip.css.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg ecde9066d7 stylelint: Fix declaration-block-no-redundant-longhand-properties.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg 790c8a1582 stylelint: Fix at-rule-empty-line-before.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Lauryn Menard a9b3a9c673 narrow: Use dict to map operator to by_* method in NarrowBuilder.
Updates the logic for identifying the method to use to extend the
query for the given term from a narrow to use a dictionary that
maps the operator string to the by_* method in the NarrowBuilder
class.

Previously, the by_* method was determined by building a string
based on the operator string and replacing dashes with underscores.
2023-03-20 15:37:09 -07:00
Joelute ff6ff1e014 integration: Add branch names to Azure Devops merged PR event.
This is a follow up to #24673, we want to modify every webhook
events to follow the same pattern and consistency where branch name
should only show on opened and merged events.
2023-03-20 12:33:47 -07:00
Anders Kaseorg cd3c4cd991 styles: Extend help sidebar heading links like list links.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 11:35:53 -07:00
Alex Vandiver 33b61d9dc4 invite: Be more fair about the no-messages-sent warning flag.
The RealmCount statistics will be empty if the realm was created since
the last daily aggregation.  In cases where the daily stats have no
rows, it is likely fast enough to do the real count in the messages
table.  This stops unduly penalizing folks who have actually sent
messages, and are just inviting people within the first day.
2023-03-20 11:35:19 -07:00
Alex Vandiver e6eaa9a7f6 webhooks: Handle explicit null context_line in Sentry. 2023-03-20 11:34:17 -07:00