Commit Graph

50369 Commits

Author SHA1 Message Date
Tim Abbott 93d0a6b1ba version: Add missing API feature level bump.
This should have been done in
042bbf2936.
2023-03-16 14:55:48 -07:00
Anders Kaseorg 3109ee8015 eslint: Enable @typescript-eslint/recommended plugin.
This is not automatically enabled by
@typescript-eslint/recommended-requiring-type-checking for some
reason.

https://typescript-eslint.io/linting/configs/#recommended

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-16 13:24:27 -07:00
Anders Kaseorg 96e657a954 install-node: Upgrade Node.js from 18.14.1 to 18.15.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-16 12:32:28 -07:00
Alex Vandiver 330141f55d invites: Switch new LIMITED-plan heuristic to enforcing. 2023-03-16 11:41:49 -07:00
Alex Vandiver 50a2a54393 test_invite: Rework and expand invitation limit tests.
This adds tests for more corner cases, in exchange for dropping the
query count tests, which were of dubious utility.  It also adds the
time-machine library to mock the current time to test that the limits
do expire.
2023-03-16 11:41:49 -07:00
Alex Vandiver 6971c6d62d test_invite: Just import django.core.mail and use it. 2023-03-16 11:41:49 -07:00
Alex Vandiver 9e972bc82c test_invite: Clarify by filters that no *new* ScheduledEmails are made. 2023-03-16 11:41:49 -07:00
Alex Vandiver 83fdc59304 test_invite: Remove a totally uninteresting assert. 2023-03-16 11:41:49 -07:00
Alex Vandiver 566806fb41 test_invite: Fix a docstring. 2023-03-16 11:41:49 -07:00
Alex Vandiver 695730b609 test_invite: Explicitly test that no emails are actually sent. 2023-03-16 11:41:49 -07:00
Alex Vandiver 34c8cd1b74 tests: Split out test_invite from test_signup.
There is no good reason for this single test file to be more than 6k
lines.
2023-03-16 11:41:49 -07:00
Joelute 869cb6dc34 integration: Modify branch names on pull request events.
Previously when Github bot receives an update pull request event,it
will produce the following message:

user updated PR #1 Start writing unit tests from test to main

"from test to main" is improper and causes unnecessary confusion.
These changes will update the logic to remove the phrase from
update events. These changes will also include the org: prefix to
the branch names to keep it consistent with Github and further
reduce confusions on branch names.

Fixes #24536.
2023-03-16 11:31:48 -07:00
Lauryn Menard c446f86173 rendered-markdown: Move `pre` element CSS reset rules.
Moves CSS reset rules for `pre` elements to the `rendered_markdown`
class block.

Adds the `rendered_markdown` class to the scrollbar rules.
2023-03-16 11:30:04 -07:00
Lauryn Menard 2d8283e579 rendered-markdown: Move inline code CSS reset rules.
Moves the CSS reset rules for inline code elements to be in the
`rendered_markdown` class block.
2023-03-16 11:30:04 -07:00
Lauryn Menard d98ba32588 rendered-markdown: Copy anchor tag CSS rules from bootstrap.
Prep commit for moving CSS reset rules for inline code elements
in `rendered_markdown.css` to the `rendered_markdown` class rules.
2023-03-16 11:30:04 -07:00
Anders Kaseorg 83b6866018 templates: Replace unnecessary {{#tr}} blocks with {{t}} helper.
`{{#tr}}` supports HTML and allows translators to accidentally
introduce HTML, so it’s safer to use the `{{t}}` helper unless HTML is
needed.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-16 11:26:45 -07:00
Anders Kaseorg 8cd78d356f templates: Allow the same line-wrapping in {{t}} as in {{#tr}}.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-16 11:26:45 -07:00
Anders Kaseorg ba5a2c8866 templates: Support context variables in Handlebars {{t}} helper.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-16 11:26:45 -07:00
Prakhar Pratyush 042bbf2936 UserTopic: Set visibility_policy or delete UserTopic row without error.
This commit updates 'set_user_topic_visibility_policy_in_database'
to not raise an error when deleting a UserTopic row and the user
doesn't have a visibility_policy for the topic yet, or when setting
the visibility_policy to its current value.

Also, it includes the changes to not send unnecessary events
in such cases.
2023-03-16 10:55:54 -07:00
David Rosa f783e8b6ca help: Add a dedicated page on how to add emphasis to text.
- Adds "Via Markdown" instructions block.
- Adds "Via compose box buttons" instructions block.

Fixes part of #24209.
2023-03-16 10:51:57 -07:00
David Rosa 2e2747dfac help: Update Message formatting documentation.
- Updates intro paragraph in Message formatting page.
- Change Markdown syntax -> Markdown formatting.
- Reorders items in the Writing messages section of the left sidebar.
2023-03-16 10:51:57 -07:00
David Rosa b66d8dfd90 help: Add new "Writing messages" section.
Moves pages from "Sending messages" to a new help center section
to document what you can do in a Zulip message, and make this
information easy to find.

Fixes #24208.
2023-03-16 10:51:57 -07:00
Prakhar Pratyush 80a50741e5 help: Update 'Include organization name in subject line' documentation.
Document new "Automatic" configuration option.

This commit updates the help page 'email-notification.md' to reflect
the change in zulip#24075 from a checkbox to a dropdown for the
'Include organisation name in subject line' setting.
2023-03-16 10:49:07 -07:00
Zixuan James Li ee26590528 util: Implement a safer type narrowing helper for arrays.
This implements a helper that parses an array that possibly contains
falsy elements into undefined when it does have at least one falsy
element, or returns a type narrowed array of non-undefined elements.

We use this in people.js, which achieves the same check we have using
"arr.every(Boolean)", but with type safety since it is not based on
validation.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-03-16 10:47:12 -07:00
Zixuan James Li cd97c497bc people: Do not return undefined for is_cross_realm_email.
It would be semantically more straightfoward to return false when the
check does not succeed.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-03-16 10:47:12 -07:00
Zixuan James Li 111f2f5e9d people: Do not return false for group_pm_with_user_ids.
Returning undefined as opposed to false makes more sense in the context
of this function. This also will simplify the type annotation.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-03-16 10:47:12 -07:00
Zixuan James Li 04782a48e2 settings_data: Extract TimePreferences.
This type will get used in people.ts in "get_user_time_preferences".

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-03-16 10:47:12 -07:00
Zixuan James Li 215f776f0e dependencies: Add @types/blueimp-md5.
This is a dependency of people.js. We include the stubs to prepare it
for a conversion to TypeScript.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-03-16 10:47:12 -07:00
Anders Kaseorg d693b53aa6 templates: Fix &nbsp; syntax.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-15 16:34:32 -07:00
Aman Agrawal 64584557b2 streams_list: Don't zoom out user when stream list rearranges.
Fixes #23588

When a new message arrives in an inactive stream, it will lead
to stream being marked as active from inactive which leads to
stream list being rearranged which zooms out the user since the
active stream is reset momentarily. To avoid this, we delay the
stream list redraw until user zooms out and only update the topics
list.
2023-03-15 16:17:24 -07:00
Aman Agrawal f8e093c730 left_sidebar: Highlight inactive streams when narrowed to.
Having active streams greyed out can be confusing to the user. This
is especially useful when the app is still fetching messages on
a reload and the active stream has no messages and is thus marked
as `inactive`.
2023-03-15 16:17:24 -07:00
Tim Abbott b9d1efcd1b i18n: Update translation data from Transifex. 2023-03-15 15:57:26 -07:00
Zixuan James Li 234771d5db integrations: Add a link to GitHub webhooks documentation.
The list of supported events for filtering itself does not document what
each of the events does. Adding a link to GitHub's documentation would
be a pointer to get people started. But ideally we need to establish a
better system to document the events in general.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-03-15 15:37:42 -07:00
Alya Abbott 584124bb45 help: Improve "Deactivate your account" help page. 2023-03-15 15:32:47 -07:00
Alex Vandiver 1a65315566 puppet: Switch teleport to running under systemd, not supervisord.
There is no reason that the base node access method should be run
under supervisor, which exists primarily to give access to the `zulip`
user to restart its managed services.  This access is unnecessary for
Teleport, and also causes unwanted restarts of Teleport services when
the `supervisor` base configuration changes.  Additionally,
supervisor does not support the in-place upgrade process that Teleport
uses, as it replaces its core process with a new one.

Switch to installing a systemd configuration file (as generated by
`teleport install systemd`) for each part of Teleport, customized to
pass a `--config` path.  As such, we explicitly disable the `teleport`
service provided by the package.

The supervisor process is shut down by dint of no longer installing
the file, which purges it from the managed directory, and reloads
Supervisor to pick up the removed service.
2023-03-15 17:23:42 -04:00
Tim Abbott d342f70440 api_docs: Clarify API changelog brevity. 2023-03-15 08:18:06 -07:00
Tim Abbott 11d3852f58 api_docs: Add missing detail in changelog entry 152. 2023-03-15 08:18:06 -07:00
Palash Baderia bf51277226 popovers: Add confirmation modal for marking all messages as read.
This commit adds a confirmation modal with loading spinner for
marking all messages as read.

New file: confirm_mark_all_as_read.hbs
Fixes: #24624
2023-03-15 08:17:41 -07:00
Abhijeet Prasad Bodas ba0dd70904 user_topics: Introduce visibility policy enum subclass in models.py.
This commit gives more readable code than using the `VISIBILITY_POLICY`
prefix.
This commit does not alter the database schema.
2023-03-14 17:50:45 -07:00
Abhijeet Prasad Bodas 4d5e12961a user_topics.js: Rename `visibility_policy_inherit` -> `inherit`.
This makes our frontend code less verbose, and makes this name
consistent with the names of other visibility policies (which
do not have the `VISIBILITY_POLICY` prefix).
2023-03-14 17:50:45 -07:00
Prakhar Pratyush ae72777c77 user_settings: Automate 'Include realm name in message email subject'.
Currently, there is a checkbox setting for whether to
"Include realm name in subject of message notification emails".

This commit replaces the checkbox setting with a dropdown
having values: Automatic [default], Always, Never.

The Automatic option includes the realm name if, and only if,
there are multiple Zulip realms associated with the user's email.

Tests are added and(or) modified.

Fixes: #19905.
2023-03-14 17:48:57 -07:00
Prakhar Pratyush ab8222c4ae custom_check: Update FILES_WITH_LEGACY_SUBJECT set.
This commit adds 'zerver/lib/email_notifications.py'
to the FILES_WITH_LEGACY_SUBJECT set.

Because the file can have 'subject' in the email sense,
it should be exempted from the 'avoid subject as a var' lint rule.
2023-03-14 17:48:57 -07:00
SameepAher 079eb6a4da keyboard_ui: Add a new keyboard shortcut '='.
Added new keyboard shortcut '=' to toggle the first emoji on the
selected message if it exists, else do nothing.

Fixes: #24256.
2023-03-14 14:17:54 -07:00
Daniil Fadeev a80f96dde6 reactions: Prevent multiple simultaneous requests for reaction update.
Prevents multiple simultaneous requests to the API when adding or
removing reactions. This commit blocks emoji state changes until
the request is executed.

Fixes part of #21213
2023-03-14 13:53:42 -07:00
Lauryn Menard b9dd109e93 docs: Edit `pull-requests.md` and `reviewable-prs.md`.
Fixes a few typos / errors in commit a633890d8 that updated
these documentation articles on pull requests.

Also adjusts language around screenshots to match what we use
in the pull request template on GitHub for the zulip server and
web app repository.
2023-03-14 13:24:18 -07:00
Sahil Singh 19ae2f9180 i18n: Add translation tags to loading message.
Previously, no translation tag was present for 'Loading…' message.

Fix this and also switch to using the … character instead of 3
. characters.
2023-03-14 13:23:48 -07:00
Sahil Singh 37a0c9c1b9 settings: Fix alignment of loading message.
The loading message that appears at the
top of the page when loading the Bots/
Uploaded Files/Users/Deactivated Users
page under Settings appears to be misaligned.

We fix this by changing the height of the
loading-spinner to match the line-height
of loading text.
2023-03-14 13:23:48 -07:00
Alya Abbott b06fe89fc2 portico: Link to new "Try Zulip" page from TUM case study. 2023-03-14 13:21:09 -07:00
Alya Abbott 005ca2b033 portico: Add landing page about trying Zulip by visiting chat.zulip.org. 2023-03-14 13:21:09 -07:00
Sahil Batra bd9d1b9158 dropdown_list_widget: Set dropdown menu wide enough to fit options.
We now set the width of dropdown menu opened for dropdown-list-widget
elements such that it is enough for all the options. For smaller
screens the dropdown menus are wide since the settings panel and
modal content can be scrolled horizontally.
This change is done only for dropdown-list-widget elements in
"Organization settings" panel and in bot-owner widget in bot edit
modal.

We don't do this change for move topic modal now as it cannot be
scrolled horizontally and appears beneath the button due to position
property.
2023-03-14 12:53:41 -07:00