Save discard widget behavior was not correct for
"General" subsection of user default settings as the
proposed value for color scheme was a string which
was being compared to the numerical current value
and thus check_realm_default_settings_property_changed
always returned true for "General" subsection.
There's no reason we need to make up weird fallback text when we're
specifically trying to copy a given link; we can just use the original
link when we determine we can't add special formatting.
On Firefox, with `dom.event.clipboardevents.enabled` set to false, the
previous code path (shared with the fancy "copy link" code that tries
to add extra content types) would fail.
Fix this by reverting part of 37b5d539a0.
The comments in this code were correct that we just want to let the
browser handle the copy event. We can do that by just returning the
right value to the hotkey code path such that it won't do
preventDefault, without using deprecated execCommand or doing anything
else special.
Fixes#33912.
This commit hides sidebar menu option button instead of showing
it with "Mark all messages as read" option, for home view when
there are no unread messages.
This table's export and import weren't working:
1. It didn't have a Config in export.py, so it wasn't exported at all.
2. Its `date_created` wasn't registered in `DATE_FIELDS`.
3. It wasn't registered in `ID_MAPS` in import_realm.py, so having any
SavedSnippets in the export would cause the import to fail with an
exception.
4. It was missing a `fix_datetime_fields` call in its import codepath.
Without this change, the child tables of UserProfile didn't get their
objects exported if those objects were tied to a mirror dummy user.
For example, a `Recipient` of type `PERSONAL`, or the associated
`Subscription` would not get exported. Same for other tables with
foreign keys to `UserProfile` - such as `UserPresence`.
This happened because the Configs for the export are defined as follows:
```python
user_profile_config = Config(
custom_tables=[
"zerver_userprofile",
"zerver_userprofile_mirrordummy",
],
# set table for children who treat us as normal parent
table="zerver_userprofile",
virtual_parent=realm_config,
custom_fetch=custom_fetch_user_profile,
)
user_subscription_config = Config(
table="_user_subscription",
model=Subscription,
normal_parent=user_profile_config,
filter_args={"recipient__type": Recipient.PERSONAL},
include_rows="user_profile_id__in",
)
Config(
table="_user_recipient",
model=Recipient,
virtual_parent=user_subscription_config,
id_source=("_user_subscription", "recipient"),
)
```
while in `export_from_config` we have:
```python
elif config.normal_parent:
# In this mode, our current model is figuratively Article,
# and normal_parent is figuratively Blog, and
# now we just need to get all the articles
# contained by the blogs.
model = config.model
assert parent is not None
assert parent.table is not None
assert config.include_rows is not None
parent_ids = {r["id"] for r in response[parent.table]}
```
This meant that when processing a table with
`normal_parent=user_profile_config`, the `parent_ids` above would only
have the ids of `UserProfile` objects under the `zerver_userprofile` key in
the exported data - completely missing those in
`zerver_userprofile_mirrordummy`.
The alerts in portico were not being closed since the class responsible
for hiding them — `home-error-bar` was defined in `web/styles/zulip.css`
which isn't being shared with portico. This commit moves this class to
`web/styles/alerts.css` which is shared with portico, and fixes the bug.
This commit serves as the base commit for redesigning the alert banners
by migrating them to use the new banner component. We use a new name
to refer to these banners — "Popup banners", which is more descriptive
about their behavior.
The Popup banners are appended to the container in a stacking order,
i.e., the most recent popup banner appears on the top and the oldest one
is sent to the bottom of the stack. These banners also inherit the
animations from the alert banners for visual appeal.
This commit also fixes the bug where clicking on the "Try now" button
in the popup banner resulting from an error in the `/json/messages`
endpoint resulted in call to restart_get_events in server_events.js
instead of load_messages in message_fetch.ts.
Fixes#31282.
This is prep commit for the alert banner redesign, which adds flex
layout to the alert-box container and modifies the animations logic to
work with the new layout.
Removed `is_billing_admin` user property as it is no longer used since
billing permissions are now determined by `can_manage_billing_group`
realm setting.
This replicates the smart selection
feature that works with selecting a
single expression within a math block
for inline math expressions.
Fixes: #33865.