Commit Graph

3922 Commits

Author SHA1 Message Date
Tim Abbott e436aea917 change_password: Avoid super generic CSS classes. 2024-03-21 10:48:54 -07:00
afeefuddin 6f81fe1b5b info_overlay: Convert module to TypeScript. 2024-03-21 09:00:33 -07:00
evykassirer f1b8e11e8b narrow: Remove stale comment about deactivate(). 2024-03-20 19:11:25 -07:00
evykassirer ba215e3e80 buddy_list: Ensure users are visible when hide_headers is true. 2024-03-20 18:47:24 -07:00
evykassirer 1defce3172 composebox_typeahead: Don't use typeahead to store `completions`.
It wasn't being used in the typeahead, just hackily being
referenced within composebox_typahead.
2024-03-20 13:08:26 -07:00
evykassirer d5d505a561 typeahead: Remove unneeded eventSupported.
It will always be true.
2024-03-20 13:08:26 -07:00
evykassirer 596233e14d typeahead: Default options to undefined instead of null. 2024-03-20 13:08:26 -07:00
Prakhar Pratyush 6484532830 help: Migrate configure-notification-bot help page to a new URL.
This commit migrates the 'help/configure-notification-bot' help
page to a new URL i.e. 'help/configure-automated-notices'.
2024-03-20 11:48:06 -07:00
roanster007 3d152296f6 message_view: Fix error thrown on deleting stream and searching for it.
Previously, when a stream is deleted and the deleted stream is looked
up in the search bar, then an error is thrown.

This is because, when the StreamSubscription object of the deleted
stream is fetched we try to access its properties - invite_only and
is_web_public, despite it being undefined.

This is fixed by accessing the properties only when the object is not
undefined.
2024-03-20 09:59:10 -07:00
afeefuddin 69fbd81a73 integration_url_modal: Fix input selector for runtime safety. 2024-03-19 16:05:34 -07:00
Aman Agrawal c3488bfe76 css: Merge common media queries. 2024-03-19 15:15:23 -07:00
Aman Agrawal 93373d1c12 css: Merge common media queries. 2024-03-19 15:15:23 -07:00
Aman Agrawal ac77d9e42a css: Wrap common media queries under `default-sidebar-behaviour`. 2024-03-19 15:15:23 -07:00
Aman Agrawal 1f89eec5ba css: Move media queries in scheduled_messages to zulip.css. 2024-03-19 15:15:23 -07:00
Aman Agrawal 5f1f0f9eb0 compose: Move related media queries to zulip.css. 2024-03-19 15:15:23 -07:00
Aman Agrawal af25709e30 css: Wrap more selectors under `.default-sidebar-behaviour`. 2024-03-19 15:15:23 -07:00
Aman Agrawal 4740485a13 css: Use better selector names for typeahead. 2024-03-19 15:15:23 -07:00
Aman Agrawal 66bc77cf61 css: Remove unused property.
`zulip.css` applies the same style to this so there is no need
for this.
2024-03-19 15:15:23 -07:00
Aman Agrawal 79565b4e90 css: Remove unused properties of dropdown-menu.
They are always overriden by the same properties set in compose.
2024-03-19 15:15:23 -07:00
Aman Agrawal fc48919a8b css: Remove invalid property applied to search icon.
Since `.zulip-icon-search` has `position: static` which is set
by default, setting `right` here makes no difference to its
position.
2024-03-19 15:15:23 -07:00
Aman Agrawal afe420dcd3 css: Hide left column in both navbar and app.
This was a regression in #29331 with no visual effects.
2024-03-19 15:15:23 -07:00
Anders Kaseorg 85d5669a4a web: Fix selectors to correspond with annotated types.
TypeScript does not check that these annotations are consistent with
the given selector strings.  We need to ensure that ourselves for
runtime safety.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-19 13:14:27 -07:00
Anders Kaseorg 548805dff9 realm_logo: Fix selector for image_upload_widget.hbs migration.
Commit 548107632c (#15333) should have
updated this but didn’t.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-19 13:14:27 -07:00
Joydeep Bhattacharjee d99238526d widgetize: Convert module to typescript. 2024-03-19 12:12:23 -07:00
Joydeep Bhattacharjee 94cd67b90f poll_widget: Fix ExtraData type. 2024-03-19 12:12:23 -07:00
Joydeep Bhattacharjee 2842945e6d ts: Replace all occurance of widgetize.js with widgetize.ts. 2024-03-19 12:12:23 -07:00
Anders Kaseorg f530f6749c sentry: Delay reading current_user and realm until they’re available.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-19 11:57:05 -07:00
shashank-23002 b74dabfaa4 alert_words: Highlight overlapping alert words more accurately.
This fixes a bug where alert words that are contained in another alert
word would have only the smaller alert word highlighted.

Note that it does not handle weirder cases, like "one two" and "two
three" being alert words; "two three" will always be highlighted, and
not "one"; this is probably fine in practice.

Fixes: #28415
Co-Authored-By: danieldotcomcoder <daniel_shdeed@hotmail.com>
2024-03-19 11:20:16 -07:00
shashank-23002 ebafe4d08f alert_words: Reuse set_alert_words to better share code. 2024-03-19 11:20:16 -07:00
afeefuddin 417d4b3a8a integration_url_modal: Convert module to TypeScript. 2024-03-19 09:38:22 -07:00
Prakhar Pratyush ad3603c0aa onboarding: Show one-time modal to introduce recent conversations view.
To improve onboarding experience, this commit adds a
one-time modal which introduces the recent conversations view.

Users see this one-time modal on visiting the recent
conversations view.

Fixes #29073.
2024-03-19 09:32:59 -07:00
Prakhar Pratyush 9a7634d527 onboarding: Show one-time modal to introduce inbox view.
To improve onboarding experience, this commit adds
a one-time modal which introduces the inbox view.

Users see this one-time modal on visiting the inbox view.

Fixes part of #29073.
2024-03-19 09:32:59 -07:00
Tim Abbott a33c68026c message_edit_history: Fix display of unknown private streams.
Previously, if such a stream were in certain positions in message edit
history, it would incorrectly be displayed as the empty string.
2024-03-18 17:26:28 -07:00
Mahhheshh e7adde96e0 message_edit: Reimplement message history modal as an overlay.
We redesign the message history modal to make it look similar to the
drafts and scheduled messages, using the shared styling/rendering
logic for that those existing elements to have a less goofy widget.

Fixes #28695.
2024-03-18 17:26:28 -07:00
Tudor Stefan Pagu 3324721eb7 tooltip: Hide scroll button tooltip on transition.
Fix a bug where the tooltip for the scroll
to bottom button would remain visible after the
button disapeared, if the user was hovering over
the button as it was dissapearing, without moving
their mouse. Now, the tooltip dissapears when
the button finishes the visibility transition.

Fixes #28656
2024-03-18 16:46:57 -07:00
Aman Agrawal 631aa1aac5 css: Wrap CSS related to hiding columns in `default-sidebar-behaviour`.
We might wrap more elements in future but this this is enough for
testing that nothing breaks right now.

Use `git show -w` for the real changes.
2024-03-18 15:28:03 -07:00
Aman Agrawal c643d0c0ae css: Specify for columns where it is located.
Navbar and app share same class for sidebar, so it is important
that we specify which one we are referring to if we are not referring
to both of them.
2024-03-18 15:28:03 -07:00
Aman Agrawal 803092f9f0 ui_init: Add a class to `body` to specify the current sidebar state. 2024-03-18 15:28:03 -07:00
Aman Agrawal ea85e526fb css: Specify to which `.column-middle` the styles is applied.
We use `#navbar-middle` and `.app-main .column-middle` specifically
to apply styles to those elements.
2024-03-18 15:28:03 -07:00
Aman Agrawal 4c6164ad49 ui_init: Remove unused dropdown menu code.
We migrated from bootstrap dropdown to use tippy. This change should
have been removed as part of that change.
2024-03-18 15:28:03 -07:00
Aman Agrawal 9ee11afb7e css: Remove min-width styles on app.
We always want to render Zulip at maximum available width with a
max-width.
2024-03-18 15:28:03 -07:00
Aman Agrawal df50c305ae css: Merge media queries. 2024-03-18 15:28:03 -07:00
Aman Agrawal 47acfc0bae css: Remove unused classes.
While they might be useful, it create a potential for elements
that we want to display on wide widths for a setting like
hide user list but was bugged due to a css class like this.
2024-03-18 15:28:03 -07:00
Aman Agrawal 341c25d087 css: Use variables for border colors in sidebars.
This is important step to fix a bug related to making sure css
for `.column-right` doesn't apply in navbar but only `.app-main`.
2024-03-18 15:28:03 -07:00
Sohaib-Ahmed21 d145aba3a5 hotkeys: Shift + M work in recent conversations and inbox.
Earlier, the Shift + M shortcut only functioned in messages to
mute/unmute topics in the messages section.

This commit enables the Shift + M shortcut to work in recent
conversations and the inbox. It achieves this by utilizing the
existing function toggle_topic_visibility_policy in user_topics_ui.
The focused row message of the recent_view_ui is passed to mute/unmute the
selected topic in the recent_view_ui, and the same process
is applied to the inbox_ui but the logic of muting/unmuting the topic
is kept in inbox_ui which uses function toggle_topic_visibility_policy
in user_topics_ui.

The function toggle_topic_visibility_policy is called in both
cases based on specific conditions to prevent the shortcut from
affecting other parts of the page, thus avoiding errors.

Fixes #27741.
2024-03-18 10:42:17 -07:00
Kislay Verma 454f2f2d95 compose: Fix unresolve button for empty topics.
When composing to an empty topic, only the compose box topic is
changed to remove the tick-prefix from it.

Fixes #29182.
2024-03-15 18:00:10 -07:00
Pratik Chanda 0c8845cec5 group_settings: Fix group settings panel title not updating.
Earlier in group settings, clicking a non participating group from
"all groups" and then clicking "your group" would reset the right
panel but the panel title would remain same as that of the non
participating group.

This commit fixes the behaviour and resets the panel title to
default.
2024-03-15 17:22:10 -07:00
Pratik Chanda a504753961 stream-settings: Fix right panel resetting on filter change.
Earlier in stream settings, filtering for streams by search stream
name would reset the right panel to default if a stream was selected
from stream row.

This commit fixes the behaviour by keeping the stream open in right
panel in stream settings even on any filter change.
2024-03-15 17:22:10 -07:00
Pratik Chanda f96ad02454 stream-settings: Fix stream settings panel title not updating.
Earlier in stream settings, clicking an unsubscribed stream in "all
streams" tab and then clicking subscribed tab, the right panel would
reset but the panel title and url hash would remain same as that of
the unsubscribed stream.

This commit fixes the behaviour and resets the panel title and url
hash to default.

Fixes zulip#28465.
2024-03-15 17:22:10 -07:00
Alex Vandiver bfe4017663 katex_server: Add Prometheus metrics. 2024-03-15 15:34:12 -07:00
Alex Vandiver c13e3dee24 katex: Replace subprocess call with minimal external service.
Replace a separate call to subprocess, starting `node` from scratch,
with an optional standalone node Express service which performs the
rendering.  In benchmarking, this reduces the overhead of a KaTeX call
from 120ms to 2.8ms.  This is notable because enough calls to KaTeX in
a single message would previously time out the whole message
rendering.

The service is optional because he majority of deployments do not use
enough LaTeX to merit the additional memory usage (60Mb).

Fixes: #17425.
2024-03-15 15:34:12 -07:00
Anders Kaseorg 959e51fe58 tests: Replace unneeded override_rewire uses by whole-module mocks.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-15 17:29:47 -04:00
afeefuddin 15db564246 search_suggestion: Convert module to TypeScript. 2024-03-15 13:10:34 -07:00
afeefuddin 611b28e308 search_suggestion: Rename invalid to incompatible_patterns. 2024-03-15 13:10:34 -07:00
afeefuddin 089e363313 search_suggestion: Rename huddle to huddle_emails. 2024-03-15 13:10:34 -07:00
Roshan Jagadish 20e44997e2
types: Migrated add_stream_options_popover to TypeScript.
The migration requires some new assert statements as well as a change
in how the `return undefined` case is spelled to match the types declared by 
Tippy upstream.
2024-03-15 13:02:20 -07:00
Anders Kaseorg 45cfa42469 tests: Avoid override_rewire for bootstrap_typeahead.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-15 12:56:03 -07:00
Mahhheshh 1c48ed0a1c stream picker: Remove stream colorblock.
To achive this the `stream_header_colorblock` div was removed from
`dropdown_widget_with_stream_colorblock.hbs` template. this change made
the file name irelevenet so it was necessary to rename the file to
`dropdown_widget_wrapper.hbs`. After removing the html strcuture for
colorblock from templates the css for colorblock was also removed.
followed by the javascript which was used to add colorblock to the
stream picker. After removing javascript tests were updated.
Fixes: #28796.
2024-03-15 11:11:04 -07:00
evykassirer db24df488c typeahead: Convert from a jQuery plugin to a normal exported function. 2024-03-15 10:05:44 -07:00
Karl Stolley bb114ed525 settings: Set light- and dark-mode color on field hints. 2024-03-15 09:58:33 -07:00
N-Shar-ma ef5cdff9d9 settings: Scroll save button into view when a change made needs saving.
Whenever a setting that needs confirmation to save is tweaked, and the
save button is not visible, we scroll it into view, to ensure the user
does not mistake it for an automatically saved change and misses saving
their change.

Fixes: #29290.
2024-03-14 17:31:39 -07:00
Tim Abbott 252a03790a condense: Fix accidentally deleted function call.
42dd55df42 incorrectly deleted this.
2024-03-14 17:12:14 -07:00
Aman Agrawal c84b9cbc97 upgrade: Allow payment by invoice. 2024-03-14 16:43:52 -07:00
Sahil Batra 12e298dd4c settings: Add description below name field.
This commit adds description text below the name field in
profile settings panel mentioning how the field will be used.

Fixes #29226.
2024-03-14 10:53:36 -07:00
Sahil Batra 0ac0f95ee8 register: Add description below name field.
This commit adds description text below the name field
mentioning where the field will be used.

Fixes part of #29226.
2024-03-14 10:53:36 -07:00
Sahil Batra 74ab3d2cbe webapp: Rename "Full name" field to "Name".
This commit renames "Full name" field in profile settings,
"Edit user" form and in the email modal for demo orgs to
"Name".

Fixes part of #29226.
2024-03-14 10:53:36 -07:00
Aman Agrawal 9846c4c476 inbox_row: Don't show topic visibility toggle button by default.
We emulate the same behaviour of hiding topic visibility button
by using opacity if for default topic visibility state.
2024-03-14 10:15:49 -07:00
N-Shar-ma f4d58f1ba6 compose: Show counter inside Drafts button for the current recipient.
Now we show the number of drafts that are addressed to the current
recipient selected in the compose box, if any, in the Drafts button
within parentheses (whether it is next to the Send button, or in the
Send options popover), and explain that it is the number of drafts for
this conversation in the tooltip.

Fixes: #28696.
2024-03-13 16:53:45 -07:00
N-Shar-ma 6ec04c2469 drafts: Refactor function to have a default value for its 1 parameter.
For function `filter_drafts_by_compose_box_and_recipient` since the set
of drafts to filter from is almost definitely going to always be all
drafts, we make the required drafts parameter optional with the default
value of all drafts.

This is a prep commit for the next commit which will use this function.
2024-03-13 16:53:45 -07:00
N-Shar-ma d491c7d53c typeahead: Fix bug where change event was not triggered post selection.
This fixes a regression introduced in the commit making typeahead undo
friendly, d88ce61801.

This fixes the bug where selecting a topic via keyboard in the compose
recipient area did not update the fade.
2024-03-13 16:53:45 -07:00
Sahil Batra 2296c0b717 settings: Do not pass JQuery object to check_property_changed.
The function check_property_changed is called at two places - we
pass elem as HTML object in one call and JQuery object in another.

We should make it consistent and we now pass HTML object in both
the calls as that would be better when we would convert
settings_components file to typescript.
2024-03-13 13:34:57 -07:00
Sahil Batra 67074e7dcc settings_components: Fix enclosing jquery object by "$".
There is no need to enclose a jquery object by "$".
2024-03-13 13:34:57 -07:00
Sahil Batra 75c297b5d4 settings: Pass HTML element not jquery object to get_input_element_value.
We now pass HTML element to get_input_element_value instead of JQuery
object so that we can easily assert types later when we migrate the
file to typescript.
2024-03-13 13:34:57 -07:00
Sahil Batra a6cc9acb22 settings_components: Refactor code in check_property_changed.
This commit updates code in check_property_changed to handle
all time limit settings in the same switch case.
2024-03-13 13:34:57 -07:00
Sahil Batra 40ce7d3df5 settings_components: Do not pass unnecessary parameter.
"Number.parseFloat" only accepts one string parameter and
no other parameter like radix passed in Number.parseInt.
2024-03-13 13:34:57 -07:00
Sahil Batra 517da47da7 settings: Return empty string for "Anytime" case.
We use 'get_realm_time_limits_in_minutes' function to get the
value to be put in the custom input element. Previously, we
returned "null" for the case when the setting was set to
"Anytime", but now we instead return an empty string as returning
null created some issues while converting the file to typescript.

There is no change in behavior due to this as in both cases the
input will be empty.
2024-03-13 13:34:57 -07:00
Sohaib-Ahmed21 7e99c90190 typeahead: Improve compose topic typeahead behaviour.
Fixes: #29006

We make the following changes:
* Do not show the typeahead menu when there are no matching topics.
* When the typeahead is not shown, pressing Tab in the topic field
should move the cursor to the compose box.
* When the typeahead is shown, pressing Tab should select the
currently focused option (as it does now), but put the cursor at
the end of the topic, rather than at the beginning.
2024-03-13 10:00:56 -07:00
N-Shar-ma f16208d9f1 message_view: Allow quoting selected message text, via hotkey and menu.
Whenever the user has text selected within a single message, and uses
the hotkey to quote and reply, this selection will be quoted. In case of
no selection or selection not within a single message, the entirety of
the currently focused message will be quoted like before.

Similarly, when the user selects text within a single message, opens
that message's actions menu, and clicks the "Quote and reply" option,
the selected text will be quoted. In case of no selection or selection
containing any other message/s, the entirety of the message whose menu
was opened will be quoted like before.

When partially quoting a message, it is the markdown version of the
selection that is quoted, hence preserving any formatting. Any other
elements of the message, outside of the content, selected presumably by
accident (like the timestamp or sender name), are ignored.

Fixes: #19712.
2024-03-12 12:29:30 -07:00
Tim Abbott f5505ace89 right-sidebar: Remove duplicate search people tooltip.
The buddy list redesign introduced a new, more detailed tooltip, and
neglected to remove the previous one.
2024-03-12 11:31:42 -07:00
Aman Agrawal d10d72e6a9 narrow_state: Change source of truth for is_message_feed_visible. 2024-03-12 11:31:23 -07:00
Aman Agrawal 374e09b2da message_fetch: Check filter instead of message list.
Reduces use of `message_lists.home`.
2024-03-12 11:31:23 -07:00
Aman Agrawal 1f6625168a message_scroll: Fix scroll to bottom button visible in Inbox view. 2024-03-12 11:31:23 -07:00
Sahil Batra 11c9ec925b stream-settings: Add code to live update email UI on changing privacy.
This commit adds code to live update the stream email address UI
when changing stream privacy.
2024-03-12 10:49:54 -07:00
Sahil Batra ded5fa75b5 stream-settings: Remove unnecessary code for live update.
There is no element with class ".personal" and so this code
is unnecessary. This should have been removed in 87e824d43e
when we changed the code to handle tabs to us
data-stream-section attribute instead of class.
2024-03-12 10:49:54 -07:00
Sahil Batra 749da8ab2f stream-settings: Fix handling live update for stream email UI.
This commit fixes code for live updating the stream email UI
when user subscribes or unsubscribes from the stream.
2024-03-12 10:49:54 -07:00
Tim Abbott d98580ab14 compose_state: Remove incorrect recipient_has_topics helper.
This function was introduced in
99d1c5a1f3 and always has the opposite
value from what its name suggests. It worked OK because the caller
also expected it to have an incorrect value.

It's cleaner in this context to just use the `stream_id` helper, so
just delete the bad code and use that.

Fix the docstring comment having been incorrectly pushed down while
we're addressing this.
2024-03-11 16:31:58 -07:00
Karl Stolley 3a0621fb66 rendered_markdown: Blur code content behind REPL and copy buttons. 2024-03-11 15:38:03 -07:00
Karl Stolley 2df6b6c02a rendered_markdown: Present REPL and Copy buttons with modern techniques.
This also removes the `.btn` class and interference from Bootstrap
on the code Copy buttons.

Fixes: #29165
2024-03-11 15:38:03 -07:00
Karl Stolley 2cf726c53b rendered_markdown: Refine templates and logic for REPL, copy buttons.
Co-Authored-By: shashank-23002 <21bec103@iiitdmj.ac.in>
2024-03-11 15:38:03 -07:00
Aman Agrawal 73370087ed message_feed_top_notices: Simplify check for all message view. 2024-03-11 14:14:36 -07:00
Aman Agrawal fa8b7d898b stream_muting: Refactor to not use message_lists.home. 2024-03-11 14:14:34 -07:00
Aman Agrawal 233bbbaa5f reload: Remove redundant parameter.
`save_narrow` is always true right now and it makes sense
to always save the current narrow when reloading the app.
2024-03-11 14:13:26 -07:00
Aman Agrawal 19af746ce4 reload: Avoid using message_lists.home. 2024-03-11 14:13:26 -07:00
Aman Agrawal 5548a28980 message_fetch: Allow spectators to access all messages view. 2024-03-11 14:13:26 -07:00
Aman Agrawal 8204abf1ce unread_ops: Minor refactor. 2024-03-11 14:13:26 -07:00
evykassirer 03ec788a91 typeahead: Move module to web/src. 2024-03-11 09:56:18 -07:00
evykassirer a55979ebf8 typeahead: Fix buggy advanceKeyCodes code.
The `advanceKeyCodes` option was introduced in #10092.
It included a buggy check for `$.inArray` that returned
a falsey value only when the keycode was the first
element of `advanceKeyCodes`.

Because the only instance of `advanceKeyCodes` right now
is for search and contains only one element, this change
is functionally equivalent.
2024-03-11 09:56:18 -07:00
evykassirer 99c119b01b typeahead: Add missing option to lookup call. 2024-03-11 09:56:18 -07:00
evykassirer 593784b35f typeahead: Remove unused on_move option. 2024-03-11 09:56:18 -07:00
evykassirer aa4e92ee18 typeahead: Stop using html() to set value from updater().
I confirmed that updater() only returns a string or undefined.

composebox_typeahead.js

- compsebox calls `content_typeahead_selected` which returns the composebox
  text content
- stream and PM: implicitly returns undefined

pill_typeahead.js

- implicitly returns undefined

search.js

- narrow_or_search_for_term — returns `get_search_bar_text` or empty string

custom_profile_fields.js, settings_playground.js

- no updater function

If no updater function is provided, then updater returns the
value passed to it, which is
`this.$menu.find(".active").data("typeahead-value")`, which is a string.
2024-03-11 09:56:18 -07:00
evykassirer 30ecf6fafd typeahead: Don't call html with a jquery object.
This is helpful beyond appeasing the linter, because TypeScript only
[permits](https://unpkg.com/browse/@types/jquery@3.5.29/JQuery.d.ts#L5287)
`.html(…)` to accept a `string` or `HTMLElement` argument (or
function returning those), not JQuery. The behavior with a JQuery
argument is also [undocumented](https://api.jquery.com/html/#html2).
2024-03-11 09:56:18 -07:00
evykassirer 2140138f5e typeahead: Confirm that highlighter text is safe html.
All existing typeaheads have values for highlighter that are one
of the following:

* render_search_list_item (a handlebars render function)
* render_typeahead_item which calls a handlebars render function
* another function in typeahead_helper which eventually calls
  typeahead_helper
2024-03-11 09:56:18 -07:00
evykassirer 7219e3835d typeahead: Confirm that header text is safe html.
All current definitions of header(), which is renamed to
header_text() in this commit:

composebox_typeahead.js
- `get_header_html` uses `_.escape`
- `render_topic_typeahead_hint` — is a handlebars function
- third typeahead doesn’t have a header function

custom_profile_fields.js, pill_typeahead.js, search.js,
and settings_playground.js have typeaheads, but none of them
have header functions.
2024-03-11 09:56:18 -07:00
evykassirer 135395e8ce typeahead: Remove unused header_html option. 2024-03-11 09:56:18 -07:00
evykassirer 60018dfd12 typeahead: Use text() instead of html() in set_value.
This particular codepath is never reached right now,
because set_value is only called when `naturalSearch`
is `true`, and the only instance of `naturalSearch`
isn't for a `contenteditable` field.

But we don't need to use `html()` here because it's
displaying a plain string typeahead option.
2024-03-11 09:56:18 -07:00
evykassirer 099810e80f typeahead: Import jquery instead of passing it to a wrapper function. 2024-03-11 09:56:18 -07:00
evykassirer 827b42dd9f typeahead: Replace substring with slice.
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
2024-03-11 09:56:18 -07:00
evykassirer d131f4119f typeahead: Remove unused `hideOnEmpty` option. 2024-03-11 09:56:18 -07:00
evykassirer dc4244b9d8 typeahead: Rename e to event for legibility. 2024-03-11 09:56:18 -07:00
evykassirer 6d30e3e01c typeahead: Stop using deprecated window.event.
See https://developer.mozilla.org/en-US/docs/Web/API/Window/event
for more about this.
2024-03-11 09:56:18 -07:00
evykassirer 8986846436 typeahead: Remove unnecessary that = this.
This isn't needed with arrow functions.
2024-03-11 09:56:18 -07:00
evykassirer 331efb0def typeahead: Refactor to avoid no-case-declarations issue. 2024-03-11 09:56:18 -07:00
evykassirer e12543f957 typeahead: Use const instead of let when not reassigned. 2024-03-11 09:56:18 -07:00
evykassirer 0a321f5e16 typeahead: Fix no-jquery/variable-pattern. 2024-03-11 09:56:18 -07:00
evykassirer 40b4db3323 typeahead: Refactor switch statements to avoid fallthrough. 2024-03-11 09:56:18 -07:00
evykassirer ff1f62bc56 typeahead: Use ?? instead of ||. 2024-03-11 09:56:18 -07:00
evykassirer 64b262d514 typeahead: Replace empty backup functions with inline functions. 2024-03-11 09:56:18 -07:00
evykassirer bb68dde1da typeahead: Use `startsWith` instead of a falsey index check. 2024-03-11 09:56:18 -07:00
evykassirer b034875216 typeahead: Replace ~ operator with includes().
Before ES2016, `indexOf` and jQuery's `inArray`
were used more often. They return -1 for a missing
element, and 0 is the only integer that’s falsy, so
-1 is the only integer whose bitwise complement is
falsy. Using bitwise not (~) like this is no longer
common practice and is a lot more confusing to read.
Now that we have `includes` we can use that instead.
2024-03-11 09:56:18 -07:00
evykassirer 2085d90736 typeahead: Change unused expression to just function calls. 2024-03-11 09:56:18 -07:00
evykassirer 624a879b4e typeahead: Remove unused variables. 2024-03-11 09:56:18 -07:00
evykassirer bcdde201ec typeahead: Use !== instead of !=. 2024-03-11 09:56:18 -07:00
evykassirer 7ccb833b35 typeahead: Run prettier for automatic format cleanup. 2024-03-11 09:56:18 -07:00
evykassirer 99ee72860e typeahead: Run eslint for automatic format cleanup. 2024-03-11 09:56:18 -07:00
sujal 29ca4ba662 stream_settings: Convert name to pills.
Convert anchor tag to pills containing an image/avatar
and username within both existing and new stream
subscriber member lists and group member lists
using the new user_display_only_pill.hbs template.
If user has long username that breaks the UI,
overflow is handled with ellipsis.
add a context class (panel_subscriber_member_list)
to add 'padding 5px'to 'pill_value' for stream
subscriber member list and group member list.

To retrieve  an avatar of a user add a
'img_src: people.small_avatar_url_for_person(user/person)'
field in 'stream_editsubscriber.js', 'user_group_edit_members.js',
'stream_create_subscribers.js' and 'user_group_create_members.js'.

Fixes: #25724.
2024-03-08 17:33:14 -08:00
N-Shar-ma 90cf911e89 typeahead: Update activity score computation algorithm for streams.
Earlier, streams were prioritised like this: pinned streams > subscribed
streams > other streams, with message volume serving as the tie breaker.

Now we prioritise them like: stream being composed to > pinned unmuted
streams > unpinned unmuted streams > pinned muted streams > unpinned
muted streams > unsubscribed streams, with the same tie breaker.

Fixes: #20618.
2024-03-08 16:11:17 -08:00
Temidayo32 11e498f937 resize_handler: Convert module to Typescript. 2024-03-08 10:49:52 -08:00
Lauryn Menard 4d470a52f8 remote-support: Highlight if audit log data is stale or current.
Includes has_stale_audit_log boolean in the remote support view
data so that we can style the last audit log data for the remote
server to visually highlight if it is stale or current.
2024-03-08 09:40:43 -08:00
Lauryn Menard c9caad20d0 support: Have distinct labels for remote vs Cloud support views. 2024-03-08 09:40:43 -08:00
Lauryn Menard 3fe15e048e remote-support: Make approve sponsorship button stand out more.
Adds some color to the approve sponsorship button so that it is
more visible in the support sponsorship forms.
2024-03-08 09:40:43 -08:00
Lauryn Menard b421f3c7ca remote-support: Add class to form for removing a CustomerPlanOffer.
Adds a class to the form for removing a configured CustomerPlanOffer
so that we can add some margin between the form and the information
about the plan offer.
2024-03-08 09:40:43 -08:00
Alya Abbott 736070ca2e portico: Align plans on /for/education with /plans. 2024-03-07 17:31:20 -08:00
nimishmedatwal 8e0518d777 user_profile: Navigate tabs by arrow keys.
Left/right keys arrows in User Profile now navigates
between tabs when it's first opened.
Fixes #28615
2024-03-07 16:48:04 -08:00
Alya Abbott e4cf5ba0c5 bookends: Add periods to stream status bookends.
Also change "deactivated"->"archived" for consistency.
2024-03-07 16:16:02 -08:00
Temidayo32 42dd55df42 condense: Convert module to Typescript. 2024-03-07 16:15:30 -08:00
evykassirer c0bce2c4bf state_data: Fix alphabetical sorting. 2024-03-07 13:25:20 -08:00
evykassirer 3622bff379 activity_ui: Convert module to typescript. 2024-03-07 12:46:37 -08:00
evykassirer c78de3cbc1 state_data: Add realm properties. 2024-03-07 12:46:37 -08:00
Lauryn Menard f3906f4a2f remote-support: Add ability to deactivate and reactivate remote servers. 2024-03-07 11:51:00 -08:00
evykassirer 33484e7ac3 people: Cache results of remove_diacritics. 2024-03-07 11:46:54 -08:00
evykassirer 1db2d0fd0f people: Move comments above fields. 2024-03-07 11:46:54 -08:00
Varun Singh 1fb03a27d8 compose_fade: Convert module to TypeScript. 2024-03-06 14:47:47 -08:00
Varun Singh d60848bb81 compose_fade: Refactor 'set_focused_recipient' function.
Previously we  declared the 'focused_recipient' object
with an initial field of 'msg_type' and progressively added
fields by mutating the object(depending on the 'msg_type' ie. 'stream'
or 'private'). This was not TypeScript friendly and the compiler threw.

Now, we first fetch those fields and then create the 'focused_recipient'
object depending on the value of 'msg_type' field.
2024-03-06 14:47:47 -08:00
Varun Singh c67b38fa7d message_viewport: Consistently use 'row_to_output' for callback.
This callback(initially named 'row_to_id') is part of two different
code paths.For one it refers to 'get_row' function local to
'visible_groups' and for other it refers to 'row_to_id' function
local to 'visible_messages'(same namings cause a confusion and is
also inconsistent).

Here I have renamed the callback to 'row_to_output', this is
more explanatory and consistent with name '_divisible_divs' uses
for the same callback.
2024-03-06 14:47:47 -08:00
Varun Singh 99ea6ae3fc rows: Fix type of 'message_group'. 2024-03-06 14:47:47 -08:00
Varun Singh ead68e731b compose_fade: Fix argument to be a jQuery object. 2024-03-06 14:47:47 -08:00
Tim Abbott 242c5cbb1d condense: Pass message objects to collapse functions.
This creates a much cleaner API and types for these functions. Since
the callers already had the message objects, this avoids extra work
both in the most callers and in these functions.

We also loop through all_rendered_message_lists rather than hardcoding
logic for message_lists.home.
2024-03-06 14:40:47 -08:00
Sayam Samal 70013d0f28 navbar: Add navigate to home view tooltip to the organization logo.
The organization logo in the upper left navigates to the user's home
view. We add a tooltip to make this easier to discover.

We show `Esc` as the keyboard shortcut here, unless the user has
disabled it, in which case we show the alt shortcut `Ctrl` + `[`.

Fixes #29185.
2024-03-06 13:58:36 -08:00
afeefuddin 5e18bd762f left_sidebar_navigation_area: Convert module to TypeScript. 2024-03-06 13:57:33 -08:00
Karl Stolley b20beda905 emoji_picker: Express colors as CSS variables.
This also adds a previously missing dark-mode background color for
reacted emoji's :focus state in the picker.
2024-03-05 14:58:58 -08:00