Commit Graph

46379 Commits

Author SHA1 Message Date
Aman Agrawal 70c9c2e137 message_events: Remove existing messages that were updated.
For filters that cannot be applied locally, we don't know if the
messages are still a part of the filter. So, we remove the
existing message that were updated and let `maybe_add_narrowed_messages`
treat them all as new messages to the filter.

This fixes the bug where existing messages that were present in
the narrow were not updated.
2022-02-17 15:11:48 -08:00
Aman Agrawal bda90ec5ae message_events: Ask server if cannot filter locally.
For filters that cannot be applied locally, we ask the server
to determine if the `events_messages` are part of the narrow.

Fixes #21073
2022-02-17 12:56:33 -08:00
Aman Agrawal a7f904cdc3 message_events: Take function to add messages as callback. 2022-02-17 12:56:33 -08:00
Alya Abbott e93320c40d portico: Add a self-hosting page.
Co-authored-by: Aman Agrawal <amanagr@zulip.com>
2022-02-17 12:43:13 -08:00
Tim Abbott eb3ae7c3d9 docs: Update link to mypy casts documentation. 2022-02-17 12:42:37 -08:00
Alex Vandiver a40b3e1118 realm_emoji: Stop swallowing all exceptions from upload_emoji_image.
Putting all of the logic in a `finally` block is equivalent to a bare
`except` block, which silently consumes all exceptions.

Move only the most-necessary parts into the except; this lets
`BadImageError` exceptions from `zerver/lib/upload.py` to escape,
allowing better the generic "Image file upload failed" to be replaced
with a more specific message.

It also allows unexpected exceptions, as the previous commit resolved,
to escape and 500.  This lets them be detected and resolved, rather
than give users a silently bad experience.
2022-02-17 12:19:47 -08:00
Alex Vandiver 96a5fa9d78 upload: Fix resizing non-animated images.
5dab6e9d31 began honoring the list of disposals for every frame.
Unfortunately, passing a list of disposals for a non-animated image
raises an exception:
```
  File "zerver/lib/upload.py", line 212, in resize_emoji
    image_data = resize_gif(im, size)
  File "zerver/lib/upload.py", line 165, in resize_gif
    frames[0].save(
  File "[...]/PIL/Image.py", line 2212, in save
    save_handler(self, fp, filename)
  File "[...]/PIL/GifImagePlugin.py", line 605, in _save
    _write_single_frame(im, fp, palette)
  File "[...]/PIL/GifImagePlugin.py", line 506, in _write_single_frame
    _write_local_header(fp, im, (0, 0), flags)
  File "[...]/PIL/GifImagePlugin.py", line 647, in _write_local_header
    disposal = int(im.encoderinfo.get("disposal", 0))
TypeError: int() argument must be a string, a bytes-like object or a
number, not 'list'
```

`check_add_realm_emoji` calls this as:

```
    try:
        is_animated = upload_emoji_image(image_file, emoji_file_name, a
uthor)
        emoji_uploaded_successfully = True
    finally:
        if not emoji_uploaded_successfully:
            realm_emoji.delete()
            return None
        # ...
```

This is equivalent to dropping _all_ exceptions silently.  As such,
Zulip has silently rejected all non-animated images larger than 64x64
since 5dab6e9d31.

Adjust to only pass a single disposal if there are no additional
frames.  Add a test for non-animated images, which requires also
fixing the incidental bug that all GIF images were being recorded as
animated, regardless of if they had more than 1 frame or not.
2022-02-17 12:19:47 -08:00
Aman Agrawal c396c2f7a4 home: Send rendered realm description for spectators.
Display rendered markdown after passing it through our local
rendered_markdown JS library.
2022-02-17 16:17:15 +00:00
Aman Agrawal 73266350ef user_info_popover: Hide user local time for spectators. 2022-02-16 13:25:53 -08:00
Aman Agrawal 7c9e8a5071 decorator: Enable web-public view for production. 2022-02-16 13:25:53 -08:00
Anders Kaseorg 2b3a821807 docs: Remove highlight parameters from links.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-16 13:15:39 -08:00
Anders Kaseorg 2a5adf1453 auth: Remove unused kwargs for saml_sp_metadata.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-16 13:01:34 -08:00
Anders Kaseorg ce4261cbfb auth: Fix incorrect kwargs forwarding for logout_then_login.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-16 13:01:34 -08:00
Jai soni 9cd27fd773
right sidebar: Add word-wrap property in tooltips.
This prevents the overflow of tooltips on hovering over buddy list.

Fixes #21119.
2022-02-16 12:59:38 -08:00
Alex Vandiver 1d2582c899 upgrade: Log the commit hash and directory when upgrading. 2022-02-16 12:33:58 -08:00
Yogesh Sirsat dcae70c0c0
stream_settings: Ignore hover on actions column in tables.
In the dark theme, disable the hover behavior to display sorting options
for actions column in tables (Which doesn't support this).

Matches existing behavior in light theme.

Fixes: #21137
2022-02-15 17:47:55 -08:00
N-Shar-ma 728fee31b2 typeahead: Ignore mouse position for selection until it's moved.
Added a property `mouse_moved_since_typeahead` to the typeahead class
which tracks whether the mouse has been moved since the typeahead
menu appeared.

The hovered over menu item is highlighted on `mouseenter` only if
`mouseMoved` is true. Otherwise, the cursor is hidden temporarily.

Code substantially reorganized by tabbott.

Fixes: #21018.
2022-02-15 17:26:22 -08:00
Tim Abbott 653af70d5a typeahead: Avoid spurious href on typeahead links.
This cause the browser to display an inaccurate indication of what
will happen if you click.
2022-02-15 17:26:22 -08:00
Aman Agrawal 3736c943b3 narrow_banner: Add special notice for spectators.
On non web public stream narrows, tell user that stream is not
web public or does not exist.
2022-02-15 17:21:41 -08:00
Aman Agrawal fd0f26dc1b right_sidebar: Minor improvements.
Fix width of realm description.
Reduce left margin of list in rendered markdown.
Increase right margin.
2022-02-15 17:21:41 -08:00
Aman Agrawal c3b6b48fa2 click_handlers: Only select messages on click by a spectator.
When a message clicked, don't show login modal or open compose
for a spectator.
2022-02-15 17:21:41 -08:00
Aman Agrawal 450e4bbb56 login: Specify spectator login is in beta. 2022-02-15 17:21:41 -08:00
Sahil Batra d6fb439c7a bots: Do not allow removing owner from UI.
This commit removes the "Remove owner" button
from bot-edit form since we anyways do not allow
to remove owner in the API.

Fixes #20116.
2022-02-15 17:15:39 -08:00
Steve Howell 1e8dff6ca9 edit subscribers: Lift form tag to parent template.
For our Subscribers tab we want to enclose our
add-subscriber widget in a form for now, and we
continue to do so, but now we have the form tag
getting created in the parent template, not the
child.

Here is why:

    We want to re-use our add-subscriber widget in an
    upcoming commit for when you create streams.

    In our create-stream UI, there is already an outer
    <form>...</form> section of the HTML for the entire
    process of creating a stream.

    HTML does not yet you nest forms, and even though
    browsers just silently ignore an inner form, we won't
    want to create semantically incorrect HTML.

    Therefore, we want the child template not to have
    the form tags around them.

It's possible that we don't really even want to
enclose the input-pill widget and Add button inside
a form for the Subscribers tab, but tweaking that
for now is too risky. (We don't really take advantage
of the form tag in any meaningful way, since we
don't directly submit form data to the server, and
we can't use a single submit handler for the Enter
key and Add button due to some magic in our input
pills.)
2022-02-15 17:15:02 -08:00
Steve Howell 67fe782714 create stream: Improve click handler for Create.
We want to avoid submit handlers here, because we may
have embedded widgets that have their own forms or
buttons.

We use "finalize" here to distinguish the two Create
buttons related to streams.  You hit one button to
start the UI and then the second button to finalize
the process.

I also fix the bad test idiom of clicking on the
sea-green button.
2022-02-15 17:15:02 -08:00
Steve Howell e8ad76f522 subscribers: Fix misleading placeholder text.
You don't start auto-completing user groups with an @,
so the previous placeholder text made no sense.

There might be a better way to do autocomplete in
these add-subscriber input pills, but that is beyond
the scope of my current efforts.
2022-02-15 17:15:02 -08:00
Alex Vandiver c656d933fa puppet: Switch from $::memorysize_mb to non-legacy $::memory. 2022-02-15 12:04:37 -08:00
Alex Vandiver f2f4462e71 puppet: Switch from $::fqdn to non-legacy $::networking. 2022-02-15 12:04:37 -08:00
Alex Vandiver bb4c0799cc puppet: Switch to the canonical case for $::os['family'].
The == operator in Puppet is case-insensitive for ASCII
characters[1], which is potentially surprising.  Switch to the
canonical case that `$::os['family']` returns.

[1] https://puppet.com/docs/puppet/5.5/lang_expressions.html#string-encoding-and-comparisons
2022-02-15 12:04:37 -08:00
Alex Vandiver d4eefbbeea puppet: Switch from $::osfamily to non-legacy $::os. 2022-02-15 12:04:37 -08:00
Alex Vandiver a787ebe0e2 puppet: Switch from $::architecture to non-legacy $::os. 2022-02-15 12:04:37 -08:00
Alex Vandiver d7e8733705 puppet: Use goarch for wal-g.
wal-g does not currently provide pre-built binaries for
arm64/aarch64 (see #21070) but if they begin to, it will likely be
with the goarch names.
2022-02-15 12:04:37 -08:00
Alex Vandiver abdbe4ca83 puppet: Use goarch for go-camo. 2022-02-15 12:04:37 -08:00
Alex Vandiver be2f2a5bde puppet: Use goarch for golang.
Fixes: #21051.
2022-02-15 12:04:37 -08:00
Alex Vandiver 788daa953b puppet: Factor out $::architecture case statement for golang. 2022-02-15 12:04:37 -08:00
Steve Howell 19ab70c922 node tests: Remove unneeded mock. 2022-02-15 09:43:06 -05:00
Anders Kaseorg f6a701090c setup-apt-repos: Don’t install lsb_release.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-14 16:38:53 -08:00
Anders Kaseorg 45f4db9702 puppet: Remove unused $release_name.
It would confuse a future Debian 15.10 release with Ubuntu 15.10, it
relies on the legacy fact $::operatingsystemrelease, the modern fact
$::os provides this information without extra logic, and it’s unused
as of commit 03bffd3938.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-14 16:38:53 -08:00
Mateusz Mandera 26f9f3cc4b migrations: Don't push events to deferred_work queue if TEST_SUITE.
The deferred_work events can't be processed in the test suite
environment, since it tries to make requests to the host <realm.uri>
which is "zulip.testserver" and obviously not going to work. Since the
test suite base data set has no animated emoji, there's nothing to do,
and we can skip this step.

This code only runs when applying the migration to an already
provisioned test db - because during an initial db set up there are no
realms yet, so no events get pushed by the migration.
2022-02-14 16:05:25 -08:00
Anders Kaseorg 7213116dd3 provision: Use apt-get --allow-downgrades.
Needed for commit 9c8d2b7be3 (#21115).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-14 16:02:35 -08:00
jai2201 44bd6cafb7 js: Add tabindex attribute for anchor tag to allow focus.
This adds tabindex='0' in anchor tags for allowing the message menu
popover box to be focusable using hotkey 'i' through keyboard.

This is a necessary follow up to
729c09074a, which removed the href
attribute from anchor tags to which click-handlers were attached,
which resulted in making them non-focusable as jQuery doesn't allow
anchor tags to be focusable without tab-index or href attribute.

Fixes #21125.
2022-02-14 15:23:46 -08:00
Tim Abbott 36b208ad51 reactions: Increase font size for reactions.
This seems to have no negative effect, and substantially improves the
visuals in situations where we're displaying a user's name.

While we're at it, switch to a relative font size.
2022-02-14 12:01:09 -08:00
Tim Abbott d915a13d61 filter: Add near operation to operators allowing collapsing.
I noticed this bug only a few minutes after merging
02af4e9ad0.
2022-02-14 12:00:11 -08:00
Aman Agrawal 430d1a411e tippy: Make background color of tooltips close to black.
This is aimed towards increasing the contrast for tooltips in
dark theme.
2022-02-14 11:57:04 -08:00
Tim Abbott 02af4e9ad0 message feed: Don't share headers for non-adjacent messages.
When viewing a narrow such as a search or `sender:` view, where
consecutive messages in the view may not be consecutive in their
original stream/topic context, we should avoid displaying the messages
with a shared sender/recipient bar header, as that creates the
incorrect perception that they are consecutive.

Back in 2013 (bc8bc8567b), we
implemented this via the collapse_messages flag, but it appears more
recent refactoring (no more recent than
dbffb2a614) made it always true.

The original logic was incorrect, in that it only considered full-text
search views, and not other views with this property.

I originally planned to use the existing logic for
can_mark_message_read designed for this purpose, but I think there
might be product reasons why might want the logic to be independent.
2022-02-14 11:53:35 -08:00
ditsuke 6491ed7213 message_feed_view: Align images with message.
Removes the 5px `margin-right` on images, replacing it
with a 5px `margin-left`. This change aligns the images
with the message content while making sure they do not
stick stick together in other layouts.
2022-02-14 11:48:01 -08:00
Aman Agrawal 2421f6846d compose_control_buttons: Move GIF button out of the popover. 2022-02-13 19:13:29 -08:00
kraktus 0ed5626a08
api docs: replace `subject` with `topic` in Curl example.
`subject` has been a deprecated alias since zulip 2.0.0.

It seems to be the only hardcoded example according to c4d805a82c
2022-02-13 19:12:54 -08:00
Anders Kaseorg 12da3ac0ad pgroonga: Re-enable PGroonga in development.
This partially reverts commit fdabf0b357
(#21104).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-13 19:11:49 -08:00
Anders Kaseorg 9c8d2b7be3 apt-repos: Downgrade PostgreSQL to dodge PGroonga regression.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-13 19:11:49 -08:00