Commit Graph

62065 Commits

Author SHA1 Message Date
PieterCK
42a22e6aaa slack-integration: Block requests from Slack retries.
A Slack fail condition occurs when we don't respond with HTTP 200 within
3 seconds after Slack calls our endpoint. If this happens, Slack will
retry sending the same payload. This is often triggered because we need
to perform callbacks when converting messages. To avoid sending the same
message multiple times, we block subsequent retry calls from Slack.

This commit returns early HTTP 200 response as soon as we get any retry
calls from Slack.

Part of #30465.
2024-12-11 13:06:52 -08:00
PieterCK
c54d90e5c7 slack-integration: Add callback function to Slack API.
Payloads from Slack's Events API don't include human-readbale
information for a Slack username and for Slack channels.

This commit makes the Slack integration callback to the relevant
Slack API endpoints for that information.

Fixes #30074.
2024-12-11 13:06:52 -08:00
PieterCK
1ebbe2fd99 slack-integration: Add test fixtures for extra Slack payloads.
This commit adds 4 new payload fixtures to the Slack
integration for messages we don't process properly yet:

- Messages with code blocks.
- Messages with overlapping text formatting (e.g, bold
  and italic).
- Messages with formatted mentions.
- Messages with quote blocks.

The follow-up plan to add support for these kind of
Slack messages is tracked in #30827.

Part of #30465.
2024-12-11 13:06:52 -08:00
PieterCK
f29312ce03 slack-integration: Update Slack integration to handle Events API.
This updates the Slack webhook integration to handle the Slack Events
API[1], while maintaining backwards compatibility with Slack's legacy
Outgoing Webhook service.

The Events API introduces the "challenge" handshake[2] to verify and
add a new webhook URL for them to call. This commit adds a handler for
the challenge handshake.

Additionally, this commit reformats incoming payloads using the Slack
text reformatter from `slack_message_conversion.py`. There is some
duplicative code here because of the difference in Slack export data
and Slack's webhook payload.

Part of #30465

[1]: https://api.slack.com/apis/events-api#using-events-api
[2]: https://api.slack.com/apis/events-api#handshake
2024-12-11 13:06:52 -08:00
Tim Abbott
a59a93c436 css: Consolidate move_topic_modal styles. 2024-12-11 12:32:04 -08:00
whilstsomebody
0ce7278edf move_topic_popover: Show the number of messages to be moved.
Added a feature to the move message confirmation box to display the
count of messages that will be moved. The count updates dynamically
based on the selected option in the dropdown.

Fixes #23115.
2024-12-11 12:32:04 -08:00
Alex Vandiver
06d04b4291 migrations: Change migration 0639's dependency for backporting to 9.x.
This moves it "earlier" in the migrations graph, onto the last
migration in 9.x, and adds a merge migration to fold it back into
main's current migrations tip.
2024-12-11 12:21:25 -08:00
Gunnar Samuelsson
876dd7ca60 popover: Fix misleading time description in right side-bar.
In the right side-bar, the popover states "Active x minutes ago",
even though the user could have been idle before going offline.
In that case we are stating something false, as the user was not
"Active x minutes ago", they were "Idle x minutes ago". Always
prioritizing the active_timestamp if possbile rather than taking
the max of active_timestamp and idle_timestamp fixes this issue.
2024-12-11 12:17:41 -08:00
Sahil Batra
143bda8a4b test_user_groups: Use "123456" as invalid group ID.
Since we have many group based settings and many of them
use anonymous groups as default, there might be a group
with ID "1111" as group IDs keep increasing across a test
suite run and it is no longer an invalid group ID.

This commit updates the tests to use a large enough
value like "123456" as invalid group ID.
2024-12-11 12:15:02 -08:00
Sahil Batra
1153d088b9 tests: Fix flaky behavior of test to update group permissions.
The test for updating group permissions when passing old value
used "1111" as an invalid group ID passed as new value as well
as old value. But now since we have many group based settings
and many of them use anonymous groups as default, there might
be a group with ID "1111" as group IDs keep increasing across
a test suite run and it is no longer an invalid group ID.

So, updated the test to -
- Use a large enough value like "123456" as new value for
testing invalid group ID case.
- Remove the test passing invalid value as "old" because we
do not check validity for old values and just compare it
with the actual current value of the setting.
2024-12-11 12:15:02 -08:00
Sahil Batra
289e71637c tests: Fix flaky behavior of test to set permissions on group creation.
The test for setting group permissions value when creating groups used
"1111" as an invalid group ID, but now since we have many group based
settings and many of them use anonymous groups as default, there might
be a group with ID "1111" as group IDs keep increasing across the test
suite run and it is no longer an invalid group ID.

So, updated the test to use a large enough number like "123456" as
invalid group ID.
2024-12-11 12:15:02 -08:00
Anders Kaseorg
26aa19db43 click_handlers: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 12:12:07 -08:00
Anders Kaseorg
4f297bee32 recent_view_ui: Make tooltip data compatible with buddy_data.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 12:12:07 -08:00
Anders Kaseorg
df657e7208 click_handlers: Cut import of server_events.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 12:12:07 -08:00
Anders Kaseorg
cb3cf7ec4a click_handlers: Remove dead .trigger-natural-click handler.
It’s been unused since its introduction in commit
49f7f02a0a (#25667).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 12:12:07 -08:00
Anders Kaseorg
e2d56db2a3 message_cache: Use the sender’s recipient_id for incoming 1:1 DMs.
For an incoming 1:1 DM, the recipient’s own recipient_id is useless to
the recipient themselves. Substitute the sender’s recipient_id, so the
recipient can use recipient_id as documented to uniquely represent the
set of 2 users in this conversation.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 12:05:03 -08:00
Anders Kaseorg
6ef0f0c072 event_queue: Use keyword-only arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 12:05:03 -08:00
Lauryn Menard
8107104ff2 corporate: Update links to use "manage-permissions" help article. 2024-12-11 12:02:11 -08:00
Lauryn Menard
fc810655e6 help: Rename "roles-and-permissions.md" to "manage-permissions.md".
Renames file and redirects existing links to "help/user-roles" as
the previous content tracks to that current file's content.

Updates existing links (excluding ReadtheDocs) to go to either
"help/user-roles" or "help/manage-permissions" depending on which
help center article applies to the content.
2024-12-11 12:02:11 -08:00
Lauryn Menard
0fd0a1ab21 help: Rename "change-a-users-role.md" to "user-roles.md".
Renames file and adds redirect to existing help center
links.
2024-12-11 12:02:11 -08:00
Alya Abbott
3737cb59a6 help: Update roles and permissions documentation. 2024-12-11 12:02:11 -08:00
Alya Abbott
f0d9193354 help: Remove mention of roles for invitation permissions. 2024-12-11 12:02:11 -08:00
Anders Kaseorg
a5d7ecd7e7 avatar: Fix missing function call. (#32667)
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 10:05:01 -08:00
Anders Kaseorg
77f97762c6 eslint: Fix unicorn/explicit-length-check. (#32666)
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 09:19:46 -08:00
Anders Kaseorg
d446b0d672 user_events: Convert module to TypeScript (#32658) 2024-12-11 09:18:52 -08:00
Anders Kaseorg
666ce4519d hashchange: Convert module to TypeScript. (#32670) 2024-12-11 09:15:18 -08:00
Anders Kaseorg
38ad1e8bdc openapi: Fix config_options.validator documentation for webhook bots.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-10 21:30:29 -08:00
Anders Kaseorg
c5aa7df1bf eslint: Clean up obsolete rules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-10 19:16:44 -08:00
Anders Kaseorg
cf1eed9c22 tools: Use top-level await.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-10 19:16:25 -08:00
Shubham Padia
f147e4dd4a Group invalid inputs (#32647)
* css: Extract invalid input outline and shadow colors to variables.

We will use these colors in future for input pills and it would be
convenient to have them in a variable.

* group_setting_pill: Show outline on invalid input.

We could have manipulate the class directly from user_group_pill. But
it felt better to have `show_outline_on_invalid_input` as a param for
the input_pill prototype since we can have a consistent error state for
other pill input boxes if we want to.

* input_pill: Widget should not show as pending after pill creation.

* group_settings: Disable save changes button if pill widget is pending.

This will disable the button for group, realm and stream group settings.

* user_group_create: Don't go to next step with pending group widget.

We just show the red outline and shaking animation as an indication that
a group widget setting is pending when the user tries to go to the add
members step.

* stream_create: Don't go to next step with pending group widget.

Fixes #32113.
We just show the red outline and shaking animation as an indication that
a group widget setting is pending when the user tries to go to the add
subscribers step.
2024-12-10 16:57:48 -08:00
Karl Stolley
34d6d3948e left_sidebar: Use font metrics to adjust browse-more label. 2024-12-10 16:27:43 -08:00
Karl Stolley
bc37be5f40 left_sidebar: Match browse-more link grid to other sidebar row values. 2024-12-10 16:27:43 -08:00
Karl Stolley
0b940602c3 left_sidebar: Better structure and style browse-more line. 2024-12-10 16:27:43 -08:00
Maneesh Shukla
74708cfd03 settings_users: Remove an unused block of code.
This commits remove the unused block of code which involves
`failed_listing_users` when there is no users to list.

Since, this is a case which is not possible to occur because there
should always be at least one active user, i.e. yourself.
2024-12-10 15:45:30 -08:00
evykassirer
c067b06f8e compose: Clear preview area when starting a new draft. 2024-12-10 15:44:02 -08:00
Tim Abbott
dc58c8450f user_group_edit: Document group creator API details. 2024-12-10 12:11:59 -08:00
Varun Singh
010e2b9867 user_group_edit: Convert module to TypeScript. 2024-12-10 12:07:46 -08:00
Varun Singh
0ed81f6bef user_group_edit: Don't mutate data object.
Instead of mutating data object with fields
that it does not have at declaration, we should declare the
complete object once.
This is a prep-commit for upcoming TypeScript migration of module.
2024-12-10 12:07:45 -08:00
Varun Singh
6e06a452db settings_org: Consistenly pass arguments as jQuery objects. 2024-12-10 12:07:45 -08:00
evykassirer
7bd4016254 message_events: Convert module to typescript. 2024-12-10 10:52:01 -08:00
evykassirer
f241aa77c1 message_events: Don't accept undefined filter in filter_has_term_type.
Accepting an undefined Filter  has no advantage; every caller either
passes a defined Filter or has to later check for undefined anyway.
2024-12-10 10:52:01 -08:00
evykassirer
ca4e425031 message_edit: Don't validate stream message mentions for DMs.
This was passing typechecking previously because of an
incorrect assertion and NaN getting into `validate_stream_message_mentions`.
2024-12-10 10:16:27 -08:00
Alex Vandiver
2250ae3f0d migrations: Update user and realm preferences of zh_Hant to zh_TW. 2024-12-10 10:00:45 -08:00
Alex Vandiver
25069c8d47 i18n: Merge zh_Hant into zh_TW. 2024-12-10 10:00:45 -08:00
Anders Kaseorg
84d5ef1285 upload: Show text/plain uploads inline.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-10 09:51:57 -08:00
Sahil Batra
f4cbdd8c9c css: Remove unnecessary CSS for ".clear_search_button".
We can remove some of the CSS properties for
".clear_search_button" selectors because they
were being overridden by CSS set using more
specific selectors or by CSS set using
".bootstrap-btn" selector.

As a result, we can remove some the overriding
CSS as well where they were being used to set
default values.
2024-12-10 09:47:01 -08:00
Sahil Batra
c4058ffc22 user_profile: Use grid layout for stream search input.
This commit updates CSS to use grid layout for stream
search input in user profile modal so that we can have
clean CSS and do not have different values for padding,
right and margin properties at different places.

This also fixes the alignment of "x" button.

Also, the heading and search input were not aligned
perfectly, so changed the CSS to they align better.
2024-12-10 09:47:01 -08:00
Sahil Batra
835bedb515 recent-view: Use grid layout for search input.
This commit updates CSS to use grid layout for search input
in recent conversations view so that we can have clean CSS
and do not have different values for padding, right and margin
properties at different places.

This also fixes the alignment of "x" button.
2024-12-10 09:47:01 -08:00
Sahil Batra
1555e99abe settings: Use grid layout for search in stream and groups UI.
This commit updates the search input to in stream and groups
UI to use grid layout. This also helps in fixing the alignment
of the "x" button.
2024-12-10 09:47:01 -08:00
Maneesh Shukla
6a76fcfd0e settings: Disable the move-handle for new-choice-row.
This commit hides the move-handle for the new-choice-row in the
profile field choice editor, since the empty row can't be moved.

Fixes: #32612.
2024-12-09 17:00:14 -08:00