Commit Graph

41399 Commits

Author SHA1 Message Date
Anders Kaseorg d84727ce7f styles: Use Source Code Pro as our monospace font.
Fixes #15993.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-05 15:18:41 -07:00
Anders Kaseorg 236e114870 styles: Consistently use generic fallback font families.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-05 15:18:41 -07:00
Aman Agrawal 1a83112cf9 giphy: Register click events inside giphy module.
Primary reason for this is to allow us more control over
creation of giphy popover as will be evident in future commits.
2021-04-05 15:04:50 -07:00
Aman Agrawal 4593ca9ed7 click_handlers: Export convert_enter_to_click from ui_util.
This allows us to use this function in other places without
importing click_handlers which depends on a lot of other modules.
2021-04-05 15:04:50 -07:00
Aman Agrawal 5e83965e80 giphy: Use GIPHY web SDK to allow inserting GIFs in compose box.
We use GIPHY web SDK to create popover containing GIFs in a
grid format. Simply clicking on the GIFs will insert the GIF in the compose
box.

We add GIPHY logo to compose box action icons which opens the GIPHY
picker popover containing GIFs with "Powered by GIPHY"
attribution.
2021-04-05 15:04:49 -07:00
Vishnu KS f00c13d303 actions: Improve the secrets of one click release action. 2021-04-05 14:40:45 -07:00
LoopThrough-i-j ffd0d822fe actions: Send reaction events to subscribers with history access.
Previously, if a user subscribed to a stream with
history_public_to_subscribers, and then was looking at old messages in
the stream, they would not get live-updates for that stream, because
of the structure in how notify_reaction_update only looked at
UserMessage rows (we had a previous workaround involving the
`historical` field in `UserMessage` which had already made it work if
the user themselves added the reaction).

We fix this by including all subscribers with history access in the
set of recipients for update events.

Fixes a bug that was confused with #16942.
2021-04-05 13:43:39 -07:00
LoopThrough-i-j 277fbb3f02 stream_subscription: Add subscribe_ids_with_stream_history_access.
This new function returns the set of `user_ids` with access to the
stream's full history, for use in send_event calls.
2021-04-05 13:23:11 -07:00
Vishnu KS 9d96847d43 faq: Add instruction for requesting sponsorship when free trial is disabled.
The request sponsorship form(/upgrade page) is shown after the organization
creation only when the free trial is enabled.
2021-04-05 12:29:13 -07:00
Steve Howell d50462568b refactor: Avoid update_calculated_fields() calls.
This change should make live-update code less brittle,
or at least less cumbersome.

Instead of having to re-compute calculated fields for
every change to a stream message, we now just compute
the fields right before we render stream settings UI.
2021-04-05 09:52:19 -07:00
Steve Howell 36632637dc refactor: Remove foo_display fields on subs.
Also add a helpful comment explaining how these work.
2021-04-05 09:52:19 -07:00
Steve Howell 5624ed2afe refactor: Extract stream_data.clean_up_description().
We use this in the few places where update_calculated_fields()
could plausibly be dealing with a new rendered description.
2021-04-05 09:52:19 -07:00
Steve Howell 99b177dc7d minor: Avoid reliance on is_old_stream. 2021-04-05 09:52:19 -07:00
Steve Howell 430fadfb0b refactor: Extract stream_data.can_subscribe_others(). 2021-04-05 09:52:19 -07:00
Steve Howell 36fd76dc20 refactor: Extract can_view_subscribers().
We also remove some needless uses of the calculated
field in the node tests.
2021-04-05 09:52:19 -07:00
Steve Howell ea972569a3 refactor: Extract stream_data.can_change_permissions(). 2021-04-05 09:52:19 -07:00
Steve Howell b27ff978c7 minor: Extract can_preview() helper. 2021-04-05 09:52:19 -07:00
Steve Howell 93471ed3e4 refactor: Extract can_toggle_subscription(sub).
We don't want to rely so much on calculated fields,
and the `should_display_subscription_button` name
is a bit misleading in certain contexts.
2021-04-05 09:52:19 -07:00
Steve Howell 9c9d74fd6d minor: Use page_params.is_realm_admin.
We don't need to get this off the sub.
2021-04-05 09:52:19 -07:00
Steve Howell 4380fe4eaf refactor: Extract stream_settings_data.
This is mostly a pure code move.

In passing I remove an unneeded call to
update_calculated_fields in the dispatch code,
plus some tests that don't need them.
2021-04-05 09:52:19 -07:00
Siddharth Asthana e7f24ac8d4 docs: Improve documentation for changing a realm's subdomain.
The current documentation doesn't clearly explain the process of
changing the organization's subdomain.
This commit adds instructions for user to get the string_id of their
organization and then lists the commands to be executed in the
management shell to change the subdomain.

Part of #17857.
2021-04-05 08:43:34 -07:00
Steve Howell c75b7e851a minor: Add stream_id const for node test. 2021-04-05 10:58:54 -04:00
Ganesh Pawar 5262ca7621 hotkey: Map numpad navigation keys to close compose when empty.
This maps pageup/pagedown/home/end to close compose when used in empty
compose box, matching the existing behavior for the Up/Down arrow keys.

Currently, these keys do nothing when used in an empty compose box.
Typically, a user intends to navigate when pressing these keys (and
with empty compose, they can't be expecting to navigate within the
compose box), so it makes sense to map them to navigate the message
feed just to save users from needing to hit `Esc` in these contexts.

Fixes #17917
2021-04-05 07:21:57 -07:00
Tim Abbott e7e2340eda hotkeys: Move copy_with_c shortcut definition and improve comments.
The `copy_handler` function that this shortcut calls is not useful
unless the body of a Zulip message is selected, so we shouldn't try
running it in other situations.
2021-04-05 07:20:32 -07:00
Tim Abbott 4462df64da hotkey: Fix incorrect preventDefault for recent_topics hotkeys.
This logic correctly prevents the hotkeys implemented below it from
being active when "Recent topics" is open.  We expect to change some
parts of that soon (see #17685), but in any case, we should always
return false in the hotkey code when we don't process a key, so that
default browser behavior works.

This fixes browser shortcuts like Ctrl+C, Ctrl+V, etc. when recent
topics is loaded.

This bug was introduced in 1eafb1d8b3.

Thanks to ganpa3 for noticing this bug.
2021-04-05 07:20:32 -07:00
PIG208 e86b2c8d58 embedded bot: Use server settings for storage_size_limit. 2021-04-04 18:05:30 -07:00
Aman Agrawal 1d12fb0bb9 recent_topics: Extract function to check `table` focus. 2021-04-04 18:01:06 -07:00
Anders Kaseorg 6dc783e562 eslint: Enable sort-imports for member sorting.
This sorts the members imported within each individual declaration; we
use import/order for sorting multiple declarations.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-03 15:54:14 -07:00
Steve Howell c40dfaa616 node tests: Clean up hotkey mock_esm calls.
I removed an unnecessary call and put another one in
in lexical order.
2021-04-03 15:43:47 -04:00
Steve Howell 902e0f7e95 node tests: Clear page_params at start of run_test. 2021-04-03 15:03:00 -04:00
Steve Howell 58d5778368 node tests: Explicitly set page_params values. 2021-04-03 15:03:00 -04:00
Steve Howell 5fe8bbd9da node tests: Clear message_user_ids.
This defends against future intra-test leaks.
2021-04-03 15:03:00 -04:00
Steve Howell deaffe2f0b node tests: Use override for rerender_messages. 2021-04-03 15:03:00 -04:00
Steve Howell df83808c27 node tests: Avoid mutating test fixture.
This makes the tests less order-sensitive.
2021-04-03 15:03:00 -04:00
PIG208 53ab137710 docs: Fix mocking documentation with a new example.
Fixes: #17830
2021-04-03 08:25:02 -07:00
Cyril Pletinckx b7fa41601d emails: Truncate overly-long From fields for RFC compatibility.
Amazon SES has a limit on the size of address fields, and rejects
emails with too-long "From" combinations of name and address. This
limit is set to 320 bytes and comes from an RFC limitation on the
size of addresses. This RFC standard states that an email address
should not be composed of a local part (before the '@') longer than
64 bytes and a domain part (after the '@') longer than 255 bytes.
It is possible that Amazon SES misinterprets this limitation as it
checks the length of the combination of the name and the email
address of the sender.

To ensure that this problem is not encountered in the send_email
module of Zulip the length of this combination is now checked
against this limit and the from_name field is removed to only
keep the from_address field when it is necessary in order to
stay below 320 bytes.

If the from_address field alone is longer than 320 bytes the
sending process will raise an SMTPDataError exception.

Tests for this new check are added to the backend test suite in
order to test if build_email correctly outputs an email with filled
from_name and from_address fields when the total length is lower
than 320 bytes and that it correctly throws the from_name field
away when necessary.

Fixes: #17558.
2021-04-03 08:13:26 -07:00
rht 4f38da5ce7 docs: Add info on zulip-archive on for/working-groups-and-communities. 2021-04-03 08:05:02 -07:00
Siddharth Asthana 47e478945b support: Create RealmAuditLog when updating realm_subdomain. 2021-04-03 08:01:46 -07:00
Siddharth Asthana 80c9243c6a support: Create RealmAuditLog when updating sponsorship status. 2021-04-03 08:01:46 -07:00
Siddharth Asthana ddbc6d7662 support: Create RealmAuditLog when realm reactivation email is sent. 2021-04-03 08:01:46 -07:00
Siddharth Asthana 233c4d520c support: Create RealmAuditLog when updating billing_method.
This commit also makes acting_user as a mandantory argument and fixes
the tests accordingly.
2021-04-03 08:01:46 -07:00
Siddharth Asthana 44c34cb39a support: Create RealmAuditLog when approving sponsorship. 2021-04-03 08:01:46 -07:00
Siddharth Asthana 6945ed3587 support: Pass acting_user to attach_discount_to_realm. 2021-04-03 08:01:46 -07:00
Siddharth Asthana c3f37c2a64 support: Pass acting_user to do_change_plan_type.
acting_user is now a mandatory field, so wherever this function is used,
we are passing acting_user as well.
2021-04-03 08:01:46 -07:00
Tim Abbott f745efdde0 help: Link quote-and-reply and permalink articles.
This to a partial rewrite of the quote-and-reply article to explain
the current details for how it works (the permanent link is relatively
new).
2021-04-03 07:51:29 -07:00
Tim Abbott c01c947f5b help: Clean up documentation around permanent links. 2021-04-03 07:51:10 -07:00
Tim Abbott 53adf889e5 popovers: Change label for "Copy link to conversation".
"Copy link to message" is both a clearer label, and also more likely
to be what someone is looking for.  (It also avoids adding the
"conversation" terminology to the product).

The previous label was also somewhat inaccurate, because it actually links
to a specific message in the conversation.
2021-04-03 07:47:07 -07:00
Mandeep Singh ea3cb941d4 settings: Replace user groups delete button with fa-trash-o.
This makes this settings page a bit more consistent with the rest of
the site.
2021-04-03 07:43:33 -07:00
Aman Agrawal f7f5308986 recent_topics: Don't change background color on thead hover.
We expect to give recent topics a cleaner look by doing so.

Fixes #17934
2021-04-03 07:41:01 -07:00
Tim Abbott 4488254da9 streams: Adjust confirmation message for stream deactivation. 2021-04-02 22:09:48 -07:00