Commit Graph

60344 Commits

Author SHA1 Message Date
evykassirer 5cc5659010 stream_data: Remove unused home_view_stream_names. 2024-08-15 17:16:22 -07:00
evykassirer 90cced31af stream_data: Remove is_stream_muted_by_name to favor stream ids. 2024-08-15 17:16:22 -07:00
evykassirer fd5112fbb2 message_list: Use stream id instead of name in update_trailing_bookend. 2024-08-15 17:16:22 -07:00
evykassirer 7203244015 stream_data: Fix return type of stream_info.get.
We can definitely be looking up stream ids that don't map to
anything. All callers already assume it can be undefined.
2024-08-15 17:16:22 -07:00
evykassirer 9dab566d10 filter: Canonicalize operator before creating parsed term.
We decide what operators are valid when parsing a term by
calling `operator_to_prefix`, but `operator_to_prefix` calls
`canonicalize_operator`, so we need to call `canonicalize_operator`
on the operand we return from `parse`, or else we might end up
with an invalid operator in a parsed term.

Fixes this bug:
https://chat.zulip.org/#narrow/stream/9-issues/topic/valid.20search.20terms.20in.20uppercase.20followed.20by.20.3A.20throwing.20error
2024-08-15 17:13:36 -07:00
Shubham Padia 620970c46d user_group_popover: Show popover on group mention in drafts overlay.
Fixes #31102.
It would be good to have defined the event listener in
`user_group_popover.js` to keep everything in one place, but since direct
event handlers were getting invoked before delegated event handlers, we
had to define direct event handlers in the launch function of drafts
overlay ui.
2024-08-15 16:28:55 -07:00
Shubham Padia 29809ea61b user_group_popover: Show popover on all .messagebox user group mention.
Show user group popover for scheduled messages overlay, compose box
preview, message edit preview, message edit history.
`.messagebox` was chosen as the selector since that was the nearest
parent class that was common for all of the above.

This commit won't work for drafts overlay since drafts has a direct
event listener which receives the event before our delegated event
listener.

This commit also adds an explicit `cursor: pointer` to
`user-group-mention`.
2024-08-15 16:28:53 -07:00
Shubham Padia 2b3a41be58 user_card_popover: Show popover on all .messagebox user mention.
Show user card popover for scheduled messages overlay, compose box
preview, message edit preview, message edit history.

`.messagebox` was chosen as the selector since that was the nearest
parent class that was common for all of the above.

`@all` does not have a popover and that's why it will have the same
pointer as its parent element. We also introduce a new class called
`.user-mention-all` for managing css rules specific to that mention.
2024-08-15 16:28:08 -07:00
Shubham Padia d983d0ec2e user_card_popover: Show popover on user mention in drafts overlay.
We introduce `has_message_context` as an additional argument to
`toggle_user_card_popover_for_message`. `has_message_context` is set to
false for all messages that have not been sent yet i.e. drafts and in
the future commits: scheduled messages, compose box, edit message box.

It would be good to have defined the event listener in
`user_card_popover.js` to keep everything in one place, but since direct
event handlers were getting invoked before delegated event handlers, we
had to define direct event handlers in the launch function of drafts
overlay ui.
2024-08-15 16:23:26 -07:00
Shubham Padia 0cede4cca6 user_card_popover: Remove unused user `undefined` check.
This was introduced in 3c7e470cfb, and
since the comment said it should never happen, it felt safe enough to
remove.

The `message` argument has also been replaced with `sender_id` since
that is the only property we need from the message now. This will
become useful in adding support for these popovers to compose box where
the message object will not be present but there would be a sender_id.
2024-08-15 16:23:26 -07:00
Shubham Padia ddef232c42 user_card_popover: Remove redundant message_user_card.is_open() check.
Even without the check, mutliple message_user_cards will not be opened
by the app.
2024-08-15 16:23:26 -07:00
Aman Agrawal aac75f87f9 message_view: Update narrow title after change in narrow filter.
This needs to be done to update narrow title for different
`near` message targets or no `near` topic narrows.
2024-08-15 16:17:46 -07:00
Prakhar Pratyush 52a9846cdf user_profile: Remove 'tutorial_status' field.
The 'tutorial_status' field on 'UserProfile' model is
no longer used to show onboarding tutorial.

This commit removes the 'tutorial_status' field,
'POST users/me/tutorial_status' endpoint, and
'needs_tutorial' parameter in 'page_params'.

Fixes part of zulip#30043.
2024-08-15 13:31:40 -07:00
Prakhar Pratyush ee806c49b9 ui_init: Use OnboardingStep for narrowing on first web app load.
We plan to remove the 'tutorial_status' field from UserProfile
table as it is no longer used to show tutorial.

The field is also used to narrow a new user in DM with
welcome bot on the first load.

This prep commit updates the logic to use a new OnboardingStep
for the narrowing behaviour on the first load. This will help
in removing the 'tutorial_status' field.
2024-08-15 13:31:40 -07:00
Prakhar Pratyush 13c0571183 message_fetch: Use email as operand for 'dm' operator.
In our web client code we use email as the operand for
'dm' operator. Later user_ids_array is set as operand
in 'handle_operators_supporting_id_based_api' before
making the API call.

Earlier, using user_id as the operand was resulting in
the following error during user signup:
data=b'{"result":"error","msg":"Invalid narrow[0]: Value error,
operand is missing","code":"BAD_REQUEST"}

This commit replaces user_id with email as operand.
2024-08-15 13:31:40 -07:00
PieterCK d974c10efc integration-docs: Update Open Collective for new doc format.
Other than reformatting documentation for Open Collective, this
commit also moves it to the "Financial" category from "Communications".
This is because Open Collective is mainly a fundrising + legal status +
money management platform, as stated in https://opencollective.com/.

Part of #29592.
2024-08-15 13:16:14 -07:00
PieterCK 00f9892d8d integration-docs: Update Mention for new doc format.
Part of #29592.
2024-08-15 13:16:14 -07:00
PieterCK 07fda86ff9 integration-docs: Update Netlify for new doc format.
Besides reformatting the Netlify doc, this commit also updates the
instructions to match some UI changes in Netlify. The "Outgoing Webhook"
menu is now called "HTTP Post request".

Part of #29592.
2024-08-15 13:16:14 -07:00
PieterCK 9494620022 integration: Delete Opbeat integration.
Opbeat was acquired by Elastic in 2017[1] and maintained until Elastic
APM went live[2]. Now that Elastic APM is online, it looks like Opbeat
repositories have been marked as archived/unmaintained[3].

[1]: https://www.elastic.co/blog/welcome-opbeat-to-the-elastic-family
[2]:
https://www.elastic.co/observability/application-performance-monitoring
[3]: https://github.com/opbeat
2024-08-15 13:16:14 -07:00
Tim Abbott 60eb621477 help: Update documentation for new deletion feature. 2024-08-15 12:03:49 -07:00
Vector73 80969a62e6 settings: Add `can_delete_any_message_group` setting.
Fixes #30717.
2024-08-15 12:03:49 -07:00
evykassirer dc938768ca message_edit: Avoid use of e.target.
This commit changes some event handlers to pass in relevant
JQuery objects instead of using `e.target`. This will be
necessary for converting message_edit to typescript.
2024-08-15 10:08:07 -07:00
evykassirer b0c90c0ba2 message_edit: Remove unused topic edit code.
`message_edit_topic_propagate` is only used in the template for
moving messages, separate from the message edit template, and
`message_edit_topic` doesn't show up anywhere anymore. Editing
the topic of a message used to be part of the message edit file,
and was removed in 0fc19732bc (diff-c68d68d71e21a4d22f39212a43e4f66ecc774bd17109963fe017d9878aace9bf)
2024-08-15 10:08:07 -07:00
Lauryn Menard 73029c8348 support: Show sponsorship and discount headers for Zulip Cloud. 2024-08-15 09:51:35 -07:00
Lauryn Menard 391c52639f support: Show discount information on remote support views.
In commit 7203661d99, we removed the default_discount field on the
Customer model, but we didn't update the remote support views for
this change.

Adds a has_discount boolean to the SponsorshipData that's used in
the support views for headers, and updates the discount information
on a deactivated remote realm to show any pre-existing discounted
prices.
2024-08-15 09:51:35 -07:00
evykassirer fc2ce3deb2 search: Fix bug preventing closing regular search pills.
In an earlier refactor, `removePill` was being called with the exit
button element instead of the pill. This change fixes that bug by
using similar code to what we previously did (and still do in
input_pill for cases without on_pill_exit).
2024-08-15 09:49:12 -07:00
Prakhar Pratyush c0ac38fe8a docs: Update the stale links in "Set up Git" docs. 2024-08-15 09:46:31 -07:00
roanster007 e104fed6ef echo: Extract the waiting for id and ack into separate module.
This commit extracts the "waiting_for_id" and "waiting_for_ack"
data structures of "echo.js" into a separate module in "echo_state".

This is a preparatory commit so as to be able to use them for
"stream_topic_history" module, without causing import cycles.
2024-08-14 18:24:56 -07:00
Prakhar Pratyush 19d56f77b5 rocketchat: Fix "OSError: [Errno 36] File name too long" error.
Earlier, we were replacing too long attachment name with random uuid
when the character count of the file name was greater than 255.

This results in "OSError: [Errno 36] File name too long" error in
few cases when the file name has less than 255 characters but more
than 255 bytes (file name with Non-ASCII characters).

This commit updates the code to check the file name's byte size
instead of characters count.
2024-08-14 18:18:31 -07:00
Prakhar Pratyush 54492ec7a0 help: Add a note in "Export your Rocket.Chat data" section.
This commit adds a note to NOT shut down Rocket.Chat server
while creating database dump using mongodump utility because
as this results in bugs like empty instances.bson file and
empty uploaded data after import.
2024-08-14 18:18:31 -07:00
Prakhar Pratyush adae69c65f help: Document rocketchat's livechat channels/messages not imported.
We ignore Rocket.Chat livechat channels/messages. It was
implemented in #20195.

This commit documents the caveat.
2024-08-14 18:18:31 -07:00
Tim Abbott 2144904cf5 docs: Explicitly discuss management commands in Zulip Cloud.
This already seems obvious to many users, but it seems appropriate to
spell out.
2024-08-14 14:04:46 -07:00
Tim Abbott e01206d04c help: Document change_auth_methods command.
I also added a basic warning to help avoid folks getting into this
state.
2024-08-14 14:04:46 -07:00
Mateusz Mandera bf7fc5701f management: Add change_auth_backends command.
A utility command to enable or disable certain authentication backends
for a realm from the command line. Can be helpful e.g. if the
administrator accidentally disables some auth methods in the UI leaving
themselves with none remaining that they could actually use to log back
into the organization.

Example usage:
```
(zulip-py3-venv) vagrant@c32c137f59a0:/srv/zulip$ ./manage.py change_auth_backends -r zulip --show
Current authentication backends for the realm:
Enabled backends:
  Dev
  Email
  GitHub
  GitLab
  Google
  Apple
  SAML
  OpenID Connect
(zulip-py3-venv) vagrant@c32c137f59a0:/srv/zulip$ ./manage.py change_auth_backends -r zulip --disable GitHub
Disabling GitHub backend for realm Zulip Dev
Updated authentication backends for the realm:
Enabled backends:
  Dev
  Email
  GitLab
  Google
  Apple
  SAML
  OpenID Connect
Disabled backends:
  GitHub
Done!
(zulip-py3-venv) vagrant@c32c137f59a0:/srv/zulip$ ./manage.py change_auth_backends -r zulip --enable GitHub
Enabling GitHub backend for realm Zulip Dev
Updated authentication backends for the realm:
Enabled backends:
  Dev
  Email
  GitHub
  GitLab
  Google
  Apple
  SAML
  OpenID Connect
Done!
```
2024-08-14 14:04:46 -07:00
Tim Abbott e4567e05ac css: Explode dark theme disabled rule.
This replaces a :disabled selector with individual ones for each
element type; I verified in CSS selector profiling that this change
removes lines that were previously about 10% of profiled CSS selector
processing time for rendering the combined feed.

The reason being that the rendered elements have very few disable-able
elements, but the browser was spending a lot of time trying to match
**every** element for whether it might have been disabled, which was
slow.

This probably reflects a browser bug.
2024-08-14 13:42:59 -07:00
Lauryn Menard 206531f703 help: Fix details in "Change your call provider" section.
Adds note about feature being available only to organization owners
and administrators.

Fixes the icon in the note about BigBlueButton to be the zulip icon
that's currently used in the compose box.
2024-08-14 13:21:43 -07:00
Prakhar Pratyush 39c5bb9fa5 user_topics_ui: Fix 'toggle_topic_visibility_policy' behavior.
This commit updates the stale logic in 'toggle_topic_visibility_policy'
function. It was not updated after the addition of 'follow' visibility
policy resulting in buggy behavior.
2024-08-14 13:20:58 -07:00
Prakhar Pratyush cbc3f84be4 hotkey: Fix 'Shift + M' to not work in unsubscribed channel.
Earlier, 'Shift + M' hotkey was working in unsubscribed channels.

This commit updates the logic to make it non-functional. This
helps to keep the UI consistent as we don't offer a way to
change visibility_policy in unsubscribed channels via
recipient_bar_controls or other UI elements.

Note: We don't implement this restriction in server because
we don't delete the user-topic states in db when a channel is
unsubscribed as it helps to retain those states when re-subscribed.
And implementing this restriction at server level can create
a confusion of why such states exists in db when API doesn't allow.
2024-08-14 13:20:58 -07:00
Alex Vandiver 2bfdccd065 narrow: Do not error when given an empty DM recipient list. 2024-08-14 10:39:40 -07:00
Vector73 fa408a969e api-docs: Handle multiple examples in `responses`. 2024-08-14 09:37:15 -07:00
Tim Abbott 07c927ae88 migrations: Fix Nagios bot cleanup crash.
We didn't correctly check for the possibility that these users don't
exist.
2024-08-13 23:30:32 -07:00
Aman Agrawal a7b86a7e66 filter: Cached computed values for faster comparison. 2024-08-13 23:28:21 -07:00
Aman Agrawal e956ec0483 filter: Make filter comparison more robust and faster.
Convert operand to lowercase for case-insensitive operators.
2024-08-13 23:28:21 -07:00
Aman Agrawal 1ce9fcdada left_sidebar: Fix user unable to type in DM search input.
This was due to non message list views didn't know that they
shouldn't try to process hotkey when DM search input is in focus.
2024-08-13 23:22:50 -07:00
Shubham Padia b322ca4cc3 help-beta: Set pagination to false.
Fixes #31250.
2024-08-13 22:52:53 -07:00
Shubham Padia a746a7e784 css: Remove unnecessary rule for subscriptions_overlay.
Even though the border-color was set for `#subscriptions_overlay
.subsection-parent div`, since the border-style was not set. It did not
have any effect on the appearance of the children div of
.subsection-parent.
2024-08-13 22:36:35 -07:00
Shubham Padia 2081fb52a1 css: Use padding-top instead of putting margin-top on first div.
It has the same visual effect and we do not have to use a div selector.
Having the `div` 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-13 22:36:35 -07:00
Shubham Padia 0d95d79033 css: Use classname instead of div for .flex.overlay-content.
Each child div for .flex.overlay-content has the class
.overlay-container, so it is safe to replace the div with that
classname.
Having the `div` 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-13 22:36:35 -07:00
Shubham Padia 8b96aa277a css: Use classname instead of `div` selector for .blocks.
Having the `div` 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-13 22:36:35 -07:00
Shubham Padia e9d0e1d30d css: Use flexbox for .stream-row and .group-row.
Before this, we were having each direct child div for both the classes
as inline blocks. It is better to just have `display: flex` on the
parent element instead. There is a slight change in appearance which has
been confirmed in
https://chat.zulip.org/#narrow/stream/6-frontend/topic/Subscription.20list.20slight.20look.20change/near/1906254
2024-08-13 22:36:35 -07:00