Commit Graph

57002 Commits

Author SHA1 Message Date
Mahhheshh 6c0818ff51 email_page: Migrate has_request_variables to typed_endpoint.
Refactor `email_page` view to use `typed_endpoint` decorator instead of
`has_request_variables`.
2024-03-13 16:47:34 -07:00
Anders Kaseorg 8772a70d15 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-13 14:46:30 -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
Alya Abbott b5e4d1d0e7 portico: Add quote from UTFPR to /for/education. 2024-03-13 12:43:40 -07:00
Alya Abbott eadd257854 help: Document new option to quote part of a message. 2024-03-13 11:40:03 -07:00
Alya Abbott 53ad0e4218 help: Add example playground URL templates.
Fixes #29067.

Co-authored-by: Rohan Sharma <rs545837@gmail.com>
2024-03-13 11:29:45 -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
Mahhheshh 22bd8048b1 parse_client: Migrate has_request_variables to typed_endpoint.
Refactor `parse_client` view to use `typed_endpoint decorator`
instead of `has_request_variables`. This change improves code consistency
and enhances codebase comprehension.
2024-03-12 13:27:21 -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
Alya Abbott c969e11d7b help: Clarify how automated notices are translated. 2024-03-12 12:17:08 -07:00
Alya Abbott 5384f7a326 help: Organize and extend guide for moderating open organizations. 2024-03-12 11:52:46 -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
Lauryn Menard 8f5b8dbf1a stripe: Remove unused do_change_remote_server_plan_type.
This was implemented instead as part of the BillingSession class
with the do_change_plan_type method.
2024-03-12 11:19:29 -07:00
Alya Abbott d76ba00168 help: Rewrite article about automated notices.
- Rename article "Configutre Notification Bot" -> "Configure
automated notices".
- Reorganize article around types of notices.
- Other cleanup and clarifications.
2024-03-12 11:18:17 -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
Alex Vandiver d460743705 realm_activity: Correct the "messages sent" column. 2024-03-11 14:39: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 2b12c8b4b9 narrow: Fix comment. 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 babe525b5c linter: Add _html as a variable name for safe html. 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