Commit Graph

3594 Commits

Author SHA1 Message Date
Anders Kaseorg 2dca29ce5a eslint: Fix @typescript-eslint/no-unnecessary-type-assertion.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-29 16:14:26 -08:00
roanster007 04013cdec1 left_sidebar: Add mark all messages unread to three dot topic menu.
This commit adds a new option to the three-dot topic menu in the
left sidebar to mark all the messages of topic as unread, provided
the topic's messages are already read before choosing this option.

This is done with the help of bulk_update_read_flags_for_narrow
method to remove the read flag on bulk of messages.

Fixes #25085
2024-01-29 16:07:19 -08:00
roanster007 b1ca1fd606 unread_ops: Refactor bulk_mark_messages_as_read method.
This commit renames the bulk_mark_messages_as_read method to
bulk_update_read_flags_for_narrow, and takes in an additional
parameter - op, which takes in values of add or remove, indicating
whether to add or remove the read flag for bulk messages.

This is a preparatory commit to bulk mark multiple messages as unread.
2024-01-29 16:07:19 -08:00
Prakhar Pratyush edec29e0b6 support: Add support to configure fixed_price plan. 2024-01-29 11:23:20 -08:00
Lauryn Menard 15ba9cf8ec bootstrap: Remove bootstrap.btn classes from support view buttons.
Moves CSS styles for support view buttons to
`web/styles/portico.activity.css`.

Also removed the "sea-green" and "small" classes from a few buttons
as no CSS rules were being applied and most of those buttons will
be removed when these forms are refactored to use a modal.
2024-01-29 10:59:33 -08:00
evykassirer ea04f7d27d topic list: Convert module to typescript. 2024-01-29 10:22:35 -08:00
evykassirer 7154539e80 typeahead_helper: Convert module to typescript. 2024-01-29 10:06:18 -08:00
evykassirer fdb6f212d0 Remove User type from types.ts. 2024-01-29 10:06:18 -08:00
Sahil Batra 5f82bf0002 css: Remove bootstrap css for "fade" class.
We do not use "fade" class in our app anymore so we can
remove its CSS from boostrap.app.css.
2024-01-29 09:55:32 -08:00
Sahil Batra d375921eb4 settings: Do not use bootstrap "fade" class.
We used bootstrap "fade" class to show the password strength
only after password_quality module is imported. Adding "fade"
class was only hiding the bar by setting opacity and the
transition defined in bootstrap was not used as it was
overridden by transition in progress_bar.css. So, we just
hide and show the bootstrap by using "hide" class and remove
the use of "fade" as part of the bootstrap removal project.
2024-01-29 09:55:32 -08:00
Sahil Batra 69d0c78f1e settings: Remove unnecessary code.
We do not use "#pw_change_controls" element any more as it
was removed in 2ca0fb412.
2024-01-29 09:55:32 -08:00
Tim Abbott 41fa2e7174 css: Remove unused portico tab-content CSS rules. 2024-01-28 16:08:30 -08:00
Tim Abbott 065dc8fc5d css: Remove several unused Bootstrap rules from portico. 2024-01-28 16:08:30 -08:00
Tim Abbott b44c3d321d css: Delete unused Bootstrap close rules from portico. 2024-01-28 16:08:30 -08:00
Tim Abbott 00aa0631fe css: Move Bootstrap alerts CSS to separate file. 2024-01-28 16:08:30 -08:00
Tim Abbott db9ee6237e css: Remove portico copy of Bootstrap typeahead CSS.
We don't use the typeahead component in portico pages.
2024-01-28 16:08:30 -08:00
Tim Abbott 56a884e0be css: Extract Bootstrap Typeahead CSS to its own file. 2024-01-28 16:08:30 -08:00
Tim Abbott 73aca658f6 css: Remove unused Bootstrap dropdown-backdrop rules. 2024-01-28 16:08:30 -08:00
Tim Abbott 4395c54c23 css: Remove unused Bootstrap CSS for nav elements. 2024-01-28 16:08:30 -08:00
Tim Abbott ee97d018af css: Remove unused Bootstrap dropup CSS. 2024-01-28 16:08:30 -08:00
Tim Abbott 3818969f04 css: Remove overridden body styles from app. 2024-01-28 16:08:30 -08:00
Tim Abbott 98637e3a88 css: Remove unused Bootstrap text-* styles from app. 2024-01-28 16:08:30 -08:00
Tim Abbott 49ff0dc2e2 css: Remove unused row/container CSS from app. 2024-01-28 16:08:30 -08:00
Tim Abbott 25d7740b26 css: Remove dead Bootstrap CSS from app.
The only reference to any of these was in a comment.
2024-01-28 16:08:30 -08:00
Karl Stolley f07dae6b25 bootstrap: Fork CSS into app, portico copies.
This aims to reduce the cognitive overhead of doing Bootstrap CSS
cleanup by concerning contributors only with Zulip or the portico.
2024-01-28 15:07:36 -08:00
Pratik Chanda f4260cf40d stream_settings: Add stream "reset to default notifications" button.
This commit introduces a "reset to default notifications" button to
the personal panel in stream settings. On clicking, it unmutes the
current stream and resets all its notification configurations to
default user settings.

Fixes zulip#27624.
2024-01-28 14:32:45 -08:00
evykassirer 3975c508b5 topic_generator: Convert module to typescript. 2024-01-28 14:20:45 -08:00
evykassirer d969ac3764 reactions: Rename reaction_info to rendering_details.
When we convert to typescript, these variables
will be of type EmojiRenderingDetails. This is
a more clear name.
2024-01-28 14:17:15 -08:00
evykassirer 3208235e79 emoji: Remove number as possible type for emoji_code.
More details here:
https://github.com/zulip/zulip/pull/28375#issuecomment-1878073956
2024-01-28 14:17:15 -08:00
evykassirer 0e358b9f85 reactions: Always call update_user_fields with should_display_reactors.
This was wrong before. `update_user_fields` is called with
`should_display_reactors` everywhere else.
2024-01-28 14:17:15 -08:00
evykassirer 84038a9984 reactions: Fix typo. 2024-01-28 14:17:15 -08:00
evykassirer fc1bd590b6 reactions: Remove view namespace.
This will make a migration to typescript easier,
and was unnecessary extra complexity.
2024-01-28 14:17:15 -08:00
Sahil Batra 3fc2bccc21 bootstrap: Remove css for btn-link elements.
We currently use btn-link class only in buttons used for
changing email and password in account settings panel and
for we already bootstrap CSS rules for those so we can
safely remove the CSS rules in bootstrap-btn.css.
2024-01-26 09:10:09 -08:00
Sahil Batra 6b459c0ea4 invite: Re-add bootstrap CSS rules for btn-link elements.
This commit re-adds the bootstrap CSS rules for the specific
btn-link elements in invite modal to zulip.css. This is part
of the bootstrap removal project.
2024-01-26 09:10:09 -08:00
Lauryn Menard bfd9eec4b3 activity: Add totals row as sticky footer to activity charts.
Updates the total row for the installation and remote activity
charts to be in the table footer. Makes the footer class sticky
to the bottom of the view so that it is always visible on the
chart.

Also, updates the installation activity column for revenue to
be formatted as a dollar string, since this formatting was being
applied in the updated total row.
2024-01-26 09:04:39 -08:00
Tim Abbott 371dea3f0d css: Remove unused btn-info styles. 2024-01-25 18:35:38 -08:00
Tim Abbott ee9a9bfa98 css: Remove unused btn-block styles.
The (unfinished) two-factor UI isn't designed at all, so we can just
remove the classes from it.
2024-01-25 18:35:38 -08:00
Tim Abbott f04b54ff47 css: Remove unused boostrap nav-header styles. 2024-01-25 18:35:38 -08:00
Tim Abbott 4b6b1da83c bootstrap: Remove now-unused tabs JS component.
This was the last bootstrap.js feature, so we finally get to remove
the whole module.
2024-01-25 18:35:38 -08:00
Tim Abbott f105c6b12e css: Remove unused Bootstrap nav-tabs styles. 2024-01-25 18:35:38 -08:00
vighneshbhat9945 642cce1a30 settings: Remove extraneous background for export button.
Removed the div along it's css rules which was
responsible for extraneous background around the
'start export of public data' button.

Fixes: #28625.
2024-01-25 18:24:06 -08:00
Sayam Samal 222364733f emoji_picker: Restructure CSS related to the emoji picker.
This commit tries to improve the CSS related to the emoji picker by
restructuring relevant parts of `reactions.css` and `dark_theme.css`.

Via this commit, the redundant classes -- "reaction", "status-emoji",
"composition" are also removed from `emoji_popover_emoji.hbs`.

If needed, specific styling -- according to the type of emoji picker,
can now be applied using the `data-emoji-destination` attribute of the
`.emoji-picker-popover`.
2024-01-25 18:15:45 -08:00
Sayam Samal d0c111c809 emoji_picker: Fix status emoji picker inconsistencies.
Due to a logical bug in the `process_enter_while_filtering` function,
the `toggle_reaction` was being called when pressing enter while
filtering the emojis in the status emoji picker.

This commit fixes the above bug, while also adding some cleanups to the
`emoji_picker.js` by combining multiple click handlers and aggregating
all the logic related to an emoji being selected into a common function.

Fixes #28464.
2024-01-25 18:15:45 -08:00
vighneshbhat9945 6d6fa145cc
css: Make the height of compose buttons steady.
When any stream name includes some other language's letters is scrolled down in 
the recent views, the height of compose-controls bar would change.

Fix this by setting a precise line-height for these elements.

Fixes: #27837.
2024-01-25 15:16:00 -08:00
Sahil Batra 6781d06988 settings: Remove extraneous divider in account settings. 2024-01-25 14:28:48 -08:00
Sahil Batra 3d56f65df3 settings: Show the text about downloading config in "Active bots".
This commit moves the "Download config of all active outgoing
webhook bots in Zulip Botserver format." text to be shown in the
"Active bots" section since the text is relevant for active bots
only. This commit also updates the code to show the text only
if user has atleast one active outgoing webhook bot since the
text is relavant only for outgoing webhook bots.
2024-01-25 14:28:48 -08:00
Sahil Batra a6370fda68 settings: Do not use bootstrap tabs in bots panel.
This commit replaces the boostrap tabs with our own
tabs implementation from components.ts. This is part
of the bootstrap removal project.
2024-01-25 14:28:48 -08:00
N-Shar-ma 0003c3c1ef typeahead: Fix bug where typeahead showed momentarily on shift + tab.
Since the keyup event for keys including shift triggers the typeahead,
shift tabbing into the topic recipient field would show the typeahead
momentarily, which is distracting.

As we need typeahead to trigger on shift for certain use cases in the
compose box, but not in the topic recipient field, we now do not trigger
typeahead on shift keyup events in the topic recipient field.

Fixes: #24152.
2024-01-25 11:12:26 -08:00
N-Shar-ma e4258b56d5 hotkey: Introduce hotkey Alt+P to toggle preview for compose box.
On Mac, it's Option+P.

Fixes: #18471.
2024-01-25 10:51:25 -08:00
N-Shar-ma 972b4de7c4 hotkey: Correct Mac equivalent of Alt and handle exceptions separately.
Though the correct mapping for Alt in Mac is Option, we had so far been
mapping it to Command, since for the 2 pre-existing shortcuts that used
Alt, Command was the only key that worked on Mac. However, these are
exceptions.

Now we map Alt to Option, and handle the 2 exceptions separately, using
data attributes on those shortcut elements.

This is a prep commit for introducing a hotkey that uses Alt / Option.
2024-01-25 10:51:25 -08:00
N-Shar-ma 536ab78587 refactor: Extract new function `show_preview_area` for the compose box.
The code responsible for switching from edit mode to preview mode from
`compose_setup.js` is now extracted into a new function in `compose.js`,
to facilitate reuse.

This is a prep commit for introducing a hotkey to toggle between edit
and preview mode for the compose box.
2024-01-25 10:51:25 -08:00
Anders Kaseorg 118cfbea65 typeahead: Remove insecure default highlighter implementation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 17:46:56 -08:00
Anders Kaseorg 5348bee0eb settings_playgrounds: Fix HTML injection in language typeahead.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 17:46:56 -08:00
evykassirer d7b02a699c pygments_data: Move data to typescript. 2024-01-24 17:06:03 -08:00
evykassirer bd6471f0e3 page_params: Add custom_profile_field_types. 2024-01-24 17:06:03 -08:00
evykassirer ebb1105e2f typeahead: Fix type of sorting_comparator. 2024-01-24 17:06:03 -08:00
Sahil Batra 866a610664 group_settings: Empty right panel based on the url hash.
This commit adds code to empty the right panel if hash is
changed to "#groups/your" or "#groups/all".
2024-01-24 14:01:47 -08:00
Sahil Batra a87de19aa7 groups_settings: Fix browser back button for groups overlay.
There is no problem in behavior of browser back button if we open
the group settings overlay using "#groups/your", "#groups/all" or
"#groups/new" url hash, but someone can directly go to a link with
"#groups" and in this case we want to fix the browser back button.

This commit replaces "#groups" entry with "#groups/your" which is the
default section opened, such that pressing back when on "#groups/your"
does not go to "#groups", which will then a form a cycle and instead
go back actually.
2024-01-24 14:01:47 -08:00
Sahil Batra 6e61077ab4 gear_menu: Open group settings overlay with "#groups/your" hash.
This commit fixes the bug in browser back button behavior when
opening the groups overlay from gear menu. The bug was caused
due to browser history containing both "#groups" and "#groups/your"
entries, which essentially resulted in a "#groups/your" -> "#groups"
-> "#groups/your" cycle and thus nothing happend on clicking
browser back button.

The case for a user manually typing "#groups" url would be handled
in next commit.
2024-01-24 14:01:47 -08:00
Sahil Batra baad78aafd groups_settings: Make "Cancel" button work in group creation form. 2024-01-24 14:01:47 -08:00
Pratik Chanda 8559032d3a help_menu: Fix help_menu message formatting overlay not opening.
This commit fixes the behaviour of message formatting overlay in
help menu not opening due to assertion error in rendered markdown
after changes from #28418.
2024-01-23 18:09:57 -08:00
Anders Kaseorg e9ea4280ab vdom: Fix types to avoid relying on unsound bivariance.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-23 12:13:41 -08:00
Aditya Kumar Kasaudhan 19f315cf4f settings: Rename 'display_settings' to 'preferences'.
Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Aditya Kumar Kasaudhan 6cd165386a settings: Rename 'emoji-display-settings' to 'emoji-preferences'.
Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Aditya Kumar Kasaudhan 61a10dfca0 settings: Rename 'display-settings' to 'preferences'.
This commit renames "display-settings-radio-choice-label" to "preferences-radio-choice-label".

Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Lauryn Menard ccfcb34bea activity-css: Make activity charts header row sticky.
This will be applied to both the overall installation activity chart
as well as the associated remote, client, realm and user views.

Co-authored-by: Karl Stolley <karl@zulip.com>
2024-01-23 09:31:05 -08:00
Sahil Batra 9fa39ce71d stream_edit_subscribers: Remove unnecessary logging.
There is no need to log if the stream edit UI is not opened
when an event for updating subscribers list is received and
we should just return because this is not a bug.
We do the same in other places where we just return early
without logging because we do not need to make any updates.
2024-01-22 22:08:10 -08:00
Anders Kaseorg cacdae5a10 message_viewport: Remove needlessly complex make_dimen_wrapper.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-22 18:21:53 -08:00
Lalit 6f6795f607 ts: Migrate `message_viewport` to typescript.
Used function overloading for methods - `make_dimen_wrapper`
and `scrollTop`.
2024-01-22 16:29:23 -08:00
Lalit f2c700b6e1 message_viewport: Refactor `message_viewport_info` method.
Refactoring to avoid having an object of incomplete type i.e. `res`.
2024-01-22 16:29:23 -08:00
Lalit 82841a7b5f message_viewport: Remove unused parameter from `in_view` function. 2024-01-22 16:29:23 -08:00
Lalit d4a4e2df3a message_viewport: Modify parameters for dimension wrapper functions.
JQuery's `height` and `width` methods only takes one argument in case
we want to set height or width. The argument is of type `string` or
`number` or a function.

Refrence: https://api.jquery.com/height/#height-value.

Therefore, we can get rid of argument array and just accept a single
argument in the inner function in `make_dim_wrapper`.
2024-01-22 16:29:23 -08:00
Lalit 530f4fc763 message_viewport: Avoid having unbound methods.
Passing class methods such as `$.fn.height` as values is dangereous
because it removes type safety by failing to capture `this`.
eslint-rule: @typescript-eslint/unbound-method.

Hence, I fixed this rule by directly binding `$scroll_container`
to these methods before passing them as values to wrapper function.
2024-01-22 16:29:23 -08:00
Lalit 69294d5baf message_lists: Add type for `opts` parameter of `select_id` method. 2024-01-22 16:29:23 -08:00
ColeBurch 9917ffa220 settings: Rename four custom profile fields types.
This commit renames four custom profile fields types.

Fixes part of #28511.
2024-01-21 12:51:53 -08:00
Aman Agrawal abe6e5b807 personal_menu: Fix clicking on `Set status` not working.
Use `tabindex` instead of `href` to set focus on `a` tag.

Ideally, we should use `button` for these elements but since
we want to keep the pattern for these dropdowns same where some
`a` elements do have a valid `href`.
2024-01-21 12:06:53 -08:00
Varun Singh c0a0c0e834 scheduled_messages: Convert module to TypeScript. 2024-01-21 08:54:20 -08:00
Varun Singh ac42de07eb scheduled_messages_data: Convert object to Map. 2024-01-21 08:54:20 -08:00
Aditya Kumar Kasaudhan 80ea965408 settings: Rename display_settings_labels to preferences_settings_labels.
Fixes part of #26874.
2024-01-19 17:55:13 -08:00
evykassirer 1948cf15a4 rendered markdown: Assert data-user-group-id is always defined. 2024-01-19 17:54:07 -08:00
evykassirer 8473b9dd48 rendered_markdown: Throw error if stream_id_string is undefined. 2024-01-19 17:54:07 -08:00
evykassirer 1de36ec743 rendered_markdown: Convert module to typescript. 2024-01-19 17:54:07 -08:00
evykassirer 4c5f115a6e people: Remove string type for user_id.
Further discussion here:
https://github.com/zulip/zulip/pull/28418#discussion_r1442220867
2024-01-19 17:54:07 -08:00
evykassirer e4ba07dcf2 message_store: Only allow number for message_id. 2024-01-19 17:54:07 -08:00
evykassirer e986813943 emoji_picker: Don't allow toggling of user status emoji. 2024-01-19 17:54:06 -08:00
Tim Abbott e32468e97f compose: Simplify convert_mentions_to_silent_in_direct_messages.
The behavior to replace existing message content was leftover code
from a previous version of the mechanism, and not intended.
2024-01-19 14:56:55 -08:00
Tim Abbott ca591b49ca compose: Don't convert bot mentions to silent mentions.
This fixes an unintended consequence of the silent mention conversion
logic added in 4d1ade1f88, where bots
that looked for personal mentions would not process mentions in 1:1
DMs.
2024-01-19 14:56:55 -08:00
vighneshbhat9945 d9865e960d emoji_picker: Avoid exception in emoji_picker.
Added if-else condition to check whether the
'section_head_offsets[]' is empty or not.
If it is empty then 'currently_selected' is
coded as 'Popular' else it is assigned with
'section_head_offsets[0].section'.

Fixes #24776.
2024-01-19 11:17:09 -08:00
sayyedarib 9f509d4ab2 status_emoji_selector: Replace fa-smile with custom zulip-smile-icon.
Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
2024-01-19 09:48:02 -08:00
sayyedarib d41ee3d3d8 user_status: Fix alignment of select-emoji icon of user-status modal.
use flex display justify-content for vertical alignment
instead of using offsets like "top". for horizontal
alignment of smiley-icon use text-align center.

Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
2024-01-19 09:48:02 -08:00
Aman Agrawal a17f18f155 narrow: Fix message row partially visible on narrow.
This will prevent any message we want to select after narrowing
from being offscreen entirely or partially.

Steps to reproduce the bug:
* `./manage.py populate_db -n 3000 --max-topics=2`
* Narrow to a stream and scroll high up.
* Align two recipient bars together with nothing between them.
* Click on the first recipient bar after keeping the selected message
  on the second recipient bar.
* You will see that the selected message is not in view.
2024-01-19 09:36:19 -08:00
Aman Agrawal db10cca4a2 Revert "desktop_app: Close popover when clicking on "Plan management"."
This reverts commit 1f79e6294f.
No longer required after
70ba7cc042
2024-01-19 08:42:25 -08:00
Aman Agrawal febeeb5dac popover_menu: Fix popover not closed on clicking external links.
For example, gear menu was not closed after `Integrations` button
was clicked since we don't have an event handler which opens
`/integrations` in a new tab but we let the browser navigate user
to `/integrations` after clicking on `a href='/integrations'`.

There was no handler for hiding the popover after clicking on such
links, so this commit adds one.
2024-01-19 08:42:25 -08:00
Mateusz Mandera 1f79e6294f desktop_app: Close popover when clicking on "Plan management". 2024-01-18 15:57:51 -08:00
Aditya Kumar Kasaudhan 1ab4520c4e settings: Rename display-settings-form to preferences-settings-form.
Fixes part of #26874.
2024-01-18 13:39:57 -08:00
Shubham Padia afac26e3e9 refactor: Don't use today arg from render_now in timerender tests.
We cannot remove the today argument for render_now since it is being
used in one other place: timerender.update_timestamps .
2024-01-18 08:32:30 -08:00
Shubham Padia a43a898e12 refactor: Remove today arg from absolute_time.
The today argument was only used in tests and now we're using
MockDate to set the current date.
2024-01-18 08:32:30 -08:00
Shubham Padia 3d2110be51 refactor: Remove current_date arg from last_seen_status_from_date.
The current_date argument was only used in tests and now we're using
and now we're using MockDate in tests.
2024-01-18 08:32:30 -08:00
Shubham Padia d5de26ff3b refactor: Remove current_date arg from relative_time_string_from_date.
The current_date argument was only used in tests and now we're using
MockDate to set the current date.
2024-01-18 08:32:30 -08:00
Shubham Padia 3a233d73c1 refactor: Remove today arg from render_date and use MockDate for tests.
Fixes #26774.
We don't need the today argument anymore since every value passed to
it was a new Date() except the tests where we are using MockDate now.
2024-01-18 08:32:30 -08:00
Aman Agrawal a15d4e2be7 narrow: Extract common methods around setting current list.
This will help us combine activate and deactivate.
2024-01-18 08:31:48 -08:00
Aman Agrawal 9aa8c1f156 lightbox: Use rows module to query message_row elements. 2024-01-18 08:31:48 -08:00
Aman Agrawal 07cc079c8d narrow: Remove unused `narrowed_view` class. 2024-01-18 08:31:48 -08:00
Aman Agrawal 514075329b pm_list: Remove not needed narrow_state mock. 2024-01-18 08:31:48 -08:00
Aman Agrawal 1f1749ffb1 actions_popover: Remove unused parameter `narrowed`. 2024-01-18 08:31:48 -08:00
Aman Agrawal df180f7bd5 single_message: Use data-message-id instead of zid. 2024-01-18 08:31:48 -08:00
Aman Agrawal 633f64a79e narrow: Use message list id to track message lists in DOM.
This removes use of zfilt and zhome from codebase.
2024-01-18 08:31:48 -08:00
Alya Abbott 8272210b47 notifications: Add # to stream name in desktop notifications.
Follows the general pattern of always using a stream marker.
2024-01-17 16:39:41 -08:00
CIC4DA c7fc82727f inbox_ui: Use Intl.ListFormat rather than .join(", "). 2024-01-17 13:43:17 -08:00
CIC4DA ea6b3b84c4 settings_org: Use Intl.ListFormat rather than .join(", "). 2024-01-17 13:43:17 -08:00
CIC4DA caa2dbbba4 filter: Use Intl.ListFormat rather than .join(", "). 2024-01-17 13:43:17 -08:00
CIC4DA cd91bc3d71 compose_ui: Use Intl.ListFormat rather than .join(", ") 2024-01-17 13:43:17 -08:00
CIC4DA efb2a5a38d util: Defining common formatter function 2024-01-17 13:43:17 -08:00
Aman Agrawal e2520da24d event_status: Avoid ever-increasing calls to start_status_polling.
In case, we have an error and `completed` is `false`, we start
two loops of `start_status_polling` which keep increasing with
each call.
2024-01-17 12:46:44 -08:00
Aman Agrawal 6d50a3b2db billing: Fix `Update card` from billing page not working.
Since we don't provide `tier` info to session on billing page,
it was not working.
2024-01-17 12:46:44 -08:00
vighneshbhat9945 59a7a2e11d
settings: Use correct tooltips for deactivated bots.
Added handlebars if-else conditions to display
'User is deactivated' tooltip for deactivated users
and 'Bot is deactivated' tooltip for deactivated bots.

Fixes #28593.
2024-01-17 12:45:03 -08:00
Vidhi Agrawal b21dc465b8 billing: Change background color of reactivate subscription.
Fixes #28428
2024-01-17 12:43:01 -08:00
Aman Agrawal 781473414f drafts: Fix flaky drafts tests.
There were two typeahead displayed while we were testing
create_private_message_draft. One was topic typeahead from previous
create_stream_message_draft test and the other was cordelia
DM typeahead. So, when clicking on the typeahead, we clicked
the topic typeahead when we really wanted to select the cordelia
typeahead. This resulted in drafts test failing.
2024-01-16 09:31:10 -08:00
Aditya Kumar Kasaudhan 8f39b6f905
e2e-tests: Rename display_settings_section to preferences_section.
Fixes part of #26874.
2024-01-16 09:29:40 -08:00
Karl Stolley 906559c2b5 portico: Extend proper background gradients to /plans. 2024-01-15 18:43:33 -08:00
Karl Stolley cc4bb3493a portico: Scope pricing-plans styles to pages that need it. 2024-01-15 18:43:33 -08:00
Karl Stolley f5245285b4 portico: Isolate global plans-page styles in own file. 2024-01-15 18:43:33 -08:00
Mateusz Mandera fc247cba3f remote_billing: Fix /self-hosted-billing/ handling for desktop app.
When you click "Plan management", the desktop app opens
/self-hosted-billing/ in your browser immediately. So that works badly
if you're already logged into another account in the browser, since that
session will be used and it may be for a different user account than in
the desktop app, causing unintended behavior.

The solution is to replace the on click behavior for "Plan management"
in the desktop app case, to instead make a request to a new endpoint
/json/self-hosted-billing, which provides the billing access url in a
json response. The desktop app takes that URL and window.open()s it (in
the browser). And so a remote billing session for the intended user will
be obtained.
2024-01-15 16:50:48 -08:00
shashank-23002 dcec36b824 typeaheads: Fix mention typeaheads spill width.
Fixes: #27825
2024-01-15 16:17:11 -08:00
Aman Agrawal 272337f0f9 filter: Remove incorrect check for `All messages` view.
All message view has `in-home` filter and is not empty.
If there are no terms provided, we set filter to display
all messages (including muted streams/topics).

We make it mandatory to provide terms to Filter.
2024-01-15 12:26:24 -08:00
Aman Agrawal 5357b9814e search: Check for narrow_state.filter being undefined. 2024-01-15 12:26:24 -08:00
Aman Agrawal b36163dd8f typing_events: Handle search_terms() being an empty list. 2024-01-15 12:26:24 -08:00
Aman Agrawal a217138788 message_list: Check filters to decide if list is narrowed.
All messages list always has the "in-home" filter. We are in the
process of removing "zhome/zfilt" from message list, so this would
help in that process.
2024-01-15 12:26:24 -08:00
Aman Agrawal 2f8b82d808 upload: Fix drag drop not working for edit message in `All messages`.
Instead of `zfilt`, we should use table name of the current
message list.
2024-01-15 12:26:24 -08:00
Aman Agrawal 2fdd43a917 filter: Fix tests for guest user without indicator. 2024-01-15 12:26:24 -08:00
Aman Agrawal 5b0d346dd9 filter: Don't modify original terms when testing. 2024-01-15 12:26:24 -08:00
Aman Agrawal d7cbe17773 message_list: Remove unused variable. 2024-01-15 12:26:24 -08:00
Aman Agrawal d52cce9c3a message_list: Cleanup use of zhome to check for all message list.
Add a simple method to check for in-home filter.
2024-01-15 12:26:24 -08:00
N-Shar-ma 2952f0f44f refactor: Initialise state variables to undefined instead of false.
For compose state variables `last_focused_compose_type_input` and
`message_type` that are assigned non-boolean values on user interaction,
`undefined` is the semantically better choice than `false` for
initialisation, to avoid incorrect boolean implications.
2024-01-14 18:11:26 -08:00
N-Shar-ma 79ec61b373 turndown: Paste single line of code as inline code in markdown.
When pasting any code without any newlines, whether from a code block or
a code span, it will always be pasted as inline code.

That is, a line of code copied from within a code span will retain code
span formatting on paste, and a line of code copied from within a code
block will be pasted as inline code, instead of a 1 line code block.
2024-01-14 15:36:38 -08:00
sanchi-t 446ba4d6df message_edit: Fix cursor style on hover in edit area.
Fixes #3938.
2024-01-14 15:34:28 -08:00
shubham 664f29b4f1 unread_ops: Use /messages/flags/narrow to mark stream/topic as read.
This commit refactors the original mark_all_as_read in unread_ops to
bulk_mark_mesages_as_read to include marking stream/topic as read.
The unread_ops API reamins the same to mark stream/topic as read but the
underlying implementation now uses a different endpoint. A new function
mark_all_as_read has been added so that the unread_ops API remains the
same.

Fixes #27372.
2024-01-14 15:32:03 -08:00
Sahil Batra af7cfb677f stream_edit_toggler: Remove setup_stream_subscriptions_hash.
We only update the url hash in one place, i.e. in callback for
toggler, so there is no need to have a separate function and it
also prevents in someone using that function incorrectly in future.
2024-01-14 15:30:46 -08:00
Sahil Batra f3add07280 stream_settings: Make the right panel empty according to the URL hash.
We now make the right panel empty if the URL hash is changed to
"#streams/all" or "#streams/subscribed" either manually or by
using the browser back button.

We call the function to make the right panel empty in change_state
and not in the callback function for toggler.goto because the right
panel empty becomes empty due to change in hash and not due to
toggling between subscribed and all streams.
2024-01-14 15:30:46 -08:00
Sahil Batra 332d61f820 stream-settings: Do not toggle right section in switch_to_stream_row.
We handle showing the correct section in right panel by calling
set_up_right_panel_section from show_settings_for, so there is
no need to call stream_edit_toggler.goto from switch_to_stream_row.
2024-01-14 15:30:46 -08:00
Sahil Batra e26ca5a547 stream-settings: Refactor code used to update url hash.
This commit refactors code to not try to update the hash multiple
times.

We now update the url hash only in the callback function for
toggler.goto and remove the call to setup_subscriptions_stream_hash
in open_edit_panel_for_row. This change works as the hash depends
on the section being opened in right panel, so it seems better to
handle the hash update while toggling to the correct section.

A couple of more changes we need to do to make this work correctly
are -

- We extract the code to call "toggler.goto" for the correct section
outside the update_toggler_for_sub to a new function
set_up_right_panel_section. This is changed as update_toggler_for_sub
returns early without doing anything if the url hash is not the one
we have when settings panel for a particular stream is opened and
now the hash is updated after that check as a callback from
toggler.goto.

- set_up_right_panel_section uses stream_edit_toggler.select_tab
to toggle to the correct section in right panel so we now need
to set stream_edit_toggler.select_tab in change_state.
2024-01-14 15:30:46 -08:00
Sahil Batra a03e3ddc5a stream-settings: Don't change tab when navigating between streams.
This commit fixes the bug of tab in right side being changed to
"general" when navigating between streams through keyboard instead
of opening the tab which was opened for previous stream.

Fixes #28422.
2024-01-14 15:30:46 -08:00
evykassirer 572844f257 typeahead: Maybe stop advance for keypress always.
We don't want to process the key if `suppressKeyPressRepeat`
is true, but we always want to check to see if we should
stop propagation, or else characters typed into the input
field can be processed as hotkeys.
2024-01-14 15:07:24 -08:00
evykassirer 177dfade9d typeahead: Create helper function for stopping propagation.
No functional changes, only a refactor. This is about to be
used in a third place.
2024-01-14 15:07:24 -08:00
evykassirer cf2f0d88c3 search: Add setter and getter for search bar text.
The search bar input is about to get more complicated,
and an upcoming commit will be switching the element
from `input` to a contenteditable div, which means
we'll be accessing the text with text() instead of
val(). To make that change easier, and reduce future
bugs of using the wrong text/val, this commit
makes setter and getter functions so that the text/val
is isolated to one spot.
2024-01-14 15:07:24 -08:00
evykassirer 128c12d0e2 search: Nest pill styling under the typeahead styles.
This is needed for adding pills to search, so that these
styles don't get applied to the search pills.
2024-01-14 15:07:24 -08:00
evykassirer ec0ef35f3c search: Remove unnecessary export of narrow_or_search_for_term. 2024-01-14 15:07:24 -08:00
evykassirer 33e4c9b25c topic_list_data: Convert module to typescript. 2024-01-14 14:50:49 -08:00
N-Shar-ma a4fad5dda1 compose: Revamp and improve test suite for compose formatting buttons.
Earlier, the tests for compose formatting were verbose, hard to read as
well as extend, and overly granular, without even having the ability to
test the final text selection or the cursor position.

Now, new test helpers, `init_textarea_state` and `get_textarea_state`,
have been added, enabling the tests to be more concise and readable,
while also being more powerful. A representative string alone now
describes the textarea state (the text and the selection / cursor),
making each test case as easy as defining the initial state as a string
and comparing the expected state post formatting with another string.

These new tests helped surface a couple bugs which have been fixed in
preceding commits.
2024-01-12 15:48:53 -08:00
N-Shar-ma aba5997557 compose: Fix bug where toggling off link formatting left extra spaces.
In cases where either the description or the URL, or both were empty,
there would be an unneeded space, originally intended to space out the
description and URL, lingering even when the description and/or URL was
missing. The resulting highlight would also be off at times.

Now we only add in a space if both the description and URL are present,
and the highlight too is as intended.
2024-01-12 15:48:53 -08:00
N-Shar-ma b686f97a71 compose: Fix bug where spoiler would not always start on a new line.
Earlier, when a selection not starting at the beginning of a line was
formatted as a spoiler, the spoiler would not start on a new line, and
so would not be rendered as a spoiler. The `Header` highlighting too
was off by one character.

Now, the spoiler starts on a new line, and the `Header` highlighting
works as expected too.
2024-01-12 15:48:53 -08:00
Aditya Kumar Kasaudhan 49a9954413 settings: Rename settings_display to settings_preferences.
This commit renames "settings_display.js" file to
"settings_preferences.js".

Fixes part of #26874.
2024-01-12 15:33:16 -08:00
Tim Abbott 40f99d0990 Revert "portico: Extend proper background gradients to /plans."
This reverts commit 536d2f4e7f.

Apparently pricing_plans.css is included in many unrelated pages.
2024-01-12 14:43:28 -08:00
Aman Agrawal 03254bea5b billing: Change how flat discount on billing/upgrade page is displayed. 2024-01-12 08:50:51 -08:00
Aman Agrawal c9a4660911 header: Avoid using `.dropdown` for class name.
This is avoid conflict with styles defined for `.dropdown` in
bootstrap.
2024-01-12 08:40:51 -08:00
Aman Agrawal 9d1e977e2a portico: Don't use `dropdown-toggle` class.
We want to avoid using `dropdown-toggle` class to avoid
properties leaking from bootstrap.
2024-01-12 08:40:51 -08:00
Aman Agrawal 70ecdf2add helpers: Remove dead bootstrap tabs code. 2024-01-12 08:40:51 -08:00
Anders Kaseorg be13557ead playground_links_popover: Remove wrong $ prefix for non-jQuery variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-11 18:15:59 -05:00
Anders Kaseorg 43e53d9b9d user_status: Fix parsing of partial user_status events.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-11 14:06:11 -08:00
Alex Vandiver e0bd169c77 docs: Fix other help pages that were renamed or moved, to save a redirect. 2024-01-11 13:52:12 -08:00
Vector73 ed97420ffc
settings: Fix setting label click functionality.
This commit fixes "Automatically follow topics where I'm mentioned"
setting label click functionality so that the setting is toggled
on clicking the label.
2024-01-11 13:34:46 -08:00
Karl Stolley fd559495ab message_row: Remove unnecessary .sender-status-controls style and structure. 2024-01-11 12:53:31 -08:00
Karl Stolley 272b62138e message_row: Remove styles and JS for nonexistant .sender-status. 2024-01-11 12:53:29 -08:00
Karl Stolley 09ae717fee message_edit: Lay out edit buttons with flexbox. 2024-01-11 12:51:02 -08:00
Karl Stolley f0f8d6a42d message_edit: Remove styles with no associated structure. 2024-01-11 12:51:02 -08:00
Karl Stolley fd5fe64a33 message_edit: Consolidate styles into message row CSS. 2024-01-11 12:51:02 -08:00
evykassirer 4b14f0efad stream_topic_history_util: Convert module to typescript. 2024-01-11 12:45:39 -08:00
evykassirer 8bd9a91216 stream_list_sort: Convert module to typescript. 2024-01-10 17:43:08 -08:00
evykassirer a75253cdba stream_list_sort: Use more accurate stream_id name. 2024-01-10 17:43:08 -08:00
evykassirer 426e345e65 stream_list_sort: Use a flag instead of checking for undefined list. 2024-01-10 17:43:08 -08:00
Aman Agrawal c58c12911c typing_events: Show typing notification in a proper topic narrow.
It is possible to have multiple topic / stream terms if user
is searching or if the URL is malformed. So, we should check
if the user is in a proper topic narrow before showing
typing notifications.

This fixes the error of topic being undefined due to there
being multiple topic terms in narrow when trying to display
notifications.
2024-01-10 09:08:38 -08:00
evykassirer cd58655a4b stream_topic_history: Convert module to typescript. 2024-01-10 09:02:17 -08:00
evykassirer 8a1fa8b161 stream_topic_history: Simplify add_or_update params. 2024-01-10 09:02:17 -08:00
Sahil Batra dcac272afc user_group_popover: Convert module to typescript. 2024-01-09 16:47:37 -08:00
afeefuddin d0deaff7fd portico-header: Dropped find accounts link for smaller windows.
Fixes #27477
2024-01-09 16:46:24 -08:00
Karl Stolley 5c0e37844b plans: Reduce font-size of text comparison elements. 2024-01-09 16:00:16 -08:00
Karl Stolley f71c7458a7 plans: Consolidate positioning on comparison values. 2024-01-09 16:00:16 -08:00
Karl Stolley 941b76f510 plans: Reduce font-weight on push placeholder button. 2024-01-09 15:59:38 -08:00
roanster007 69de75ec0b compose: Fix display of compose banner when dm disallowed.
Previously, when the compose bar was open with any DM recipient,
and the organization wide setting to disallow DM is toggled, then
the DM not allowed banner is not displayed on the compose until
it is reopened.

This is fixed by changing the server event dispatch of
private_message_policy from noop to a method to  check for
the compose's posting policy status, and display the banner.

Fixes #27774
2024-01-09 12:35:02 -08:00
N-Shar-ma ed949fbc92 compose: Fix duplicate warning banners for the same private stream.
Earlier, a new banner would be showed for each mention of the same
private stream in the compose box. This commit fixes that by checking
if the private stream warning banners already shown include the private
stream just mentioned, and if so, not showing a new banner.

This implementation is in line with the one for warnings for mentions of
users not subscribed to the current stream.

Fixes: #26914.
2024-01-09 10:44:43 -08:00
ecxtacy 62fcb08b1b dev: Center devtool link buttons on devlogin page. 2024-01-09 10:42:47 -08:00
Anuja Patil a3252e0de7
typeahead: Improve slash command typeahead text.
Update the text displayed in the typeahead suggestions for slash commands 
(/poll, /todo, /me) to be cleaner and clearer.

Fixes #27391.
2024-01-09 10:34:05 -08:00
Karl Stolley b80f8eabd4 plans: Specify text color on :active comparison links. 2024-01-09 10:20:00 -08:00
Karl Stolley 6d3f0361f5 plans: Remove overwrought !important declarations.
These were unnecessary, and interfered with expected link, :hover,
and :active styles.
2024-01-09 10:20:00 -08:00
Anders Kaseorg 79379c479d notification_settings: Open push notification docs link in new tab.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-09 09:22:31 -08:00
Aman Agrawal 2c6a811468 upgrade: Fix free trial showing annual schedule.
If localstorage has `annual` schedule set, upgrade page for
free trial will show annual schedule. We fix it was overriding
the schedule if it was set to be fixed to a value by us.
2024-01-08 14:41:22 -08:00
Aman Agrawal 3cb1ebeb34 plans: Align price with `details` when no discount is applied. 2024-01-08 14:41:22 -08:00
Karl Stolley 536d2f4e7f portico: Extend proper background gradients to /plans. 2024-01-08 14:15:37 -08:00
kota-karthik 9143172619 settings: Fix color leak during row dragging in tables.
Fixed an issue in the linkifier and custom profile tables where
dragging darker rows color changes in the background.
Following a CZO discussion on using alpha values in HSL,
I implemented a fix using the CSS color-mix property. This approach
mixes the original color with var(--color-background-modal) in
sRGB mode, effectively eliminating the use of alpha and preventing
color leaks. For more context, see the CZO discussion:
[https://chat.zulip.org/#narrow/stream/6-frontend/topic/alphas.20in.20color.20definitions].

Fixes #26480.
2024-01-07 19:30:00 -08:00
Angelica Ferlin 3fcb44e24d
organization settings: Use tippy for edit/delete custom field.
Fixes #27816.
2024-01-07 19:08:05 -08:00
N-Shar-ma f99635d582 refactor: Pass only stream id, not name, to `compose_actions.start()`.
As part of the process of moving from stream names to ids, we now only
pass the stream id in compose args to `compose_actions.start()`.

For when we still need the stream name, and have access to the compose
args, we compute it from the id exactly where needed, to localise the
instances of stream names.
2024-01-07 16:39:56 -08:00
Varun Singh af3b15ef10 read_receipts: Convert module to TypeScript. 2024-01-05 11:52:59 -08:00
Tim Abbott c5a9c78af7 settings_realm_domains: Fix linter error.
This got through into main because the linter error is new.
2024-01-05 11:32:04 -08:00
Varun Singh 4b04716237
settings_realm_domains: Convert module to TypeScript. 2024-01-05 10:50:08 -08:00
evykassirer 979ace1cea message_util: Convert module to typescript. 2024-01-05 10:47:12 -08:00
evykassirer c20df9d64a message_list: Return consistent data structure from add_message.
This was weird, and I think incorrect. Places that call add_message
seem to expect consistent data structures.

I tried looking a bit into it, and couldn't find anywhere where
returning true made more sense. I'm sort of confused this hasn't
caused issues though.
2024-01-05 10:47:12 -08:00
Karl Stolley 9fde83c161 billing: Add Cloud comparison table. 2024-01-04 18:46:05 -08:00
evykassirer 4e66e8742f rows: Convert module to typescript. 2024-01-04 12:45:42 -08:00
evykassirer e3e0125092 rows: Throw exception instead of returning NaN.
We don't expect this to happen, and we don't want
to try to maintain the difficult task of gracefully
handling errors that we don't expect to happen
anyways. This will also make the conversion
to typescript easier.
2024-01-04 12:45:42 -08:00
evykassirer 17bc9af106 message edit: Select message id before getting row.
Getting the row was sometimes causing errors because
the row wasn't in the DOM at the time of trying to
get it. By selecting the message id first, we ensure
it's in the DOM before we call `get_row`.

More conversation here:
https://chat.zulip.org/#narrow/stream/464-kandra-js-errors/topic/Error.3A.20Caller.20should.20pass.20in.20a.20single.20row.2E
2024-01-04 12:45:42 -08:00
N-Shar-ma 48d0d49fde compose: Clear stream id when prompting user for stream selection.
Now we clear the stream id from the compose state on opening the stream
selection dropdown when no stream is specified.

This fixes the bug where the compose box placeholder text would refer to
the previously selected stream, even when the open stream dropdown had
no stream selected.
2024-01-04 10:59:36 -08:00
Joydeep Bhattacharjee e3744627ac
css: Fix the color of alert word in dark theme.
This was incorrectly not declared as a theme-dependant color.

Fixes #28407.
2024-01-04 10:53:14 -08:00
Karl Stolley 0c8730a723 portico: Correct spacing at footer bottom.
This reduces reliance on margin for layout, preventing undesired
space appearing below the footer and better using flexbox to align
elements in the legal area.
2024-01-04 10:26:36 -08:00
evykassirer 434b67caf5 message_feed_top_notices: Convert module to typescript. 2024-01-03 14:39:26 -08:00
Tim Abbott 337b0023db e2e-tests: Remove stale comment.
This was incorrectly not removed in
6e725fb3c3.
2024-01-03 13:59:21 -08:00
Sahil Batra 9197a2c3e2 user_pill: Add support to not allow adding inaccessible users manually.
We previously allowed adding pills for inaccessible user by typing
the email manually. This commit updates it to handle inaccessible
users like we handle invalid emails.
2024-01-03 11:04:35 -08:00
Sahil Batra ede88191a8 input_pill: Define a type for pill_config object. 2024-01-03 11:04:35 -08:00
evykassirer cd9a479a7e narrow_banner: Convert module to typescript. 2024-01-03 10:28:10 -08:00
evykassirer 08bee0f180 message flags: Convert module to typescript. 2024-01-02 16:48:45 -08:00
evykassirer a87b1d5ad8 filter: Use terms instead of operands.
Operand is a confusing name because this
data structure has an attribute *called*
operand. This commit renames references to
this structure to "term", short for "search
term".
2024-01-02 16:24:53 -08:00
Alya Abbott 2732da2bb2 settings: Update description text in Settings > Topics panel. 2024-01-02 15:54:48 -08:00
evykassirer c0719e0285 pm_list_data: Convert module to typescript. 2024-01-02 10:27:02 -08:00
Anders Kaseorg 06d439e0b2 typing_events: Fix early read of page_params.
For spectators,
page_params.server_typing_started_expiry_period_milliseconds has not
been initialized yet at module load time.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-01 17:39:10 -08:00
Anders Kaseorg 45c8dcc9c3 typing: Fix early read of page_params.
For spectators,
page_params.server_typing_started_wait_period_milliseconds and
page_params.server_typing_stopped_wait_period_milliseconds have not
been initialized yet at module load time.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-01 17:39:10 -08:00
Anders Kaseorg 80432c8c06 stream_create: Fix early read of page_params.
For spectators, page_params.realm_create_public_stream_policy,
page_params.server_web_public_streams_enabled,
page_params.realm_enable_spectator_access have not been initialized
yet at module load time.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-01 17:39:10 -08:00
Anders Kaseorg 8f069ac1d8 settings_profile_fields: Fix early read of page_params.
For spectators, page_params.custom_profile_field_types has not been
initialized yet at module load time.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-01 17:39:10 -08:00
Anders Kaseorg 8066405d9b tests: Fix incorrect reference to page_params.sent_by_me.
Commit 24a1f7b792 (#23056) introduced
this mistake; it has never existed.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-01 17:37:50 -08:00
Anders Kaseorg 2a69545bec page_params: Move initial_pointer and friends to message_fetch.
These aren’t sent by the server; they’re client-side global variables.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-01 17:37:50 -08:00
Anders Kaseorg e8e7142ed1 page_params: Move events_queue_expired to server_events.
This isn’t sent by the server; it’s a client-side global variable.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-01 17:37:50 -08:00
Sahil Batra 8f795e22e8 settings: Fix discard button in groups UI in dark theme. 2023-12-30 11:15:30 -08:00
Anders Kaseorg 8514c8d739 page_params: Fix types of narrow, server_sentry_dsn, user_id.
page_params.narrow may be undefined, page_params.server_sentry_dsn may
be null but not undefined, and page_params.user_id may be 0 (for
spectators) but not undefined.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-29 14:16:19 -08:00
Anders Kaseorg a5d51a0895 people: Don’t reference nonexistent page_params.is_bot.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-29 13:05:30 -08:00
sayyedarib b430ba2bd5 navbar_help_menu: Migrate module to typescript.
Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
2023-12-29 12:15:08 -08:00
Anders Kaseorg 2cf8f1c063 page_params: Move page_load_time to zulip_test.
This isn’t sent by the server; it’s a client-side global variable.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-29 11:58:58 -08:00
evykassirer baf6c68ab8 starred_messages: Migrate module to typescript. 2023-12-28 18:24:40 -08:00
evykassirer baba72df91 compose_banner: Restrict banner to only JQuery, never htmlString.
Co-authored-by: Anders Kaseorg <anders@zulip.com>
2023-12-28 16:53:46 -08:00
evykassirer 1f21510dd4 compose_notifications: Convert module to typescript. 2023-12-28 16:53:46 -08:00
Varun Singh 62a636068e subscriber_api: Convert module to TypeScript. 2023-12-28 15:05:16 -08:00
evykassirer 6157d83d3a unread_ui: Convert module to typescript. 2023-12-28 11:26:37 -08:00
evykassirer 8d685d5b5a page params: Add furthest_read_time attribute. 2023-12-28 11:26:37 -08:00
evykassirer 5f5e77afd5 local_message: Convert module to typescript. 2023-12-27 23:23:36 -08:00
evykassirer b20694aa07 narrow_history: Convert module to typescript. 2023-12-27 23:12:09 -08:00
evykassirer e0a10c2d94 all_messages_data: Convert module to typescript. 2023-12-27 22:55:47 -08:00
evykassirer ccd5b4a813 narrow_state: Convert module to typescript. 2023-12-27 22:16:21 -08:00
evykassirer b7a28f1630 page params: Add narrow attribute. 2023-12-27 22:16:21 -08:00
evykassirer 0f1fa8e159 message_list_data: Potentially return undefined in first_unread_message_id. 2023-12-27 21:48:54 -08:00
evykassirer 0cf1d49fee message_list_data: Convert module to typescript. 2023-12-27 21:48:54 -08:00
evykassirer dc8d0ed861 message_lists: Convert module to typescript. 2023-12-27 20:44:58 -08:00
evykassirer e0fef6fdff narrow_title: Migrate module to typescript. 2023-12-27 20:39:53 -08:00
evykassirer 01abd96127 buddy_data: Convert module to typescript. 2023-12-27 15:53:39 -08:00
evykassirer 68f2535ebc recent senders: Convert module to typescript. 2023-12-27 14:05:35 -08:00
evykassirer 1f2ea95b9f recent senders: Use for loop instead of filter/if combination. 2023-12-27 14:05:35 -08:00
Anders Kaseorg 6e220f4dc1 eslint: Enable @typescript-eslint/method-signature-style.
For historical reasons, TypeScript ignores variance errors for method
shorthand type declarations even in strict mode.  Prefer the correctly
checked style.

https://typescript-eslint.io/rules/method-signature-style

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-26 17:30:33 -08:00
Anders Kaseorg b44daf080c list_widget: Remove unknown generic defaults.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-26 17:30:33 -08:00
Anders Kaseorg d7803db5c7 list_widget: Remove get.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-26 17:30:33 -08:00
Anders Kaseorg c1636ffc6f list_widget: Add missing generic parameters to handle_sort.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-26 17:30:33 -08:00
Anders Kaseorg 3cc94ea930 types: Remove stacktrace-gps declarations.
I sent these upstream with documentation in 3.1.0.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-26 16:26:22 -08:00
evykassirer 4ce13f72f0 filter: Convert module to typescript. 2023-12-26 15:45:40 -08:00
evykassirer cc8b35ff23 filter: Preparation to appease the typescript linter. 2023-12-26 15:45:40 -08:00
evykassirer 2c35aa38b7 filter: Move static functions above public instance method definitions. 2023-12-26 15:45:40 -08:00
evykassirer 86fd0864a7 page_params: Add narrow_stream to type. 2023-12-26 15:45:40 -08:00
Anders Kaseorg c16837a664 eslint: Fix @typescript-eslint/prefer-string-starts-ends-with.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-23 15:36:05 -08:00
Anders Kaseorg c943dc5035 eslint: Fix @typescript-eslint/prefer-optional-chain.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-23 15:36:05 -08:00
Anders Kaseorg 3d55e7ef10 eslint: Fix @typescript-eslint/prefer-nullish-coalescing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-23 15:36:05 -08:00
Anders Kaseorg 9ec4c6d852 eslint: Fix @typescript-eslint/no-inferrable-types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-23 15:36:05 -08:00
Anders Kaseorg b33988a553 eslint: Fix @typescript-eslint/no-empty-function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-23 15:36:05 -08:00
Anders Kaseorg f88e3b9735 presence: Remove paranoid handling of falsy timestamps.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-23 15:36:05 -08:00
Anders Kaseorg a36ef0b593 stream_data: Avoid undefined return from is_user_subscribed.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-23 15:36:05 -08:00
evykassirer 5604ebedf0 unread: Iterate over both topic_name and messages. 2023-12-23 15:14:34 -08:00
Sahil Batra 415fb2014b settings: Show push notifications tooltip on stream specific row.
This commit fixes the bug about not showing the tooltip about push
notifications not being enabled on the server on checkbox in stream
specific notification row.
2023-12-23 14:55:23 -08:00
Sahil Batra 99f29983a1 settings: Do not show tooltip if push notifications are enabled.
We previously showed tooltips about push notifictions not being
enabled on server on the checkboxes in "Notification triggers"
section incorrectly when server had push notifications enabled.

This bug was present as realm_push_notifications_enabled was
not passed to the template correctly. This commit fixes it by
instead using "is_disabled" in the "if" condition as we only
expect it to be true when push notifications are not enabled
on server.
2023-12-23 14:55:23 -08:00
evykassirer d1acdf20e7 unread: Convert module to TypeScript. 2023-12-22 16:18:50 -08:00
evykassirer d2cf9aaff2 unread: Return consistent data structure in unread_count_info_for_stream. 2023-12-22 16:18:50 -08:00
evykassirer dedae1de12 unread: Remove Bucketer in favor of simpler Map. 2023-12-22 16:18:50 -08:00
evykassirer af84d9dab0 FoldDict: Always use IterableIterator.
Being more specific will help in converting
the unread module to typescript.
2023-12-22 16:18:50 -08:00
Anders Kaseorg cbe227af6f eslint: Fix @typescript-eslint/no-unnecessary-boolean-literal-compare.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-21 16:14:40 -08:00
Anders Kaseorg 6368cf17cb eslint: Fix @typescript-eslint/no-confusing-void-expression.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-21 16:14:40 -08:00
Aman Agrawal e192aef23d billing: Apply a flat discount for self hosted plans. 2023-12-20 23:09:21 -08:00
Aman Agrawal 0337c726d3 plans: Align basic plan price detail at bottom. 2023-12-20 23:09:21 -08:00
Aman Agrawal 48af342bd8 landing-page: Show correct pricing tab based on context. 2023-12-20 23:09:21 -08:00
Karl Stolley a37354f92a corporate: Add a Basic plan. 2023-12-20 23:09:21 -08:00
Karl Stolley 3a0be097f4 portico: Reduce bold in additional info area. 2023-12-20 23:09:21 -08:00
Alya Abbott fd911cbfbb billing: Update sponsorship hint text. 2023-12-20 23:09:21 -08:00
Sahil Batra 377df9e4db user_groups: Do not remove the user group row if user can join again.
We now do not remove the user group row immediately from "Your groups"
panel when user is removed from the group, if the user can join that
group again by themselves. This makes the behavior similar to what
we have for streams.
2023-12-20 20:34:01 -08:00
Karl Stolley e4a3b1b1a3 plans: Precisely determine min- and max-widths. 2023-12-19 13:31:57 -08:00
Karl Stolley 44c8e25e32 portico: Correct tab/scroll logic for self-hosted fragments. 2023-12-18 12:24:50 -08:00
Aman Agrawal d962814a30 upgrade: Make it possible to upgrade to a provided tier.
Main work is maintaining context during various redirects and
and passing the context to the final upgrade process.
2023-12-18 12:23:46 -08:00
Lalit 02257b8cbf ts: Migrate `popover_menus` to typescript.
This commit migrates `popover_menus` module to TypeScript. Also adds
a placeholder types declaration file for `css_variables` module.
2023-12-17 14:00:44 -08:00
evykassirer bfff48decc unread: Return objects directly, no functional change. 2023-12-17 10:14:11 -08:00
evykassirer f15a687916 unread: Use message type instead of checking stream_id. 2023-12-17 10:14:11 -08:00
evykassirer 6596598949 unread: Create key_to_bucket object in call to constructor. 2023-12-17 10:14:11 -08:00
evykassirer 722494bfae unread: Rename KeyDict to key_to_bucket. 2023-12-17 10:14:11 -08:00
evykassirer 5c9bb51c5b unread: Use some clearer variable names. 2023-12-17 10:14:11 -08:00
evykassirer 24dc2e783d message_store: Migrate message_store to typescript. 2023-12-17 09:43:47 -08:00
Aman Agrawal d85462a459 pricing_plans: Fix scrollbars always visible.
Kick in min-width at the required width.
This will ensure that scrollbars are only visible if the window
is at this width.
2023-12-16 22:51:21 -08:00
Anders Kaseorg 4aa2d76bea models: Extract zerver.models.streams.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-16 22:08:44 -08:00
Anders Kaseorg 45bb8d2580 models: Extract zerver.models.users.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-16 22:08:44 -08:00
Anders Kaseorg e601d0ae7c models: Rename zerver/models.py to zerver/models/__init__.py.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-16 22:08:44 -08:00
Anders Kaseorg 9d11f2c8fc echo: Update build_display_recipient comment.
Commit c6b3d0212d (#12959) moved the
code it refers to.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-16 22:08:44 -08:00
Karl Stolley e44ba3b1f1 portico: Add new self-hosted plans.
Co-authored-by: Alya Abbott <alya@zulip.com>
2023-12-15 11:03:42 -08:00
Karl Stolley 92de3d11d2 portico: Add self-hosted plans comparison table.
Co-authored-by: Vlad Korobov <vlad.korobov@zulip.com>
Co-authored-by: Alya Abbott <alya@zulip.com>
2023-12-15 11:03:42 -08:00
Karl Stolley 5d7010c8a0 billing: Update copy, modal for self-hosted downgrades and trials. 2023-12-15 11:03:42 -08:00
Aman Agrawal 8fb126505c sponsorship: Show different discount text for self hosted orgs. 2023-12-15 11:03:42 -08:00
Aman Agrawal 3aed22dcd0 gear_menu_popover: Enable `Plan management` in production. 2023-12-15 11:03:42 -08:00
evykassirer 1f7b3d7a2d stream edit toggler: Update `select_tab` when changing hash."
This fixes a bug in #26717 where the hash would flash to #personal
before #subscribers. Sometimes `setup_toggler` is called after
the hash change, and it needs to know which tab to show.

Ideally in the future we'd clean up this code so that the hash
changing function isn't called multiple times.
2023-12-15 08:47:45 -08:00
Evy Kassirer 6e902defba
node tests: Use noop helper function pattern in test files.
Some files already were using `noop` in place of `() => {}`.
It's both clearer what it means and is easier to type.
This updates all test files to fully use `noop`, and
adds a shared import from the test lib file.
2023-12-14 14:51:33 -08:00
Sahil Batra 94f0837b9c settings: Restrict length of realm Jitsi url custom input.
We have a restriction of 200 characters for jitsi_server_url
realm setting custom input element.

Fixes part of #27355.
2023-12-14 12:11:59 -08:00
Tim Abbott 1757b88760 billing: Offer release announcement subscriptions.
Also avoid prompting for full name time more than once.
Adds TOS version field to Remote server user.

Co-authored-by: Karl Stolley <karl@zulip.com>
Co-authored-by: Aman Agrawal <amanagr@zulip.com>
2023-12-14 10:51:16 -08:00
Anders Kaseorg a13e42f18a docs: Add missing spaces around code spans.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-14 00:05:44 -08:00
Sayam Samal c61b353b4b gear_menu_popover: Update the rocket icon used for plan and pricing.
Fixes #28163.
2023-12-13 07:59:13 -08:00