Commit Graph

3922 Commits

Author SHA1 Message Date
Karl Stolley 11fcd4091c emoji_picker: Reorder CSS to match template structure. 2024-03-05 14:58:58 -08:00
Karl Stolley e22666f116 emoji_picker: Remove selectors not used with Tippy. 2024-03-05 14:58:58 -08:00
Sayam Samal a60e3d93e9 compose: Fix topics required banner closing on enter to send.
We were updating the compose banners on every `keyup` event on the
topic input. Since, `keyup` also gets triggered for the modifier and
non-printing keys such as "Enter", this lead to banner for topic
required being closed via the `check_posting_policy_for_compose_box`
when pressing "Enter" to send a message with no topic.

This bug was probably introduced in 5c993f0, which moved additional
logic into `update_on_recipient_change`.

To solve this issue, we use the `input` event instead of the `keyup`
event to update the compose banners only when the value inside the
input element changes.

This change also prevents the the compose banner from being closed
when we only press modifier keys - such as Shift.
2024-03-05 14:57:02 -08:00
Karl Stolley a5a6afb0ab portico: Remove All plans tab at mobile scale. 2024-03-05 14:55:43 -08:00
evykassirer 0062d3f999 reactions: Deduplicate shared code.
Creates a function for code shared by update_user_fields
and make_clean_reaction.
2024-03-05 14:54:45 -08:00
evykassirer 2de1486719 reactions: Send full message object to update_ui_and_send_reaction_ajax. 2024-03-05 14:54:45 -08:00
evykassirer 3d854771a2 reactions: Make count non-optional on ReactionUserIdAndCount. 2024-03-05 14:54:45 -08:00
Lauryn Menard bd1450f7b0 markdown-css: Wrap longer code elements in documentation.
Add a word-wrap rule so that longer code elements, such as example
URLs or long return value names in the API documentation, do not
overflow out of the view in narrowed browsers or mobile views.
2024-03-05 12:23:16 -08:00
Mateusz Mandera 898e47fbdd config_error: Change the look of the page.
Replaces the green theme with the old Zulip octopus with a plain, white
page.
2024-03-05 11:53:51 -08:00
Mateusz Mandera 1ede8da46c events: Change format of authentication_methods realm_update_dict event.
Makes the event in line with state_data.realm_authentication_methods.
2024-03-05 11:48:58 -08:00
Mateusz Mandera da9e4e6e54 backends: Implementation of restricting certain backends by plan.
Only affects zulipchat, by being based on the BILLING_ENABLED setting.

The restricted backends in this commit are
- AzureAD - restricted to Standard plan
- SAML - restricted to Plus plan, although it was already practically
  restricted due to requiring server-side configuration to be done by us

This restriction is placed upon **enabling** a backend - so
organizations that already have a backend enabled, will continue to be
able to use it. This allows us to make exceptions and enable a backend
for an org manually via the shell, and to grandfather organizations into
keeping the backend they have been relying on.
2024-03-05 11:48:58 -08:00
N-Shar-ma bff750e825 copy_and_paste: Fix formatting of code pasted from VS Code.
Since the html copied from VS Code is not structured as code but as
styled divs for each line, any code copied from it would be pasted
unformatted with blank lines between each line of code.

This has now been fixed, by detecting VS Code style code blocks by the
CSS property `white-space: pre` and pasting the text within as is, as
code.
2024-03-05 11:34:22 -08:00
evykassirer af8263fb87 people: Don't refetch user when we already have it. 2024-03-05 11:27:34 -08:00
Sahil Batra e965ed2eb8 stream_settings: Show banner on successful stream creation.
This commit adds banner which is shown on successful stream
creation which contains a link to stream narrow. This banner
makes it more clear that stream was created successfully and
also makes it easy to navigate to the new stream.

Fixes #29171.
2024-03-05 10:56:30 -08:00
Sayam Samal 24e5004a54 compose_tooltips: Rename "non-stream" to "non-specific" type/view.
We want to name types/views that are not Stream or Direct related to be
"non-specific". The previously used term "non-stream" could be confusing
since it would literally mean any type/view which is not a stream type/
view, which would encapsulate the Direct type/view also.

Thus, we finally use the following terms to describe the type of
conversation:
1. Stream type (Streams or Topics)
2. Direct type (A)
3. Non specific type (Inbox, Recent conversation, All messages)
2024-03-05 10:55:20 -08:00
Sayam Samal 1091938252 compose_tooltips: Fix compose buttons not updating for inbox view.
This commit fixes the bug, where navigating to inbox view does not
update the closed compose buttons. Due to this the tooltip over the
"Start new conversation" button also showed the wrong content.
2024-03-05 10:55:20 -08:00
Sayam Samal a0411e32b6 compose_tooltips: Fix tooltips for disabled conversation button.
In the situation where the DMs are disabled in an organization, we
disable the new conversation button. But due to this, the tooltip
hinting towards the same, was also being disabled because it was
attached to a disabled element which does not fire any events.

This commit fixes this bug, by wrapping the new conversation button
inside a div, and attaching the tooltip to this wrapper instead.
2024-03-05 10:55:20 -08:00
Sayam Samal f00d79399e compose_tooltips: Change new conversation button tooltip logic.
As reported on CZO, the new conversation button sometimes had stale
tooltip content rendered on it. In this commit, we change the logic
used to render this tooltip, to now render the tooltip content on the
fly via `instance.setContent()` which should eliminate any such bug.

Fixes #27158.
2024-03-05 10:55:20 -08:00
Aman Agrawal de61a91738 message_list: Fix delayed events finding current msg list undefined.
Events that are called after a delay can find message_lists.current
to be undefined if user has moved to non-message list view.
2024-03-05 10:54:07 -08:00
evykassirer fb7d77545f reactions: Convert module to typescript. 2024-03-04 19:07:49 -08:00
evykassirer 07671997ca reactions: Calculate vote_text before creating clean reaction.
This is essential for converting to typescript, because
we can't create half a clean reaction and then calculate
vote_text afterwards. Instead, we should calculate it
with the information we already have, and create the
clean reaction object afterwards, all at once.
2024-03-04 19:07:49 -08:00
evykassirer 9d859ddbc9 reactions: Calculate should_display_reactors without clean reactions.
When we move to typescript, we want to be able to calculate
this value *before* creating the clean reactions, so that
we can generate the clean reactions in one go instead of
having some half-created object.
2024-03-04 19:07:49 -08:00
afeefuddin 72681c2d5a hotspots: Convert module to TypeScript. 2024-03-04 18:17:34 -08:00
afeefuddin 6314139d4a zcommand: Convert module to TypeScript. 2024-03-04 18:10:38 -08:00
N-Shar-ma b4d53c7930 compose: Fix bug where inserted content would not be scrolled into view.
On chromium browsers, the scroll position is not restored when the text
in a textarea is replaced. So instead of directly replacing the text,
we call the `insert_and_scroll_into_view` function with `replace_all`
set to true.
2024-03-04 17:14:11 -08:00
N-Shar-ma ef0be22899 compose: Add parameter `replace_all` to `insert_and_scroll_into_view`.
We refactor the `insert_and_scroll_into_view` function to accept a new
parameter, `replace_all`, defaulting to false, that when set to `true`,
will replace all existing content of the textarea with the new content,
instead of inserting the new content at the current cursor position.

This is a prep commit for the next commit, which will set this new flag.
2024-03-04 17:14:11 -08:00
Aman Agrawal ad2e176625 help: Link mark as read in conversation banner to help page.
Fixes #29115
2024-03-04 16:55:59 -08:00
tnmkr 25cca93bc9 stream_settings: Show relevant streams in left panel.
We want to make the default stream listing more relevant. To do this,
we always show "All streams" tab when stream is opened from another
user's profile. From other places, we show "Subscribed" if the user
is subscribed to the stream they are trying to edit otherwise
"All streams" are shown.
2024-03-04 16:52:57 -08:00
tnmkr 9275a8ded4 group_settings: Show relevant groups in left panel.
We want to make default group listing in left panel more relevant.
Thus "All groups" are shown when group is opened from another user's
profile. From other places, "Your groups" are shown if the user is in
the group they are trying to edit otherwise "All groups" are shown.
2024-03-04 16:52:57 -08:00
tnmkr ca6e0ce8c8 user_profile: Add links to group settings.
This commit adds links to open group settings from "User groups" tab
of user profile. These links are not shown to guests as they cannot
view `#groups` urls.

Fixes #25214.
2024-03-04 16:52:57 -08:00
Prakhar Pratyush 6630981de8 inbox: Remove 'default' visibility policy indicator.
We no longer show the 'default' visibility policy in
the inbox view. 'Unmute', 'Follow', and "Mute' are
still shown.

For topics with 'default' visibility policy, it is
still possible to change the visibility policy via the
three-dot menu.

The motivation is not to have the default state so
prominently called out.
2024-03-04 14:07:59 -08:00
Anders Kaseorg aaa6f16538 web: Use Zod z.discriminatedUnion more.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 15:39:04 -05:00
Anders Kaseorg a03a26151c onboarding_steps: Depluralize OnboardingStep type name.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 15:39:04 -05:00
Anders Kaseorg f39675f061 rows: Make errors fatal in id, local_echo_id.
This lets us simplify their types and remove dead error-handling code.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 07:30:44 -08:00
Anders Kaseorg 398c63566e rows: Fix get_message_id type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 03:50:11 -05:00
Anders Kaseorg 6f50ed4ca3 user_status_ui: Fix input_field() type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 03:48:26 -05:00
Varun Singh bda6470951 user_status_ui: Convert module to TypeScript. 2024-03-01 18:02:20 -08:00
Varun Singh 063287d459 user_status_ui: Extract repetitive conditional logic into a function.
The function 'emoji_status_fields_changed' separates the conditional
logic into two parts. Now, we compare 'selected_emoji_info' and
'old_emoji_info' only when both of them have the fields necessary for
comparison.This helps with upcoming type inference and we no longer have
to write same conditional logic twice.
2024-03-01 18:02:20 -08:00
Varun Singh 70c14d0d3f user_status_ui: Refractor to satisfy '.trim()' function.
'.val()' function returns 'string','string[]' and 'number' type
whereas '.trim()' only accepts a 'string' type argument.
2024-03-01 18:02:20 -08:00
Varun Singh da18350b5b user_status_ui: Replace logical OR with null coalescing operator.
While || targets null, undefined, false, NaN, 0, -0, 0n, "",
and document.all, ??(null coalescing) specifically targets
null and undefined,which we are looking for here.
2024-03-01 18:02:20 -08:00
Varun Singh 0a7bdfaa1c user_status_ui: Add missing argument. 2024-03-01 18:02:20 -08:00
nimishmedatwal 3d30fcd10a onboarding: Improve placeholder message for dm with yourself.
Fixes #29078
2024-03-01 16:09:54 -08:00
evykassirer c60cc07605 drafts: Convert module to typescript. 2024-03-01 15:49:53 -08:00
evykassirer e26b4bbd3e drafts: Reimplement handlers for buggy drafts using zod. 2024-03-01 15:49:53 -08:00
evykassirer bd4da24086 drafts: Create formatted draft all at once.
Instead of partially creating it and then adding
more attributes, this commit creates the return
value (formatted draft) in a single assignment.
This is needed for typescript work, in an upcoming
commit.
2024-03-01 15:49:53 -08:00
evykassirer e8d5241c0d drafts: Return updatedAt timestamp in snapshot_message.
It was always being set after the fact, and it will
be easier to manage types for the conversion to
Typescript if we just set this when setting the
rest of the data for the draft message.
2024-03-01 15:49:53 -08:00
evykassirer 97c46a7375 stream_data: Allow undefined stream_id in get_color.
Sometimes get_color is called with undefined
stream ids. This change makes more clear
what was already happening, and allows
for smoother conversion of other files
to typescript, including an upcoming
conversion of the drafts module, which
can call `get_color` with a draft with
undefined stream_id.

This keeps the color logic contained in
the `get_color` function, which seems
cleaner than the alternative of exporting
DEFAULT_COLOR to be used wherever sream_id
might be undefined.
2024-03-01 15:49:53 -08:00
evykassirer 8784fd9944 drafts: Remove unused localstorage version.
It's been present since 1929cc5 and clearly is intended
to be part of a never-implemented format conversion
system. We can add a version if/when we actually need
such a feature.
2024-03-01 15:49:53 -08:00
evykassirer 34b6be668e util: Add test coverage for lower_same. 2024-03-01 15:49:53 -08:00
Tim Abbott 3c708edb2c team: Add more repositories and rename tabs.
Based on an audit of all repositories in the zulip organization.
2024-03-01 14:57:46 -08:00
Lauryn Menard 666041e480 remote-support: Show deactivated servers in search results.
The remote support view now returns results for deactivated remote
servers with those results sorted to the end and formatted to
visually stand out.

Forms to change sponsorship and discount fields on the customer
for the remote server or realm are not shown, but the data stored
on the customer object is shown, including any sponsorship request
information (if the customer had a sponsorship request pending when
it was deactivated).

Forms to schedule a plan are also not shown for deactivated servers
and their associated remote realms.

Forms and information for any current plan or scheduled plan, for
either the deactivated remote server or its associated remote
realms, are shown so that support staff can update those plans if
necessary.
2024-03-01 14:11:19 -08:00
Anders Kaseorg 13115c8180 Revert "copy_and_paste: Fix formatting of code pasted from VS Code."
This reverts commit 4a1423b34a.
2024-02-29 20:44:43 -05:00
Aman Agrawal c6d0a3c098 apps: Minor tweaks to apps page.
Co-authored-by: Alya Abbott <alya@zulip.com>
2024-02-29 16:18:12 -08:00
N-Shar-ma 4a1423b34a copy_and_paste: Fix formatting of code pasted from VS Code.
Since the html copied from VS Code is not structured as code but as
styled divs for each line, any code copied from it would be pasted
unformatted with blank lines between each line of code.

This has now been fixed, by detecting VS Code style code blocks by the
CSS property `white-space: pre` and pasting the text within as is, as
code.
2024-02-29 15:12:13 -08:00
N-Shar-ma c440b4575e copy_and_paste: Extract function `within_single_element` for reuse.
This is a prep commit for the next which will introduce a new function
that also calls `within_single_element`.
2024-02-29 15:12:13 -08:00
Lauryn Menard ad9f7a4549 corporate: Update directories for activity and support frontend files. 2024-02-29 15:11:48 -08:00
afeefuddin 34a8dc649f settings: Update the icon of preferences in personal settings.
Fixes: #29132
2024-02-29 15:10:32 -08:00
Anders Kaseorg 1118b2cc19 web: Convert uses of deprecated text-field-edit function aliases.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-29 13:24:27 -08:00
Anders Kaseorg 220c4cbdc2 base_page_params: Restore google_analytics_id.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-29 11:24:33 -08:00
Karl Stolley 7930209929
reactions: Increase prominence of own reactions.
To address feedback that own emoji reactions were not sufficiently distinct, we increase
the prominence of one's own emoji reactions by:

- Setting a pixel-and-a-half border around own reactions.
- Reducing the alpha on the inner drop shadow of other reactions.
- Increasing the contrast on own reactions borders (and decreasing 
  them, in dark mode, on other reactions).
- Space around the emoji is maintained as in the current design in the own reactions. 

Other reactions benefit from an additional half pixel of padding, top and bottom, 
which is necessary to keep the pills (and the hover reaction button) the same 
height as each other--regardless of whether there's an own reaction among them 
or not. Padding is reduced in line with the increased border on own reactions.
2024-02-28 13:04:11 -08:00
evykassirer 5d604a4429 buddy_list: Assert we always find something with find_li.
More context for this change here:
https://github.com/zulip/zulip/pull/29022#discussion_r1499949934
2024-02-28 08:51:33 -08:00
Tim Abbott a60ee9f7bc narrow: Clarify decisions for certain local variables.
This helps avoid having to think about the possibility of logic from
certain code paths leaking into others.
2024-02-27 19:43:31 -08:00
Aman Agrawal 8a6455551c narrow: Merge narrow activate and deactivate calls.
Fixes part of #23812.
2024-02-27 19:43:31 -08:00
Anders Kaseorg 664fdf1a92 channel: Use base_page_params.
Fixes errors on /devtools/integrations/ and /emails/.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-27 21:18:00 -05:00
Lauryn Menard a931d72af3 activity: Limit width of columns in activity charts.
Sets the max-width for table data cells in the activity and
installation charts.

If the content exceeds the limit, then the overflow is set to
hidden and the text-overflow is set to ellipsis, so there is
a visual indication that the text is not completely visible.
2024-02-27 11:24:54 -08:00
afeefuddin 28e4fe1820 onboarding_steps: Convert module to TypeScript. 2024-02-26 08:16:44 -08:00
Sayam Samal 069680a7d1 message_list_tooltips: Add "View bot card" tooltips for bots.
This change aids in differentiating between a normal user and a bot
account, furthur eliminating any confusion between them (a step forward,
considering how good LLM bots have become in impersonating a real user).

Fixes #25958.

Co-authored-by: 1010nishant <nishantjangid6377@gmail.com>
2024-02-25 16:33:34 -08:00
Sahil Batra 30aa0a19fe puppeteer: Disable flaky administrative UI test.
This might be similar to the failure reported in #28864.
2024-02-25 12:54:02 -08:00
Prakhar Pratyush fe1a20ebb3 settings: Add realm-level setting 'zulip_update_announcements_stream'.
This commit adds a realm-level setting named
'zulip_update_announcements_stream' that configures the
stream to which zulip updates should be posted.

Fixes part of #28604.
2024-02-25 09:33:00 -08:00
Tim Abbott e6109ba192 ui_init: Fix misconverted conditional.
f630272b4c incorrectly considered the
case that message_lists.current was itself undefined.
2024-02-24 14:47:17 -08:00
Alya Abbott f0cf4dad04 stream/group settings: Improve error strings.
- Use proper punctuation.
- Make errors friendlier.
2024-02-24 09:16:07 -08:00
Alya Abbott 72132502b9 tooltips: Rename LaTeX button to "Math (LaTeX)". 2024-02-24 08:33:45 -08:00
Aman Agrawal a44a4342b9 message_scroll: Don't process msg scroll events in non-message views. 2024-02-24 08:31:18 -08:00
Aman Agrawal 861acb9abd hotkey: Avoid checking message_lists.current for `narrow_private`.
Since `narrow_private` doesn't need a message for the hotkey to
work, there is no need to call do_narrow_actions which needs a
selected message id.
2024-02-24 08:31:18 -08:00
Aman Agrawal de0db7ad1a filter: Make excludes_muted_topics a method of the `Filter` class. 2024-02-24 08:31:18 -08:00
Aman Agrawal c20340a5a6 narrow_state: Use `message_lists.current` to return current filter.
It doesn't make sense for us to track a separate current filter when
it should just the be filter of current message list if there is one.

This will reduce possible confusion in the codebase where filter
returned by narrow_state is different from message_lists.current.
2024-02-24 08:31:18 -08:00
Aman Agrawal f630272b4c message_lists: Set `current` to be `undefined` for non message view. 2024-02-24 08:31:18 -08:00
Aman Agrawal 4ccf64b02b narrow: Use update_current_message_list instead of set_current.
It's important to remove the focused class and remote the
old message list from DOM which only happens in
update_current_message_list.
2024-02-24 08:31:18 -08:00
Alya Abbott 3aece96d19 banners: Remove the term "narrow" from comose notification banner. 2024-02-23 17:09:29 -08:00
Alya Abbott 34cbc5717b help: Reorganize keyboard shortcuts documentation.
Also remove the unnecessary term "narrow".
2024-02-23 17:09:29 -08:00
Sayam Samal a7e7176aae uploads: Improve abstraction of `upload.js` by removing object exports.
The `upload_objects_by_message_edit_row` map object was being exported
to handle the uploads during the editing of a message. To improve the
abstraction, we move the logic being used to access
`upload_objects_by_message_edit_row` and itself into `upload.js`.

Similarly, the `compose_upload_object` constant which was being exported
to handle the cancelling of compose uploads. This commit removes this
export and instead defines a new method `compose_upload_cancel` to
handle the same.
2024-02-23 16:46:40 -08:00
Sayam Samal 65be62e4cb uploads: Fix duplicate drag-and-drop uploads during message editing.
Every time a user edits a message, we call the `setup_upload` method
which creates a new Uppy instance and adds some event listeners to
enable the upload process. These event listeners were not being removed
during the cleanup process of message editing, which led to multiple
event listeners being attached to the edit message form. Due to this,
multiple duplicate files would get attached via these multiple event
listeners if a user opened the edit message form for the same message
multiple times.

This commit adds the `deactivate_upload` method to perform all the
necessary cleanups while closing the edit message form. Via this
method, we remove the event listeners attached and close the Uppy
instance which cancels all uploads, resets progress and removes all
files.
2024-02-23 16:46:40 -08:00
evykassirer 44b07094df stream_list: Convert module to typescript. 2024-02-23 16:18:48 -08:00
evykassirer fda1afaaa7 stream_list: Pass required parameter to build_stream_list.
Using `false` because `undefined` is falsey.
2024-02-23 16:18:48 -08:00
evykassirer 5178a6f2fe list_cursor: Update return type of find_li to allow undefined.
This reflects how the function is used in
`stream_list.initialize_stream_cursor`, and is already
handled appropriately in `ListCursor.get_row`.
2024-02-23 16:18:48 -08:00
evykassirer c2412b5480 unread: Refactor get_counts for two return types. 2024-02-23 13:26:34 -08:00
Alya Abbott 4013336e3c portico: Add quote to /self-hosting. 2024-02-23 10:24:42 -08:00
David Rosa 948b427de7 api-docs: Add instructions to download `zuliprc` files.
- Adds instructions for downloading a zuliprc file for a bot or for
  yourself.
- Updates the button label to "Download zuliprc", since that's the
  filename it downloads.

Fixes #28881.
2024-02-23 09:43:57 -08:00
David Rosa 9a6ccba733 account-settings: Rename "API key" button.
Renames button to "Manage your API key", and updates docs
accordingly.

Fixes part of #28881.
2024-02-23 09:43:57 -08:00
Lauryn Menard e4e65074df remote-support: Add push notification status information.
Adds the information returned by get_push_status_for_remote_request
for remote billing users to the support page. Note that getting
the current push status data will result in some duplicate database
queries (getting customer, plan, current billed users, next billing
cycle) when generating the remote support view.
2024-02-23 09:08:21 -08:00
Lauryn Menard 423af9916a remote-support: Add specific class for support section headers. 2024-02-23 09:08:21 -08:00
sujal 1e625bc43b setting_ui: Fix sorting by "Expires at" column.
Previously, the sorting was broken due to
incorrect referencing of the property.
The code has been updated to use the "expiry_date"
property instead of "expires_at".

Fixes #29005.
2024-02-23 09:04:18 -08:00
Alya Abbott d8848057ef playgrounds: Replace replit playground example with Rust playground.
Passing code to replit as a URL parameter no longer works.
2024-02-23 09:03:44 -08:00
Aman Agrawal 04cf552884 dropdown_widget: Replace widget_id with widget_selector. 2024-02-22 16:38:25 -08:00
Aman Agrawal a9dc669f3c dropdown_widget: Migrate to typescript. 2024-02-22 16:38:25 -08:00
sanchi-t 7eb34529e6 stream_create.js: Fix function call by removing unnecessary parameter.
The parameter was not being passed because
`report_already_exists` takes no parameters.
2024-02-22 16:34:39 -08:00
Prakhar Pratyush a8d056ac3b typing: Fix assertion error when narrowed to a non existing stream.
When narrowing to a stream which doesn't exist, the
code to render users who are typing in that narrow
resulted in an assertion error as the stream didn't exist.

This commit removes the assertion and returns an empty array
(array of users who are typing) in such case to fix the issue.
2024-02-22 16:12:42 -08:00
Prakhar Pratyush f023a11d01 typing: Fix "Missing stream_id" server error.
This commit fixes an error where composing a message with
no stream selected resulted in making a POST request to
'/typing' with stream_id as undefined which resulted in
a "Missing server_id" error.

We no longer make a POST request if the stream is not
selected.
2024-02-22 16:12:42 -08:00
Karl Stolley 1a5c475910 features: Make All view table as narrow as possible. 2024-02-22 16:10:56 -08:00
Karl Stolley 65bbfa8d44 features: Tweak edge cases across feature subheaders. 2024-02-22 16:10:56 -08:00
evykassirer ea2818786e buddy_list: Convert module to typescript. 2024-02-22 16:05:27 -08:00
evykassirer 5db0f5f29a buddy list: Remove stale jank from find_li.
It's clearer to return undefined than an empty list,
because it's easier to do an equality check for undefined
at call sites to this function.

`ListCursor.get_row` returns early for falsey values
returned from `find_li`, so I think whatever this
comment is referring to is no longer relevant.
2024-02-22 16:05:27 -08:00
evykassirer be033394b1 stream events: Rebuild buddy list when user is subscribed or unsubscribed. 2024-02-22 16:05:27 -08:00
evykassirer 5434130171 buddy list: Calculate render data once per view.
The work now being done in set_render_data used
to be done in render_more, which is called in
batches of 20 rows at a time. This work only
needs to be done once per narrow/view, so this
is a great performance improvement.
2024-02-22 16:05:27 -08:00
evykassirer 231c0087a4 compose fade users: Remove fade logic in favor of buddy list split.
This also removes buddy_list.get_items which were only used
for compose_fade logic.
2024-02-22 16:05:27 -08:00
evykassirer 231aa098cb buddy list: Create section in buddy list for users from narrow.
Fixes #21285.
2024-02-22 16:05:27 -08:00
Sahil Batra b154cb39f8 groups: Handle "#groups/new" url for users who cannot create groups.
We already do not show the buttons for opening the group creation
form if user is not allowed to create group at all, but the
user can still open the form by going on "#groups/new" url.

This commit fixes this by redirecting such users to "#groups/your"
like we do for streams.
2024-02-22 13:09:33 -08:00
Sahil Batra 2fe36cc0d7 group-settings: Handle invalid urls correctly.
There were couple of problems in our handling of invalid or
incomplete URLs-
- The browser back button behavior breaks if someone enters
url with invalid group ID, incorrect group name.
- On typing group edit URLs with invalid group ID, an error
was raised and the URLs remained the same with just opening
the groups overlay with "Your" tab selected in left panel.
- On typing group edit URLs with incorrect right side tab or
without any right side tab, we showed "general" section, which
is fine, but the URL was still incorrect.

This commit fixes the above mentioned problems-
- URLs with invalid group IDs are now handled gracefully
with groups UI opening in the same way as before but the
url is updated to "#groups/your".
- We now update the right side tab to "general" if right
side tab is invalid or there is no right side tab.
- All the URL updates to fix invalid urls are done using
"history.replaceState" to make sure the browser back button
behaves as expected.
- All the code for checking the urls is done in hashchange.js
itself, so we can remove some code from change_state.
2024-02-22 13:09:33 -08:00
Sahil Batra eea5ee8923 stream-settings: Handle invalid urls correctly.
There were couple of problems in our handling of invalid or
incomplete URLs-
- The browser back button behavior breaks if someone enters
url with invalid or inaccessible stream ID, incorrect stream
name, "#streams/new" url without permission to create streams.
- On typing stream edit URLs with incorrect right side tab or
without any right side tab, we showed "general" section, which
is fine, but the URL was still incorrect.

This commit fixes the above mentioned problems-
- We now update the right side tab to "general" if right
side tab is invalid or there is no right side tab.
- All the URL updates to fix invalid urls are done using
"history.replaceState" to make sure the browser back button
behaves as expected.
- All the code for checking the urls is done in hashchange.js
itself, so we can remove some code from change_state.
2024-02-22 13:09:33 -08:00
Sahil Batra 7da8f9650c streams: Handle "#streams/new" url for users who cannot create streams.
We already do not show the buttons for opening the stream creation
form if user is not allowed to create streams at all, but the
user can still open the form by going on "#streams/new" url.

This commit fixes this by redirecting such users to
"#streams/subscribed" like we do for guests.
2024-02-22 13:09:33 -08:00
Sahil Batra 54bc960898 message_view_header: Include right tab in stream settings link.
Previously, the link opened on clicking the stream name in
header was "#streams/{stream_id}/{stream_name}". It is now
changed to "#streams/{stream_id}/{stream_name}/general" as
the stream edit UI is opened with "general" tab.
2024-02-22 13:09:33 -08:00
Sahil Batra 61d481559f group_settings: Include tab selected in right section in url hash.
The url hash for a group edit view now includes "general" or
"members" in the end depending upon which tab is selected in
the right section.

Fixes #28678.
2024-02-22 13:09:33 -08:00
Sahil Batra 79975ae27e group_settings: Refactor code to handle tabs in right section.
We now use "data-group-section" attribute to set the "key" for
toggler in right section of groups overlay.

This change is preparatory work for showing the section opened
in right side in the url hash as we would use the "key" value
in url hash as well and the existing "group_general_settings"
and "group_member_settings" toggler key values were too long to
be used in the url. We previously used toggler key value as
class name and then used that class as selector to show the
relevant section but we now use "data-group-setting" section
to avoid using common class names like "general" and "members".
2024-02-22 13:09:33 -08:00
Sahil Batra e40846ef4e user_group_edit: Do not pass unused parameter to function.
There is no need to pass group as parameter to
update_toggler_for_group_setting.
2024-02-22 13:09:33 -08:00
Anders Kaseorg ac166dcfd4 dependencies: Upgrade JavaScript dependencies.
Fixes #26969.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-22 12:46:40 -08:00
Sayam Samal 9a12d1798e read_receipts: Fix duplication bug when opening menu repeatedly.
The (1) delay in fetching the read receipts data from the api call to
`/json/messages/${message_id}/read_receipts`; followed by the execution
of the success callback function, and the (2) use of `.append()` to
render the modal and user list, together lead to duplication of the read
receipts modal and also the user list inside the read receipts menu.

This commit adds a check to set the read receipts menu contents only if
the read receipts modal for the selected message ID is open by the time
the network request is resolved.

In addition, this commit also uses the `on_shown` hook instead of the
`on_show` hook in the read receipts modal logic, to add a delay in the
calling of the read receipts API, which prevents the stacking of the
requests.
2024-02-22 10:49:29 -08:00
Sayam Samal ece115c22d hotkey: Reorder "Edit selected message or view source" in ? and /help. 2024-02-22 10:49:29 -08:00
Sayam Samal eae148b67a hotkey: Add `Shift` + `V` shortcut to toggle read receipts modal.
The read receipts option, resides under the triple-dot message actions
menu. This made the process of viewing the read receipts take up
multiple steps, even via a keyboard-driven workflow.

Via this commit, now while focused on any message in a message feed,
and pressing `Shift` + `V`, efficiently brings up the read receipts
for that message.

Fixes part of #24716.

Co-Authored-by: SameepAher <sameepaher@gmail.com>
2024-02-22 10:49:29 -08:00
evykassirer b30f6bb705 user_search: Convert module to typescript. 2024-02-21 19:14:02 -08:00
evykassirer 860150525c sidebar_ui: Convert module to typescript. 2024-02-21 18:50:51 -08:00
evykassirer 134c5a8315 sidebar_ui: Add missing param to should_mask_unread_count. 2024-02-21 18:50:51 -08:00
evykassirer b609d3d88e base_page_params: Add realm_rendered_description. 2024-02-21 18:50:51 -08:00
Karl Stolley ecbfd61e6a left_sidebar: Remove padding from bot icon.
This is no longer necessary for vertical alignment, and by
removing the 6px of padding it represents, bot DM rows will have
the same 22px height as other DM rows.
2024-02-21 13:14:02 -08:00
Tim Abbott 2598596ad2 vdom: Eliminate undefined type declaration for impossible case.
This was just debugging logic working around the fact that vdom.ts was
not originally implemented in TypeScript, and should not be polluting
our types.
2024-02-21 10:49:24 -08:00
evykassirer aab25fae6a pm_list: Convert module to typescript. 2024-02-21 10:49:24 -08:00
Karl Stolley 1093ff841f left_sidebar: Remove unnecessary padding on bot icon. 2024-02-21 10:32:02 -08:00
Lauryn Menard 16135fbac6 support: Clean up class names in support views.
Updates the class name used for the sponsorship form container in
the remote support views to be more specific.

Adds a shared "support-form" class for the different forms in the
realm_details template.

Use the same CSS rule for current and next plan information sections.
2024-02-21 10:28:08 -08:00
Prakhar Pratyush ee612dafac settings: Rename signup_notifications_stream realm setting.
This commit renames the realm-level setting
'signup_notifications_stream' to 'signup_announcements_stream'.

The new name reflects better what the setting does.
2024-02-21 09:04:23 -08:00
Prakhar Pratyush ab453fbe20 settings: Rename notifications_stream to new_stream_announce..._stream.
This commit renames the realm-level setting 'notifications_stream'
to 'new_stream_announcements_stream'.

The new name reflects better what the setting does.
2024-02-21 09:04:23 -08:00
shashank-23002 d6219e93a8 popover: Rename user-card-status-text. 2024-02-20 18:10:38 -08:00
shashank-23002 6caacbcd07 tooltips: Fix status-emoji tooltip for user-card popover.
This tooltip seems to have been broken when #user_info_popover was
renamed to the user card popover.
2024-02-20 18:10:38 -08:00
shashank-23002 865f886f56 tooltips: Add a dedicated tooltip for status-emoji.
Fixes: #26772
2024-02-20 18:10:38 -08:00
Lauryn Menard b9c4a8a811 support: Add CSS formatting for form areas on support views. 2024-02-20 15:46:55 -08:00
Lauryn Menard b6d50c158d support: Add CSS grid for confirmation objects in query results. 2024-02-20 15:46:55 -08:00
Lauryn Menard b74a8a5ff5 support: Add CSS grid for user and user realm. 2024-02-20 15:46:55 -08:00
Lauryn Menard 8c5325fc2c remote-support: Add CSS grid for remote server and remote realms. 2024-02-20 15:46:55 -08:00
Lauryn Menard 439e88e251 support: Remove relative positioning for form elements.
Prep commit for adding a grid layout for some query response data.
2024-02-20 15:46:55 -08:00
Aman Agrawal e6718369d6 css: Apply fa-chevron-down CSS to zulip-icon-chevron-down.
This was missed as part of #27577 migration.
2024-02-20 15:16:56 -08:00
N-Shar-ma 8002f0db8f compose: Fix bug where sometimes message draft remained post sending it.
Now whenever we initiate sending a message, we save / update its draft,
which is deleted on a successful send. Earlier, we did this only for
locally echoed messages. Hence a non locally echoed message's draft
would remain, if created in the timeframe between initiating send and
receiving the same message from the server, which can be significant
for slow connections.
2024-02-20 11:59:46 -08:00
Aman Agrawal 90e67f7d75 upgrade: Fix spacing issue for fixed plan upgrade page. 2024-02-20 11:51:32 -08:00
Aman Agrawal 949379581e billing: Add separate entry point for billing login pages.
We just exclude upgrade.ts from the imports to avoid page_params
being imported which results in an error.

s
2024-02-20 11:51:32 -08:00
shashank-23002 5803d4afec clipboard: Align click to copy button inside spoiler tag.
Fixes: #20712
2024-02-20 10:18:43 -08:00
Aman Agrawal 0c6dfd1e5e message_actions_popover: Select message being moved.
This helps keep the content of this message in the move messages
modal relevant.
2024-02-20 09:29:26 -08:00
Aman Agrawal 4d1bb762be css: Add 25px to content width on right for chevron-down icon.
This fixes chevron-down icon overlapping with content when content
occupies full width of the select element.
2024-02-20 09:29:26 -08:00
Varun Singh c91ca3eca8 message_live_update: Convert module to TypeScript. 2024-02-20 08:30:04 -08:00
Varun Singh 5fd6a819d4 message_lists: Add 'rerender_messages' function to type. 2024-02-20 08:30:04 -08:00
Varun Singh d432b5e36a message_lists: Add 'rerender_view' function to type. 2024-02-20 08:30:04 -08:00
evykassirer 23795ca153 message_edit_history: Convert module to typescript. 2024-02-19 21:39:40 -08:00
evykassirer a8be874f70 state_data: Add realm_allow_edit_history. 2024-02-19 21:39:40 -08:00
Anders Kaseorg cc8a4636ba namespace: Prevent direct mutation of ES modules in tests.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-19 21:20:35 -05:00
Anders Kaseorg 10892f1d60 tests: Fix direct mutation of ES modules again, again.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-19 21:20:35 -05:00
Karl Stolley 29dd61c20c bootstrap: Remove pre styles.
Happily, every last CSS property in these styles is already
described for the places <pre> appears in the Zulip UI:

1. In rendered message markdown
2. In the compose preview
3. In the information overlay (Message formatting)
2024-02-19 18:15:26 -08:00
Anders Kaseorg 2c799125ea bundles: Remove unnecessary imports of effect-free modules.
Some of these may have once been necessary to enforce an ordering on
cyclic imports, but we’ve fixed all of those now.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-19 17:55:40 -08:00
Karl Stolley 384e28c8e2 bootstrap: Remove li style.
The `line-height` value is set to `inherit` in zulip.css, rendering
this line moot. `inherit` will always force list items to take
their line height from the nearest ancestor that sets one.
2024-02-19 17:53:50 -08:00
Karl Stolley 6073507230 bootstrap: Remove q styles.
There is no evidence of the <q> (quote) element in use in the
Zulip UI, nor that any of the Python-Markdown syntax generates them
either.
2024-02-19 17:51:10 -08:00
Anders Kaseorg 976987f9a3 webpack: Remove extraneous inclusions of page_params.
Commit a4938d3760 (#28971) fixed the
order-sensitivity of these modules, so it suffices to just import them
where they are used.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-19 15:10:02 -05:00
Aman Agrawal f6b1fe9f36 billing: Remove unused page_params on event_status page.
a4938d3760 introduced assertions
for page_params for which they were used. This caused the
assertion to fail on event_status page making the page not work.
Removed the page_params from running on event_status page to fix it.
2024-02-19 08:41:34 -08:00
Anders Kaseorg e568064f4e page_params: Set and expect state_data = null for spectators.
Fix a ZodError when spectators load the app, introduced by commit
a4938d3760 (#28971).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-19 03:03:58 -05:00
Anders Kaseorg a5c055ae82 state_data: Rename Term type to NarrowTerm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-17 00:02:38 -08:00
Anders Kaseorg a4938d3760 page_params: Parse page_params and state_data with Zod.
This establishes a runtime check that their types continue to reflect
reality going forward.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-17 00:02:38 -08:00
Sayyed Arib Hussain 8e39123839 message_view_header: Manage no description in message_view_header.
This commit modifies the behavior of the message view header
when a stream's description is empty. Previously, it displayed
"(no description)". With this change, if the user is an admin
or owner (i.e., has permission to update the description), it
will now display a "Add description" link to the settings. If
the user does not have these permissions, it will display nothing.

Fixes #28851

Signed-off-by: Sayyed Arib Hussain <sayyedaribhussain4321@gmail.com>
2024-02-16 15:41:27 -08:00
Anders Kaseorg ac68996ac3 sentry: Avoid early reads from state data.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-16 15:12:42 -08:00
Aman Agrawal 176c15f74b billing: Redirect user to login page if session expires.
If user makes an AJAX request but their session is expired, we
redirect user to the login page.
2024-02-16 14:56:26 -08:00
Anders Kaseorg a68c96231f stats: Fix types for upload_space_used, guest_users parameters.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-16 17:39:45 -05:00
Anders Kaseorg b5702422ed page_params: Remove max_message_id from type.
As of commit fd2ad130f9 (#28930) this is
popped in ui_init.initialize_everything now.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-16 17:35:11 -05:00
Sohaib-Ahmed21 d2bc94a724 invitations: Improve text in resend confirmation modal.
Importantly, this clarifies that this is useless for expired invites.

Fixes: #28829
2024-02-15 17:31:31 -08:00
Pratik 4f89a0f605 user_profile: Add "copy link to profile" button in user_profile_modal.
This commit adds a "copy link to profile" button in user_profile_modal.
Clicking on this button copies the user's profile link and displays a
"Copied!" tooltip.
2024-02-15 17:17:38 -08:00
Pratik cad051e5a6 user_profile: Enable dynamic URL generation for "View profile" option.
Clicking on "View profile" option now dynamically generates a URL,
allowing the user profile modal to open. Upon closing the modal,
the URL is reverted back to one that was active before the modal
was opened.

Additionally, It displays a profile access error modal when a user
attempts to either view an inaccessible profile or when an invalid
user id is present in the URL.

Fixes #28445.
2024-02-15 17:17:38 -08:00
Tim Abbott 76e86bc8fa team: Update for zulip-android-legacy repository rename. 2024-02-15 16:52:23 -08:00
afeefuddin a41c39db26 portico-team: Rework repository on team page
Fixes: #28504
2024-02-15 16:52:23 -08:00
Aman Agrawal 16868c39a5 navbar: Restructure navbar items. 2024-02-15 16:18:34 -08:00
sayyedarib 5c993f0479 direct_message: Allow DMs to bots and self regardless of policy.
Previously, in DM disabled org messaging to bot was not working when
starting new conversation and adding bot as recipient because of not
updating on recipient change. And secondly, self messaging was not
allowed.
This commit ensures that the DM to bot and self are allowed irrespective
of dm restrictions.

tests: Verify DMs adhere to DM restriction policy.

Fixes #28412

Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
2024-02-15 16:13:36 -08:00
Karl Stolley 22b4ec09fa css: Extract CSS variables into own file. 2024-02-15 15:50:25 -08:00
Alex Vandiver fc41d6085b tornado: Split server restart events from web client reload events. 2024-02-15 15:42:50 -08:00
Anders Kaseorg 823e8d8716 state_data: Fix custom_profile_fields type for CHOICE → SELECT rename.
Commit bd6471f0e3 (#28691) added this
reference to the old name, even though it had already been renamed in
commit b220d29fed (#17775), presumably
because that had failed to update the OpenAPI description.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-15 16:00:25 -05:00
evykassirer 07b2ad27fa topic edit: Warn when renaming a topic to an existing topic name.
Fixes #27369.

When editing a topic name via the topic header bar, it's easy to
accidentally move messages into an existing topic, which is
difficult to undo. This commit adds a confirmation modal for when
this is about to happen.
2024-02-15 11:58:23 -08:00
evykassirer 42122b851c message edit: Remove unused message_id assignment. 2024-02-15 11:58:23 -08:00
evykassirer c86558521f message edit: Remove redundant if clause.
`topic_changed` must be true by this point, because
of the earlier return statement.
2024-02-15 11:58:23 -08:00
evykassirer 47560d0b8b confirm dialog: Allow conf to override defaults. 2024-02-15 11:58:23 -08:00
Karl Stolley 9c77300c5a bootstrap: Remove body selectors, zero margin/padding explicitly. 2024-02-15 10:31:29 -08:00
Karl Stolley 79959573bd bootstrap: Remove unnecessary root properties.
* `font-size: 100%` is unnecessary, as `font-size: 16px` is set on
  the `body` selector.
* `text-size-adjust` is unnecessary, as supporting browsers appear
  to use `100%` as a default value anyway.
2024-02-15 10:31:29 -08:00
Anders Kaseorg bf6978185d home: Send state_data in a separate object.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-15 10:22:52 -08:00
Anders Kaseorg b9e62c7af8 page_params: Split out state data for realm.
For spectators, the chunk of page_params that originates from
do_events_register isn’t assigned until ui_init.js.  That means the
TypeScript type of page_params is mostly a lie during module load
time: reading a parameter too early silently results in undefined
rather than the declared type, with unpredictable results later on.

We want to make such an early read into an immediate runtime error,
for both users and spectators consistently, and pave the way for
runtime validation of the page_params type.  As a second step, split
out the subset of fields that pertain to the entire realm.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-15 10:22:52 -08:00
Anders Kaseorg e96ede0ef6 page_params: Split out state data for current user.
For spectators, the chunk of page_params that originates from
do_events_register isn’t assigned until ui_init.js.  That means the
TypeScript type of page_params is mostly a lie during module load
time: reading a parameter too early silently results in undefined
rather than the declared type, with unpredictable results later on.

We want to make such an early read into an immediate runtime error,
for both users and spectators consistently, and pave the way for
runtime validation of the page_params type.  As a first step, split
out the subset of fields that pertain to the current user.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-15 10:22:52 -08:00
Anders Kaseorg fd2ad130f9 page_params: Move max_message_id to local_message.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-15 10:22:52 -08:00
Anders Kaseorg 2d575ae576 page_params: Move queue parameters to server_events.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-15 10:22:52 -08:00
Anders Kaseorg 26df98a2fb echo: Remove unnecessary page_params.queue_id reference.
The web app never gets a new queue ID.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-15 10:22:52 -08:00
Anders Kaseorg e4bbd04f5d page_params: Remove muted_users from type.
ui_init.initialize_everything removes this from page_params with
pop_fields("muted_users").

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-15 10:22:52 -08:00
Anders Kaseorg 80a6b12690 docs: Optimize /api links to skip trailing slash redirect.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-14 21:06:03 -05:00
Varun-Kolanu e0339715cc skip_navigation: Add skip navigation link to /help and /api sites.
Skip navigation links added in /help and /api sites for accessibility
Fixes #28564.
2024-02-14 15:08:45 -06:00
Vector73 6801ea33ba message_move: Disable stream select dropdown for unprivileged users.
This commit disables the stream-select dropdown in the "Move message"
modal if the user is not allowed to move messages between streams, and
adds a tooltip for clarification when the dropdown is disabled.

 Fixes #28345.
2024-02-14 12:46:13 -08:00
Sahil Batra 30fc4f7832 groups: Disable "Add" button in members list if input is empty.
We previously had code to disable the "Add" button initially but
then we re-enabled it again if user had permission to add members.

We do not need that code to enable/disable the button based on
permission since the button is disabled initially and it is
only enabled when user updates the input which is not allowed
if users is not allowed to add members.
2024-02-14 12:26:07 -08:00
Sahil Batra e6e806f656 groups: Do not allow user to type when not allowed to add members.
Previously, we allowed user to type in the input even when user
was not allowed to add members to the group. This commit fixes that.
2024-02-14 12:26:07 -08:00
Sahil Batra ed1bc84566 group-members: Remove the error/success message on typing in input.
Previously, when there is no valid pill in the members list and
user clicks on "Add" button, then "No user to add" error is shown
but the error message is visible until successful user is added
and the same goes for success messages too.

This commit updates the code to remove both error and success
messages when user types in the input.
2024-02-14 12:26:07 -08:00
cherish2003 f4016eb3bf stream-subscribers: Remove the error/success message on typing in input.
Previously, when there is no valid pill in the members list and user
clicks on "Add" button, then "No user to subscribe" error is shown
but the error message is visible until successful user is added and
the same goes for success messages too.

This commit updates the code to remove both error and success messages
when user types in the input.

Fixes #27438.
2024-02-14 12:26:07 -08:00
somudas f00f4f95be stream_settings: Make stream name in right panel header a link.
The stream name in right side header is now a link to the stream
narrow.

Fixes #25171.
2024-02-14 11:27:41 -08:00
qx24680 86e306a679 settings: Improve placeholder text for empty settings tables.
Fixes: #27250.
2024-02-14 08:52:52 -08:00
Vector73 144c2c2f11 stream_settings: Add confirmation modal for changing privacy.
Fixes: #27916
2024-02-13 17:56:44 -08:00
evykassirer 925f5e8b67 drafts: Move some functions from draft_overlay_ui.
Preparation for an upcoming commit.
2024-02-13 15:20:48 -08:00
Karl Stolley 76220fdc2c features: Suppress plan-comparison subheadings. 2024-02-13 15:11:02 -08:00
Karl Stolley 43ee8b2ce1 features: Adjust table columns for Cloud default. 2024-02-13 15:11:02 -08:00
Karl Stolley 04b94f6ad5 features: Swap in redesigned feature-comparison table. 2024-02-13 15:11:02 -08:00
vighneshbhat9945 f9ba4da012 stream-settings: Show indicator on notification settings.
In the Personal settings stream management panel,
when notification settings are changed, Saving/Saved
indicator are shown on personal settings heading instead
of notification settings heading.

Fix this issue by showing indicator on
notification settings heading.

Fixes: zulip#28728.
2024-02-13 14:47:42 -08:00
vighneshbhat9945 ab927cbb2a templates: Remove unwanted div. 2024-02-13 14:47:42 -08:00
vighneshbhat9945 4903870ec3 stream_settings: Remove duplication logic.
This commit addresses code duplication issue in
'stream_is_muted_changed()' which was redundantly
present in 'stream_setting_changed()'.

The changes ensure that the functionality is now centralized
and can be easily updated or extended in the future.
2024-02-13 14:47:42 -08:00
Lauryn Menard b275e9c4d6 stripe: Add billing portal for customer name and address.
Adds a link on the upgrade and billing pages that opens a stripe
billing portal for the customer to update their name and address
that will appear on invoices and receipts.

On the billing page, updating the credit card information will
no longer update the customer billing address, since they can
now do this directly through the billing portal. To be consistent
with the credit card form on the upgrade page, we still require
inputting a billing address for the card.

Note that, once an invoice is paid/complete, then changes to the
customer's name and address will not be applied to those invoices.
2024-02-13 14:18:38 -08:00
Varun Singh e246db6709 playground_links_popover: Return if 'playground_info' is undefined.
We need fields like 'url_template' to do the code extraction.
Those are absent if 'playground_info' is undefined, thus we should
return immediately in those cases.
2024-02-13 11:44:01 -08:00
Varun Singh 3fa308369d playground_links_popover: Convert module to TypeScript. 2024-02-13 11:44:01 -08:00
Varun Singh 44e4a90ab8 playground_links_popover: Don't mutate global playground object.
The 'playground_url' field is specialized to the 'else' block ,
but is being written into global 'playground' object thus mutating
it.

To avoid this , we create a Map, with its values being objects
that contain all the fields (including playground_url) neccessary
to be passed into the template for rendering.
2024-02-13 11:44:01 -08:00
Varun Singh 1af9fa4263 realm_playground: Remove redundant omit utility.
Omitting 'pygments_language' property adds extra unnecessary complexity.
2024-02-13 11:44:01 -08:00
ayush amawate 071e93277f stream_settings: Fix overlapping Unsubscribe button with side scroll.
Fixes #26835.
2024-02-13 10:59:28 -08:00
Aman Agrawal 8cba101e05 support: Add button to delete configured fixed next plan.
This will help us modify the configured plan if we need to.
2024-02-13 09:40:53 -08:00
Aman Agrawal 68c3c6b872 stream_popover: Remove stale code.
We don't show a cancel button with stream color picker and
`.popover` and `.popover-inner` classes don't exist for
stream popover.
2024-02-13 08:53:57 -08:00
Karl Stolley 35098f4959 Revert "plans: Handle table widths in CSS."
This reverts commit 960e29dc5a.

An earlier draft of the comparison table made this CSS necessary;
it should have been removed before merging.
2024-02-12 15:18:01 -08:00
Karl Stolley 5f509f5b0c plans: Remove unnecessary comparison-table conditional. 2024-02-12 15:18:01 -08:00
Karl Stolley 5be2e8fa64 portico: Beef up IntersectionObserver on comparison table. 2024-02-12 15:18:01 -08:00
Aman Agrawal 7ca85bed71 stripe: Fix $0 invoices being generated on upgrade.
Instead of charging the customer using the attached payment
method and then creating the invoice, we create an invoice and
force an immediate payment for the invoice via the attached
payment method.
2024-02-12 15:15:56 -08:00
Lauryn Menard 831381f160 email-log: Update CSS styles for dev environment email log.
Removes reliance on bootstrap alert and label rules/styles that
were used or expected for this email log page.
2024-02-12 11:35:36 -08:00
roanster007 07ccd29a9b typing_status: Add an extra notification_event_type to Recipients.
This is a preparatory commit. It adds an extra notification_event_type
to the Recipient type. This can be used to differentiate between
typing notifications and message edit typing notifications since
they send different events.
2024-02-12 10:51:12 -08:00
roanster007 ea2b659314 message_edit_notice: Change edited notice computation logic location.
This commit extracts the edited notice computation logic of
edited_in_left_col, edited_alongside_sender and edited_status_message
to a new function - set_edited_notice_locations and calls it right
after the method merge_message_groups.

This is a preparatory commit, and is done since theses three variables
were previously wrongly initialized in the beginning for live messages
received.

We also introduce a modified flag to decide whether to display the
edited notice or not. This is useful since now we are computing
the edited notice values even when messages are not edited, and
hence we show the notices only when the modified flag is true.
2024-02-12 10:51:12 -08:00
Varun Singh e4c6476c57 ts: Update extension of recently migrated '.js' files. 2024-02-12 09:49:54 -08:00
Varun Singh 5f9b6d82a4 typing_events: Convert module to TypeScript. 2024-02-12 09:49:54 -08:00
Varun Singh bec806db18 typing_events: Refactor 'narrowed_by_topic_reply' conditional.
Fetching narrow 'stream_id' and 'topic' into variables will
help with upcoming type assertion.
2024-02-12 09:49:54 -08:00
Varun Singh 0ec622c5f4 typing_events: Refactor 'get_key' function.
The function body contains only two conditionals, so the
'switch' statements can be replaced with simple 'if's that
return immediately, thus making the code block cleaner.
2024-02-12 09:49:54 -08:00
Varun Singh c8f135b97a page_params: Add typing notifications constant to type. 2024-02-12 09:49:54 -08:00
evykassirer d3b5a76a67 stream bar: Convert module to typescript. 2024-02-10 07:07:08 -08:00
evykassirer 49d79730b8 resize: Convert module to typescript. 2024-02-09 21:17:16 -08:00
evykassirer 4d6cfcb0ff resize: Remove unused return value of resize_sidebars. 2024-02-09 21:17:16 -08:00
evykassirer 781387781b resize: Don't pass unused value to resize_bottom_whitespace. 2024-02-09 21:17:16 -08:00
evykassirer d913ab1e3c resize: Fix buggy check for #stream_settings element. 2024-02-09 21:17:16 -08:00
Tim Abbott 3f7b26d8bd message_notifications: Shorten other users string.
This makes it more likely to not be truncated.
2024-02-09 18:03:29 -08:00
Aman Agrawal 7bab31068a message_notification: Set title based on length of title.
Including content length in this calculation doesn't make sense.
2024-02-09 18:03:29 -08:00
Aman Agrawal 192306f9ee notification: Use display_recipient to get other_recipient length. 2024-02-09 18:03:29 -08:00
Aman Agrawal 2d2e2f8882 message_notifications: Translate private message content. 2024-02-09 18:03:29 -08:00
Tim Abbott b975301e84 notifications: Remove custom truncation logic.
This logic was part of the original desktop notifications
implementation in 4cb0c6225e.

There's no apparent standard for the number of characters allowed to
be shown in a desktop notification, so truncating at 150 characters
arbitrarily seems wrong.

Further, we've decided it's no longer a priority to truncate at word
boundaries, we can rely on the browser to take responsibility for
truncation.

Fixes #25260.
2024-02-09 17:27:59 -08:00
Tim Abbott 27deebe45b click_handlers: Remove dead code for Bootstrap popovers. 2024-02-09 17:06:03 -08:00
Tim Abbott e17e231b2a stream_popover: Remove dead unsub code.
This seems to have been dead since it was introduced in
64079b382f.
2024-02-09 17:06:03 -08:00
sanchi-t edf8b13430 stream_popover: Hide popover when clicked on `unsubscribe`. 2024-02-09 17:06:03 -08:00
Rinwaoluwa fbe7285af8 left_sidebar: Remove export in deselect_top_left_corner_items.
It is safe to remove the export, because
deselect_top_left_corner_items isn't called anywhere else outside the
file.
2024-02-09 15:53:05 -08:00
Rinwaoluwa afe3bcd6c5 left_sidebar: Simplify deselection with deselect_top_left_corner_item.
Refactoring to avoid duplication, improve readability, and standardize
deselection logic by converting calls to remove to
deselect_top_left_corner_items.
2024-02-09 15:51:57 -08:00
Anders Kaseorg 497bd740e9 web: Replace Zod z.union with z.discriminatedUnion or .nullable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-09 18:48:20 -05:00
Tim Abbott d5281292d5 compose_ui: Clean up placeholder logic.
This removes messy indirection through email addresses in passing a
set of users between two modules.
2024-02-09 15:11:17 -08:00
Joydeep Bhattacharjee 264a9a1057 compose_ui: Convert module to typescript. 2024-02-09 15:11:17 -08:00
Tim Abbott 91bdcc9596 compose_ui: Use startsWith/endsWith helpers.
Suggested by @joydeep2001 in #28725.
2024-02-09 15:11:17 -08:00
Karl Stolley 0290642f1d plans: Use IntersectionObserver to handle subheaders. 2024-02-09 09:20:34 -08:00
Karl Stolley 7ea313c658 plans: Ensure linked comparison tables scroll into view. 2024-02-09 09:20:34 -08:00
Karl Stolley 960e29dc5a plans: Handle table widths in CSS. 2024-02-09 09:20:34 -08:00
Karl Stolley 5aa3615f4b plans: Add comparison-switcher logic and styles. 2024-02-09 09:20:34 -08:00
Karl Stolley 0e3699c3dc plans: Open up spacing around feature-cell text. 2024-02-09 09:20:34 -08:00
Karl Stolley 33fd82ead3 plans: Add comparison-tab buttons and icons. 2024-02-09 09:20:34 -08:00
Karl Stolley 7d2adda31c plans: Filter table based on active plans tab. 2024-02-09 09:20:34 -08:00
Karl Stolley 5031d7a06c plans: Avoid hover effect on header row. 2024-02-09 09:20:34 -08:00
Sahil Batra 0d25efd4a0 settings: Fix check_property_changed code for user access setting.
The proposed_val for "realm_can_access_all_users_group" setting
was always returning NaN value which resulted in the value
being included in request even when it was not changed or disabled
due to org not being on "Plus" plan. This resulted in a bug where
user was not allowed to change the "guest" indicator setting
on orgs without "Plus" plan.

For orgs with "Plus" plan there was no problem in changing the
setting but the save button was visible incorrectly if the setting
was set to the initial value.

This commit fixes both the bugs.
2024-02-08 11:03:47 -08:00
Sahil Batra 1d5a083869 admin: Remove unnecessary development_environment check.
The "Who can access all users" setting is not disabled for
organizations not on "Plus" plans in production because of
the "page_params.development_environment" check.

We do not need that check anymore as the feature is now
enabled in production.
2024-02-08 11:03:47 -08:00
Tim Abbott 20d90a6df6 portico: Fix subdomain check flickering with arrow keys.
The previous logic would treat navigating with the arrow keys, or
alt-tab, as a reason to clear the subdomain unavailable warning, and
would not necessarily check again immediately. Now just trigger off
changes in the input.

Instead, just trigger off actual changes in the value of the input.
2024-02-07 12:10:00 -08:00
Tim Abbott ea89a4c6f7 puppeteer: Disable flaky administrative UI test. 2024-02-07 09:45:27 -08:00
Tim Abbott d015a8ca52 typing: Pass the type parameter in typing requests.
Not passing this parameter is a deprecated way to do things.
2024-02-07 09:12:49 -08:00
Varun Singh e213d9505b typing: Convert module to TypeScript. 2024-02-07 09:12:49 -08:00
Varun Singh 391e2a8e01 typing_status: Use TypeScript unions for 'Recipient' type.
Typing 'Recipient' as union of 'stream' and 'direct' message type will help with upcoming type inference.
2024-02-07 09:12:49 -08:00
Varun Singh b64a9d6ae0 page_params: Add typing notifications constants to type. 2024-02-07 09:12:49 -08:00
Varun Singh 94558478df scheduled_messages_feed_ui: Convert module to TypeScript. 2024-02-06 22:25:55 -08:00
Varun Singh f0b8cc7865 scheduled_messages_feed_ui: Refactor to avoid duplicate function calls.
While this logic might seem to be different,
util.same_stream_and_topic would always return false when passed a
topic of undefined.
2024-02-06 22:25:55 -08:00
Varun Singh fc86aca769 scheduled_messages: Make ScheduledMessage type more precise.
Typing 'ScheduledMessage' as union of 'private' and 'stream' scheduled
message types will help with upcoming type inference.
2024-02-06 22:25:55 -08:00
Varun Singh 3d23b39793 scheduled_messages_feed_ui: Fix false/empty array type confusion.
This looks to be a mistake resulting from moving this line out of the
filtering loop just below.
2024-02-06 22:25:55 -08:00
Prakhar Pratyush 2055dfa83e support: Add support to configure fixed-price plan with pay-by-invoice.
* Manually create & send invoice
* Configure a fixed-price plan with sent invoice-id.
* When customer pays, upgrade them to concerned plan.
2024-02-06 18:43:23 -08:00
Prakhar Pratyush 79a1b3b80e billing: Show annual data for fixed-price plan, by default.
On /upgrade page, we show annual schedule & price for a
fixed-price plan, by default.

This also acts as a prep commit for fixed-price plan
with pay-by-invoice collection method as we only offer
annual plan in such case. So, annual data is shown by default
on /upgrade page.
2024-02-06 18:43:23 -08:00
David Rosa 8e92b54df1 help: Update external links to "Bots overview" help center page.
The page was renamed and thus this will avoid an unnecessary redirect.
2024-02-06 18:22:57 -08:00
Tim Abbott f4ad102d39 narrow_state: Add pm_ids_set helper.
This provides a more easy to work with model of which users, if any,
are involved in the current DM conversation, if any.
2024-02-06 14:44:09 -08:00
Tim Abbott 772ed724c0 peer_data: Extend get_subscriber_count to allow excluding bots.
The new buddy list code path will want to be able to do this.
2024-02-06 14:44:09 -08:00
evykassirer a46c4f7b7e people: Gracefully fail for invalid users in user_is_bot.
Many of these code paths largely expect it to be a valid user ID, so
we could raise an exception if the user ID is invalid, but probably
gracefully proceeding is reasonable for the callers.
2024-02-06 14:44:09 -08:00
Tim Abbott f55ee266b7 message_list_view: Ensure render window IDs are integers.
The previous logic threw confusing exceptions if, during
testing/debugging, one picked an odd render window size.
2024-02-05 23:17:43 -08:00
Tim Abbott a8698c08ca navigate: Correct handling of limited fetched content.
This correctly avoids pageup/pagedown scrolling past already rendered
content, while also always making progress, which the previous logic
introduced in d8ec141de2 might do, at
least in degenerate cases with very small render windows.

I'm not sure this change has any effect in practice with current
render window values, but it does fix a bug if I set the maximum
render window size to 20.
2024-02-05 23:17:43 -08:00
Tim Abbott b9af5ce86e unread: Fix process_visible race with fetching.
The previous batch of improvements to this code path in
6562ea94e4 introduced a race bug where:

- You navigate to a narrowed view; Zulip renders cached data from
  `all_messages_data` that we know is current, but
  `fetch_status.has_found_newest` is initialized to `false`
  nonetheless.

- The bottom is visible, triggering the check for whether the view
  should be marked as read.

- `fetch_status.has_found_newest` is still `false`, and so we
  incorrectly refuse to mark as read.

- We finish fetching data from the server, do the background rerender
  for that (with no changes), but that doesn't trigger a re-check for
  whether the bottom is visible.

There's several ways to address this, but most correct to me is to not
check fetch_status in this particular code path.

The same reasoning applies to the navigate.js call sites.
2024-02-05 23:17:43 -08:00
roanster007 49e3e6da06 timerender: Fix get_timestamp_for_flatpickr when no parameter passed.
Previously, when no parameter was passed to the get_timestamp_for_
flatpickr method, it would result in an uncaught exception. This is
breaking the "Add global time" of compose bar.

This can be avoided by doing an early return of current time to hour
in case no string is passed.
2024-02-05 12:33:39 -08:00
roanster007 d971b36026 timerender: Extract get_current_time_to_hour helper.
We will reuse this in the next commit.
2024-02-05 12:33:13 -08:00
Aman Agrawal 37b0f59200 reactions: Rename `get_reaction_section`.
We pluralize it to indicate that it can return multiple row from
multiple lists / rows.
2024-02-05 11:06:46 -08:00
Aman Agrawal c436b8011f message_list_view: Use `$()` to create an empty jQuery object. 2024-02-05 11:06:46 -08:00
Aman Agrawal 7463f561f1 echo: Track if we are showing slow spinner for a message. 2024-02-05 11:06:46 -08:00
Aman Agrawal 8acbf02ad7 reactions: Fix reactions not displayed in all messages view.
We were not updating all the rendered `messages-rows` but just
for the current view.

This bug was introduced in
df180f7bd5
2024-02-05 11:06:46 -08:00
Aman Agrawal f71337aaf7 compose_actions: Fix incorrect condition.
This was introduced in #28767 with the intention to skip scrolling
the selected message.

So, the actual bug that the PR fixed would have been just fixed
by opening the compose box early.
2024-02-05 08:51:10 -08:00
Tim Abbott 67ed87ecb5 web: Use better exponential backoff algorithm.
This matches the algorithm that we designed for the Python API, except
that we use a ratio of 2 rather than sqrt(2) in the message_fetch code
path, because it's a heavier request.

We increase the number of failures before showing a user-facing error
to roughly preserve the same time period before a user-facing error is
shown.
2024-02-04 17:38:56 -08:00
Tim Abbott e91748022f web: Respect rate-limiting headers in main APIs.
Previously, these endpoints just did exponential backoff, without
looking at the rate-limiting headers returned by the server, resulting
in requests that the client could have been certain would fail with an
additional rate-limiting error.

Fix this by using the maximum of the existing exponential backoff with
the value returned by the rate-limiting header.

Fixes #28807.
2024-02-04 17:38:56 -08:00
Tim Abbott 624e1a85ce message_fetch: Add small backfill delay.
This should help reduce the risk of hitting rate limits when users
have a very large number of messages to fetch via this mechanism.

Inline the `messages` variable that was only used in one place while
we're touching this.
2024-02-04 17:38:56 -08:00
Tim Abbott 370afd6464 reload: Add on-focus handler after a delay. 2024-02-04 17:38:56 -08:00
Tim Abbott 5f4e1de661 util: Fix call_function_periodically.
This function incorrectly and misleadingly did an immediate initial
call, despite both of its callers doing immediate calls themselves (in
one case, with a different parameter passed).

This led to unnecessary server load when reloading the app via event
system triggered reloads, since every client would call `/` twice.
2024-02-04 17:38:56 -08:00
Tim Abbott d8ec141de2 navigate: Fix buggy detection of start/end.
I was not able to reproduce obviously badly broken behavior from these
logic bugs, but after the renaming of message_viewport helpers in the
last few commits, it's clear that this logic was trying to check if
we're actually at the start/end of the possibly message feed, not just
the rendered portion, and doing so incorrectly.
2024-02-04 17:34:24 -08:00
Tim Abbott 4f8da7462d message_scroll: Add some explanatory comments. 2024-02-04 17:34:24 -08:00
Tim Abbott 84ec491e34 message_viewport: Rename at_top for clarity. 2024-02-04 17:34:24 -08:00
Tim Abbott 42956e0305 message_viewport: Rename at_bottom for clarity. 2024-02-04 17:34:24 -08:00
Tim Abbott 45f9bd21e5 message_viewport: Rename bottom_message_visible. 2024-02-04 17:34:24 -08:00
Tim Abbott 6562ea94e4 unread: Stop treating bottom of render windows as the global bottom.
The previous logic for both scrolling down and using pagedown would
incorrectly mark an entire conversation as read when reaching the
bottom of a render window, even if there were more messages loaded or
to fetch from the server.

Fix this error in the calculation by asking the correct data
structures if we're actually at the bottom.

To avoid the navigate.js keyboard shortcut code paths circumventing
this new logic, or needing to duplicate it, they now call
process_visible, rather than its helper.
2024-02-04 17:34:24 -08:00
Aman Agrawal da7cb0af1c bootstrap: Remove unused dropdown toggle class definitions. 2024-02-03 17:20:28 -08:00
Aman Agrawal ee2f08aa96 css: Remove state dropdown-toggle class. 2024-02-03 17:20:28 -08:00
Aman Agrawal 088eadbca1 css: Remove stale dropdown-list-widget class. 2024-02-03 17:20:28 -08:00
Aman Agrawal 1b8605a6e6 stream_popover: Remove remnants select_stream_widget.
We replaced the bootstrap dropdown with our custom dropdown
widget. These were missed during the migration.
2024-02-03 17:20:28 -08:00
Aman Agrawal 91073cfbe1 css: Remove stale CSS.
This doesn't seem to be effectively used anywhere.
2024-02-03 17:20:28 -08:00
Aman Agrawal e923c593f6 topic_generator: Rearrange checks inside if statement.
Primary objective is to remove the call to narrow_state.active,
in doing so, I rearranged the conditions a bit.
2024-02-03 17:19:30 -08:00
Aman Agrawal adedc0283f narrow: Remove not required call to save_narrow.
Since we always call `deactivate` from `hashchange`,
`browser_history.state.changing_hash` is always `true` and hence
`save_narrow` just retuns without doing anything.
2024-02-03 17:19:30 -08:00
Aman Agrawal eaafaba482 unread_ops: Remove unused function. 2024-02-03 17:19:30 -08:00
Aman Agrawal 3099457e06 narrow: Remove duplicate clear search form.
This function doesn't need to be called since `render_title_area`
already takes care of it which is always called when changing
narrow.
2024-02-03 17:15:26 -08:00