This commit refactors code to handle realm authentication methods
in a better way. We remove the get_complete_data_for_subsection
function and instead let populate_data_for_request handle the
request data for authentication methods.
We also remove the "prop-element" class from each authentication
setting checkbox and instead add it to the container div as a
the list of those checkboxes represent a single field, i.e.
the realm_authentication_methods field received from the server
and the authentication_methods field sent to 'PATCH /realm'
endpoint.
Since `onHidden` is only called once tippy is fully hidden, tippy
can fail to call `onHidden` if `onShow` is called before
tippy is fully hidden. This hurts us as we want to call `destroy`
to remove this tippy instance from DOM.
To avoid this, we `destroy` the tippy instance outside of tippy
callbacks which is more reliable since our event handlers call
`hide` without fail.
Updates the labels in the "Messages sent by client" analytics chart
for the user-agent/client names for the Flutter mobile app, which
can be "ZulipFlutter" or "ZulipMobile/flutter".
Fixes#28220.
This commit adds a new helper function to create or update
a UserGroup object for a setting. We could have used existing
update_or_create_user_group_for_setting but that also validates
user IDs and subgroup IDs which we can skip in tests.
This commit fixes the code store correct old value in audit
log data when changing can_mention_group setting from a
anonymous group to another anonymous group. The bug was
because the old value was being computed after updating
the UserGroup object with new members and subgroups and
is fixed by computing the old value for all the cases
and passing it to do_change_user_group_permission_setting.
We still had some code in invite.ts for the textarea element
which was replaced by pill container, so this commit removes
that code.
This commit also removes the CSS for textarea and radion buttons
which are no longer present in the UI.
There is no need to call toggle_invite_submit_button while
changing inputs on the modal, or while selecting all streams
using the "Check all" button as the state of button is only
dependent on the input in email pill container and on which
tab is opened.
Previously, when the invite modal was opened with user having
permission to send email invites, the button at the bottom had
"Generate invite link" text. It should instead be "Invite" with
the button disabled since email invites section is opened by
default.
This was because the toggle_invite_submit_button was called
when the modal was not visible and thus calling `.is(":visible")`
for email pill container element returned false. This commit
changes it to pass the selected tab to toggle_invite_submit_button
to avoid computing which tab is opened by checking the element
visibility, attributes, etc. when the modal is not visible and
the tab container might not be present in the DOM.
requests transforms the base urllib3 exceptions into
requests.RequestExceptions -- but only within code that it is
running. When parsing the streaming body in fetch_open_graph_image,
the read itself (inside lxml) may trigger urllib3 to raise its own
timeout error -- which escapes the current catch of
requests.RequestExceptions.
Catch both requests and urllib3 exceptions.
This commit replaces occurrences of realm_uri with realm_url in
"context_processors.py" and related templates.
With by-hand translation updates for German (also updated in
Transifex) to avoid breaking the i18n system tests that use some
modified strings.
Co-authored-by: Junyao Chen <junyao.chen@socitydao.org>
This commit replaces occurrences of realm_uri with realm_url in email templates
and other related backend files.
Co-authored-by: Junyao Chen <junyao.chen@socitydao.org>
This adds `--automated` and `--no-automated` flags to all Zulip
management commands, whose default is based on if STDIN is a TTY.
This enables cron jobs and supervisor commands to continue to report
to Sentry, and manually-run commands (when reporting to Sentry does
not provide value, since the user can see them) to not.
Note that this only applies to Zulip commands -- core Django
commands (e.g. `./manage.py`) do not grow support for `--automated`
and will always report exceptions to Sentry.
`manage.py` subcommands in the `upgrade` and `restart-server` paths
are marked as `--automated`, since those may be run semi-unattended,
and they are useful to log to Sentry.
This was only being used in one place in compose_closed_ui
to create the label for the closed composebox. But it
only checked if the `channel` and `topic` filters existed,
while `stream_sub` can return `undefined` for a few other
reasons. To ensure that we're catching the undefined sub
while also avoiding duplicate work, it makes sense to just
call `stream_sub()` directly.
Fixes this bug:
https://zulip.sentry.io/issues/5367251929/events/40073ecf007a4a9798e728061a576377/?project=450455688282112
Earlier, we were using 'send_event' in 'do_update_message'
which can lead to a situation where we enqueue events but
the transaction fails at a later stage.
Events should not be sent until we know we're not rolling back.
Earlier, we were using 'send_event' which can lead to a situation
where we enqueue events but the transaction fails at a later stage.
Events should not be sent until we know we're not rolling back.
Compose textarea typeaheads don't hide when `Send` button is clicked.
If you type `@` and press send, mention typeahead is still visible.
This happens since the textarea is still focused after sending the
message while other input area trigger a `blur` event which hide
the typeahead for them.
We always call `clear_compose_box` wherever textarea is cleared
as a result of sending message. So, it is the right function to
hide the typeahead in.