This commit moves get_realm_user_groups_for_setting and
get_realm_user_groups_for_dropdown_list_widget functions
from user_groups.ts to group_permission_settings.ts.
This change is needed to avoid import cycles in further
commits to add "Permissions" panel for groups.
We now pass group in functions called while handling group update
events, instead of fetching the groups in those function as we
will need the old setting value in future commits.
Tests for testing user group events does not stub "user_groups"
module anymore as it is mainly used to handle data and it is
easy to test the events without stubbing them.
While adding a new reaction, we create a new JQuery element
called "message_reaction_container" and append it to the
view to display the emoji.
Previously, when the reaction count became zero for an emoji,
we used to just remove the emoji but not the JQuery element
mentioned above, requiring a reload to remove it. This
inconsistency introduced a bug in the UI. causing unwanted
spaces between emojies as this element used to get accumulated.
This commit resolves the bug by introducing logic to remove
reaction containers with no reactions.
Fixes: #32983
This ensures that using `^V` pastes the content from excel as
an image.
To get normal text in a formatted manner one can use
`^⇧V`.
The earlier conditions in `is_single_image` caused
the classification to fail in case of Excel pasted
content, which is why we check for the for the XML
namespaces associated with Microsoft in the pasted
HTML.
Fixes#32968.
When using `position` to get the scroll offset, it uses `offsetParent`
to calculate the offset which is not necessary the scroll container.
To account for this case, we use `offset` to correctly calculate
the position of element relative to the document.
This commit adds support to display `realm_empty_topic_display_name`
value (in italics) in the search suggestions & search input pills
for topics having the actual value of empty string.
We show `realm_empty_topic_display_name` for empty string topics
in the recent conversations view.
This commit makes it possible for users to search for
the `realm_empty_topic_display_name` value to filter out empty
string topics.
This commit unifies translation strings for reply button label
to reduce translation effort.
Both the `has_empty_string_topic` and other cases now use a single
"Message <z-recipient-label></z-recipient-label>"`, with dynamic
content passed appropriately.
This commit is a part of the work to support empty
string as a topic name.
Previously, empty string was not a valid topic name.
Adds `allow_empty_topic_name` boolean parameter to
`GET /users/me/{stream_id}/topics` endpoint to decide
whether the topic names in the fetched `topics` array
can be empty strings.
If False, the topic names in the fetched response will
have the value of `realm_empty_topic_display_name` field
in `POST /register` response replacing "".
Fixes part of #23291.
We are using `can_add_subscribers_group` instead of
`invite_to_stream_policy` to check whether a user can subscribe other
users.
We've removed `invite_to_stream_policy` from the frontend wherever
applicable.
This is more of a workaround than a bug fix.
Some JS implementations are less "aggressive" about
canonicalizing things like America/Montreal to America/Toronto.
We instead use offset checks.
These tests are false positives in some cases, since
browser behavior varies.
We will kill off the function soon, but for now we
still maintain 100% coverage (albeit indirectly).
I also split up a test into two smaller ones.
In the function `get_stream_topic_link_syntax`,
we used the typed syntax text to make out
the channel name and then use it to
generate the appropriate link syntax.
We change that to directly accepting the
channel name.
This is in preparation for #31420
Previously, all the non-system groups were shown in the DM
recipient typeahead. Now, we show system groups as well but
do not show groups with more than 20 members.
This commit adds support to display `realm_empty_topic_display_name`
value as the compose reply button label for topics having the actual
value of empty string.
We update max_avatars on rerenders based on recent view width
to prevent participant avatars from overflowing their width.
We use resize event to update `--recent-view-max-avatars` which
is checked on `complete_rerender`.
The deprecated `user` object was removed from message objects
and reaction events in #32701. This commit restores the `user` object
in reaction events to maintain compatibility with mobile clients.
This commit adds support to display `realm_empty_topic_display_name`
value in the recent conversations view for topics having the actual
value of empty string.
This commit ensures that narrow links involving
empty topic names, such as:
* #narrow/channel/1-general/topic//near/12345
* #narrow/channel/1-general/topic/
work correctly in the web client.
This change ensures proper navigation and behavior
for such links.
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.