Commit Graph

48625 Commits

Author SHA1 Message Date
Zixuan James Li 3193afffe8 test_runner: Remove monkey-patched SubSuiteList.
This monkey-patching approach is not meaningful when what we really need
is just the names of the test, that can already be done in
get_test_names.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-09-20 10:18:22 -07:00
Lauryn Menard 9177ac7a4c buddy-data: Remove unimplemented `user_circle_status` description.
In #11882, the alternate tooltip text/behavior for user status
circles was removed from the implementation, but not from the
buddy list data.

This commit removes the `buddy_data.status_description` function
and related frontend tests. There are no remaining instances of
`user_circle_status` in the codebase.

Prep commit for transitioning from 'unavailable' user status
feature to 'invisible mode' user presence feature.
2022-09-20 10:04:11 -07:00
Sahil Batra b3b6449034 settings: Enable and disable the save button in change_save_button_state.
We now enable and disable save button when changing inputs for custom time
limit settings in change_save_button_state function only which shows or hide
the save-discard widget instead of handling them in "change" event handlers.

This fixes the bug of save button flashing to its enabled state from
disabled state before hiding after clicking on "Discard" as now button
is re-enabled only after save-discard widget is hidden and it is disabled
if required before being shown.

Note that there is still a bug for message edit and delete limit settings
where the save button flashes to enabled state when setting is changed to
the original value instead of clicking on "Discard". This bug is not present
for email notification batching setting in a follow-up PR.

This commit also renames update_save_button_state function to
enable_or_disable_save_button to avoid confusion with
change_save_button_state function.
2022-09-19 20:20:53 -07:00
Sahil Batra a446f05c98 settings: Disable save btn for invalid values of batching period setting.
We disable the "Save changes" button for invalid values in custom
input of realm-level default of email notification batching period
setting.
2022-09-19 20:20:53 -07:00
Sahil Batra fa63045b49 settings: Rename dropdown value for custom option for msg limit settings.
This commit renames dropdown value for custom option for message edit
and delete limit settings to "custom_period" to make it consistent
with the value for email notification batching setting and thus
we can avoid code duplication in further commits.
2022-09-19 20:20:53 -07:00
Sahil Batra 25223539d1 settings_org: Move update_save_button_state function to module level.
We would use update_save_button_state for realm-level default of
notification batching setting also in further commits.
2022-09-19 20:20:53 -07:00
Sahil Batra 2933f079b8 settings: Modify update_save_button_state to use it for other settings.
This commit modifies update_save_button_state such that it can be used
for other time-limit settings too.
2022-09-19 20:20:53 -07:00
Lauryn Menard 34f5218cc8 templates: Replace default HTML title and meta-description elements.
Removes the default title element of "Zulip" from `base.html` and
the default meta-description sentence from `meta_tags.html`. Also
removes default open graph metadata.

For portico templates that would would fail tests, set both
`PAGE_TITLE` and `PAGE_DESCRIPTION` variables with appropriate
content.

Co-authored-by: Alya Abbott <alya@zulip.com>
2022-09-19 20:17:17 -07:00
Lauryn Menard 7a0d659f14 templates: Add HTML title element to templates that extend base/portico.
Adds HTML title elements to templates that extend either `base.html`,
`portico.html` or `portico_signup.html`, and that are not website
portico landing pages that will use the `PAGE_TITLE` variable to set
the HTML title element (see following commit in series).

Also, updates some templates for missing translation tags.

As a general rule, we want the title element (and page content)
translated. Exceptions that are updated in this commit are templates
used in the development environment, analytics templates that are used
by staff and templates related to Zephyr.
2022-09-19 20:17:17 -07:00
Anders Kaseorg 92f9a9ba41 forms: Fix another 500 error on realm creation with invalid email.
Followup to commit c0287473b9 (#22723).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-19 14:12:32 -07:00
Aman Agrawal 683a5e7c23 view_code_in_playground: Fix tooltip being partially hidden. 2022-09-19 14:11:53 -07:00
Zixuan James Li 3400cb425b models: Tighten type annotation for query_for_ids.
This makes use of the type parameters of ValuesQuerySet (a.k.a
_QuerySet) to provide a more accurate type annotation for query_for_ids.

Note that QuerySet[ModelT] is equivalent to _QuerySet[ModelT, ModelT].

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-09-19 14:10:15 -07:00
Lauryn Menard 5441ec7d16 buddy-data: Remove unused `get_my_user_status` function.
As of 297379029d, the data for the current user's buddy list
row no longer uses the '(unavailable)' or '(you)' text generated by
`buddy_data.get_my_user_status`. This commit removes the function
and related frontend tests.

Remaining instances of `my_user_status` in the codebase are related
to the CSS rule in `right_sidebar.css`, which is still relevant.

Prep commit for transitioning from 'unavailable' user status
feature to 'invisible mode' user presence feature.
2022-09-19 14:09:21 -07:00
Anders Kaseorg 23d9dd3163 streams: Fix can_remove_subscribers_from_stream type.
Added by commit c3fe8420fd (#22589).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-19 13:53:44 -07:00
Anders Kaseorg 8dd72497a7 zilencer: Mark remote_server_dispatch request argument positional-only.
In the presence of **kwargs, this is required by the Concatenate type
expected by default_never_cache_responses.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-19 13:52:35 -07:00
Purushottam Tiwari 4db6c51fb1 stream_edit: Fix warning in confirm dialog modal from sub-unsub modal. 2022-09-18 16:02:08 -07:00
Mateusz Mandera 29589a69eb bots: Replace some redundant logic with is_cross_realm_bot_email.
is_cross_realm_bot_email is just
`email.lower() in settings.CROSS_REALM_BOT_EMAILS` which is the same,
aside of looking at .lower() - which is actually more correct.
2022-09-17 17:52:01 -07:00
rht a7cff0f091 Slack import: Translate to emoji name to codepoint using iamcal data.
Because Slack emoji naming is different from Zulip's.
According to https://emojipedia.org/slack/, Slack's emoji shortcodes are
derived from https://github.com/iamcal/emoji-data.
There are probably some deviations from that dataset, but this PR should
at least catch the ones that are identical to iamcal's.
2022-09-17 12:04:07 -07:00
Ganesh Pawar a1ac78f34e delete custom emoji: Add confirmation dialog.
Fixes part of #22812.
2022-09-17 11:55:33 -07:00
Ganesh Pawar 3646ad28d9 emoji: Change `Delete emoji` to `Deactivate emoji` in the help center. 2022-09-17 11:55:33 -07:00
Anders Kaseorg 403837e52d python: Use ‘not in’ for negated membership tests
Fixes “E713 Test for membership should be `not in`” found by
ruff (https://github.com/charliermarsh/ruff).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-17 11:48:33 -07:00
Alya Abbott 83523328c9 corporate: Add request for cover letter to job application instructions. 2022-09-17 11:47:25 -07:00
Ganesh Pawar 4c32972274 modals: Add `data-simplebar` to `login` and `api key` modal.
c439b9d3af added `data-simplebar` to
the `dialog_widget` module, but these modals don't use it. So, add it
separately.
2022-09-17 11:45:36 -07:00
Jason Hildebrand 7efd59b6d7 email_mirror: Remove limits (expiry, max uses) to improve usability.
These limits don't appear to provide useful security benefits, and
they do impact usability because they prevented email-based users from
replying more than once, or from replying to message more than 5 days
old.

Fixes #2755.
Fixes #19994.
2022-09-16 18:07:28 -07:00
Yogesh Sirsat 2a9145c212 user_profile: Initialize user type fields only when necessary. 2022-09-16 17:51:34 -07:00
Yogesh Sirsat 9416427dc2 settings_bots: Open bots streams tab from personal settings > bots.
UI in settings for bot owners to unsubscribe their bots from streams,
Personal settings > Bots > Bot info card > hashtag icon.

Fixes: #22460
2022-09-16 17:51:34 -07:00
yogesh sirsat d3b4b1cefd stream_bots: Display unsubscribe button on bots full profile modal.
Displaying unsubscribe button on bots full profile modal, allowing bot
owners to ubsubscribe their bots from streams.

Admins can also unsubscribe any bot from any subscribed streams from
bots full profile modal.

Fixes part of: #21402
2022-09-16 17:51:34 -07:00
Yogesh Sirsat 23fbd38b4c bots: Display full user profile modal for bots.
This commit can display a full user profile modal for bots too,
by clicking on "View Full Profile" in the profile info popover
same as normal users.

Fixes part of: #21402
2022-09-16 17:51:34 -07:00
yogesh sirsat 180a9cbdcb stream_bots: Allow bot owners to unsubscribe their bots from streams.
Users who owns bots can unsubscribe their bots from streams.

Fixes part of: #21402
2022-09-16 17:51:34 -07:00
yogesh sirsat 45307affc0 popovers: Text change from "Owner" to "Bot Owner" in profile popover. 2022-09-16 17:51:34 -07:00
Lauryn Menard eb377a8872 read_receipts: Exclude muted users from read receipts.
Removes IDs of users who have muted or been muted by the current
user from the list of user IDs returned by the read receipts
endpoint.

Fixes #22909.
2022-09-16 16:19:54 -07:00
Lauryn Menard 5e58f86aa7 models: Add backward relation to MutedUser foreign keys.
Updates the two UserProfile foreign key fields to have a backward
relation in the MutedUser model by changing the `related_name`
property.

This is a prep commit for removing users with a muted relationship
to the current user from read receipts.
2022-09-16 16:19:54 -07:00
Sahil Batra 13ffb36834 help: Update the help pages according to permissions change.
We allow only owners to change "Joining the organization"
settings and this commit updates the help pages to mention
this restriction.
2022-09-16 15:27:52 -07:00
Tim Abbott d5d2647c1b openapi: Update API feature level permission changes. 2022-09-16 15:27:52 -07:00
Sahil Batra 05b7ca01c4 settings: Disable "Joining the organization" settings for admins.
This commit disables the settings in "Joining the organization"
subsection for admins as they can be changed by only owners.

We also move the tooltip mentioning "Only owners can change..."
to the subsection heading.
2022-09-16 15:27:52 -07:00
Sahil Batra 6ddc83d034 settings: Fix typo in id of "Joining the organization" subsection. 2022-09-16 15:27:52 -07:00
Sahil Batra b9e0575829 realm: Allow only owners to change waiting_period_threshold setting.
We allow only owners to change the waiting period setting to become
full member. This commit contains only backend changes, frontend
changes will be done separately.
2022-09-16 15:27:52 -07:00
Sahil Batra f23bfbd462 realm_domains: Allow only owners to add, edit or delete domains.
We allow only owners to add, edit or delete the allowed domains.
This commit only contains backend changes, frontend changes will
be done in a separate commit.
2022-09-16 15:27:52 -07:00
Sahil Batra 1396fbab6e realm: Allow only owners to change restricted-login related settings.
We allow only owners to change disallow_disposable_email_addresses
and emails_restricted_to_domains settings. This commit only contains
change in backend part, frontend changes will be done separately.
2022-09-16 15:27:52 -07:00
Sahil Batra 63fa2a9338 realm: Allow only owners to change invite_required in backend.
We allow only owners to change the invite_required setting.
This commit only adds the restriction in backend, frontend
changes will be done separately.

We also add a helper function in test_realm.py to avoid
writing same code repeatedly and this helper will also
be used in tests for other settings to be added in
further commits.
2022-09-16 15:04:54 -07:00
Yogesh Sirsat 8d04e2b4c3 custom_profile_fields: Display deleted options in confirmation modal.
While editing custom profile fields, when user delete option(s) of
select type profile field, display that deleted option(s) in delete
option confirmation modal.

Follow-up: 21878
2022-09-16 15:04:01 -07:00
Yogesh Sirsat 1c2b90eae9 custom_profile_fields: Update text of delete options confirmation modal. 2022-09-16 15:04:01 -07:00
Yogesh Sirsat 2328dc0d4e custom_profile_fields: Confirmation modal for delete profile field. 2022-09-16 15:04:01 -07:00
Yogesh Sirsat c4233d2472 custom_profile_fields: Display success status after add/edit fields.
Display success status "Saved" for consistency in settings UI, after
successful request of Add or Edit custom profile fields.

Follow-up: #21878
2022-09-16 15:04:01 -07:00
Tim Abbott 76bcb96414 realm_export: Improve estimate of data export size.
As suggested by the new comments, the cost for a Zulip data export
scales with messages actually included in the export, so an
organizations with 1M private messages but only 50K public stream
messages should not be modeled the same as one with 1M public stream
messages for the purpose of the limits here.

Also improve the comments and variable names more generally.
2022-09-16 14:54:45 -07:00
Aman Agrawal 155540c0e3 popovers: Fix alignment of icons in sidebar and msg action popovers.
The regression was introduced in c8f346b5e5.
Reverted the change that caused the regression and introduced a
new fix.
2022-09-16 11:47:44 -07:00
Aman Agrawal 2aaf3c3c76 Revert "popovers: Align icons and content in middle."
This reverts commit 948dc3a629.
2022-09-16 11:47:44 -07:00
Anders Kaseorg 31b4be3b9b event_queue: Replace sequential queue IDs with UUIDs.
This prevents ID conflicts when resharding between multiple Tornado
shards.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-16 10:06:07 -07:00
Anders Kaseorg e38f9f038a landing_nav: Add tabnabbing protection to external target="_blank" link.
This has no impact because zulip.com is not attacker-controlled, but
we should be consistent in protecting external target="_blank" links.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-15 17:14:10 -07:00
Anders Kaseorg 82f9014970 stream_list: Fix another “subscribed” typo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-15 16:55:15 -07:00