Commit Graph

4572 Commits

Author SHA1 Message Date
Anders Kaseorg 7303851fd5 drafts: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg ff23f79550 copy_and_paste: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg e50a115d6f composebox_typeahead: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg a1ca665119 compose_ui: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 6eec89ab96 compose_reply: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg cbffc10e9e compose_fade: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 468da9ed23 compose_actions: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 015e3917ac common: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 5a4b0420d1 buddy_list: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 6cd8c9bb8c bot_data: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 8cec7dd917 bootstrap_typeahead: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 9ad8ca4223 blueslip_stacktrace: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 284beed889 billing/sponsorship: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg c2c2e0b9ea billing/remote_billing_auth: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 01677db59e attachments_ui: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 9b711cda20 tippy: Use namespace import for tippy.js.
Names like “delegate”, “Instance”, “Placement”, “Props”, and
“ReferenceElement” are much too generic to make sense as named
imports.

The downside is that we now need to write tippy.default(…) instead of
tippy(…) (because ES module namespace objects cannot be callable), but
that cost is worthwhile.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:45:46 -07:00
Aman Agrawal 817bffe6b1 message_list: Rename `narrowed` property.
We rename it for clarity so that someone new to the codebase
knows instantly what it is checking.
2024-05-30 11:41:13 -07:00
Aman Agrawal 71341d282e narrow: Remove last remains of was_narrowed_already.
This doesn't seem useful even for sentry logs since they
will already contain the full hash change history.

Rest of it was removed in 240f7b53b2.
2024-05-30 11:41:13 -07:00
roanster007 7b1a5d84fc refactor: Extract the methods called post narrow message list update.
This commit extracts various methods called post the current
message list is updated in "narrow.js" such as update_unread_banner,
handle_post_view_change, etc. into a separate method --
"handle_post_message_list_change".

This allows us to be able to call these methods independently
in case we need to update the filter and the corresponding
message lists.

This is a preparatory commit to #30114.
2024-05-30 11:37:13 -07:00
Varun Singh 50e0f336f0 settings_streams: Fix error thrown when adding 'default-channels'.
The 'Select channel' dropdown in 'Add default channels' modal is
the LAST dropdown element on the modal and it does not contain
`data-stream-id` attribute.

.attr('data-stream-id') would return undefined for this element
and as a result the returned `Set` would have its last element a
`NaN` --- passing a `NaN` inside 'data' field of 'channel.post' threw
an error.

We tweaked the selector string to selectively map over the elements with
'data-stream-id' attribute.
Also we removed '.toString()' converting stream-id to a string (stream-id is a
'number' type).
2024-05-30 10:53:19 -07:00
Anders Kaseorg 4d8e5b5029 5xx: Fix development server preview of 500 error page.
This can be viewed at http://localhost:9991/webpack/5xx.html on the
development server.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 10:49:03 -07:00
Anders Kaseorg 27a993a504 stats: Make sent_data_schema specifically expect human and bot keys.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 10:01:59 -07:00
Aman Agrawal e74dd93b52 5xx: Add a comment explaining how CSS is applied to this page. 2024-05-30 09:12:59 -07:00
Aman Agrawal 4811dd3ffd Revert "5xx: Remove css classes and duplicate div tags."
This reverts commit eada57921e.

This does have CSS applied to it via webpack.

See

```
new HtmlWebpackPlugin({
    filename: "5xx.html",
    template: "html/5xx.html",
    chunks: ["error-styles"],
}),
```
2024-05-30 09:12:59 -07:00
Anders Kaseorg 7377d3fab9 topic_generator: Fix types of get_next_stream, get_prev_stream.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-29 23:33:27 -07:00
Anders Kaseorg c20af83770 people: Fix get_custom_fields_by_type type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-29 23:33:11 -07:00
Anders Kaseorg a01d68e838 people: Rename ProfileData type to singular ProfileDatum.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-29 23:33:11 -07:00
Anders Kaseorg ec199082fd types: Move Submessage to submessage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-29 17:47:09 -07:00
evykassirer 48fc0bc750 message_helper: Convert module to typescript. 2024-05-29 16:45:36 -07:00
evykassirer 7364c02ed6 message_helper: Set clean reactions when processing the raw message. 2024-05-29 16:45:36 -07:00
evykassirer 28107eb913 message_helper: Be more explicit about converting subject to topic. 2024-05-29 16:45:36 -07:00
evykassirer 297d393539 message_helper: Only convert subject to topic for stream messages.
There was a stale comment here saying we needed to do this for
private messages too, but `convert_message_topic` only modifies
`message` if its type is "stream".
2024-05-29 16:45:36 -07:00
evykassirer 50f5cf9ad8 message booleans: Return new message instead of mutating a raw message. 2024-05-29 16:45:36 -07:00
evykassirer 59a743de01 reify_message_id: Save id on most up-to-date message object.
Previously we relied on `echo.reify_message_id` to set the new
`id` and `locally_echoed` value, but it was setting this on
the message stored in `waiting_for_id`, which isn't guaranteed
to be the same as the message in the message store. Once
`process_new_message` stops mutating the message it gets and
returns a new message object, this would have caused a bug.
2024-05-29 16:45:36 -07:00
evykassirer bab1dc5d9c message tests: Don't assume process_new_message mutates the message.
We already changed callsites in the codebase to use the message
returned from `process_new_message` instead of assuming the raw
message passed in will be mutated. This fixes a few remaining tests.
2024-05-29 16:45:36 -07:00
evykassirer 61371868ad message_store: Mark optional attributes as optional.
These aren't set when the Message object is first created
and only used within `message_list_view`, so they should be
optional.
2024-05-29 16:45:36 -07:00
evykassirer 26dbb953e0 people: Remove line for type of message that can't exist.
This will help us with a code coverage issue in an upcoming
commit.
2024-05-29 16:45:36 -07:00
evykassirer 854b3868ac message: Remove unused star_status attribute.
Based on git log -S 'starred_status', it’s been unused since
4bf16ca9cc (#22746).
2024-05-29 16:45:36 -07:00
Aman Agrawal eada57921e 5xx: Remove css classes and duplicate div tags.
Since this file doesn't link any stylesheet, no CSS is applied to
these classes.

Tested change by pasting the content of it in `link_malformed`
and rendering that template using a malformed email confirmation link.
2024-05-29 09:37:25 -07:00
Aman Agrawal 0daee09b79 bootstrap_typeahead: Rename parentElement for clarity.
We don't use tippy to position the typeahead if a `parentElement`
is specified. `non_tippy_parent_element` helps us covey that.
2024-05-29 09:35:32 -07:00
Tim Abbott 097066f412 Revert "recent_topics: Change background color in dark mode on hover on a row."
This reverts commit 4ee37244bb.

This was not found to be uniformly agreed as an improvement.
2024-05-28 14:38:50 -07:00
sanchi-t 8ef4ee6845 user_profile: Update the profile tab after editing.
Use user events to update profile tab for a
synchronized experience across all users.

Fixes #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
sanchi-t ca74c95c60 user_profile: Display `Saved` feedback.
Visually confirms successful profile changes with a clear
`Saved` message.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
sanchi-t 5a0abeed92 user_profile: Disable save button until changes are made.
Prevents modal from closing when `Save changes` is clicked
after editing a profile field. Also, disables the `Save changes`
button until at least one field has been edited.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
sanchi-t c442db64fc custom_user_profile_fields: Add `name` attribute to fields.
In `custom_user_profile_fields.hbs`, the name attribute has been
introduced to profile fields to facilitate the future use of the
`get_current_values` function in retrieving field values.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
sanchi-t 2ad886f427 dialog_widget: Extract `get_current_values` function from `launch`.
This commit separates the `get_current_values` function from the
`launch` code, allowing it to be exported and utilized independently.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
Karl Stolley 0884b96fc6 spoilers: Style headers in Markdown-neutral way. 2024-05-28 14:34:10 -07:00
Prakhar Pratyush 95be5db08b narrow: Add 'more topics' state to browser history.
When navigating "back" or "forward", the left sidebar state
should be restored.

Earlier, "more topics" expanded was not considered a distinct
state.

This commit makes it possible to correctly place you in the
"more topics" view or not, depending on where you were.

Fixes #29548.
2024-05-28 12:09:57 -07:00
Sahil Batra 3971c033c3 templates: Remove unnecessary prop-element class.
We use "prop-element" class only to handle save-discard widget
and not anywhere else, so there is no need to have this class
for elements that do not use save-discard widget.
2024-05-28 10:44:15 -07:00
Sahil Batra 671547345d settings: Refactor code to handle realm authentication methods.
This commit refactors code to handle realm authentication methods
in a better way. We remove the get_complete_data_for_subsection
function and instead let populate_data_for_request handle the
request data for authentication methods.

We also remove the "prop-element" class from each authentication
setting checkbox and instead add it to the container div as a
the list of those checkboxes represent a single field, i.e.
the realm_authentication_methods field received from the server
and the authentication_methods field sent to 'PATCH /realm'
endpoint.
2024-05-28 10:44:15 -07:00