Commit Graph

4550 Commits

Author SHA1 Message Date
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
Aman Agrawal 431145d4f2 bootstrap_typeahead: Fix AssertionError due to `onHidden` not called.
Since `onHidden` is only called once tippy is fully hidden, tippy
can fail to call `onHidden` if `onShow` is called before
tippy is fully hidden. This hurts us as we want to call `destroy`
to remove this tippy instance from DOM.

To avoid this, we `destroy` the tippy instance outside of tippy
callbacks which is more reliable since our event handlers call
`hide` without fail.
2024-05-28 10:34:06 -07:00
Aman Agrawal 847dbe5b91 inbox: Fix assertion error on row being outside visible area. 2024-05-28 07:21:26 -07:00
Anders Kaseorg a4256012ed scroll_util: Remove workaround for SimpleBar type issue fixed upstream.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-26 19:23:35 -07:00
Anders Kaseorg 4019ccecbb eslint: Outsmart formatjs/enforce-default-message.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-26 19:20:10 -07:00
Anders Kaseorg caf6387514 stylelint: Fix shorthand-property-no-redundant-values.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-26 19:20:10 -07:00
Varun Singh 7861fd0a50 starred_messages_ui: Rename field 'new_value' to 'updated_starred_flag'.
The name 'new_value' seemed rather generic and uninformative.
2024-05-25 17:50:00 -07:00
Varun Singh f7e1403a12 starred_messages_ui: Convert module to TypeScript. 2024-05-25 17:50:00 -07:00
Sahil Batra 4ef3117191 invite: Fix comment mentioning textarea.
We no longer use textarea element to take emails in the invite
modal and instead use a pills.
2024-05-25 17:48:48 -07:00
Sahil Batra 5e347e971d invite: Remove code for old UI.
We still had some code in invite.ts for the textarea element
which was replaced by pill container, so this commit removes
that code.

This commit also removes the CSS for textarea and radion buttons
which are no longer present in the UI.
2024-05-25 17:48:48 -07:00
Sahil Batra 41409b7c4c invite: Remove unnecessary calls of toggle_invite_submit_button.
There is no need to call toggle_invite_submit_button while
changing inputs on the modal, or while selecting all streams
using the "Check all" button as the state of button is only
dependent on the input in email pill container and on which
tab is opened.
2024-05-25 17:48:48 -07:00
Sahil Batra 52ec8a0c2b invite: Fix button state when initially opening invite modal.
Previously, when the invite modal was opened with user having
permission to send email invites, the button at the bottom had
"Generate invite link" text. It should instead be "Invite" with
the button disabled since email invites section is opened by
default.

This was because the toggle_invite_submit_button was called
when the modal was not visible and thus calling `.is(":visible")`
for email pill container element returned false. This commit
changes it to pass the selected tab to toggle_invite_submit_button
to avoid computing which tab is opened by checking the element
visibility, attributes, etc. when the modal is not visible and
the tab container might not be present in the DOM.
2024-05-25 17:48:48 -07:00
Anders Kaseorg 8364cbe26d user_settings: Fix initialize_user_settings type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:24:22 -07:00
Anders Kaseorg dbfc980c82 realm_user_settings_defaults: Fix initialize type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:24:22 -07:00
Anders Kaseorg a5995a69f3 people: Fix get_custom_profile_data type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:23:00 -07:00
Tim Abbott 3bce9fd293 muted_users_ui: Rename misleading variable name. 2024-05-24 15:18:35 -07:00
afeefuddin 8a13bbd953 muted_users_ui: Convert module to TypeScript. 2024-05-24 15:18:35 -07:00
Anders Kaseorg a68bc645ed filter: Don’t parse dm-including operand as a list.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 10:25:46 -07:00
evykassirer 825fa6f0e1 narrow_state: Remove narrowed_to_topic function.
This was only being used in one place in compose_closed_ui
to create the label for the closed composebox. But it
only checked if the `channel` and `topic` filters existed,
while `stream_sub` can return `undefined` for a few other
reasons. To ensure that we're catching the undefined sub
while also avoiding duplicate work, it makes sense to just
call `stream_sub()` directly.

Fixes this bug:
https://zulip.sentry.io/issues/5367251929/events/40073ecf007a4a9798e728061a576377/?project=450455688282112
2024-05-24 10:24:16 -07:00
Karl Stolley 852637d3b3 left_sidebar: Convert stream-privacy icon sizes to ems. 2024-05-24 10:23:41 -07:00
Karl Stolley d5a5044ecd left_sidebar: Improve icon alignment in stream rows. 2024-05-24 10:23:41 -07:00
Karl Stolley 0818aa759d icons: Correct whitespace around lock, vdots icons.
This fixes a perennial problem with a droopy lock icon, and better
situates the vdots in the box created in the SVG-to-font
conversion.
2024-05-24 10:23:41 -07:00
Karl Stolley dda75a56bc left_sidebar: Consolidate .stream-privacy styles. 2024-05-24 10:23:41 -07:00