Commit Graph

56701 Commits

Author SHA1 Message Date
Anders Kaseorg 1fdc09a88f requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-22 21:57:38 -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
Lauryn Menard e5c92a1ee6 remote-billing: Add index to RemoteRealmAuditLog for billing events.
When profiling the database queries for the remote support view,
getting the user counts for remote realms was identifed as an
expensive query. Adds an index on RemoteRealmAuditLog to improve
this relatively common query for remote billing information.
2024-02-22 16:30:06 -08:00
Anders Kaseorg bf4933942c run-dev: Abbreviate error message when receiving an https request.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-22 16:26:36 -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
Anders Kaseorg 12699cdb1d editorconfig: Use [[shell]] section for shfmt options.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-22 16:36:16 -05:00
Alya Abbott 8b8c43163f portico: Drop "comparison" from table heading.
This avoids an extra line for the self-hosted heading on mobile widths.
2024-02-22 13:30:55 -08:00
Alya Abbott 47b7abf324 portico: Tweak "contact sales" line on Cloud plans page. 2024-02-22 13:30:55 -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 aeeea453dd install-shfmt: Upgrade shfmt from 2.7.0 to 2.8.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-22 12:46:40 -08:00
Anders Kaseorg 94cf99bcf2 install-node: Upgrade Node.js from 20.9.0 to 20.11.1.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-22 12:46:40 -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
Alya Abbott c6feafe298 portico: Link to Semsee case study. 2024-02-22 10:33:31 -08:00
Alya Abbott fce68e23a2 portico: Add Semsee case study. 2024-02-22 10:33:31 -08:00
Aman Agrawal bddb44eebf stripe: Disable free trial for legacy customer with ended plan.
This ensures that customer who had legacy plan any time in the past
cannot avail free trial.
2024-02-21 21:40:47 -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
Tim Abbott d0c276d863 corporate: Fix billing_session variable reuse confusion.
The previous logic incorrectly used the server-level number of users
even when a (presumably smaller) realm-level count was available.

Fixes a bug introduced in 2e1ed4431a.
2024-02-21 17:51:30 -08:00
Anders Kaseorg 0347e07a96 ci: Upgrade external GitHub actions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-21 17:17:36 -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
Lauryn Menard 161125c9be remote-support: Get user data once from the database.
Instead of querying the database twice for the user counts and
for the currently used licenses, we know pass that information
to the function where we populate the plan data for the remote
server or realm.
2024-02-21 12:40:34 -08:00
Lauryn Menard 907c209296 remote-support: Add search results for remote server/realm uuid. 2024-02-21 12:40:34 -08:00
Lauryn Menard 1eca9b3f6e remote-support: Return server results for realms with host match.
Checks for remote realm hosts that match the search query. Adds a
database query to getting the initial search results.
2024-02-21 12:40:34 -08:00
Lauryn Menard aec02d18af remote-support: Improve getting remote realm/server data.
Only get the customer information once from the database.

Extract logic for any next plan (either scheduled or an offer) data
into a separate function and do not hit database twice when getting
the number of licenses at the next plan renewal.
2024-02-21 12:40:34 -08:00
Lauryn Menard 8189b94a70 remote-support: Improve search results in view code.
Removes prefetch of remote realms on the remote server query
because, by excluding the system bot realm when this is referenced,
we end up hitting the database again.

Strips whitespace from query string and makes a few small updates
for readability.
2024-02-21 12:40:34 -08:00
Tim Abbott bd0b5d80ba zilencer: Use early return pattern for readability. 2024-02-21 11:10:45 -08:00
Mateusz Mandera ea863bab5b remote_billing: Remove code migrating Legacy plan from server to realms.
We no longer want to migrate Legacy plans from server to realms, since
Legacy plans are not really a thing in the original sense anymore, since
February 15th.

Now they're just a tool to give temporary extensions of access to the
push notification service for users, when needed. And as such, it makes
no sense to migrate like that.

The remaining code in this function is for migrating (any) plan from the
server object to the realm object, if the server has just a single
realm.
2024-02-21 11:10:45 -08:00