Users and confirmation objects with the type
`Confirmation.USER_REGISTRATION` or `Confirmation.INVITATION` may have
plan data associated with them but not displayed previously due to a
bug.
This fixes this issue and adds test cases to verify that the realm
details correctly displays the plan data.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This is a prep commit for a refactoring that fixes an issue with plan
data not being displayed when the realm is displayed by the query result
of users or confirmation objects.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This avoids monkey-patching `CustomerPlan` and other related information
onto the `Realm` object by having a separate dictionary with the realm
id as the key, each corresponds to a `PlandData` dataclass.
This is a part of the django-stubs refactorings.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
The name does not really comply with the actual behavior of
the decorator since it returns True for an unauthenticated user.
This makes it clear that the 2fa check only applies to users that
are already logged in.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This replaces user.is_verified with is_2fa_verified.
The helper does extra checks such that the user being checked for 2fa
authentication status is valid.
`request.user.is_verified` is functionally the same as `is_verified`
from `django_otp.middleware`, except that the former is monkey-patched
onto the user object by the 2FA middleware. We use the latter wrapped
in `is_2fa_verified` instead to avoid accessing the patched attribute.
See also: 6b24d56e59/docs/source/overview.rst (authentication-and-verification)
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This simulates the situation in which the user is not
authenticated (as an AnonymousUser) and have 2FA enabled.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Two of the callers of `get_confirmations` uses a `QuerySet` of confirmation
objects instead of their ids to filter the confirmations. This refactors
`get_confirmations` so that it is typed to accept `Iterable[int]` that
is a list of ids.
It's worth noting that this might be less performant than the previous
approach since it requires more queries when we force the ids into lists
without having django creating a nested query. But the performance
is not a concern here compared to clarity.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This is a prep commit for enabling a two section layout in the
buddy_list. The sections will be for "users" and "others".
Hence, this commit performs a simple rename of:
- `user_presence_row.hbs` -> `presence_row.hbs`
- `user_presence_rows.hbs` -> `presence_rows.hbs`
And then a search and replace of `user_presence_row` to
`presence_row` (which also handles the second rename).
It also makes one modification in buddy_list.js where it changes a
template variable we're passing from "users" to "row_members".
This is a prep commit for adding a two section layout to the
buddy_list. It frees the "other_key" name which we intent to use
extensively in future commits.
Allows the 3 articles that use the same instructions for reviewing
the organization settings to share an include file, and also
allows the 2 articles that share the same settings highlight info
to share an include file as well.
Also, fixes mentions of UI features to use bold instead of
quotations.
Fixes a few help center documentation articles where UI features
were referenced with quotation marks instead of bold text. Also,
updates these articles for other current documentation styles.
Adds a note to the `content` and `stream_id` parameters for the
`/update-message` endpoint that indicates these parameters throw
an error when sent in the same request.
Also, updates the main description of the endpoint to include
changing a message's stream. And updates some of the parameter
descriptions to be more consistent with each other and clear.
We are abandoning jQuery animation because it build up queue
when there is continous switch in animation state.
i.e When user goes ↑↓↑↓↑↓… at the bottom.
Also added `aria-hidden` to `#scroll-to-bottom-button-container` so
that this widget doesn't interfere with screen readers.
Removes the `mac-cmd-style` CSS rule that was introduced in
d3e8348 when support for updating keyboard shortcuts with
the `Ctrl` key to the Mac cmd key, `⌘`, was added.
Removing the rule makes the font-size and font-family CSS more
consistent with other keyboard shortcuts in the documentation.
Also, removes the parameter in `adjust_mac_shortcuts` that added
the CSS class / rule to these specific keyboard shortcuts.
Zulip Server 2.1.0 and above have a UI tool, accessible only to server
owners and server administrators, which provides a way to download a
“public data” export. While this export tool is only accessible to
administrators, in many configurations server administrators are not
expected to have access to private messages and private
streams. However, the “public data” export which administrators could
generate contained the attachment contents for all attachments, even
those from private messages and streams.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This increases consistency and saves a bit of code, but more
importantly, it makes it much easier to switch between these APIs
while refactoring tests.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This click handler reset the stream creation form; it's not clear why
that behavior would be useful, or why we'd want anything to happen
when clicking in these background areas, so the correct thing to do is
just remove the handler.
Fixes: #21785
Uptil now, both names and descriptions of streams and user groups were
matched to show the typeahead suggestions. This led to unexpected
behaviour like for a clear mention of a certain stream, the typeahead
menu suggested a completely different stream which had a mention of
the first stream in it's description.
To prevent such bugs and also since description matching is not really
useful for streams and user groups, only names will be matched.
Updates the `adjusts_mac_shortcuts` function to render shortcuts
with the `Fn` key as a separate html element (e.g. `Fn` + `arrow`)
instead of rendering the shortcut as one block (e.g. `Fn + arrow`).
Also, because keyboard shortcuts should be rendered with each key
as a separate html element, updates `adjusts_mac_shortcuts` to
only change html elements that are an exact match to a keyboard
key. Html elements with whitespace will be ignored (e.g. `Enter`
becomes `Return`, but `Enter or Backspace` is not changed though
it previously would have been changed to `Return or Delete`).
Fixes#22112 (in combination with #22273).
To prevent new contributors who are adding new user settings from
being confused about the legacy dicts for display settings and
notifications settings, we create `modern_settings` and
`modern_notifications_settings` dicts with comments documenting
that new user settings should be added to one of them.
Note that the `modern_notification_settings` is a placeholder for
new notifications settings as there have been no new notification
settings added since 430c5cb8 (when the legacy dicts were created)
and is currently annotated as `Dict[str, Any]` (which can be
removed if/when a new setting is added).
Updates `git-webhook-url-with-branches.md` (and two files that use
that file as an include link) for some of the follow-ups from #22315
to the Markdown parser. With this fix, all integrations docs that
reference this file as an include link should render the url as a
div element with `.codehilite` class.
Updates help center documentation for enabling `Enter` to send for
the new default button text (`Ctrl` + `Enter` to send).
Also adds backticks to all references to the `Enter` key, so that
they are updated by `adjust_mac_shortcuts` for Mac keyboards;
and removes the table at the end of the article replacing it with
a simple tip for the `Shift` + `Enter` keyboard shortcut.
Updates help center article on viewing and editing drafts of
messages for current documentation styles (less use of bold text,
no Mac keys, tabs for Desktop/Web vs subheaders, etc), which also
preps page for mobile app documentation when drafts are supported.