Commit Graph

64498 Commits

Author SHA1 Message Date
Alya Abbott
1dcda2ba9d settings: Change button intents on account & privacy panel. 2025-05-01 16:25:16 -07:00
Lauryn Menard
a7718c0548 demo-orgs: Update convert form text to be clearer. 2025-05-01 12:23:38 -07:00
Lauryn Menard
6d7bff4a16 create-realm: Simplify organization name field on new org form.
Removes the placeholder text and hint. Adds a link to the help
center article about creating your organization profile.

Fixes #34496.
2025-05-01 12:00:56 -07:00
Karl Stolley
18b2427937 bootstrap: Rescue decoupled app, portico alert styles. 2025-04-30 10:26:20 -07:00
Karl Stolley
0c07bf79f1 bootstrap: Clean up .close references.
Removing `.alert` from the dark theme seems acceptable,
as there is nowhere in the codebase we're setting a
`text-shadow` value that would require `none` here.
2025-04-30 10:26:20 -07:00
Karl Stolley
d7102f7443 compose: Remove unused .close class.
This is probably a vestige of Bootstrap, but there are
no meaningful styles or behaviors attached to this class.
2025-04-30 10:26:20 -07:00
Lauryn Menard
e69074e5a5 demo-orgs: Update tooltip for disabled personal email access setting. 2025-04-30 10:16:30 -07:00
Karl Stolley
9ae704510f org_settings: Correctly display long channel names. 2025-04-30 10:16:01 -07:00
Aman Agrawal
3cf4251944 registration: Only add realm creation context if form is for that. 2025-04-30 00:06:43 -07:00
Aman Agrawal
5d4142e056 realm_creation_form: Capture import_from if realm import enabled.
We store user's preference for `import_from` to be acted upon in
later commits.
2025-04-30 00:06:43 -07:00
Aman Agrawal
80e76d24e9 create_realm: Show import text only if automated import is disabled.
This helps preserve the original form in production.

The new "Import from" option button allows user to automate the
process, so this is not required in that case.
2025-04-30 00:06:43 -07:00
Aman Agrawal
b68479f623 tusd: Support None value for MAX_WEB_DATA_IMPORT_SIZE_MB.
Adds support for `None` and defines how different values will be
used in `prod_settings_template.py`.
2025-04-30 00:06:43 -07:00
Aman Agrawal
5a5660fcbf tusd: Use upload failure message similar to one in compose upload. 2025-04-30 00:06:43 -07:00
Anders Kaseorg
b248e2d931 tests: Assume failure in case the async task vanishes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-29 13:42:40 -07:00
Karl Stolley
16ac3c019a left_sidebar: Correct for bleedthrough on zoomed-in channel. 2025-04-29 13:26:46 -07:00
Lauryn Menard
af2a9cd0e0 showroom-banners: Update demo org banner for current design.
Updates the example banner in the devtools banner design page
for the changes to the demo organization banner.

This removes all uses of the banner-link class, but we keep the CSS
rules, since they're part of a component we may use elsewhere.
2025-04-29 12:25:28 -07:00
Lauryn Menard
fb3a48415c navbar-alerts: Update demo org banner to use buttons, not links.
Updates the navbar alert banner for demo organizations to have
buttons that align with the general bannner design.

All users have a button that opens the help center article about
demo organizations. Demo organization owners have an additional
button that opens the modal to convert a demo organization into
a permanent organization.

Part of #34447.
2025-04-29 12:25:28 -07:00
Lauryn Menard
a876addb6e demo-orgs: Separate event listeners from convert org modal.
Updates handle_demo_organization_conversion to only set up the
event listeners for the current convert organization banner in
the organization settings overlay for admins.

Moves code for launching the modal to convert the demo organization
to a permanent organization to do_convert_demo_organization.

Prep for adding a button to the navbar alert banner for demo
organization owners that will also launch the modal to convert
the organization.
2025-04-29 12:25:28 -07:00
Lauryn Menard
d732a7b801 demo-orgs: Move helper function to get days remaining until deletion.
Moves the get_demo_organization_deadline_days_remaining helper from
"web/src/navbar_alerts.ts" to "web/src/demo_organizations_ui.ts".

Prep commit for updating the navbar alert for demo organization to
have a button that opens the modal for converting the organization
to a permanent organization.
2025-04-29 12:25:28 -07:00
Karl Stolley
a9e3331fcc page_loader: Correct clipped logo circle. 2025-04-29 11:36:54 -07:00
Sahil Batra
52b20354e6 message_view: Live update on losing access to a stream.
This commit adds code to live update the message view when
user loses access to a stream and also remove the data of
messages from that stream.
2025-04-29 09:46:19 -07:00
Evy Kassirer
3383a69088 people: Remove stray console.logs that made it into main.
Introduced in 51d382f717.
2025-04-29 09:40:57 -07:00
Lauryn Menard
8d8ebaf842 demo-orgs: Update tooltip text for disabled manage API key button.
Part of #34447.
2025-04-29 09:40:24 -07:00
Lauryn Menard
7d813e2836 demo-orgs: Update note about updating name in add email modal.
Instead of using the "tip" formatting for the note suggesting
updating the name for the owner's account before inviting other
users, to be just normal text at the top of the modal.

Part of #34447.
2025-04-29 09:39:52 -07:00
Lauryn Menard
edec7cd0e0 invite-modal: Render banners for non-demo orgs and admin users only. 2025-04-29 09:39:24 -07:00
Lauryn Menard
7b5f629698 demo-orgs: Expand note about demo organizations in Welcome bot DM.
Part of #34447.
2025-04-29 09:33:46 -07:00
Sahil Batra
160670e193 settings: Refactor code for subscribers and members pill widget.
Instead of having two separate "create_without_add_button" and
"create" functions for handling creation and editing UI, this
commit updates code to use only "create" function with a
parameter passed to determine whether we want "Add" button with
the widget or not.
2025-04-29 09:29:50 -07:00
Sahil Batra
1adf3cd3f6 add_group_members_pill: Refactor create_item_from_text.
The functions to create stream and group pill were called
twice, so this commit fixes it.
2025-04-29 09:29:50 -07:00
Sahil Batra
c1dfe0474c groups-ui: Fix expand button not showing in group creation UI.
Button for expanding group pill was not shown in group creation
UI if the pill was created not being selected from the
typeahead.
2025-04-29 09:29:50 -07:00
Niloth P
ec6506c643 integration-docs: Clarify the download-python-bindings macro.
Replaced "server" with "system" so that the macro can be used with all
integrations with integration scripts, irrespective of whether it needs
to be run from a server or a user's machine.

Replaced "bot" with "integration script" to ensure that the integration
script is not confused with the Zulip bot user that is created using the
UI in the instruction above this instruction.
2025-04-29 09:27:37 -07:00
Harsh
bc9e6e13bb message-list-view: Use specific header for DM conversation with self.
For the DM conversation with the current user, use "Messages with
yourself" for the message header bar and tooltip.

Fixes #33321.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Harsh
bdf2317b40 filter: Use specific title for DM conversation with self.
For the DM conversation with the current user, show "Messages with
yourself" for the title, which is determined by the filter for the
message list view.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Harsh
20e3262233 sidebars: Show "(you)" after user's own name in user lists.
Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Harsh
57ce1371a8 drafts: Use specific text for DM conversation with self.
Adds "You" and "Drafts from conversations with yourself" as
labels in the drafts overlay for the DM conversation with
the current user.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Harsh
c8763f919f compose-closed-ui: Use specific button label when composing to self.
When the compose box is closed, if the selected message is for the
direct conversation with the current user, then we show "Message
yourself" as the compose reply button text.

Adds `decode_dm_recipients_user_ids_from_url` helper function to
hash_util, which parses a narrow URL for DM recipient user IDs.
Checks that "dm" operand, which should be a string of user emails,
also passes the check for all the email addresses being valid
compose recipients.

Co-Authored-By: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Harsh
5caf1f9e71 compose-box: Add specific placeholder text for DM with self.
When the current user opens the compose box to send a DM to
themself, use "Message yourself" as the placeholder text when
the compose box is empty.

Adds `is_direct_message_conversation_with_self` as a helper
function to people.ts that checks a list of user IDs to see
if it only contains the current user's ID. This function is
useful for additional parts of the web app UI where we want
to show a distinct message/text for this case.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Lauryn Menard
64cb3769ce drafts-test: Fix test data for direct message drafts.
The draft values for private_message_recipient and reply_to should
be set to the same string of comma separated email addresses.
2025-04-28 20:50:51 -07:00
PieterCK
a228699108 slack_incoming: Use Slack text reformatters from data import.
This commit updates the Slack incoming webhook endpoint to use the same
Slack reformatting functions (`convert_to_zulip_markdown` and
`replace_links`) that are used for Slack data import and cleaning up any
duplicative functions.

This was previously not possible because the Slack reformatting regex in
`slack_message_conversion.py` could not handle these cases:

- Formatting applied to non-ASCII characters (e.g., emoji).

- Formatted strings separated by exactly one character.

- Formatted strings appearing immediately after a new line.

Fixes part of #31162.
2025-04-28 20:49:10 -07:00
PieterCK
c018911c5b slack_regex: Fix overlapping capture groups.
The Slack text regexes match specific characters before and after the
formatted string to ensure that they only match at word boundaries.

However, because the capture groups consume each matching character,
including the characters used to determine word boundaries, two
formatted strings separated by a single matching character result in one
string not being matched, as the trailing whitespace is already
consumed and cannot also match as the leading pre-match whitespace for
the next character.

Switch to a look-ahead regex for the trailing word boundary
characters. This is zero-width, and as such the next match can still
also consume the same characters.

This also fixes Slack webhook integrations'
`test_message_with_complex_formatted_mentions` which was previously
expecting false output.

Fixes part of #30827.
2025-04-28 20:49:10 -07:00
PieterCK
cfeb4ba731 slack_regex: Simplify Slack regex main capture group.
The inner capture group of Slack text regex is used to capture the
formatted text, so basically all characters but the formatting
characters like *, ~, and _.

It currently does this by specifying a range of characters to be
captured except the formatting characters. This unintentionally excluded
non-ASCII characters like emoji.

This commit simplifies the inner capture groups of the Slack text regex
to explicitly exclude formatting characters (e.g., *, ~, _) instead of
using an allowlist to not include them.

This change is part of the effort to make `convert_to_zulip_markdown`
compatible with output from `render_blocks` and `render_attachments`,
which may contain emoji.
2025-04-28 20:49:10 -07:00
PieterCK
ee34ccb8c2 slack_regex: Remove unnecessary inner capture group.
The inner capture groups of the Slack text regex tries to captures the
formatted string. For an unclear reason, we're currently using two
similar capture groups despite the fact that only using the second
capture groups would suffice.

This removes the first capture groups.
2025-04-28 20:49:10 -07:00
PieterCK
8992435caf slack_regex: Update Slack regex handle multiline strings.
This prep commit modifies the Slack text regex in
`slack_message_conversion.py` to use the `re.MULTILINE` flag capture
formatted strings that are adjacent to newline or end of line.

These kinds of strings are likely not uncommon to be generated by Slack
exporter itself and our Slack message block and attachment formatters
(`render_blocks` and `render_attachments`) also produces them.

This also fixes Slack webhook integration's
`test_message_with_complex_formatted_texts` which was previously
expecting false output.

Fixes part of #30827.
2025-04-28 20:49:10 -07:00
PieterCK
6c1818fa46 slack_regex: Avoid replacing all identical matches.
In `convert_markdown_syntax`, `re.finditer` is used to iterate over each
`match` found in the `text`. In each iteration, we create the Zulip
formatting equivalent of the current `match` and do a `text.replace()`
to replace all strings in `text` that matches the current `match`.

Since we're planning to add the `re.MULTILINE` flag to `re.finditer`, it
would be problematic if the first and last capture group of `match` are
zero-width characters (newlines). This is because
`convert_markdown_syntax` would reformat all identical strike-through
and bold formatted strings as many time as there are identical `match`es
of them.

Consider the following:
---
 original text: "*foo*\n*foo*"

 1. <re.Match object; span=(0, 5), match='*foo*'>
    1st replace -> "**foo**\n**foo**"

 2. <re.Match object; span=(6, 11), match='*foo*'>
    2nd replace -> "***foo***\n***foo***"
---

This commit uses `re.sub` instead of `re.finditer`, which does replace
operation only on the specific piece of the original text the `match` is
from.
2025-04-28 20:49:10 -07:00
PieterCK
946e4096fc slack_regex: Refactor how the capture groups are defined.
This updates the patterns to use a more unicode-aware pattern for their
first and last capture groups. The new patterns have the same
behaviours, but they're expressed in a more coherent way.

For example, the existing patterns lists what characters to look for,
skipping ceratin characters it don't want to match (e.g, closing
brackets & quote are skipped). The new pattern narrows down what it
looks for (whitespace, punctuation, symbols) and explicitly list what it
don't want to match (closing quote and bracket, etc).

This also refactors the `convert_markdown_syntax` to use the `regex`
module instead of the `re` module because the `regex` module has full
unicode support.
2025-04-28 20:49:10 -07:00
PieterCK
f33c5b9c1e slack_regex: Fix wrong comments. 2025-04-28 20:27:28 -07:00
Sumit Bhanushali
facbdf08fc integrations: Handle approval/unapproval for GitLab MRs.
Fixes: #34222
2025-04-28 20:26:29 -07:00
Harsh
0b3f0273e6 utils: Fix decode_stream_topic_from_url to pass origin to construct url. 2025-04-28 20:25:15 -07:00
Greg Price
4374ee403d push_notifs: In dev, use EXTERNAL_HOST directly as bouncer
The `push.{EXTERNAL_HOST}` formula effectively assumes that the host
in EXTERNAL_HOST is zulipdev.com -- it's relying on the fact that
push.zulipdev.com is in DNS as an alias of zulipdev.com.  That's a
special fact that wouldn't be true of most hostnames.

It especially isn't true of IP addresses.  If one has set
EXTERNAL_HOST to a value like `192.168.0.2:9991` -- for example in
order to reach the dev server from a separate machine, such as a
physical mobile device:
  https://github.com/zulip/zulip-mobile/blob/main/docs/howto/dev-server.md
then setting ZULIP_SERVICES_URL to `http://push.192.168.0.2:9991`
is definitely not going to work.  For example:
  https://chat.zulip.org/#narrow/channel/243-mobile-team/topic/notifications.20from.20dev.20server/near/2159863

In the dev server, the point with ZULIP_SERVICES_URL is that it
should point back to the same dev server.  So use a formula that
says that more directly and so more reliably.

Tests are a different matter: we want a distinct URL there, because
we'll be inspecting the URLs in requests.  But in tests there's also
no requirement that the two hosts have anything to do with each
other; so the existing formula is fine there, and keep it in place.

(In tests it'd probably be better to use proper RFC 6761 test
domains, like `chat.example.com` and `push.example.net`.  But
that's an independent question.)
2025-04-28 20:24:05 -07:00
Mateusz Mandera
1eecbad381 ldap: Fix the syncing of user role via AUTH_LDAP_USER_FLAGS_BY_GROUP.
This was broken, due the mechanism simply using our
is_guest/is_realm_admin/etc. role setters, but failing to adjust system
group memberships - resulting in corrupted database state.
We need to ensure that change_user_role is called for setting user role.

There are two relevant codepaths that run the sync based on
AUTH_LDAP_USER_FLAGS_BY_GROUP and thus need to get this right:
1. manage.py sync_ldap_user_data
2. Just-in-time user creation when a user without a Zulip account logs
   in for the first using their ldap credentials. After
   get_or_build_user returns, django-auth-ldap sees that the user
   account has just been created, and proceeds to run ._populate_user().

Now that both user.save() and do_change_user_realm will be getting
called together, we need to ensure this always happens atomically.

This imposes the need to override _get_or_create_user to put it in a
transaction. The troublesome consequence is that this new
`atomic(savepoint=False)` causes the usual type of issue, where tests
testing error get their transaction rolled back and cannot continue
executing.

To get around that, we add a test helper
`artificial_transaction_savepoint` which allows these tests to wrap
their problematic blocks in an artificial transaction which provides a
savepoint, thus preventing the full test transaction rollback derailing
the rest of the test.
2025-04-28 17:44:56 -07:00
Mateusz Mandera
4dd1826532 ldap: Fix dev/test-specific bugs with AUTH_LDAP_USER_FLAGS_BY_GROUP.
Without these overrides, we cannot test the functionality in DEVELOPMENT
and TESTING.

There are two codepaths that we're covering here:
1. The sync which happens via `sync_ldap_user_data`.
2. The sync which happens during just-in-time user creation upon first
   login via ldap.

Both codepaths end up triggering ldap_user._get_or_create_user().
2025-04-28 17:44:56 -07:00