Commit Graph

13514 Commits

Author SHA1 Message Date
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
Tim Abbott c4af509339 left sidebar: Increase bottom margin.
This improves the visual appearance of the state where you're scrolled
to the bottom with your mouse over a URL.
2022-02-11 14:33:54 -08:00
jai2201 e11c495dff left-sidebar: Leave space below link for it to be visible.
Add a margin below the subscription link for it to be visible when we
hover over links, where the browser will display the URL in the
bottom-left corner of the screen.
2022-02-11 14:28:30 -08:00
jai2201 2281adc101 left-sidebar: Make subscription link non-sticky. 2022-02-11 14:28:09 -08:00
Tim Abbott c674d4cac0 templates: Fix indentation formatting of input_pull.hbs. 2022-02-11 13:58:02 -08:00
YashRE42 96682a3517 status_emoji: Show status emoji in compose_pm and mentions typeaheads.
Previously the emoji_status set by the user would only be seen in a
few places, it was decided that it would be useful to show the
emoji_status in a couple of other additional places as well.

As such this commit uses the status_emoji template to show the status
emoji in the compose_pm typeahead and the mentions typeahead.

Status emoji changes do not live update these, but neither do user
renames, so there's bigger problems if that's a concern.

Fixes: #19865.
2022-02-11 13:30:08 -08:00
YashRE42 fa7c8f8c32 status_emoji: Show status emoji in compose_pm pills.
Previously the emoji_status set by the user would only be seen in a
few places, it was decided that it would be useful to show the
emoji_status in a couple of other additional places as well.

As such this commit uses the status_emoji template to show the status
emoji in the compose_pm pills. Due to the fact that we use the same
pills system to render in the user_group, we need to add a
conditional to prevent rendering there since the user status is not
valuable there.

Status emoji changes do not live update these, but neither do user
renames, so there's bigger problems if that's a concern.
2022-02-11 13:30:08 -08:00
Tim Abbott 93ce3396ac status emoji: Adjust margin for common element.
After some experimentation, these styles look better in all the places
we're displaying status emoji.  See the comments for justification.
2022-02-11 13:29:32 -08:00
AnushaNathRoy 8da5edb7af status_emoji: Show status emoji in message_body.
Previously the emoji_status set by the user would only be seen a few
places, it was decided that it would be useful to show the
emoji_status in a few additional other places as well.

Use the status_emoji template to show the status emoji in the
message_body and also implement live update behavior.

With refactor and minor edits by Yash RE.

Co-authored-by: YashRE42 <33805964+YashRE42@users.noreply.github.com>
2022-02-11 13:02:56 -08:00
AnushaNathRoy e1fd47a692 status_emoji: Show status emoji in single PMs in the PM list.
Previously the emoji_status set by the user would only be seen in the
buddy list, it was decided that it would be useful to show the
emoji_status in other places as well.

As such this commit uses the status_emoji template to show the status
emoji in the PM list and also implements live update behavior.

With refactor and minor edits by Yash RE.

Co-authored-by: YashRE42 <33805964+YashRE42@users.noreply.github.com>
2022-02-12 01:06:52 +05:30
Mr.mad 22bfa56301 left sidebar: Redirect users with no stream create permissions.
Previously, when the user clicked the `Add streams` icon in the
streams list sidebar, we provided a popover offering to create or
subscribe.  This was confusing for users who did not have permission
to create streams.

Redirect users that don't have stream creation permissions
directly to browse streams without going through this popover.

Fixes: #20676.
2022-02-11 11:02:09 -08:00
Tim Abbott a6c364cdd7 left sidebar: Rename streams_inline_cog.
The icon hasn't been a cog for some time.
2022-02-11 10:58:32 -08:00
Tim Abbott 68055048a0 message feed: Add 4px left margin to edited notices.
This makes them not look squished up against the name.
2022-02-10 13:52:24 -08:00
jai2201 67625d6c7b message_feed: Remove the parenthesis around edited notices.
They were found to not particularly improve the UI.

Fixes #21043.
2022-02-10 13:52:24 -08:00
Aman Agrawal 0ac8f053a6 search_suggestions: Remove filters unusable by spectator. 2022-02-10 11:37:38 -08:00
Aman Agrawal 6e4c2e63f5 right_sidebar: Make spectator login buttons don't stick to scroll bar. 2022-02-10 11:37:38 -08:00
Aman Agrawal bf3bf285a2 recent_topics: Hide mute and read buttons for spectators. 2022-02-10 11:37:38 -08:00
Mr.mad c80275370e stream_color: Fix stream color not updating to default.
Previously, if the user changes any stream color and updates it back
to the default color without reopening the change color popover, the
second color change didn't take effect.

Fix bug by destroying the colorpicker object and rebuilding it again
every time a color change is triggered by the confirm button.

Fixes: #21055
2022-02-09 16:20:24 -08:00
YashRE42 c81a8c0346 message_live_update: Only rerender relevant messages for name/avatar.
Previously, we would call `rerender_messages_view()` in order to
rerender messages after user renames or avatar updates. This would
lead to rerendering the entire message list for every change,
regardless of whether any specific message had changed or not.

This used to be acceptable because user renames and avatar updates
were rare events, however, as we plan to show user status emoji near
user names and updates to those would be more frequent than is
affordable, this commit implements
`rerender_messages_view_for_user(user_id)` which only rerenders
messages which have actually been changed.

This commit is, thus, both an optimisation for the existing code and a
prep-commit for the user status emoji.
2022-02-09 14:17:36 -08:00
YashRE42 33f9e83588 message_list_view: Recalculate more fields for _rerender_message.
Previously, we used to only calculate sender_is_bot, sender_is_guest,
small_avatar_url and background_color on the message_container via
build_message_groups (ie via .render, which also gets called from
.rerender_with_target_scrolltop).

This would mean that if we tried to use `_rerender_message` to update
just a single message (which is something we'd like to do, in order to
make rerenders more efficient), these values would not update.

(This could lead to avatars not light-updating properly).

As such, this commit moves assignment of these values into
`set_calculated_message_container_variables`.
2022-02-09 14:16:02 -08:00
Anders Kaseorg a800a86f54 Revert "drafts: Use simplebar."
This reverts commit 8e06335788 (#21048).

It regressed the ↑ and ↓ keys because drafts.drafts_scroll was not
updated to use ui.get_scroll_element.  Also, styling the native
scrollbar as hidden is not the right workaround because the hidden
native scrollbar still exists and can be scrolled independently of the
SimpleBar.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-09 14:15:27 -08:00
Parth e3ddd662ab message_editing: Fix topic edit propagate option cut-off.
In the topic changing UI, the 'Change later messages to this topic'
and other options in the drop down were cut off when selected in some
languages like Russian.

Make the selection box width adjust appropriately according to the
length of the text, and also place it on its own line unconditionally.
users.

With tweaks by tabbott to use the same approach we already use in the
"Move topic" modal to have the bottom margin for the color block match
that of the dropdown_list_widget itself, of having them share CSS.

Fixes #19739.
2022-02-09 14:06:49 -08:00
Aman Agrawal 7614f2203a pricing: Replace "Zulip Standard" with "Zulip Cloud Standard".
Case sensitive replace.
2022-02-09 11:00:24 -08:00
Sahil Batra 7a2bbc54a8 stream-settings: Fix browser back button behavior for stream settings overlay.
There is no problem in behavior of browser back button we open stream settings
overlay using UI elements since they are appropriately linked to "#streams/all",
"#streams/subscribed" and "#streams/new", but someone can directly go to a
link with "#streams" and in this case we want to fix the browser back button.

This commit replaces "#streams" entry with "#streams/subscribed" which is the
default section opened, such that pressing back when on "#streams/subscribed"
does not go to "#streams" and instead go back actually.
2022-02-09 10:54:52 -08:00
Sahil Batra 9501dd0f94 settings: Fix browser back button not working in settings overlay.
When we open settings overlay we first go to "#settings" hash and
then to "#settings/profile" or hash according to the last opened
section. Now when a user presses back button from "#settings/profile"
it goes to "#settings" which agains then changes to "#settings/profile"
and thus the browser back button does not work as expected.

This commit fixes this by replacing the "#settings" entry in history
with "#settings/profile" or to the hash as per last opened section,
using replaceState and thus there is no entry of "#settings" in history.

Fixes #19820.
2022-02-09 10:54:52 -08:00
Julia Bichler 8e06335788 drafts: Use simplebar. 2022-02-09 10:38:30 -08:00
Sahil Batra 518024e826 stream_settings: Use button element for button used to change stream permission.
We use button element instead of <a> element for the button used to change
stream permission. This change fixes the focus problem where the container
was focussed when closing the permission modal.

The problem here was because Micromodal focuses the element which was just
focused before opening the modal, on closing the modal. And in this case the
focused element before opening the modal was the "simplebar-content-wrapper"
element as <a> tah without href is not focusable element.

Related issue - #20223.
2022-02-09 10:20:47 -08:00
Tim Abbott d48a9ac0f4 message_edit: Fix weird variable name for edit history events. 2022-02-08 17:55:08 -08:00
Tim Abbott 729c09074a js: Avoid href="#" for buttons with a JavaScript click handler.
As seen in
https://chat.zulip.org/#narrow/stream/9-issues/topic/edit.20history.20bug/near/1320430,
clicking such a link takes you to the user's default view if the click
handler throws an exception before doing preventDefault().

There hrefs also have the negative effect of having your browser claim
that clicking the link will navigate you to the default view, which it
won't.

Comes with a linter rule to prevent future instances, since it seems
there are some recently added ones, though they are likely the result
of copy/paste.
2022-02-08 17:38:12 -08:00
Tim Abbott 03d3439784 popovers: Offer edit history option for stream moves.
Apparently, we were only dispalying the edit history option in the
message actions popover if the topic/content were changed. Fix this by
adding a small adjustment to the conditional to include stream
changes correctly.
2022-02-08 17:27:37 -08:00
AnushaNathRoy 5e05dcbc8f status_emoji: Extract status emoji template.
Currently the emoji_status set by the user is only seen in the buddy
list, it would be useful to show the emoji_status in other places as
well.

As such this commit does the prep work of extracting a template which
will be used in all places that need to show the status emoji.

With refactor and minor edits by Yash RE.

Co-authored-by: YashRE42 <33805964+YashRE42@users.noreply.github.com>
2022-02-08 16:52:49 -08:00
YashRE42 768a133715 status_emoji: Modify centering technique for .selected_emoji.
Currently, the emoji_status set by the user is only seen in the buddy
list, it would be useful to show the emoji_status in other places as
well.

As such this commit does the prep work of decoupling the
selected_emoji style in user_status.css from the .status_emoji
style... by having it always override the value of "top".
2022-02-08 16:52:49 -08:00
Ganesh Pawar 73533e578a modal: Add support for event handler on closing a modal.
Part of implementing #20373.
2022-02-08 16:50:46 -08:00
Steve Howell 01335d7492 subscribers: Improve selector for editing subscribers.
In the future we will use input pills for creating streams,
but we want this code to apply only to the edit-stream-subscribers
use case.
2022-02-08 15:21:45 -08:00
Steve Howell 35d1d326c9 subscribers: Move new_stream_users template. 2022-02-08 15:21:45 -08:00
Steve Howell e205d54796 subscribers: Extract add_subscribers_form template. 2022-02-08 15:21:45 -08:00
Steve Howell 070c03e29b subscribers: Extract get_pill_user_ids().
I also clean up all the mutations of `user_ids`
in the calling code.  We now have:

    pill_user_ids
    active_user_ids
    user_id_set
    user_ids

The new function is exported in anticipation of using
it from stream_create.js.
2022-02-08 15:21:45 -08:00
Aman Agrawal 0888a8c628 compose: Fix weird outline for GIF icon.
GIF icon had 32px line-height but only 18px height, this caused it
to trim the bottom part. Make line-height and height same to fix this.
2022-02-08 13:27:27 -08:00
Aman Agrawal 5e90b32f40 tippy: Expand `enter_sends` tooltip to full text width. 2022-02-07 22:23:13 -08:00
Aman Agrawal e1e9708ea8 compose: Remove keyboard focus from stream color block.
This make `shift-tab` from stream input to `compose_top_right`
buttons directly possible.
2022-02-07 22:23:13 -08:00
Aman Agrawal d2a96e905c compose: Reorder compose_top_right buttons in DOM.
User should be able to tab from topic/pm input to textarea and back.
Moving `compose_top_right` button before the stream, topic and PM
input structurally in DOM but keeping them visually in the same
place, allows us to do so.
2022-02-07 22:23:13 -08:00
Anders Kaseorg e1f42c1ac5 docs: Add missing space to compound verbs “back up”, “log in”, etc.
Noun: backup, login, logout, lookup, setup.

Verb: back up, log in, log out, look up, set up.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-07 19:20:54 -08:00
Anders Kaseorg b0ce4f1bce docs: Fix many spelling mistakes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-07 18:51:06 -08:00
Aman Agrawal 264ffb9f9b portico: Make hero subheader and `hero-text` have same color. 2022-02-07 14:38:08 -08:00
Aman Agrawal 8f07b63856 portico: Extend some `solution-page` styles to `case-study-page`. 2022-02-07 14:38:08 -08:00
Aman Agrawal 8d9fd3c380 portico: Use flex for quote boxes to ensure fix alignment issues.
The link at the bottom of quotes block were not properly aligned
on narrow devices. This fixes that issue.
2022-02-07 14:38:08 -08:00
Aman Agrawal 8d5903ddce portico: Don't hide all <br> tags on narrow screens.
This is an unpredictable piece of css that shouldn't be part of
the code. It was introduced earlier in
04ece5e5c5
for `open-source` content which has been completely replaced.
2022-02-07 14:38:08 -08:00
Alya Abbott f9e039b7ce policies: In DPA, add change history link and make a minor clarification.
The clarification is in Section 4.1:

Previously: ... from time to time engage additional third parties for
the purpose of providing the Services, including without limitation
the processing of Personal Data.

New: ... from time to time engage additional third parties for the
purpose of providing the Services, including without limitation the
processing of Personal Data, in accordance with Section 4.2 below.
2022-02-07 14:37:34 -08:00
Tim Abbott 3673075974 Revert "left-sidebar: Allow up to 2 lines for group PMs."
This reverts commit 97ffe2b123.

This broke the topic names, and also seems to have some problems with
unread counts and long names.
2022-02-07 11:39:57 -08:00
Aman Agrawal 6c0f513569 compose: Move time icon out of popover on narrow widths.
We have some extra space to do so.
2022-02-07 09:46:19 -08:00
Aman Agrawal 42d5f51a4c compose: Move help link beside formatting buttons.
We advertise it as message formatting button with `Aa` icon
instead of `?` help icon.
2022-02-07 09:46:19 -08:00
Aman Agrawal bed77a0a76 compose: Add drafts beside formatting buttons.
We hide the drafts button on small screen sizes since it overflows
the window on some languages like Russian.
2022-02-07 09:46:19 -08:00
Aman Agrawal c827c73783 right_sidebar: Add realm description for spectators. 2022-02-04 16:00:59 -08:00
Aman Agrawal ca71e28cd6 accounts_accept_terms: Make elements looks similar to other pages.
Add even vertical space between elements.
2022-02-04 15:48:38 -08:00
Austin Riba 81b1b18886 lightbox: Prevent undesired closing of lightbox during pan.
This commit adds a method of marking an overlay as being meant to be
left open despite click events triggering that would normally close it.
This is to prevent the case where a user drags an image and "unclicks"
in an area where normally clicking would close the overlay.
2022-02-04 14:58:36 -08:00
Austin Riba 1c2fd19d69 lightbox: Revert state of lightbox when closing the overlay.
This commit attempts to revert the lightbox state (at least
the pan/zoom part of it) when the lightbox is closed. The open()
function has been turned into a factory function so that the zoom
control which is instantiated on initialization of the lightbox can be
passed in to the on_close handler of overlay.open().
2022-02-04 14:58:36 -08:00
Austin Riba 5f83bc5cfe lightbox: Replace lightbox_canvas with PanZoom library.
This PR changes how the Pan & Zoom feature of images displayed in the
attachment lightbox are handled.

The existing method of using a canvas element is replaced by the Panzoom
library (timmywil/panzoom). This library is lightweight and has 0
transitive dependencies.

This fixes #20759 where the issue is that the viewport of a zoomed image
was not expanding to fill the available space on the page. Switching to
this new library also solves several other UX issues:

    * Images are no longer blurred when in Pan & Zoom mode.
    * The zoom behavior itself uses focal point zooming: zooming occurs
      where the cursor is on the image instead of at the center of the
      image, reducing the need for extra panning.
    * CSS transitions are used for a more visually pleasing experience
      when switching images, toggling zoom off, etc.
    * The library has the potential to open other file types which
      leaves that option open for us in the future.
2022-02-04 14:58:36 -08:00
Jai soni 97ffe2b123
left-sidebar: Allow up to 2 lines for group PMs.
This change makes it easier to see who is present in a group private message conversation
when some of the users in it have long names.

We disable a stylelint rule for this line, because this particular -webkit prefixed CSS rule 
works in all modern browsers including Firefox.

Fixes #21003.
2022-02-04 14:43:13 -08:00
NerdyLucifer 666fe465dd poll_widget: Fix the position of poll title editing button.
Places poll editing button in the same line of poll title by changing
display property of poll title from inline-block to inline.

Fixes #20753.
2022-02-04 13:43:05 -08:00
Steve Howell 05ff904378 presence: Extract $active_color CSS variable. 2022-02-03 15:31:21 -08:00
Steve Howell 498b02dfb2 presence: Avoid doc/naming references to "orange".
It seems like orange is the loudest possible color to
denote a quasi-neutral-idle state, so we hope to
replace it with another color.

This commit does not change any styling.

I removed the sentences in the doc, since they are
kind of too vague to be useful. If we want to say that
the idle state is correlated with the half-orange
circles in the buddy list, then we want to say that
more specifically.
2022-02-03 15:31:21 -08:00
Steve Howell a9ea525757 pm list: Remove obsolete user_circle_fraction class. 2022-02-03 15:31:21 -08:00
Sahil Batra 984040fd39 js: Remove unused buddy_data.huddle_fraction_present function.
This function is not used currently after we removed the
"Group PMs" section from right sidebar in 43e5b2d28b.

This commit also removes presence.is_active function as it
was only used in buddy_data.huddle_fraction_present.
2022-02-03 10:59:33 -08:00
N-Shar-ma ec25310654 typeahead: Fix typeahead for custom selection triggers.
Now checking for custom trigger keys will happen during `keydown`
instead of `keyup` so that if the key is printable, `preventDefault`
can prevent it from appearing in the compose box.

This fixes the case when jumping to topic, would eat up any space
or new line after the cursor, due to wrong splitting around the
cursor, which was a result of using the printable custom trigger key,
the ">", in contrast to a non printable one like Enter.

The problem was that custom trigger keys like `>` that the browser's
default behavior is to type (vs. others like RightArrow where that
isn't the case) can result in extra characters being emitted, which
is not wanted.
2022-02-02 17:27:08 -08:00
Sahil Batra d83b50d39f compose: Update error shown on sending message with no topic.
This commit updates the error message shown on sending a message
with no topic in an organization with mandatory_topics setting
set as true to match the error message in API.
2022-02-02 10:11:35 -08:00
Aman Agrawal acbfdb1c36 compose: Use flexbox to align items in compose top right.
This will help us align components on compose box top better
on small screen sizes.

We also center align the compose_top elements.
2022-02-02 10:04:38 -08:00
Aman Agrawal 1f812df0d2 compose: Use tippy to show tooltips for top right compose icons. 2022-02-02 10:02:49 -08:00
Aman Agrawal a38b11d188 resize: Rename reset_compose_textarea_max_height.
This no logner just resets the max-height of compose-textarea
but also preview_message_area.
2022-02-02 10:01:27 -08:00
Aman Agrawal adf8446b51 compose: Resize compose-textarea after exit from markdown-preview.
Autosize library can miss resize of compose-textarea when
compose is collapsed / expanded while preview box is displayed
and compose-textarea is hidden. So, we force a autosize.update
of compose-textarea, when user exits markdown preview, to ensure
that the textarea is of correct size.

Fixes #19353
2022-02-02 10:01:27 -08:00
Aman Agrawal 31dd1d554c compose: Avoid preview message area overlap with last message.
Instead of blindly adjusting `compose-textarea` on resize,
we adjust the height of `compose-textarea` or `preview_message_area`
based on which is visible.
2022-02-02 10:01:26 -08:00
Priyam Seth 17f74a3f57 compose: Show warning while composing to a resolved topic.
This commit creates the function warn_if_topic_resolved that checks if
the topic to which the user is composing is resolved or not. First it
checks if the stream exists and then if the topic name starts with the
RESOLVED_TOPIC_PREFIX. If the conditions are true, a warning banner is
shown to the user.

It also shows to the user a button to unresolve the topic, if he has
the permission to do so.

Fixes #20584.
2022-02-01 17:50:17 -08:00
Tim Abbott 4989a300f8 message_edit: Fix internationalization of edited notices.
The previous internationalization approach didn't support languages
with a different word order than English.

We also switch to using "moved" to explain topic/stream moves,
consistent with how the message feed explains it.
2022-02-01 14:09:19 -08:00
Tim Abbott b7a07a753f message_edit: Fix display of repeated stream moves.
The recent commits to display the previous and new streams for a moved
message did not correctly handle messages moved multiple times.

To do this, we need to do a somewhat awkward loop, at least until we
modify the API to do this loop for us.
2022-02-01 13:59:31 -08:00
somesh202 71ce154a02 i18n: Add missing translation tags in edit history strings. 2022-02-01 12:25:40 -08:00
somesh202 2b10f958bb message-edit-history: Show the edited stream in the edit history.
Previously, message edit history never displayed stream moves.

Fixes #20452.
2022-02-01 12:22:46 -08:00
jai2201 38003408cb settings: Make authentication settings more like other panels.
This may still needs further work to replace the table with a more
standard implementation.

Fixes part of #21001.
2022-02-01 11:28:27 -08:00
Sahil Batra 8565aad3fa stream_settings: Fix color of icon of the title in right column.
This commit fixes two things -

- We use the exact same color that is used for stream name in
day mode.

- Previously, we were passing black color explicitly to the
stream_privacy_icon template. This commit changes it to pass
different color in the night mode which is the same used for
stream name in night mode.
2022-02-01 11:25:01 -08:00
Aman Agrawal b4075b78eb message_feed_errors: Don't show search public stream to spectators.
Fixes #20299.
2022-01-31 17:12:03 -08:00
Tim Abbott c528e768ff message_scroll: Remove misleading comment.
The hacky code referenced in this comment was removed in
d59ccd4c0f.
2022-01-31 17:10:06 -08:00
Aman Agrawal f00db27b64 message_feed_errors: Convert to handlebars. 2022-01-31 17:10:05 -08:00
Aman Agrawal 8f2e973ab2 message_list_view: Cleanup unused bookend code.
`bookend_top` is already defined firmly for `group` in
`add_subscription_marker`, so no need to redefine it.

`bookend_bottom` is no longer used anywhere in the codebase. Not
sure what the history is here.
2022-01-31 16:50:54 -08:00
Aman Agrawal 93a03dcf3a message_list_view: Mark trailing bookend using a new variable.
We need to mark trailing bookends differently to identify them
in DOM easily. This fixes a bookend replication bug which can
happen sometimes when rendering.
2022-01-31 16:42:46 -08:00
Aman Agrawal 0bde50b851 stream_data: Set can_toggle_subscription to false for spectator. 2022-01-31 16:39:17 -08:00
Tim Abbott 6065d66d3d bookend: Simplify can_toggle_subscription variable flow. 2022-01-31 16:39:16 -08:00
Tim Abbott 2b59148e21 bookend: Simplify show_button check.
This lets us use a common function with the same logic, and thus
delete the need for a comment explaining why we think the logic is
correct.
2022-01-31 16:32:10 -08:00
Aman Agrawal 0ce2ae1782 bookend: Use it to advertise recent topics for spectators.
We show a minimal text "Browse recent topics" at the end of
every narrow. This will help new users to find additional
content on the app.

Fixes #19844
2022-01-31 16:32:09 -08:00
Aman Agrawal 0a614fe985 bookend: Move conditional bookend content inside the template.
We move the stream subscribed/unsubscribed bookend info from
js files to bookend handlebar.

Tweaked by tabbott to override the check-templates indentation logic.
2022-01-31 16:32:09 -08:00
Tim Abbott c0d4f8ec79 compose: Fix compose box initialization order.
This effectively reverts part of
70d444a8eb.  While it's correct that we
want to render this bit of Handlebars template early, it was not
correct to move all compose box initialization earlier.

Do the same thing we do with the left/right sidebar container
templates, which is to render them directly in `ui_init.js`.

Fixes #20778.
2022-01-31 10:12:45 -08:00
Anders Kaseorg 90e202cd38 docs: Consistently hyphenate “web-public”.
In English, compound adjectives should essentially always be
hyphenated.  This makes them easier to parse, especially for users who
might not recognize that the words “web public” go together as a
phrase.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-28 17:45:45 -08:00
strifel 9ae72fd48c compose_closed: Extract get recipient label helper.
This makes it possible to reuse this logic.
2022-01-28 14:54:22 -08:00
Tim Abbott b3df4ef23f lint: Fix missing newline at EOF.
Introduced in 98fa5c9ae2.
2022-01-28 11:51:29 -08:00
Aman Agrawal 98fa5c9ae2 flatpickr: Move `show_flatpickr` function in a new module.
This would avoid cyclic imports to access `show_flatpickr`
function.
2022-01-28 11:43:07 -08:00
Sahil Batra 78a81ab21a stream-settings: Add code to live update right panel title on changing privacy. 2022-01-28 11:39:15 -08:00
Sahil Batra 2280777168 stream-settings: Add code to live update right panel title on stream rename. 2022-01-28 11:39:15 -08:00
Sahil Batra 74294ae602 stream_settings: Extract function to set title in right column.
This is a prep commit such that we can use this function to
live-update the title.
2022-01-28 11:39:15 -08:00
Sahil Batra 12efde8a51 stream-settings: Refactor code to pass sub object to title template.
This commit refactors the code to directly pass sub object to
selected_stream_title template instead of passing name, is_web_public
and invite_only as different parameters.
2022-01-28 11:39:15 -08:00
Aman Agrawal 5688d8b0df scroll_bar: Remove unnessary adjustment of keyboard icon.
Since the keyboard icon is not associated with scrollbar, we
can just have a fixed margin-right for it.
2022-01-28 09:50:27 -08:00
Aman Agrawal b0dd063bb8 scroll_bar: Simplify module.
The content which is scrollable is moved left by the width of the
scrollbar when scrollbar is visible. The navbar, floating recipient bar
and composebox doesn't move. We reduce their width by scrollbar width
to adjust for the reduced width of the scrollable content.

Since floating recipient bar is center aligned (with margin: 0 auto)
we also have to move left by half the scrollbar width.

Group css classes having the same value being assigned together. This
makes the code easier to understand.
2022-01-28 09:50:27 -08:00
N-Shar-ma 4219f9bdf8 compose: Align blue selection properly in Drafts.
Added a negative `outline-offset` of the same width as the grey border
for the blue selection outline around the `draft-info-box`.

This removes the gap between the blue box in the active state, while
the unselected `draft-info-box`es look the same as before, with a grey
border.

Fixes: #20950.
2022-01-28 09:15:28 -08:00
Aman Agrawal 38e044173d login_to_access: Remove icons for login buttons.
They don't serve the purpose of adding clarity to button.
2022-01-28 08:30:56 -08:00
Steve Howell 576b966edc search suggestions: Add comment about server history. 2022-01-27 10:19:07 -08:00
Steve Howell eb2bf77212 search suggestions: Find older topics.
We no longer limit our list of candidate topics
to 300.

We continue to limit the topic results to 10, since
we don't want to overwhelm users or crowd out
non-topic-related suggestions.

We try to handle this is an efficient manner.
2022-01-27 10:19:07 -08:00
Sahil Batra 7265a76fc6 stream-settings: Show icon according to in the right column title.
We were showing # for all types of streams in the title at the top
in the right column of stream settings overlay. This commit fixes
it to show globe icon for web-public streams and lock icon for
private streams.
2022-01-26 12:50:05 -08:00
Sahil Batra e26de17ee1 stream-settings: Add space between # and stream name in title.
This commit adds space between # and the stream name appearing
at the top in right column in stream settings overlay.
2022-01-26 12:50:05 -08:00
Ashwat Kumar Singh 563b06ee08
stream_settings: Make disabled tab look disabled in dark mode.
Make disabled tabs look disabled in dark mode by adding color
to ".ind-tab.disabled" in "dark_theme.css".

Fixes #20917.
2022-01-26 04:11:47 -08:00
N-Shar-ma 048c9b99e3 compose: Add format hinting for polls.
Added a placeholder key to the polls slash command object. This is
selected and highlighted after being typed ahead in the compose box.
For slash commands without placeholder, everything works as before.

Formatting hints can easily be added for other slash commands too,
by adding a placeholder key to their object.

Fixes part of #20868
2022-01-25 18:12:42 -08:00
Aman Agrawal ec86290e2a tippy: Fix persistent message action tooltips on icons after blur.
When users tabs through the message action icons, they used to
persist even when the focus is not on them. We manually
destroy them on blur event since tippy has some issue with
handling elements with opacity hiding effect.
2022-01-25 11:15:30 -08:00
N-Shar-ma a003fe0246 compose: Fix bug where stream color didn't update on mouse selection.
Called the `decorate` function to update stream color in the compose
box on `change` instead of `blur`.

On clicking on a stream option, the input box for the stream name
remained in focus, hence decorate wasn't triggered on blur. Using
the change event instead, ensures that decorate will be called
anytime the stream is changed.

Fixes: #20871
2022-01-24 17:14:47 -08:00
Anders Kaseorg 44f9aaec32 eslint: Fix unicorn/prefer-dom-node-dataset.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 15:55:38 -08:00
Anders Kaseorg 392676d4da js: Avoid _.get.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 15:54:21 -08:00
Anders Kaseorg cc40352541 js: Avoid _.first, _.last, _.initial, _.tail.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2022-01-24 15:54:21 -08:00
Anders Kaseorg 42931e69e6 js: Convert _.isFunction to typeof.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 15:54:21 -08:00
Anders Kaseorg 57cc5cb25a js: Convert _.without to filter or other logic.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2022-01-24 15:54:21 -08:00
Anders Kaseorg e2290ef0de js: Convert _.uniq(a) to Array.from(new Set(a)).
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2022-01-24 15:54:21 -08:00
N-Shar-ma 6d2de28bf0 todo_widget: Fix bug where new todos sometimes replaced old todos.
Initialised `this.me` for the TaskData using a constructor to the
current user id.

The bug was caused due to `this.me` never being initialised, and hence
`idx` wasn't incremented on page reload, which resulted in duplicate
`data-key` attributes and hence new todos overwriting older todos with
the same `data-key`

Fixes: #20698
2022-01-24 11:25:32 -08:00
Lauryn Menard e479acc809 api_docs: Add line break before return value description text.
Adds a line break before the descriptive text for return
values and events in the api documentation in order to
help with readability of descriptions with multiple
paragraphs of descriptive text.

Adjustments made to the CSS of list items in unordered
lists to visually group the first paragraph of text
to any following paragraphs or unordered lists.
2022-01-24 10:02:02 -08:00
Anders Kaseorg c6b372b471 js: Simplify indexing arrays from the end with Array#at.
https://github.com/tc39/proposal-relative-indexing-method

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 09:58:54 -08:00
Anders Kaseorg 0b03628324 js: Shorten Object.prototype.hasOwnProperty.call to Object.hasOwn.
https://github.com/tc39/proposal-accessible-object-hasownproperty

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 09:57:09 -08:00
Sahil Batra fd1d4e101b overlay: Fix bug of information overlay not closing when text is selected.
There was a bug where information overlay was not closing on clicking
"x" when some text was selected. This was due to document.getSelection().type
returning "Range" and we do not close the modal in that case as per the code
added in 081d74141b.

As the "x" icon was button, the document.getSelection().type was
still returning "Range" for the text selected, but when the "x"
icon is inside a span, as in settings overlay, clicking on "x"
deselects the already selected text and selection type is not
"Range" and thus modal is closed.

This commit also improves the vertical alignment of "x".

Fixes #20645.
2022-01-21 17:39:01 -08:00
Aman Agrawal c4efc97d5a compose: Extend empty compose navigation logic to recipient boxes.
Navigation key presses like `Up` and `PageUp` with an empty recipient
boxes will now close the compose and propagate the keypress to the message
list or recent topics, depending upon the active view.

This extends behavior we've had for a long time with focus in the
compose box itself.
2022-01-21 16:40:13 -08:00
Ganesh Pawar 49e9cf10de user_status: Migrate modal to dialog_widget. 2022-01-21 16:17:25 -08:00
Ganesh Pawar f43d3b9986 change_email: Migrate modal to dialog_widget. 2022-01-21 16:12:34 -08:00
Ganesh Pawar 84ed22d59a api_key_modal: Place the error element at the top of the modal.
This is consistent with other modal behaviour.
2022-01-21 16:12:34 -08:00
Ganesh Pawar 79bdd8bdb6 api_key_modal: Update the modal config for `on_show`.
This is needed since 291aaf373f changed
the interface for modal event handlers.
2022-01-21 16:12:34 -08:00
Tim Abbott a020d7a80d user_profile: Fix unsubscribing other users from streams.
This fixes a bug introduced with the Micromodal migration in
7a505e3857, where the data-user-id
declaration for this modal was lost.
2022-01-21 15:45:11 -08:00
Alya Abbott 1bd83c33ab policies: Rename "Terms of Use" to "Terms of Service" in DPA. 2022-01-20 13:15:00 -08:00
Eeshan Garg f2e7b92b02 team_page: Display count of contributors with >=100 commits. 2022-01-19 17:37:09 -08:00
Eeshan Garg 1e8a7bc977 team_page: Exclude dependabot from contributors.
Dependabot has a history of merging some PRs and that makes GitHub
think that it is a contributor.
2022-01-19 17:37:09 -08:00
Eeshan Garg 94c89c80d1 team page: Display contributor count per repo.
Fixes #20725.
2022-01-19 17:37:09 -08:00
Eeshan Garg 3b9455c9ce billing: Make all buttons the same size.
Previously, the "Add Card" button was significantly larger than
the "Buy Standard" and "Submit" buttons.
2022-01-19 16:11:31 -08:00
Anders Kaseorg 3eb2791c3e CVE-2021-3853: Fix HTML escaping in recipient_row.
Commit 44f935695d (#20462) incorrectly
added these extra braces while intending to add whitespace control.
This triple-brace syntax was asking Handlebars to skip escaping the
string.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-18 21:28:21 -08:00
Aman Agrawal d4c70319eb topic_list: Fix search box not focused in expanded state.
We only check `topic_search_focused_before_build` if the
search box is visible.
2022-01-18 16:53:25 -08:00
Sahil Batra bb6dbb6383 todo_widget: Tag "Task list" heading for translation. 2022-01-18 14:15:34 -08:00
Priyank Patel 039910a159 ts: Convert lazy_set module to typescript. 2022-01-18 13:24:02 -08:00
Priyank Patel d0c339e772 lazy_set: Return set from the _make_set method.
This is done to avoid adding typescript type error checks when this
is converted to typescript.
2022-01-18 13:24:02 -08:00
Priyank Patel 84958bf7eb lazy_set: Move the size getter above other methods.
This is to avoid @typescript-eslint/member-ordering error when this
module is converted to typescript.
2022-01-18 13:24:02 -08:00
Priyank Patel 16a3d444fd lazy_set: Move set and array properties to the data field.
The data field will be a union type when it is converted to typescript.
This approach allows us to avoid introducing additional type check for
both of the properties.
2022-01-18 13:24:02 -08:00
N-Shar-ma be486b6138 i18n: Fix 'add choice' / 'add task' button size.
Removed the CSS rule setting the button's width to 100px.  This lets
the button take as much space as the appropriate translation needs,
without displaying an odd two-line button.

Fixes: #20077
2022-01-18 12:46:45 -08:00
My-Name-Is-Nabil 20d0fc9733 compose: Prevent upload files tooltip from hiding behind left sidebar.
Resolves the issue by appending tooltip to document body.

Fixes: #20639.
2022-01-11 16:30:55 -08:00
Sahil Batra df58a0740a settings: Show user name in heading of deactivation modal.
We show user name in heading of the deactivation confirmation
modal instead of email, since there can be a case when admin
does not have access to real email and we already show email,
if accessible, in the content of the modal.
2022-01-11 15:42:51 -08:00
Ganesh Pawar c1f639d115 org edit_bot_modal: Fix dropdown styling issue.
This makes use of the existing CSS present for the personal
edit_bot_modal.
2022-01-11 09:15:06 -08:00
Ganesh Pawar 21fa68ae7e org edit_bot_modal: Fix styling issues. 2022-01-11 09:15:06 -08:00
Eeshan Garg c30458e174 streams: Add notifications for posting policy changes.
An explanatory note on the changes in zulip.yaml and
curl_param_value_generators is warranted here. In our automated
tests for our curl examples, the test for the API endpoint that
changes the posting permissions of a stream comes before our
existing curl test for adding message reactions.

Since there is an extra notification message due to the change in
posting permissions, the message IDs used in tests that come after
need to be incremented by 1.

This is a part of #20289.
2022-01-10 18:29:04 -08:00
Aman Agrawal c23f5a114e topic_list: Don't restore focus to search if it wasn't focused.
After topic list is updated, only restore focus to it, if it was
focused before. This avoids jumping focus from say compose box
to topic search unexpectedly when the topic list is updated.
2022-01-07 14:39:16 -08:00
Anders Kaseorg 03f073d762 compose: Fix Enter to send switch internationalization.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-07 14:38:10 -08:00
Priyam Seth 9aa5082d63 message edit: Move with_first_message_id to message edit.js.
Prep commit so that the function first_message_id can be used
as an exported function for marking resolved topic as unresolved.

Related to #20584.
2022-01-05 17:55:00 -08:00
Aman Agrawal b3886af651 click_handler: Use a variable for target's jquery instance. 2022-01-05 16:15:40 -08:00
Aman Agrawal bf7224d04d reminder: Simplify logic and improve error text. 2022-01-05 16:15:40 -08:00
Aman Agrawal fa4311e7d0 popovers: Don't trigger remind handler on every flatpickr confirm.
This is part of remind popover and hence should be handled
separately.
2022-01-05 16:15:40 -08:00
Aman Agrawal 4d7cbc0a63 compose: Move emoji button outside of popover.
Since we more space after moving Help button below, we stop hiding
emoji icon in a popover on small screens.
2022-01-05 16:03:53 -08:00
Aman Agrawal e4b8b9a24e compose: Move `Help` icon beside `Enter send` button. 2022-01-05 16:03:53 -08:00
Aman Agrawal db09639f6c compose: Change UI which toggles `enter_sends` setting.
Use a popover which displays both the options instead of long text.
We only use a small text indicating the current state which user
can click on to trigger the popover.
2022-01-05 16:03:53 -08:00
Rishabh Maheshwari 937d49e209
popover: Fix alignment of edit and delete button.
The icons were misaligned with the time stamp.  

I changed the CSS `right` property to get proper alignment.

Fixes: #20529.
2022-01-05 15:24:00 -08:00
Eeshan Garg 7196b5ac84 header: Fix unresponsive dropdown pill on /help pages.
My PR #18974 introduced a bug where the logged-in dropdown pill on
the /help pages stopped working and has been unresponsive ever
since. This was caused by the incorrect assumption that each
`.dropdown` would be inside an unordered list `ul`. However, that
isn't the case for the dropdown pill on the /help pages. This commit
simply removes said assumption, by widening the scope of the relevant
CSS selectors.
2022-01-05 15:18:24 -08:00
Sahil Batra 98ec1acb35 settings: Make banner asking to confirm new email sticky.
We make the banner, mentioning the user to confirm new email
after changing the email through settings, sticky and it
disappears either on reload or after confirming the new email.

Fixes #20686.
2022-01-05 14:42:23 -08:00
YashRE42 e17c96d86d composebox_typeahead: Fix bug in global time backspace & delete cases.
In the previous commit (bea41e975d) we
introduced a bug by using `hotkey` instead of `hotkey.name`, further
debugging revealed that the conditional was unnecessary and as such
has been removed in this commit, the comment for the is_numeric
conditional has also been changed to explain its actual purpose.

Some other inline comments have also been moved to be on their own
lines.
2022-01-04 18:10:21 -08:00
YashRE42 bea41e975d compose: Fix numeric typing regression related to global time widget.
In commit 1d54b383bd we introduced some
changes to add better support for keyboard navigation with the global
time widget. Unfortunately, as a result of the fact that
get_keydown_hotkey returns undefined for numeric keys, we caused a
regression that prevented users from typing into the time picker.
Additionally, we also lost support for the backspace and delete keys.

Hence, this commit fixes the above bug by early returning in two
places if the key pressed is backspace, or delete or a numeric key.
2022-01-04 17:06:47 -08:00
Sahil Batra b642615e73 settings: Rephrase text in user deactivation modal. 2022-01-04 14:42:19 -08:00
Sahil Batra 2eb1f0195d settings: Show only real email in user deactivation modal.
We show email of the user being deactivated only if real email is
accessible and not the fake email generated using user id.
2022-01-04 14:42:19 -08:00
YashRE42 d82653c3de condense: Do not cache message_content height of 0 from recent_topics.
Previously, we suffered a bug where we would not properly condense
messages on first load of CZO (ie after login).

This bug was an unintended consequence of setting recent topics as the
default view, because since the page loads to recent_topics the
message_list is hidden but still gets rendered into the DOM and when
condense_and_collapse runs, it causes get_message_height to cache a
message height of 0, which results in the message not being collapsed.
There may be other ways to trigger the same broken mechanism.

This commit changes the function so we only return 0 but don't cache
the result.

Fixes: #20666.
2022-01-02 12:12:36 -08:00
Steve Howell c6d9029dfc dom: Remove outer subscriptions div. 2021-12-30 11:36:52 -08:00
Steve Howell 7ff89e4cae dom: Rename div to #manage_streams_container.
The old name was confusing, since the contents
of the div aren't just a table, and we have
smaller elements that actually do list a bunch
of subscriptions in tabular format.
2021-12-30 11:36:52 -08:00
Steve Howell 507da749b7 stream edit: Tighten up selectors for handlers.
Even though we intend to shortly share lots of code
for editing stream subscribers with the create-stream
UI, we don't want to confuse click handlers and
containers too much.
2021-12-30 11:36:52 -08:00
Steve Howell 36378477ff stream edit: Extract make_list_widget. 2021-12-30 11:36:52 -08:00
Steve Howell f55d9c2f35 stream edit: Simplify how we find the search input. 2021-12-30 11:36:52 -08:00
Steve Howell 5e86c72f8e stream edit: Extract set_up_pill_typeahead. 2021-12-30 11:36:52 -08:00
Steve Howell 5a89672ac5 refactor: Extract update_subscribers_list_widget. 2021-12-30 11:36:52 -08:00
Steve Howell fb003d757b performance: Use a single ListWidget for subscribers.
It's kind of silly to cache ListWidgets for subscriber
lists when we only ever update the most recent one.

This will save memory if you are managing a whole bunch
of streams, although I suspect the savings here is
mostly negligible unless you were doing something
crazy.

The main motivation here is just that it simplifies the
code.
2021-12-30 11:36:52 -08:00
Steve Howell afd1d12405 refactor: Remove is_sub_settings_active. 2021-12-30 11:36:52 -08:00
Steve Howell 2a19468432 subscribers: Use current_stream_id to track current stream. 2021-12-30 11:36:52 -08:00
Steve Howell 1c54d44f97 hash_util: Add is_editing_stream helper.
This is a bit more robust than active_stream().

We don't do the typeof check for parseFloat,
since even NaN is a number type.
2021-12-30 11:36:52 -08:00
Steve Howell 208cec2848 refactor: Move update_subscribers_list.
We should be able to solve the import back
to stream_edit in an upcoming commit.
2021-12-30 11:36:52 -08:00
Steve Howell 49a1d5a9a3 refactor: Reduce scope of message var. 2021-12-30 11:36:52 -08:00
Steve Howell d7f90acbf6 refactor: Extract remove_subscriber. 2021-12-30 11:36:52 -08:00
Steve Howell e742ebb8e8 refactor: Limit scope of e.target.
Now our click handlers get stream_id directly from
e.target, and then downstream code is no longer
coupled to the event semantics.

Note that we'll probably just know the stream_id
more directly after future commits.

We also remove a little bit of redundant error
handling.
2021-12-30 11:36:52 -08:00
Steve Howell 0777cd73bb stream edit: Extract stream_subscribers_ui.js.
This is a fairly straightforward extraction.

It's good to test this with Iago, and then go into
Manage Streams and add/remove subscribers for a stream
like devel.

I copy/pasted two small functions that will soon
diverge from stream_edit. The get_stream_id function
will either use a module variable (since we're
generally only editing subscribers for one stream, and
we already have the singleton assumption with
`input_pill`) or a more strict CSS selector.  And then
get_sub_for_target depends on get_stream_id. We may not
always need full subs, anyway, and when we adapt some
of this code for creating streams, things are likely to
change.

I stopped exporting a couple functions that have no
callers outside of this module.

The main entry point for the module is
enable_subscriber_management.

We continue to export invite_user_to_stream and
remove_user_from_stream, which should possibly be just
pulled into their own module to lessen some
dependencies, but they don't have too much baggage,
since they just wrap channel calls.
2021-12-30 11:36:52 -08:00
Steve Howell d938f73d05 refactor: Move code for can't-subscribe popover. 2021-12-30 11:36:52 -08:00
Biki-das b3c2f88b7b typeahead: Remove unnecessary topic_names variable.
Also fix a comment typo in the same file.
2021-12-30 06:56:29 -08:00
Tim Abbott 877c275380 typeahead: Use early return pattern for enter logic.
This makes this code more readable.
2021-12-30 06:55:57 -08:00
Julia Bichler b673e966ca spectators: Prevent toggling TODO checkboxes.
Checkboxes now don't change if a user who is not logged in
clicks on them.

Fixes #20300.
2021-12-29 17:10:21 -08:00
Sahil Batra a59d429045 settings: Fix code for special case of theme settings subsection.
We handle "Theme settings" subsection separately in
get_subsection_property_elements as it contains unique
radio-button structure for emojiset setting.

This should have been fixed while reorganizing the section
to have color scheme and emoji related settings under same
subsection in adb612a0b4.

Fixes #20644.
2021-12-29 16:32:12 -08:00
YashRE42 5e194afda3 reactions: Destructure during make..reaction call from set..reaction.
This is a pure code refactor for readability.
2021-12-28 11:12:02 -08:00
YashRE42 6fa92cce7e reactions: Use parameter destructuring in make_clean_reactions.
This is a pure code refactor for readability.
2021-12-28 11:11:57 -08:00
YashRE42 06d8e6dfd5 reactions: Refactor add_clean_reactions to make_clear_reaction.
This is a pure code refactor for readability.

Previously, we were relying on there being a side effect to
add_clean_reaction which was necessitated by the presence of an output
parameter, `message` (or more specifically `message.clean_reaction`).
Output parameters are confusing.
Hence, this commit changes to have a make_clean_reaction function that
returns a reaction.
2021-12-28 11:11:51 -08:00
YashRE42 0b0637de78 reactions: Remove `export` from add_clean_reaction() function.
This function is not called by any external files or tests.
2021-12-28 11:11:43 -08:00
YashRE42 1dffad98fa reactions: Use parameter destructuring in insert_new_reaction.
This is a pure code refactor for readability.
2021-12-28 11:11:39 -08:00
YashRE42 0438ed5777 reactions: Use parameter destructuring in update_existing_reaction.
This is a pure code refactor for readability.
2021-12-28 11:11:37 -08:00
YashRE42 0991ed4526 reactions: Use parameter destructuring in view.remove_reaction.
This is a pure code refactor for readability.
2021-12-28 11:11:31 -08:00
BIKI DAS 42dd58cffe
docs: Fix a few typos in documentation. 2021-12-28 09:36:59 -08:00
BIKI DAS d7f5d041b9
typo: Rename default_hander to default_handler. 2021-12-28 09:19:57 -08:00
Steve Howell 7f8ea5b9f2 stream edit: Find stuff within parent_container.
This will facilitate code reuse.
2021-12-16 15:28:11 -08:00
Steve Howell 2194a51b97 refactor: Extract people.get_users_from_ids. 2021-12-16 15:28:11 -08:00
Steve Howell 6c9427340a refactor: Move user-sorting code to people.js.
We also remove the blueslip check, since it is
pretty easy to audit the callers here.
2021-12-16 15:28:11 -08:00
Steve Howell ab8b550cda stream settings: Extract enable_subscriber_management.
The name here is accounting for future plans where
we will share code for both of these use cases:

    * editing subscribers on current stream (now)
    * editing subscribers on new stream (upcoming)
2021-12-16 15:28:11 -08:00