Commit Graph

60464 Commits

Author SHA1 Message Date
Alex Vandiver 64516ab9f4 install-aws-server: Output tsh ssh command, not ssh. 2024-08-20 10:04:40 -07:00
Alex Vandiver c0237e3d58 kandra: Correct group ownership and permissions to match package's.
This reverts b000328ba5 and re-applies
a759d26a32.  It is likely that the
upstream packages are simply inconsistent.
2024-08-20 10:04:40 -07:00
Alex Vandiver a5a898ba21 install-aws-server: Switch to 24.04. 2024-08-20 10:04:37 -07:00
Alex Vandiver 3adedc9545 install-aws-server: Set the name of the root EBS volume. 2024-08-20 10:03:59 -07:00
Alex Vandiver fe0a7b3b77 kandra: Drop support for 20.04 hosts. 2024-08-20 10:03:59 -07:00
Kenneth Rodrigues 50712bfa81 scheduled_messages: Migrate to typed_endpoint.
Migrate `scheduled_message.py` to typed_endpoint.

Perform Json parsing in the endpoint itself instead of
in `recipient_parsing.py`.
2024-08-20 10:03:22 -07:00
Aman Agrawal 7f38c95384 dropdown_widget: Fix click event being triggered multiple times.
Reset event handlers attached to the dropdown widget and by removing
it from DOM.

User is unlikely to use the same dropdown multiple times, even if
they do, the operation is fast.
2024-08-20 09:56:59 -07:00
Aman Agrawal 82d3058b53 dropdown_widget: Remove unused instance property. 2024-08-20 09:56:59 -07:00
Lauryn Menard 3cb14ba7db api-docs: Clarify the behavior of the near operator.
On the server-side, the implementation of the "near" operator is a
noop. Clients should instead use the "anchor" parameter to express
the "near" operator in a search box or URL fragment.
2024-08-20 09:56:00 -07:00
evykassirer d9f25d01a1 web: Use util.the for accessing element of single-item lists. 2024-08-20 09:48:15 -07:00
evykassirer 113de14547 message_edit: Remove TODOs to parse more data that we don't need.
I'd thought maybe we want to make sure they were in sync, but we don't
need to parse the full data structure.
2024-08-20 09:48:15 -07:00
Lauryn Menard 31c32bcba7 support: Remove abbreviation for "Organization type". 2024-08-20 09:45:49 -07:00
Lauryn Menard b52b1bcca8 support: Consolidate sponsorship forms for remote and Zulip Cloud views.
In the Zulip Cloud support view, adds a "Realm management" section
for support actions that are specific to that view, (e.g., changing
an organization's type or deactivating an organization).

Moves the note about emailing organization owners when a full
sponsorship is approved for Zulip Cloud Standard to the success
message for that action, which mirrors the remote server/realm
support view.
2024-08-20 09:45:49 -07:00
Lauryn Menard 85e5494507 support: Remove unused class names on support forms. 2024-08-20 09:45:49 -07:00
Lauryn Menard c152061ef2 support: Consolidate margin bottom CSS rule for forms. 2024-08-20 09:45:49 -07:00
Karl Stolley 485428db86 rendered_markdown: Approximate non-alpha dark mode table border color. 2024-08-20 09:34:07 -07:00
Ujjawal Modi 2e67d88a20 user_groups: Update code to check whether user can edit a user group.
Earlier there was only a realm level setting for configuring
who can edit user groups. A new group level setting is also added
for configuring who can manage that particular group.
Now, a user group can be edited by a user if it is allowed from
realm level setting or group level setting.

This commit make changes in frontend to also use group level setting
in determining whether a group can be edited by user or not and disables
changing the group settings when group cannot be edited by user.
2024-08-20 09:28:05 -07:00
Ujjawal Modi d32f30cedc user_groups: Add function for determining group creation permissions.
Earlier in frontend there was a single function to determine whether
user can create and edit user groups.
This commit adds a separate function for determining group creation
permissions.
2024-08-20 09:28:05 -07:00
Ujjawal Modi 3f24dd1049 user_groups: Allow setting and changing can_manage_group.
This commit adds a group level setting can_manage_group in
`#groups` overlay. This setting can be set while creating a
new user_group and can be changed for existing groups.
2024-08-20 09:28:05 -07:00
Ujjawal Modi 20229d0d3d user_groups: Add can_manage_group field to user_group object.
This commit adds can_manage_group field in user_group
object in frontend and also adds code to update the field
value from server events.
2024-08-20 09:28:05 -07:00
Ujjawal Modi 5d613ce98d user_groups: Add support to update can_manage_group setting.
This commit adds API support to update can_manage_group setting
of a user group.
2024-08-20 09:28:05 -07:00
Ujjawal Modi b0b36e884c user_groups: Add support to set can_manage_group during creation.
This commit adds API support to set can_manage_group while
creating a user group.
2024-08-20 09:28:05 -07:00
Ujjawal Modi 2505813359 user_groups: Add can_manage_group field to UserGroup objects.
This commit make changes in code to include can_manage_group
field to UserGroup objects passed with response of various endpoints
including "/register" endpoint and also in the group object
send with user group creation event.
2024-08-20 09:28:05 -07:00
Ujjawal Modi 423d5c42f6 user_groups: Update code to check whether user can edit a user group.
Earlier there was only a realm level setting for configuring
who can edit user groups. A new group level setting is also added
for configuring who can manage that particular group.
Now, a user group can be edited by a user if it is allowed from
realm level setting or group level setting.

This commit make changes to also use group level setting
in determining whether a group can be edited by user or not.

Also, updated tests to use api_post and api_delete helpers instead
of using client_post and client_delete helpers with different users
being logged in.
2024-08-20 09:28:05 -07:00
Ujjawal Modi 03220ba456 user_groups: Add can_manage_group field in database.
This commit adds a new group level setting can_manage_group
for configuring who can manage a group. This commit only adds
the field in database and make changes to automatically create
single user groups corresponsing to acting user
which will be the default value for this setting.

Fixes part of #25928.
2024-08-20 09:28:05 -07:00
Ujjawal Modi 9e699dfc85 tests: Separate test of group edit setting for creation and deletion.
Earlier there was a single backend test for testing group edit policy
for creating and deleting user group.This commit make changes in the test
and now there are two separate tests for testing group edit policy for
creating and deleting user groups.

This was done because in future commits we will be adding a
realm level setting for configuring who can create user groups.

Also, updated tests to use api_post and api_delete helpers instead
of using client_post and client_delete helpers with different users
being logged in.
2024-08-20 09:28:05 -07:00
Ujjawal Modi bb0b6900df user_groups: Add a decorator to check group creation permission.
Earlier there was a single decorator function to check whether
user can create and edit user groups. This commit adds a new
decorator function to check whether user has permissions to
create user groups.

This was done because in future commits we will be adding a
realm level setting for configuring who can create user groups.
2024-08-20 09:28:05 -07:00
Sahil Batra 3f800002be user_groups: Allow not passing old_setting_api_value. 2024-08-20 09:28:05 -07:00
evykassirer b1198785be message_edit: Convert module to typescript. 2024-08-19 16:33:04 -07:00
evykassirer d5eb997242 feedback_widget: Allow undo opts to be undefined.
There's existing logic that assumes `on_undo` can be `undefined`.
(see the `opts.on_undo === undefined` if clause)

This commit updates some types to let it actually be `undefined`,
which it is in `message_edit`, which we're about to convert to
typescript.
2024-08-19 16:33:04 -07:00
evykassirer b2400496fd rows: Consistently pass JQuery to `get_closest_row`.
This was inconsistent before, with `message_edit` using JQuery
elements, and `compose_popover` and the definition of
`get_closest_row` using HTMLElements.
2024-08-19 16:33:04 -07:00
evykassirer f393f35e1b message_edit: Rename message list to specify it holds message ids. 2024-08-19 16:33:04 -07:00
evykassirer bcb5c664ac message_edit: Add missing required attribute for StreamWildcardOptions. 2024-08-19 16:33:04 -07:00
Alya Abbott 97707ae9e2 help: Tweak keyboard navigation docs for combined and DM feeds. 2024-08-19 16:14:01 -07:00
Sahil Batra 3dc82eed57 user_groups: Refactor code to compute user group objects.
This commit refactors code in user_groups_in_realm_serialized
such that we do not prefetch "can_mention_group__direct_members"
and "can_mention_group__direct_subgroups" using prefetch_related
and instead fetch members and subgroups for all groups in separate
queries and then use that data to find the members and subgroups
of the group used for that setting.

This change helps us in avoiding two prefetch queries for each
setting when we add more group settings.
2024-08-19 15:41:55 -07:00
sujal shah a892f06cb5 help: Document "Share someone's profile".
Adds instructions regarding how to copy the user profile URL.

Fixes #31093.
2024-08-19 15:10:29 -07:00
roanster007 e22a0c7f73 user_group_settings: Disable dropdown if no permission to update it.
Previously, even when a user doesn't have permission to edit
a user group, the dropdown for the group permission settings
was not disabled, and is possible for a user to change the values.

This commit disables the dropdown of the user group permission
settings, in case user doesn't have permission to edit the settings.
2024-08-19 10:28:59 -07:00
roanster007 fc5a5c7113 dropdown_widget_label: Add wrapper around `dropdown_widget`.
This commit adds a wrapper around the "dropdown_widget" of
"dropdown_widget_label".

This wrapper is primarily added so as to be able to show tippy
tooltips over the dropdowns in case they are disabled, since
we can not assign tippy instances to disabled buttons.
2024-08-19 10:28:59 -07:00
afeefuddin e746c8899b user_profile: Set original_values in show_user_profile. 2024-08-19 10:16:15 -07:00
Prakhar Pratyush 2406a3feea streams: Update do_change...retention_days to send event on commit.
Earlier, we were using 'send_event' in
do_change_stream_message_retention_days which can lead to a situation
where we enqueue events but the function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush a9af1c0ce2 streams: Update do_change_stream_description to send event on commit.
Earlier, we were using 'send_event' in do_change_stream_description
which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush e474ab7ee0 streams: Add transaction.atomic decorator to 'do_rename_stream'.
This commit updates the 'do_rename_stream' action function
to make the db operations atomic.

Also, send_event is replaced with send_event_on_commit.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 69dec9dbc6 streams: Update 'do_change_stream_post_policy' to send event on commit.
Earlier, we were using 'send_event' in do_change_stream_post_policy
which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 41d947b89d streams: Make db operations in do_change_subscription_property atomic.
This commit adds a transaction.atomic decorator to the
'do_change_subscription_property' function to make
the db operations in the action function atomic.

Also, send_event is changed to send_event_on_commit.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 5d0b3d1a6d muted_users: Update 'do_unmute_user' to send event on commit.
Earlier, we were using 'send_event' in 'do_unmute_user'
which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 3b9a21443a muted_users: Update 'do_mute_user' to send event on commit.
Earlier, we were using 'send_event' in 'do_mute_user' which
can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 9026e6ecc1 message_flags: Update 'do_update_message_flags' to send event on commit.
Earlier, we were using 'send_event' in do_update_message_flags
which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 32a4a112b1 message_flags: Update do_mark_muted_user...read to send event on commit.
Earlier, we were using 'send_event' in
'do_mark_muted_user_messages_as_read' which can lead to a
situation where we enqueue events but the function fails at a
later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 62eb850423 message_flags: Update transactions to be durable in do_mark_all_as_read.
In 'do_mark_all_as_read', the transactions which mark the messages
as read in batches should be marked as durable to avoid addition
of any outer atomic block as we support marking a few batches
(not all messages) as read in the case of a timeout.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 64beea2765 message_flags: Update 'do_mark_stream...read' to send event on commit.
Earlier, we were using 'send_event' in do_mark_stream_messages_as_read
codepath which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00