Commit Graph

61585 Commits

Author SHA1 Message Date
Aditya Kumar Kasaudhan d1ff871523 webhooks: Support filtering GitHub activity from private repositories.
Currently, the GitHub webhook sends activity from both public and private
repositories, which could lead to unintended disclosure of sensitive
information from private repositories.

This commit introduces a ignore_private_repositories parameter to the
webhook URL. When set to true, the webhook ignore processing activity from
private repositories, ensuring that such activities are not posted to
Zulip streams. By default, if the parameter is omitted or set to false,
activities from both public and private repositories are processed
normally. This provides users with the flexibility to control the
visibility of private repository activities without altering the default
behavior.

More importantly, this introduces a cleaner mechanism for individual
incoming webhooks to declare support for settings not common to all
webhook integrations.

Fixes #31638.
2024-10-31 10:40:28 -07:00
Prakhar Pratyush fdf90f7ad1 create_user: Handle integrity error when importing settings.
During account creation when a user opted to import settings
from an existing account, the "Mark visibility_policy_banner as
read" step was raising integrity error.

It is because 'copy_onboarding_steps' is already executed earlier
in the 'do_create_user' codeflow. If the source profile had already
marked 'visibility_policy_banner' as read, we were facing integrity
error.

This commit fixes the bug.
2024-10-31 09:55:01 -07:00
Prakhar Pratyush 555ac613ac create_user: Add 'durable=True' to the outermost transaction.
We need to specify savepoint=False explicitly in the one subroutine
that already specifies a transaction.
2024-10-31 09:55:01 -07:00
Sahil Batra 50674a7a28 user_groups: Do not enable "Add" button if input is empty.
This makes sure that the "Add" button in members panel is
not enabled if the pill input is empty, in two cases - when
the members panel is opened and also when the members panel
is live-updated due to change in permission.
2024-10-31 09:53:14 -07:00
Sahil Batra aed8ac9672 settings: Fix disabled look for group settings pills UI.
We now have a grey-ish background color for the pill container
with opacity also reduced like we do for the disabled select
elements in settings.

Needed to adjust the selectors so that the CSS for disabled
state correctly overrides the CSS for enabled state.
2024-10-31 09:53:14 -07:00
Sahil Batra 9a6ef9db93 user_group_popover: Show members count if there are empty subgroups.
We show "0 members" text when a group has no direct members but
has subgroups which are all empty.

The behavior for when a group has neither direct members nor
subgroups is same where we show "This group has no members".
2024-10-31 09:53:14 -07:00
Sahil Batra 4a89fffd8a group-settings: Link to help center section for group permissions.
Fixes #25938.
2024-10-31 09:53:14 -07:00
Aditya Kumar Kasaudhan d448b75176 slack_incoming: Add ok=false to JSON in case of error.
Previously, errors were returned using Zulip's default format,
which did not match Slack's expected response structure.

This change ensures that errors in the Slack incoming webhook handler
return JSON responses in Slack's expected format: {ok: false, error:
"error string"}.

Fixes: #31878.
2024-10-30 15:33:29 -07:00
Alya Abbott 46a0c6507c contributor docs: Clarify how to find abandoned issues. 2024-10-30 15:24:06 -07:00
Karl Stolley 892d9f2443 docs: Add section on crediting the work of others. 2024-10-30 12:36:58 -07:00
Karl Stolley 2436971b1b docs: Add edits to unifinished work guidance for clarity. 2024-10-30 12:36:58 -07:00
Tim Abbott 66537c8bf8 migrations: Fix migration 0576 local backfill path and repeat.
Unfortunately, because this migration has already been run for many
installations, we need to ship another copy of the migration.

It should be a noop when repeated.
2024-10-30 12:06:33 -07:00
Sahil Batra 9b0e26e954 settings: Refactor code for handling group settings UI.
This commit updates code to just use permission settings
list from server_supported_permission_settings data
instead of calling create_realm_group_setting_widget
individually for each setting.

Also, updated the code to create dropdown widgets to check
if only system groups are allowed or not for a setting
instead of using a hardcoded list.
2024-10-30 12:03:36 -07:00
Sahil Batra 8e0a8dfa32 settings: Use new pills UI for message delete permissions. 2024-10-30 12:03:36 -07:00
Sahil Batra b8bc20e87c settings: Use new pills UI for move message permission settings. 2024-10-30 12:03:36 -07:00
Sahil Batra d9f4c473fb settings: Do not disable time limit settings.
Previously we disabled time limit settings for moving
messages when non-admin and non-moderators users were
not allowed move messages as the time limit does not
apply to admins and moderators. And the time limit
setting to delete messages was disabled when all the
users who were allowed to delete their own message also
had permission to delete any message since time limit
does not apply to users who were allowed to delete any
message.

Now, as we use the new UI and allow the permission
settings to be set to anonymous groups, we just do
not disable the time limit setting to avoid complexity
and we anyways mention about cases when time limit is
not applicable.
2024-10-30 12:03:36 -07:00
Sahil Batra fb1c7fffa2 settings: Use new UI for can_add_custom_emoji_group setting. 2024-10-30 12:03:36 -07:00
Sahil Batra dce229ba17 settings: Use new pills UI for DM permission settings.
We now use pills UI for direct_message_initiator_group
and direct_message_permission_group setting.
2024-10-30 12:03:36 -07:00
Sahil Batra 5fbc46f82c settings: Fix banner shown on custom emoji panel.
Previously the banner was always shown to admins and to users who
cannot add emoji with the banner mentioning who can add emoji.

This commit updates the code to only show the banners who cannot
add emoji irrespective of their role, and just mention that they
do not have permission without any detail about who can add.
2024-10-30 12:03:36 -07:00
Sahil Batra 891e58bb1a settings: Fix live-update of setting elements.
Some of the group setting elements were not live-updated
correctly since they were not present in realm_settings
dict and sync_realm_settings is only called for settings
present in that dict.
2024-10-30 12:03:36 -07:00
Sahil Batra 072da3b0d3 settings: Extract template file for group setting pill UI.
This helps in writing same code again and again for different
settings.

Can also update group settings to use this template in further
commits.
2024-10-30 12:03:36 -07:00
Sahil Batra a7e6d5d770 settings: Remove unused fields passed to settings template.
There is no need to pass the value of group settings to
template as rendering the UI is handled in JS. This was
probably added due to the old enum value setting being
passed to the template.
2024-10-30 12:03:36 -07:00
Karl Stolley 0cab8df681 compose: Extend 4px border-radius to topic box.
All similar elements in the compose box--the channel/DM widget, the
pill container on DMs, and the compose textarea--all use a 4px
border-radius, correcting the topic box's outlier status.
2024-10-30 11:23:22 -07:00
Karl Stolley 17561d09a1 compose: Give tab-focused widget wrapper sensible border. 2024-10-30 11:23:22 -07:00
Karl Stolley 9231c97454 compose: Bring colors into variablized concord. 2024-10-30 11:23:22 -07:00
Aman Agrawal 3fe1e554a6 echo: Fix send messages not visible when auto narrowed to recipient.
We simply forgot to `add_to_narrow` locally echoed messages if
the current narrow changed before we received confirmation from
server.
2024-10-30 10:03:30 -07:00
Anders Kaseorg 42e1517255 email_notifications: Prevent html2text from mangling Unicode.
html2text mangles Unicode by default, with a --unicode-snob option to
disable it.  If I have to get called a “snob” for wanting to correctly
support non-English languages, then uh, I’ll take one for the team.

https://github.com/Alir3z4/html2text/blob/2024.2.26/html2text/config.py#L111-L150

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-30 09:49:23 -07:00
PieterCK fc50736f4e slack_data_import: Fix incorrect hyperlink conversion.
Currently, Slack messages containing hyperlinks
(e.g.,<http://foo.com|Foo!>) are converted like
normal links. This commit reformats Slack
hyperlinks into Zulip-friendly markdown
(e.g., [Foo!](http://foo.com)).

Part of #32165.
2024-10-30 09:48:32 -07:00
Aditya Kumar Kasaudhan 18a8125dac user_groups: Include group_id in success response on group creation.
Previously, the `group_id` was not returned in the success
response of the user group creation API.

This commit updates the API to return a success response
containing the unique ID of the user group with the key
`group_id`. This enhancement allows clients to easily reference
the newly created user group.

Fixes: #29686
2024-10-30 09:46:38 -07:00
Vector73 1ba1408b01 settings: Remove `edit_topic_policy` setting.
Removed `edit_topic_policy` property, as the permission
to move messages between topcis is now controlled by
`can_move_messages_between_topics_group` setting.
2024-10-29 16:27:04 -07:00
Vector73 ed5638ec3c settings: Add `can_move_messages_between_topics_group` realm setting.
Added `can_move_messages_between_topics_group` realm setting to replace
`edit_topic_policy`.
2024-10-29 16:27:04 -07:00
evykassirer 1edf507be9 buddy_list: Show all sections (uncollapse) when searching. 2024-10-29 16:06:41 -07:00
evykassirer b826143537 buddy_list: Fix bug where header didn't show correct participant count. 2024-10-29 16:06:41 -07:00
evykassirer 3db32f1416 buddy_list: Rename all_participant_ids.
This helps avoid confusion with `participant_user_ids`
which is a property of the buddy list and describes
the currently visible participants, whereas
`all_participant_ids` describes all participants,
even those hidden due to search.
2024-10-29 16:06:41 -07:00
evykassirer 2b168a9936 buddy_list: Show empty placeholder for participants section in search.
This was overlooked when we added this section because it usually
can't have an empty placeholder, but it actually still can in search.
2024-10-29 16:06:41 -07:00
evykassirer f157bfe181 buddy_list: Simplify logic to update empty list placeholders.
Because we regularly change what we want the placeholder
text to be, as the user enters and exits search, it's simpler
to just not use `data-search-results-empty` and set up the
placeholder from the buddy list code directly. Previously we
were trying to sometimes use `data-search-results-empty` and
sometimes set it directly, which is more confusing and complex.
2024-10-29 16:06:41 -07:00
evykassirer d0dc33d8da buddy_list: Move fill_screen call to the end of populate().
Sometimes we might want to re-fill the screen after collapsing
or uncollapsing a section, so it's better to fill the screen
just once after determining if we should collapse the "other
users" section. Also, this commit removes a call to
`render_section_headers()` because that's always called at the
end of `fill_screen_with_content()`.
2024-10-29 16:06:41 -07:00
evykassirer b335c19d1c buddy_list: Refactor section collapse logic to be shared. 2024-10-29 16:06:41 -07:00
evykassirer ec1b265ff8 buddy_list: Refactor section toggle to not need custom classname. 2024-10-29 16:06:41 -07:00
Sahil Batra f29083f2ef settings: Disable save button if nobody group is not allowed.
This commit adds code to disable the save button if there no
pills selected for the setting and the setting cannot be set
to "Nobody" group.
2024-10-29 15:06:16 -07:00
Sahil Batra 8fa225d885 settings: Use new pills UI for group related realm settings.
This commit updates the code to use new UI for can_create_groups
and can_manage_all_groups settings.
2024-10-29 15:06:16 -07:00
Sahil Batra c8e906d49e settings: Use pills UI for channel creation settings.
We now use new pills UI for public and private channel
creation settings. The UI for web-public channel
creation setting is still a dropdown as we allow only
system groups for that.
2024-10-29 15:06:16 -07:00
Sahil Batra 60b12367cc settings: Use new settings UI for create_multiuse_invite_group. 2024-10-29 15:06:16 -07:00
Sahil Batra d370499557 settings: Refactor create_group_setting_widget.
This commit updates create_group_setting_widget code
to not accept setting type as a a parameter as we
would use separate function for realm settings.
2024-10-29 15:06:16 -07:00
evykassirer 35424adcc3 settings_account: Convert module to typescript. 2024-10-29 14:50:25 -07:00
evykassirer 8eb0ca3a7c settings_account: Move async call into ui_init. 2024-10-29 14:50:25 -07:00
evykassirer 7431d87d0c settings_account: Fix type for failure_msg_html (undefined). 2024-10-29 14:50:25 -07:00
evykassirer a6850410a8 settings_account: Use `this` instead of event target.
The first two are equivalent because they call `closest`
and the last one is directly equivalent. We're making these
changes to aid with the conversion to typescript.
2024-10-29 14:50:25 -07:00
evykassirer adf3280f1e settings_acount: Standardize type passed to update custom fields. 2024-10-29 14:50:25 -07:00
Sahil Batra caf919fca2 user_groups: Don't allow adding deactivated groups as subgroups in UI.
We already have the code to ignore the deactivated groups before
sending the request and show appropriate message. This commit
just adds code to not show them in the typeahead and also not
create its pill if user types the full group name.
2024-10-29 11:02:03 -07:00