Commit Graph

48933 Commits

Author SHA1 Message Date
Alex Vandiver 12a5317b8c bootstrap-aws-installer: Switch to an IMDSv2-compatible URL.
We don't use the token we request for anything, but a straight GET
request would fail in an IMDSv2-only environment.
2022-10-28 16:52:54 -07:00
Alex Vandiver 721a1d7a10 bootstrap-aws-installer: Drop "credential_source" in .aws/config.
Setting `credential_source` is used when assuming role credentials --
that is, when running as one role, use the AssumeRole right to become
someone else.

The AWS command-line tools only do this if `role_arn`, the role to
assume, is also set -- if it is not set, it transparently falls
through to IAM role attached to the EC2 instance profile.  However,
with the `aws-sdk-go` package, used by Teleport, this configuration
produces an error.

Remove the `credential_source = Ec2InstanceMetadata` line, which isn't
necessary for the AWS CLI, and interferes with Teleport operation.
2022-10-28 16:52:54 -07:00
Alex Vandiver 6662a3bac4 teleport: Switch to the new apt host for Teleport.
The apt.releases.teleport.dev repository is deprecated as of the
release of Teleport 11, and has been replaced with
deb.releases.teleport.dev[1].

[1]: https://goteleport.com/docs/changelog/#deprecated-old-debrpm-repositories
2022-10-28 16:52:54 -07:00
Alex Vandiver 88fcf6862f bootstrap-aws-installer: Add ed-25519 host key. 2022-10-28 16:52:54 -07:00
Alya Abbott 7d95f5caea help center: Clearly refer to mobile apps on /help/mobile-notifications.
Addresses user confusion about whether "mobile notifications" might refer
to text messages.
2022-10-28 11:41:11 -07:00
Sahil Batra 2a8b7412ff url_encoding: Use user name instead of email in personal_narrow_url.
This commit updates the urls for personal narrow sent in email
notifications to be of form "{user_id}-{encoded_full_name}" to
make it consistent with the urls that we use for such narrows
in webapp which were recently updated in b4eddad for improving
performance. We encode the full name in the same way that we do in
webapp by replacing the url characters encoded by browser with "-".
2022-10-28 09:47:43 -07:00
Mateusz Mandera a410f6b241 do_mark_all_as_read: Split up the work into batches.
Fixes #15403.
2022-10-27 16:59:54 -07:00
Mateusz Mandera ef468322f1 test_openapi: Fix status code passed to validate_... in test_attributes.
It doesn't seem to make sense to append _{number} to the status code in
that arg, because the resulting string stops looking like a status code
and actually makes this test fail in the follow-up commit with the
confusing error message of

Unknown response http status: 2000

So this just seems like a bug.
2022-10-27 16:59:54 -07:00
aparna-bhatt 5189826f27 css: Improve the dialog_widget loading spinner visuals.
Previously, when you clicked the confirmation button in a
dialog_widget, we'd display a loading spinner on top of an ugly grey
button background.

Remove the ugly grey background color, while making sure the loading
spinner inside the button looks good and doesn't resize the button.

Fixes: #22002
2022-10-27 16:29:22 -07:00
Zixuan James Li 6f4047c679 unread: Extract old_unreads_missing.
This avoids post-initialization access to page_params inside unread.js.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-27 14:59:16 -07:00
Zixuan James Li 79b8219797 unread: Pop unread_msgs from page_params for initialization.
This change is made so that we are not accessing the global page_params
directly. Note that we also rename unread_msgs to params to match other
modules that follow this pattern.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-27 13:03:54 -07:00
Zixuan James Li b9f7edb58a unread: Stop accessing page_param.unread_msgs after init.
This adds a get_unread_message_count helper that returns the size of
unread_messages and replaces the usage of page_param.unread_msgs.count
elsewhere in the codebase.

Fixes #23334.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-27 13:03:54 -07:00
Alya Abbott 6c88ca91b1 help center: Update emoji reactions documentation.
- Document new option for toggling whether names are displayed.
- Add mobile instructions.
- Other organization and wording improvements.
2022-10-27 12:56:19 -07:00
Tim Abbott d47f29c2d6 reactions: Implement display_emoji_reaction_users setting.
This setting provides a more ergonomic experience when viewing a
message where only a small number of emoji reactions are present; you
no longer need to hover over the reaction to see who reacted, which is
often quite important to understanding what it means.

We added this setting (visible in the development environment only,
and implemented on mobile) a few months ago; so to complete this
feature, we just need to add the frontend rendering/live update logic
and publish it.

As documented in the code comments, the current rule is "messages with
3 or fewer reactions" for which messages will display the names of the
users reacting.

The previous set_reaction_count API made sense when the display of a
given reaction was a pure function of its data. However, we will soon
be making it a function of the total number of reactions on the
message.

Thus, view functions to update reaction display now need to call a
shared update_vote_text_on_message function in all code paths, even
code paths like "add the first vote for a reaction" and "remove the
sole vote of a reaction" which previously did not need to call
set_reaction_count.

Fixes #20890.
2022-10-27 12:41:51 -07:00
Tim Abbott 98c478d994 reactions: Pass full message objects to view functions.
This is not the cleanest API, but it will be necessary in the next
commit in order to update the message's rendering of other emoji.
2022-10-27 12:41:51 -07:00
Tim Abbott 02b670fa66 reactions: Use clean_reaction_object API for view functions.
This substantially reduces the complexity of parameter passing in the
reactions rendering code path.
2022-10-27 12:41:51 -07:00
Tim Abbott b346e492c8 reactions: Reorder make_clean_reaction. 2022-10-27 12:41:51 -07:00
Tim Abbott 545a31e0b1 reactions: Delete stale message.reactions after cleaning.
Also update some comments explaining the core data model and approach
for set_clean_reactions.
2022-10-27 12:41:51 -07:00
Tim Abbott 5bd074bb36 reactions: Use a better variable name for clean_reactions objects.
We may want to rename clean_reactions to something else, but the name
`r` is pretty confusing for an object that isn't a single reaction,
but instead an object detailing all the reactions on a message.
2022-10-27 12:41:51 -07:00
Raghav Luthra a8fc195402 reactions: Change color of reaction counter from blue to black.
The blue font color on the vote_text beside the reactions in
light mode made it seem like a link which it's not, so it has
been changed to regular font color.

We preserve the blue font color on hover, matching the add-reaction
button.
2022-10-27 12:41:51 -07:00
Raghav Luthra 477a1b5789 reactions: Refactor CSS to prepare for longer vote_text.
This fixes a bug where in narrow windows, long vote_text could extend
beyond the body of the reaction's allocated area.

It also provides a matching right margin around the count/name inside
the reaction pill, which looks better when we have strings inside them.
2022-10-27 12:41:51 -07:00
Raghav Luthra 1b75151a97 settings: Fix display_emoji_reaction_users org setting save/discard.
Follow-up to commit 22a5d008c1.

The new display setting introduced in above commit was not registered
properly and enabling/disabling it from Organization settings > Default
user settings did not display a "Save/Discard" widget. This has been
fixed by modifying the `settings_org.get_subsection_property_elements`
function.
2022-10-27 12:41:51 -07:00
Aman Agrawal b23931bd66 recent: Fix unread counts wrappings to next line in long topic names.
We limit the word break to only text present inside the `a` tags
so that it doesn't apply to unread count.
2022-10-26 21:34:36 -07:00
Tim Abbott 6f8476ced9 templates: Improve unsupported DevAuthBackend error page.
Previously, we didn't mention the possibility that this could have
been disabled by an organization administrator.
2022-10-26 21:16:31 -07:00
Aman Agrawal 45f35a464e stream_list: Reduce stream header's height when scrolling elt into view.
Since stream header is now sticky, we need to reduce it's height
when calculation position of the element we want to scroll into view
so that it doesn't hide under the sticky header.
2022-10-26 13:47:08 -07:00
Aman Agrawal fc70921eeb scroll_util: Add support for sticky headers.
When calculating position of an element, we now take into account
the height of the sticky headers too.
2022-10-26 13:47:08 -07:00
Aman Agrawal 470553b457 left_sidebar: Fix some PMs not being displayed when PMs are zoomed in.
We added sticky headers above the PM list but forgot to subtract
it from the max-height of the scrollable container.
2022-10-26 13:47:08 -07:00
jai2201 6f9e97921d pm_section: Create collapsible private messages section.
This commit introduces the change of rendering private messages
section as collapsible, whose data-fetching logic came with zulip#21357.

We now have separated out `Private messages` from `top_left_corner`
section and shifted it below the `global_filters` in a different
separate section along with stream list with common scroll bar
in left-sidebar.

The new PM section will be opened by-default on loading the page
and will have a toggle-icon in its header, clicking on which makes the
section collapse/expand accordingly.

In default view, only recent 5 PM threads would be shown
and would append the active conversation as the 6th one at last
if not present in those 5, similar to how topics list work.

In PM section with unreads, a maximum of 8 conversations
would be shown and rest of them would be hidden behind
the 'more conversations' li-item, clicking on which takes
to the zoomedIn view of PM section where all the present
PM threads would be visible and rest of the sections of left-sidebar
will get collapsed.

Fixes #20870.

Co-authored-by: Aman Agrawal <amanagr@zulip.com>
2022-10-26 13:47:08 -07:00
Barissa-Imran 15b9e9c7cc bots: Customize reactivation confirmation modal for bots.
Since bots can't join user groups, and end users don't think of bots
as a special class of users, it's worth having special text here.

Fixes: #23270.
2022-10-26 13:26:16 -07:00
Rebecca Södereng 5814b61f00 popovers: Drop text for historical messages from three-dot menu.
Dropped text "(Message sent when you were not subscribed)" for
historical messages in the three-dot message menu.

This information was already available via the "You subscribed" type
divider lines, which were added about the same time back in 2013, and
this text feels somewhat ugly.

Also removed the historical field from the args object that is
passed to the template, as this is not used anymore.

Fixes #23198.
2022-10-26 13:20:37 -07:00
David Rosa 53b18f819a help: Add "View messages sent by user" page.
Some options in the profile menu are not documented in the help center.

Documents "View messages sent".
Documents "View messages with yourself".
Links `sender:me` search operator to the relevant section on this page.

Fixes: #23203.
2022-10-26 13:16:57 -07:00
Lauryn Menard 7172a6ef13 filter: Show stream and topic title for near link narrows.
Updates the `filter.get_title` logic to return the stream name for
narrows that include the stream, topic and near operators. That
way the browser/tab title remains the same for these views, which
have a particular scroll offset.
2022-10-26 12:35:28 -07:00
Aman Agrawal ca36f23d9f recent_topics: Fix long topic and stream words squeezing other rows.
Topics and streams containing long words can cause horizontal
overflow and squeeze other columns too much.
2022-10-26 12:28:58 -07:00
Alya Abbott 8f6cf65f28 help center: Reorganize and extend the "Logging in" help page.
Also move some instructions from related pages into shared /include files,
with minor tweaks.
2022-10-26 12:28:29 -07:00
Alya Abbott 16d5f15fad help center: Make URLs non-relative where appropriate.
Change URLs on "Choosing between Zulip Cloud and self-hosting" page
to be non-relative when pointing to the Zulip landing page or `/new`
for creating a new Zulip Cloud organization.
2022-10-26 12:28:29 -07:00
Lauryn Menard 95aa9a4f83 compose-box: Remove reset max-height calculation for preview click.
Removes call to reset_compose_message_max_height when clicking on
the markdown preview button, which due to the `#compose` div element
momentarily shrinking to be empty, caused the calculation of the
max-height to grow larger on each click.

Also refactors reset_compose_message_max_height to use the height
from `getBoundingClientRect`, which defaults to zero when empty.

And fixes a small discrepancy in how max-height is applied to
a div element vs a textarea element, so that the visible height
doesn't change between the preview and write modes in the compose
box.

Fixes #23277.
2022-10-25 13:49:29 -07:00
Matt Keller 4d87bf291c slack: Skip files where file_access: file_not_found. 2022-10-25 12:18:20 -07:00
Alex Vandiver 63d2565467 ci: Do not pre-install rabbitmq-server in Docker images.
Before Zulip 4.9, the Zulip install process left any already-installed
rabbitmq with whatever nodename it had previously configured.  Wince
this encodes the name of the host when it was installed, this does not
function well with containers.

Leave rabbitmq-server uninstalled, which lets the Zulip installation
process set the nodename to `localhost`, which ensures that it is
usable across container restarts.
2022-10-25 14:53:32 -04:00
Alex Vandiver b161cba078 ci: Backport two patches to the 3.4 prod install process. 2022-10-25 14:53:32 -04:00
Aman Agrawal 5ee78fc14c recent_topics: Don't process hotkeys in empty table.
The fixes errors when we are trying process user input before
anything is initialized in recent topics.
2022-10-25 11:07:26 -07:00
Aman Agrawal 2d31b52927 ui_init: Initialize hotkey handlers after other libraries are initialized.
This gives us some time to render and fetch data before allowing
user to start using hotkeys. It avoids error being thrown when
hotkeys are used when the app is still loading.
2022-10-25 11:07:26 -07:00
Lauryn Menard e66f125ee6 recent-topics: Update hash for view to be "#recent".
Updates the hash used for the recent conversations view to be
"#recent" instead of "#recent_topics".

We will need to keep the logic for handling "#recent_topics"
permanently because users potentially have messages from
Welcome Bot with links to that hash.

Including "recent_topics" as a web_public_allowed_hash in
hash_util.js can be changed once self-hosted servers cannot
upgrade directly to Zulip 5.x from the current version.

Fixes #23132.
2022-10-25 11:03:44 -07:00
Tim Abbott 530406e2ef resize: Don't call resize_page_components for new messages.
The resize handler is a somewhat expensive operation, which we'd like
to avoid when processing the receipt of new messages. It's also
unclear why it would be necesssary; bottom_whitespace is fixed in
size, and the sidebars.
2022-10-25 10:53:48 -07:00
Tim Abbott 8d33a62eca message_util: Avoid unnecessary unreads work processing new messages.
It should be very rare to discover new unread messages during a
message_fetch call. This can potentially happen due to races (fetching
just as a new message arrives), but it shouldn't be the common case.

Previously, we would trigger a full rerender of all UI displaying
unread messages every time a bulk message fetch operation returned
(including every time one narrowed), regardless of whether any actual
state had changed.

Fix this by actually checking if we discovered any new unread messages.
2022-10-25 10:53:48 -07:00
Tim Abbott 505a9119ba stream_popover: Remove unnecessary resize call.
There's no reason that opening left sidebar popovers should require
the app to recalculate the size of any of its components; popovers are
drawn on top of the rest of the UI in any case.

This appears to have been added in
9ed05a1f85 as part of prototyping the
left side user list feature.
2022-10-25 10:53:48 -07:00
Tim Abbott 20b357d8d9 popovers: Remove unused show_pm_list_sidebar.
This was likely introduced in error in
fd66d9f70336b2bdbbffb1bf13402516b9920682; it is a duplicate of
show_userlist_sidebar, which, in contrast is actually called.
2022-10-25 10:53:48 -07:00
Tim Abbott 5a83543418 stream_events: Use update_unread_counts API.
Because we can count on the unread.js data structures to be correct,
we no longer need this legacy code that tries to re-process all
messages the client has cached for whether any are present in the
target stream and marked as unread.

It's not clear we need this at all, since the current Zulip server
will mark all messages as read when unsubscribing from a stream, but
having this call protects us from future bugs should that behavior
change.

This cleanup also revealed a possible bug, where we would fail to
update global unread counts properly when unsubscribing from a stream
until the deferred_work queue processor sends us the
update_message_flags event associated with that change.
2022-10-25 10:53:48 -07:00
Tim Abbott 8265bb75cb stream_muting: Call the update_unread_counts directly.
The previous invocation message_util.do_unread_count_updates dates
from a time when `unread.js` did have any data beyond what full
message objects were present in the client, and thus we needed to
recalculate everything from those message objects when muting state
was changed.

With the modern unread.js data structures, all that's required is a
full recalculation/rerender via this function.
2022-10-25 10:53:48 -07:00
Sahil Batra b4eddad9a5 people: Use names in PM urls instead of emails.
We change the "pm-with" and "sender" narrow urls
to be of "{user-id}-{encoded_name}" form instead
of using email. This change improves performance
of changing between PM views since parseOneAddress
function was slow and we remove its usage now by
using name instead of email.

The name is encoded such that the characters that
would be encoded by the browsers are replaced by
"-".
2022-10-25 10:42:00 -07:00
Rishant Rokaha a9893fb654
settings: Add confirmation modal for reactivating a bot in personal settings.
There's already a similar modal in organization settings, so this improves 
the consistency of the UI.

Fixes #23281.
2022-10-25 10:39:16 -07:00