We have added an ability to partially load subscribers,
and this function name makes it more clear what it returns,
in contrast to an upcoming `get_full_subscriber_set`.
This was added in b387ca4, before we had
`buddy_list.update_empty_list_placeholders`
Now it's not only duplicating that functionality, but will soon
maybe run at the wrong time once the buddy list `populate` starts
making `void` calls to `async` empty list placeholder code.
This commit
- Replace the blank option with an italicized option that's the current
default language, if there is one selected with "default" label.
- Make the "text" option more informative by adding (no highlighting)
to the label.
- Remove the hint for "text".
- Prioritize as left to right, before start typing:
blank/default language, text, quote, spoiler, math, everything else...
fixes: #33682
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>
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>
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>
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>
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>
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.
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.
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.
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.
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.
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.
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.