Previously, the client tweaked messages sent in a channel with
an empty topic box to use the topic "(no topic)".
This commit updates the behavior to stop applying that tweak.
Messages will now be sent with an empty string as the topic
as we now support the empty string as a valid topic name.
This commit adds `allow_empty_name: true` to the following
endpoints to receive empty strings as topic name when such
topics are available:
* `GET /messages`
* `GET /messages/{message_id}`
* `GET /messages/{message_id}/history`
Also, it adds `empty_topic_name` client capability for spectators.
These changes are part of the broader effort to enable
support for empty string as a topic name.
Since Zulip channel and topic names cannot
contain newlines, we should not show channel
or topic suggestions if the `#**stream>topic`
syntax is spread across multiple lines.
So we tweak the regexes to exclude \n.
We do not need to change the regexes in `marked.js`
or `markdown/__init.py__` since
the message text is already split at newlines
before being matched against those regexes,
so a newline will never be present during matching,
both in the frontend and the backend.
This commit simplifies a compose_validate test by
using FakeComposeBox.
It also exposes $send_message_form to the callers.
(The general idea here is that for any individual
test, we don't want the developer to have to
switch between thinking about low-level zjquery
idioms and higher-level abstractions.)
This commit also removes the use of mock_template,
since the template in question generates trivially
easy html to deal with (and we verify the actual
effects to the DOM).
Within FakeComposeBox I **mostly** want to keep the code
concrete (using explicit selectors), but these two
concepts are an exception to that rule:
content textarea
preview message area
In particular, for the DOM element that is the textarea
where you compose your message in markdown (i.e. the
main edit area), the real code has different ways of
expressing that in jQuery.
Since the content area is a singleton on the entire page,
a lot of code sensibly does an id search for the element.
There are some other pieces of code that do another
sensible thing, which is to search for the DOM element
within the container by the class name of .message-textarea.
This aliasing may cause some headaches down the road
for testing, but this commit should make it a little
easier to work around that in the future.
For now compose_helpers only includes FakeComposeBox.
I don't love either of the names, but some of the alternatives
that I thought of have their own tradeoffs.
The compose_helpers module will soon have other
helper classes or functions in it, possibly including
the mock_banners helper from lib/compose_banner.
I don't want to step on mock_banners yet, because
I have two possible plans for improving that code,
and I haven't decided what's best yet, so for now
I don't want to step on it or move it, so I am
just leaving that alone for now.
Gotta start somewhere.
We now allow users to create voice calls when their call provider is
BigBlueButton. This is done by creating a call where cameras are
disabled for all participants in the call -- a voice call, and making
only the call creator the moderator, so no one else can switch a voice
only call to a video call.
Also, we stop using the deprecated fields "attendeePW" and "moderatorPW"
in the Big Blue Button API, and use "role" instead.
The side effects are that now we only support BigBlueButton 2.4 and
above, and that only the call creator is a moderator and all other
joinees are viewers for all BigBlueButton calls.
Fixes: #26550.
Most of the code for the integration was written by Nehal.
Apoorva made the changes that resolve conflicts which were
introduced because of the `typed_endpoint` decorator.
With some documentation tweaks by tabbott.
Co-authored-by: Apoorva Pendse <apoorvavpendse@gmail.com>
This commit replaces the spectrum color picker used in the stream
popover and stream settings with a custom color picker popover, which
contains a grid of predefined color swatches and a custom color option.
The custom color option uses the HTML5 <input type="color"> which shows
the native browser color picker UI.
Fixes#14961.
This is a bit of an emergency fix to fix the build, but
it is probably close to what we want.
Any test that cares about the height of the compose box
can probably override this behavior. Likewise for any
css calls.
Previously, inserting a bulleted or numbered list via the compose
box added an extra blank line before and after the list.
This commit removes the extra blank line inserted before the list.
Fixes#32607.
This commit includes the following changes:
- The email field is now a disabled text field.
- An "Edit" (pencil) button is added next to the email
field, which opens the change email modal.
- The "Edit" button is not shown if the user doesn't
have permission to edit their email.
- When email changes are disabled, the "email changes are
disabled" tooltip now appears over the email field, which
previously appeared to the right of the email field.
- Refactor `settings_org.test.cjs` to align with the changes
of the added "Edit" button.
Fixes#31975.
This commit includes the following changes:
- Use a regular text cursor in place of a pointer cursor for the
"Email" field label when the email changes are disabled.
- Implement tests to verify the above changes made.
This commit includes the following changes:
- Use a regular text cursor in place of a pointer cursor for the
"Name" field label when the name changes are disabled.
- Introduce a class named `cursor-text` that sets the property
`cursor: text;`.
- Implement tests to verify the above changes made.
The old function name sounded like you were entering
preview mode when, in fact, hitting the enter key
in some cases **exits** you from preview mode.
This was particularly confusing to read in the tests.
These never happen in practice since util is near the
end of the alphabet, but if you had run the tests in
reverse order, you would have seen this leak.
This leak was introduced in the efb2a5a38d commit.
We re-require templates.ts before testing each
new test module during the node tests.
This makes it so that if we make mocks in two
different tests, where such mocks influence
how the Handlebars helpers work, then both
tests will have registered their own copies
of the Handlebars helpers.
In general we want to mimimize the amount of setup at the top
of a test module and just let individual tests explicitly
mock what they need to mock.
The `override` helper has the advantage that it avoids dead
code. For example, if the way we invoked the list widget
here no longer required sorting, the unit tests would complain
about the crufty override, whereas the previous code doesn't
really have that kind of future-proofing.
We now just do the following in the mocking:
- capture which items are passed into the list
widget
- simulate the call to modifier_html to exercise
the template rendering
This commit introduces a banner on the "Start Export" modal
to notify the admin that their personal setting to export
private data is not toggled ON.
The banner is shown when the 'Export type' is 'Standard' and
admin's personal setting to export private data is not toggled ON.
The banner ensures admins are aware their private data will
not be exported unless they enable the respective setting.
Updates the invite modal so that if the custom input is 0, the
submit button is deactivated, since an email invitation or invite
link that immediately expired would be unusable.
Also, updates the custom input to show 0 if a user navigates away
from and back to the custom input option afer putting in an invalid
value, e.g. "abc" or "-20". Previously, the custom input showed
"NaN" in that case.
Since we allow calling `add_messages` without checking fetch status,
it can lead to non-contiguous message history due to latest message
being added to a message list without previous messages being
fetched.
To fix it, we only allow adding new messages via message_fetch
which properly sets `anchor` to the last message in the list
before fetching and adding messages to the list.