Commit Graph

3607 Commits

Author SHA1 Message Date
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