The stream and subscription objects now have stream_post_policy value
set according to the can_send_message_group setting representing the
superset of users who have permission to post in the channel.
For import from Rocket.Chat, we set the channel
posting policy to "Admins and moderators" only
for Rocket.Chat channels that are read-only.
This commit adds the code to set the new group
setting accordingly.
Previously, we do not allow mentioning system user groups
at all. Now we want to use silent mention syntax for system
groups in the message sent when updating the posting permission
for a stream, so it is important to allowing silent mentioning
system groups at least. And there is no problem in allowing
silent mentions of system groups for all users.
We do not allow mentioning system groups as can_mention_group
for them is set to "Nobody" group.
This commit adds a validation step that disables the Submit
button in the Manage user tab and the Manage bot tab
when the Name input field is empty.
Fixes#22904.
Co-authored-by: Alessandro Campagna <alecostacamp@gmail.com>
We were not passing the required variables in
render_stream_settings in add_sub_to_table and that
resulted in FORMAT_ERROR.
We actually do not need to append the html from
render_stream_settings here as we already handle
opening the stream settings using open_edit_panel_for_row,
so we remove that code.
When bulk marking messages as read, it can happen that the
there are less number of rows visible than the current `row_focus`.
This can lead to an error in the updated code here which results
in the bulk mark as read operation from successfully updating
the UI.
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
When editing a user or bot profile via the Manage User or Manage
Bot overlay, an error was not hidden after receiving a successful
response from the server. This commit ensures the error is hidden
upon a successful response.