Commit Graph

673 Commits

Author SHA1 Message Date
evykassirer 1948cf15a4 rendered markdown: Assert data-user-group-id is always defined. 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
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
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 9aa8c1f156 lightbox: Use rows module to query message_row elements. 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
CIC4DA caa2dbbba4 filter: 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 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 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 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
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
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
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
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
evykassirer 979ace1cea message_util: Convert module to typescript. 2024-01-05 10:47:12 -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
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
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
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 0cf1d49fee message_list_data: Convert module to typescript. 2023-12-27 21:48:54 -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
evykassirer 4ce13f72f0 filter: Convert module to typescript. 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 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 d2cf9aaff2 unread: Return consistent data structure in unread_count_info_for_stream. 2023-12-22 16:18:50 -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
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
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
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
Anders Kaseorg cd65849f7e tests: Fix “inaccesible” typo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-12 12:13:51 -08:00
Vector73 2e71ec78e3 settings: Add "Automatically follow topics where I'm mentioned" setting.
Fixes: #26795
2023-12-11 23:26:11 -08:00
Prakhar Pratyush 82191872a4 hotkey: Fix go to unread unmuted or followed topic in muted stream.
The N shortcut was not working to go to a unread unmuted or
followed topic in a muted stream.

This commit fixes the incorrect behavior.
2023-12-11 22:32:56 -08:00