Commit Graph

13417 Commits

Author SHA1 Message Date
Sahil Batra 9b7dcd11ae settings_users: Pass user_id instead of row to update_view_on_deactivate. 2022-02-25 14:55:44 -08:00
Mateusz Mandera d5db254ca8 CVE-2021-3967: Only regenerate the API key by authing with the old key. 2022-02-25 14:00:52 -08:00
jai2201 9288f00cd7 recent-topics: Add `width` CSS property in filter check icons.
This commit adds a width of 10px to fa-square and fa-check-square
icons in recent-topics table, so that on toggling between these icons
we can prevent the change in width of the whole button to make it look
good visually.
2022-02-25 11:15:54 -08:00
Sahil Batra 9be82356cb invite: Add frontend support to send an invite which never expires.
Fixes part of #20337.
2022-02-24 16:32:20 -08:00
Sahil Batra cec8191bfa popovers: Add option to deactivate user to "Manage user" modal.
This commit adds option to deactivate user to "Manage user" modal.
A modal is opened on clicking the option to confirm the deactivation
and the "Manage user" modal is closed.
The error from the server, if any, is shown in the modal itself
and in case deactivation is done successfully, the modal is closed.

Fixes #18944.
2022-02-24 15:59:58 -08:00
Sahil Batra 0a27c38af7 settings: Pass handle_confirm function as argument to confirm_deactivation.
We pass handle_confirm function as an argument to confirm_deactivation
because we will use confirm_deactivation to deactivate the user from
user-info popover and the popover case will have a different handle_confirm
function (which is called after clicking "Confirm" button of the modal)
since error handling in that case will be different as there will be no
overlay in the background.
2022-02-24 15:59:58 -08:00
Anders Kaseorg 21cd1c10b3 docs: Add missing space in “time zone”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-24 14:05:12 -08:00
Austin Riba 26ec71c39d lightbox: Prevent panning image out of view.
This commit adds a method to detect whether the draggable element has
moved out of view and if it has, move it back into view.

The panzoom library does have a `bounds` option that is supposed to
provide the functionality, but at the time of the commit it does not
appear to work correctly. Upstream bug:
https://github.com/anvaka/panzoom/issues/112
2022-02-23 12:13:17 -08:00
Austin Riba 7d3bbe03ac lightbox: Swap panzoom library to anvaka/panzoom.
This PR changes the library used for panning and zooming in the lightbox
module from timmywil/panzoom to avanka/panzoom.

The original (timmywil) version of the library contains a bug where if
you have a high resolution touchpad and Firefox and you zoom in and out
repeatedly on an image, the image may drift. avanka/panzoom does not
appear to display this behavior.

Restores the behaviour from before 5f83bc5cfe, where clicking
outside the image closes the lightbox, primarily by way of swapping
out the panzoom library.

Fixes: #21163.
2022-02-23 12:12:04 -08:00
Steve Howell ca17a452fd subscribers: Rename file to stream_edit_subscribers.js.
We are going to move to this code organization for
managing streams:

    stream_create.js
        stream_create_subscribers.js
    stream_edit.js
        stream_edit_subscribers.js

The modules stream_create.js and stream_edit.js historically
manage the entire process of creating and editing stream
data (respectively).

Going forward both will delegate most of the subscriber-specific
pieces to either stream_create_subscribers or stream_edit_subscribers.

The stream_*_subscribers modules will be somewhat similar in
nature, but the way that we manage subscribers at creation time
is a bit different than how we manage subscribers at edit time.
2022-02-22 16:29:36 -08:00
Steve Howell 22660a78c7 edit subscribers: Generalize pill/button handling.
This will help us avoid some duplicate code when
we use input pills for stream-create.

See the long comment in set_up_handlers() for
more context.

We also rename:

    submit_add_subscriber_form -> subscribe_new_users

Ideally set_up_handlers() would also extract the
concept of clearing the pills as soon as you either
hit enter or clicked on the Add button, but our
current paradigm for clearing pills when you edit
subscribers for an existing stream on the Subscribers
tab is that we wait for the server to acknowledge
the request. I believe this is a bit of a misfeature,
but I am punting on that change for now.
2022-02-22 16:29:36 -08:00
Steve Howell ebda1dfc8b manage streams: Extract add_subscribers_pill.js.
This is mostly a pure code move.  A few small tweaks:

    * The create() function is new.
    * The new module doesn't assume a `pill_widget`
      global.

This module represents the truly re-usable code
that can be shared during these two user actions:

    * edit-stream subscribers (now)
    * create-stream subscribers (future)

In both situations the input pill has (or will have)
essentially the same behavior, and the next commit
will tighten up the abstraction.

(The two processes will both also use fairly similar
ListWidgets, but the mechanics of managing the list
are going to be different, so we do not intend
to keep around stream_subscribers_ui in its current
name. More on that later.)
2022-02-22 16:29:36 -08:00
Steve Howell 65b51ae3bd subscribers: Extract subscriber_api.
This simplifies some of our dependencies.

As an example, we really don't want compose.js
to depend on stream_subscribers_ui.js, since
the former doesn't use any actual UI code from
the latter.

We also rename the two functions here:

    invite_user_to_stream -> add_user_ids_to_stream
    remove_user_from_stream -> remove_user_id_from_stream

(The notion of "inviting" somebody to a stream is
somewhat misleading, since there is really no invitation
mechanism; you just add them.)

Apart from naming changes this is a verbatim code move.

Finally, we eliminate a little bit of test cruft--the
`override` helper already ensures that a function gets
called at least once during a test.
2022-02-22 16:29:36 -08:00
Steve Howell 1bf9a9e84a node tests: Directly test user_group_pill helpers.
We also sort user_ids to be deterministic.
2022-02-22 16:29:36 -08:00
Steve Howell 0452f49c97 node tests: Directly test simple stream_pill helpers.
We also sort the user_ids to be deterministic.
2022-02-22 16:29:36 -08:00
Purushottam Tiwari 3984df88bb message-editing: Add support for dynamic elements in edit-history.
Edit history of message was rendered directly without passing
it through rendered_markdown.js. Due to this several visual
features for dynamic elements like time, spoilers, mentions
etc were not available.

To fix above issues we pass the content of edit-history
through rendered_markdown before showing edit history modal.

Fixes: #16029.
2022-02-22 15:00:01 -08:00
m-e-l-u-h-a-n 16687d4c74 markdown: Improve drafts rendering of custom Markdown features.
Improves rendering of drafts to make it look more closer
to normal messages. This is done by passing the draft content
through rendered_markdown so that dynamic elements in the content
get updated before showing drafts modal.
2022-02-22 14:59:50 -08:00
Sayam Samal d763847cb9 settings: Fix overflow due to unset border-radius. 2022-02-22 10:42:21 -08:00
Sayam Samal bbfc958c62 settings: Fix responsiveness of the profile avatar.
Moves the profile avatar to the top when the viewport is narrowed down.

Tweaked by tabbott to add the 20px bottom margin in a more consistent
way, which also lets us deduplicate some code.

Fixes #21000.
2022-02-22 10:41:59 -08:00
Sahil Batra 2c664a85fb bots: Do not allow to remove owner from edit bot form in personal settings.
d6fb439c7a removed the option to remove owner from the edit form available
to admins, but the option was still present in the edit form available to
the owner of bots in "Bots" section of personal settings. This commit
removes the option from form in "Bots" section of personal settings as well.
2022-02-22 10:35:18 -08:00
NerdyLucifer 891ed242d1 popovers: Add "busy" status to default emoji status set.
Add info about the status in the array
"default_status_messages_and_emoji_info".
Set status message as "Busy" and emoji "working_on_it".

Fixes #21179
2022-02-22 10:33:31 -08:00
Sahil Batra 21051d2130 settings: Show or hide digest weekday option on changing emails setting.
Previousy, we used to show or hide the digest weekday setting after
saving the emails setting, but now we show/hide as soon as we check
or uncheck the email setting checkbox like we do for other settings.
2022-02-21 08:53:33 -08:00
Dinesh 6afdf2410d message feed: Notify user when messages are not being marked as read.
Notifies user when messages are not being marked as read through a
banner that lets them mark all messages in the narrow as read. Note
that the banner is only displayed if the user's actions, like
scrolling, would've actually marked the messages as read.

This avoids distracting the user when viewing a thread they've already
read.

tabbott has verified that if new messages come in, the banner will reappear.

Fixes: #18768.
2022-02-18 14:48:31 -08:00
Tim Abbott bb5889b0a0 message_list: Add helper for checking if a message list has unreads. 2022-02-18 14:48:31 -08:00
Dinesh a2ca558c3e unread_ops: Add process_scrolled_to_bottom().
There are a few instances where we check if messages can be marked
read and mark that list as read when scrolled to bottom. Using
this would be nicer and also this function can be extended later to
display a banner when messages are not being marked.
2022-02-18 14:48:31 -08:00
jai2201 1b0b0d64e5 left-sidebar: Align more-topics li item with other topic names.
The class `sidebar-topic-check` has a minimum width assigned for the
`topic-resolved` icon to create an appropriate space for that column
whether or not there are resolved topics present.

Add a corresponding `margin-left` to align `more topics`
appropriately.
2022-02-18 13:39:08 -08:00
Aman Agrawal 0eafa6039b message_scroll: Show scroll to bottom button.
Show/hide scroll to bottom button when the last message is
not visible in the current scroll position.

We adjust the bottom offset of the button based on compose box
height.

Fixes #19862
2022-02-18 13:29:57 -08:00
Aman Agrawal ea07b6440c integrations: Adjust font size to fit integration name during initial load. 2022-02-18 12:22:32 -08:00
Aman Agrawal d9497afe9d integrations: Don't fix height of integration icon in detailed view.
This allows us to have more characters that we can use for the
integration name without overflowing the fixed height.
2022-02-18 12:22:32 -08:00
Aman Agrawal 9b622b7d25 gear_menu: Allow user to configure preferred theme.
We save the preferred theme in localstorage so that user doesn't
have to re-select the theme on every reload. Users on slow
computers might see flash of a theme change, if it happens.
2022-02-18 11:29:48 -08:00
Aman Agrawal 8e7e8c7179 gear_menu: Hide non-relevant buttons for spectators. 2022-02-18 11:27:12 -08:00
Aman Agrawal b675db78a3 compose: Change icon of formatting popover to a question.
Fixes #21183
2022-02-18 11:16:19 -08:00
Aman Agrawal bd97797904 compose: Add right padding to drafts to make outline look even. 2022-02-18 11:16:19 -08:00
Aman Agrawal ad555f2feb tippy: Only change background color of tooltips with no theme.
This change was not aimed at popovers that use tippy. Since
popovers use light theme and tooltips don't, we use this
`not[data-theme]` selector to exclude popovers from being
affected by this change.
2022-02-18 10:51:35 -08:00
yogesh sirsat 8a1df07e64 recent topics: Display user info popover when clicking participants.
Tweaked by tabbott to do something reasonable for muted users and
display a cursor indicating clicking will do something.

Fixes #21154.
2022-02-17 15:49:24 -08:00
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
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
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
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