Commit Graph

62144 Commits

Author SHA1 Message Date
opmkumar
7c53e8c90b compose: Replace $("textarea#compose-textarea") with $textarea.
Replaces the $("textarea#compose-textarea") selector with $textarea in
the `check_overflow_text` and `validate_message_length` functions. This
change allows $textarea to be modified in future commits to also support
the edit-message UI.
2024-12-04 11:44:51 -08:00
opmkumar
aac07e913b compose: Rename function set_message_too_long.
Renames function `set_message_too_long` to
`set_message_too_long_for_compose` in `compose_validate.ts`.
2024-12-04 11:44:51 -08:00
opmkumar
0055633002 css: Add general class names for improved extensibility.
Adds general class names in `compose.hbs` so that these elements can be
more easily expanded for use in the edit message UI as well. These
classes will be used in the `check_overflow_text` function of
`compose_validate.ts`, allowing this function to handle both the edit
message UI and compose box UI.
2024-12-04 11:44:51 -08:00
opmkumar
f2e30f4354 css: Refactor border colors for .new_message_textarea.over_limit.
This change moves the border color for `.new_message_textarea.over_limit`
to CSS variables.
2024-12-04 11:44:51 -08:00
Alya Abbott
5d710ec4c5 portico and help: Link to guide to choosing a team chat app.
Also reorder other links, and adds Why Zulip to help center nav.
2024-12-04 11:39:12 -08:00
Anders Kaseorg
7143e6910d test_classes: Refine assert_json_success output with exception chaining.
Now a failure from assert_json_success and friends shows the full
server-side traceback from the JsonableError that caused the failure,
not just the test-side traceback for `AssertionError: 400 != 200 :
{message}`.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-04 11:38:45 -08:00
Sahil Batra
3319a192d4 realm: Allow various settings to be set to "Nobody" group.
We now allow setting following settings to "Nobody" group -
- can_add_custom_emoji_group
- can_create_groups
- can_create_public_channel_group
- can_create_private_channel_group
- can_delete_any_message_group
- can_delete_own_message_group

We are fine with nobody having these permissions as there
will be no major challenges for working of the organization
with these settings and admins anyways will always have
permission to change these settings.

Fixes #32401.
2024-12-04 11:15:18 -08:00
Sahil Batra
b675e95695 stream-settings: Allow nobody group for can_remove_subscribers_group.
We can allow nobody group since admins always have permission to
remove subscribers.
2024-12-04 11:15:18 -08:00
Sahil Batra
367a0bdbff groups: Remove id_field_name field from GroupPermissionSetting.
id_field_name was being used only to set the initial dummy
values for realm settings. We can directly add "_id" to the
setting name instead of having an extra id_field_name field.
2024-12-04 11:15:17 -08:00
Sahil Batra
121df45cc4 groups: Remove allow_owners_group field from GroupPermissionSetting.
As we now allow anonymous groups and settings can be set to any
set of users, there is no benefit in not allowing a setting to
be set to "Owners" group.
2024-12-04 11:12:28 -08:00
Sayam Samal
a8146916aa buttons: Add redesigned button styles.
This commit adds the redesigned button styles to the codebase along with
with a storybook-style page in `/devtools/buttons` to view and test the
redesigned button component.

The redesigned button component, uses the `action-button` class to
follow Zulip's no-abbreviation policy, and to avoid conflicts with the
pre-existing `button` and bootstrap `btn` classes.

A button using the new redesigned styles, required two classes,
  - First, the base `action-button` class which defines the structure
  and behavior of the button.
  - Second, a modifier class like `action-button-primary-neutral` which
  defines the styles for the particular action button type.
2024-12-04 11:08:33 -08:00
Shubham Padia
7e92c2ad16 streams: Use can_administer_channel_group to administer channel.
Fixes #31959.
2024-12-03 18:38:25 -08:00
Shubham Padia
75d994f5b4 streams: Use can_administer_channel_group for checking permissions.
We're not using OrganizationAdministratorRequiredError anymore and the
new error message will be `Insufficient Permission`.
2024-12-03 18:38:25 -08:00
Shubham Padia
4b3d1a5aac streams: Creator should be able to administer new channels.
There are cases when importing from slack where the stream creator can
technically be none, that is why we have named the default group string
to `stream_creator_or_nobody`. If stream creator is not present, we
default back to nobody. See
https://chat.zulip.org/#narrow/channel/3-backend/topic/Default.20can_administer_channel_group.20for.20imported.20realms/near/1983634
for mode details.
2024-12-03 18:38:25 -08:00
Shubham Padia
eb943d54a9 streams: Add can_administer_channel_group as a stream setting.
We have not added current user as the default for new channels in this
commit.
2024-12-03 18:38:25 -08:00
Pratik Chanda
44b498f96b user_profile: Add tooltip to user group remove button when disabled.
This commit adds a tooltip to disabled buttons which lists subgroups
user is part of.

Fixes: zulip#32487.
2024-12-03 17:18:27 -08:00
Pratik Chanda
16e9099015 user_profile: Add remove button to each group row in groups tab.
Earlier, only group name were shown in user profile groups tab.

This commit adds a remove button to each group row if current user
has permissions to remove the user from groups.

Fixes part of zulip#32487.
2024-12-03 17:18:27 -08:00
Pratik Chanda
6635b0edf6 user_profile: Update user_groups_list_widget on member_edit events.
This commit stores and updates user_groups_list_widget on member
edit events on any group member updates.
2024-12-03 17:18:27 -08:00
Pratik Chanda
873652ee27 user_group_edit: Refactor handle_member_edit_event.
This commit refactors handle_member_edit_event for group overlay
settings to its own separate function.
2024-12-03 17:18:27 -08:00
Alya Abbott
4fcc087430 help: Rename user list sections according to UI changes. 2024-12-03 14:13:06 -08:00
Alya Abbott
ed40bad43f help: Document that users can be shown with avatars. 2024-12-03 14:13:06 -08:00
Alya Abbott
946a8067be portico: Document flexible permissions on /for/X pages. 2024-12-03 10:41:54 -08:00
Alya Abbott
217d17143f portico: Document new permissions capabilities. 2024-12-03 10:41:54 -08:00
Alya Abbott
c9d0192da0 portico: Minor styling fix. 2024-12-03 10:41:54 -08:00
Kislay Verma
dfc1ea785f markdown: Support message link syntax in local echo.
This is a followup to #31965 where we added
support for a new syntax for message links.
The frontend markdown processor didn't local
echo the syntax properly, resulting in a
rendering glitch in the messages.
2024-12-03 10:41:37 -08:00
Kislay Verma
c56cc14539 marked: Fix typo in guard clause.
Before calling streamTopicHandler, we ensure
that it is a function.
2024-12-03 10:41:37 -08:00
Lauryn Menard
35215d2d29 help: Document how to configure the user list style. 2024-12-03 10:32:18 -08:00
Lauryn Menard
76bd6e2d62 support: Get plan data without making end of billing cycle updates.
Updates get_plan_data_for_support_view to get the latest ledger entry
directly instead of calling make_end_of_cycle_updates_if_needed so
that viewing a support page doesn't trigger any changes to the
current and scheduled plans.
2024-12-03 10:30:35 -08:00
Lauryn Menard
a0562593b3 stripe: Update next_invoice_date for current logic of monthly invoices.
Updates next_invoice_date since, as of commit caba57fe1e, we no
longer consider the plan's billing schedule (annual or monthly)
when invoicing for additional licenses.
2024-12-03 10:17:28 -08:00
Niloth P
661e5c284e integrations: Update example screenshot for Jotform. 2024-12-02 18:08:58 -08:00
Niloth P
e731fb9eba integrations: Fix Jotform integration by accepting form-data payloads.
This does not add support for files.

Fixes part of #32460.

Co-authored by: PieterCK <pieterceka123@gmail.com>
2024-12-02 18:08:58 -08:00
Niloth P
2942a44224 test_classes: Support multipart/form-data content-type for webhooks.
Webhooks use "application/json" as the default content-type in
`check_webhook`, so the content-type will never be None when it reaches
`client_post`.
2024-12-02 18:08:58 -08:00
Niloth P
a0a1f55965 screenshot webhooks: Add support for multipart/form-data fixtures.
Add a common function for webhooks to convert multipart strings to dict.
This facilitates loading a multipart/form-data fixture as a file string,
and converting it.

This will allow testing integrations that use multipart/form-data,
and generating their example screenshots using a script.

Note that this only supports text fields, accommodation for binary files
is not included at the moment.
2024-12-02 18:08:58 -08:00
Niloth P
f99e1a5dba integrations: Improve message formatting for Jotform. 2024-12-02 18:08:58 -08:00
Shubham Padia
c57db30909 user_group: Confirm before joining a group they're part of via subgroup.
Fixes #32484.
2024-12-02 17:59:18 -08:00
Shubham Padia
bf73e1711d user_group: Disable leave checkmark if user isn't a direct member.
If the user is not a direct member, but a member via a subgroup, we will
show the list of subgroups beloging to that group which the current user
is a direct member of in a tooltip. The cursor on the checkmark will be
default in this case instead of a pointer.
2024-12-02 17:59:18 -08:00
Shubham Padia
8a28b31be3 user_group: List groups that a user is associated via subgroups.
In `Group settings` -> `Your groups` and `User Profile Popover` -> `User
groups`, we only listed groups that a user was a direct member of. Now,
we will also list groups that a user is not a direct member of, but
associated via a subgroup.
Fixes #32486.
2024-12-02 17:59:18 -08:00
Shubham Padia
c49c7a534f user_group: Show join group button if user is not a direct member.
We would show the leave group button if user was a member either
directly or via a subgroup. But that button is only applicable for
adding/removing a direct membership, so we will show the join group
button if the user belongs to a group via subgroup and not by direct
membership.
2024-12-02 17:59:18 -08:00
Shubham Padia
a491b83b79 user_group: Don't open edit panel on remove members.
When the current user was part of a group through both subgroup and a
direct membership, leaving the group would only remove the direct
membership. But since the user is part of the group through subgroup,
`is_user_in_group` will be true inside `handle_member_edit_event` which
should only be triggered when a user is on another group edit panel and
they join a group via the left panel plus button. In that case, the edit
panel of the newly joined group should open.
Instead of handling this on event, where we could not tell who triggered
the event, the current user or someone else, we now handle this in the
success callback of `add_or_remove_from_group`.
Fixes https://chat.zulip.org/#narrow/channel/9-issues/topic/group.20panel.20error/near/1987891
2024-12-02 17:59:18 -08:00
Sahil Batra
513b8aabb5 help: Mention "Who can remove members from this group" setting.
Fixes #25943.
2024-12-02 17:38:46 -08:00
Sahil Batra
da02135f88 group-settings: Use new setting for controlling removing members. 2024-12-02 17:38:46 -08:00
Sahil Batra
07f17af267 user_groups: Use new can_remove_members_group setting.
Permission to remove members from group is now controlled
by can_remove_members_group setting.
2024-12-02 17:38:46 -08:00
Sahil Batra
7e6a02b82d user_groups: Add setting to control who can remove members.
This commit adds a new setting to control who can remove
members from the group.
2024-12-02 17:38:44 -08:00
Sahil Batra
3c97fbd646 tests: Refactor tests for group permission settings.
This commit refactors test such that we can test functions
used for different group permissions without duplicating
too much code.
2024-12-02 17:29:56 -08:00
Sahil Batra
819ab3989e groups: Enable joining group if user can add members.
We already allow a user to join the group if they can add members
to that group in the API, but it was not allowed in the UI. This
commit fixes the UI.
2024-12-02 17:29:56 -08:00
Sahil Batra
0f3d459d58 streams: Minor optimization in get_setting_values_for_group_settings.
Return early without doing membership query when there are no
anonymous groups.
2024-12-02 17:29:56 -08:00
Sahil Batra
1586824322 invite: Fix placeholder for pill inputs.
Placeholders for channels and groups pill inputs are updated
to "Add channels" and "Add user group" to maintain consistency.
2024-12-02 17:13:01 -08:00
Pratik Chanda
237aaf055e css: Fix overflow in channel dropdown widget in user profile.
This commit fixes the channel name overflow in dropdown widget after
selecting a long channel name and abbreviates the channel name.
2024-12-02 17:12:17 -08:00
Niloth P
53ece78de7 jenkins: Remove the secondary line text with its former name "Hudson". 2024-12-02 17:06:33 -08:00
Niloth P
40288b729c svn integration: Use "Subversion" as the display name. 2024-12-02 17:06:33 -08:00