Commit Graph

5990 Commits

Author SHA1 Message Date
Sayam Samal 79e8cb60db copy: Use redesigned copy button in copy invite link alert. 2024-09-20 15:44:20 -07:00
Sayam Samal a743bb0eb6 copy: Use redesigned copy button in rendered codeblocks. 2024-09-20 15:44:20 -07:00
Sayam Samal 6c7b61e6f2 copy: Use redesigned copy button in the About Zulip modal. 2024-09-20 15:44:20 -07:00
Sayam Samal b57a261035 user_profile: Fix faulty custom profile field copy buttons.
This bug was introduced in 7232ff6, which while adding the
copy-to-clipboard support for the custom profile field links, removed
the ClipboardJS reference to the ".copy-custom-field-url" class.
2024-09-20 15:44:20 -07:00
Sayam Samal a74aaca8fc copy: Use redesigned copy button in user profile modal. 2024-09-20 15:44:20 -07:00
Sayam Samal 2e4e017a18 copy: Use redesigned copy button in view original message UI.
This commit also updates the copy icon in the related /help docs.
2024-09-20 15:44:20 -07:00
Sayam Samal a95c6a610e copy: Indicate successful copy by displaying a check icon momentarily. 2024-09-20 15:44:20 -07:00
Sayam Samal 3f79af12ac copy: Redesign copy button in user card popover.
This commit serves as the base for standardizing the look and feel of
the copy button throughout the UI.

Changes:
    - Replaces the old fa-copy icon with the new Zulip custom copy icon.
    - Standardizes the hover/active states for interactivity.
    - Defines two variants of the copy button, one which is just the
      icon and the other which is squared off like a traditional button.
    - Removes the `.popover-menu-icon` classes from the copy buttons,
      as that class is made to be used with popover menu option icons.
2024-09-20 15:44:20 -07:00
Pratik Chanda 41cd04a071 composebox_typeahead: Remove own user suggestion if recipients present.
Earlier, in compose recipient, if user adds own user pill in recipient,
DM message list would fade even though it was the correct view.

This commit prevents user from adding own user pill in DM recipient if
other recipients are already added.

Fixes: zulip#31629.
2024-09-20 15:31:09 -07:00
Pratik Chanda bc623369c3 compose_recipient: Remove own user pill if other recipients are added.
This commit removes own user pill from recipient box if other
recipients are added.

Fixes part of zulip#31629.
2024-09-20 15:31:09 -07:00
Yaswanth Kosuru 8e71806958 tooltips: Change tooltip for channels subscribe/unsubscribe button.
Previously, the tooltips for the subscribe and unsubscribe buttons
were static, showing the same tooltip regardless of the button's
state. This update improves the user experience by introducing
dynamic tooltips that reflect the current state of the button.

Changes include:
- Added multiple HTML tooltip templates for different button states
  subscribed, unsubscribed.
- Updated JavaScript to select and render the appropriate tooltip based on
  the button's state.
- Modified `data-tool-tip-id` prop to use state-specific tooltip
  templates.

Fixes zulip#31500.
2024-09-20 15:17:31 -07:00
Pratik Chanda 967243b2db composebox_typeahead: Move wildcard string to secondary in @-mention.
Earlier, in typeahead suggestions for wildcard mention, we rendered
wildcard string as primary text inside parentheses.

This commit separates the wildcard string as secondary_text to
be rendered without parentheses using styles like channel description.

Fixes: zulip#31245.
2024-09-20 15:16:21 -07:00
Pratik Chanda c84ff59dc9 composebox_typeahead: Add info field to slash command as secondary text.
Earlier, in typeahead suggestions for slash command, we render
supplementary info as primary text inside parentheses.

This commit separates the supplementary info as secondary text to
be rendered without parentheses using styles like channel description.

Fixes part of zulip#31245.
2024-09-20 15:16:21 -07:00
Pratik Chanda f3432b731f composebox_typeahead: Replace parentheses around pronouns with comma.
Currently, we show pronouns inside parentheses just after name in
@-mention typeaheads.

This commit changes it by removing parentheses and adding comma if
more info is present after pronouns. The pronouns also have the same
styles as that of the user emails.

Fixes part of zulip#31245.
2024-09-20 15:16:21 -07:00
Anders Kaseorg 203315958b test-js-with-node: Keep running after some tests fail.
This lets us collect all failures rather than the first failure in
each process.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-20 15:13:26 -07:00
evykassirer 52440c1cff unread_ops: Convert stream ids to integers before sending request to server.
This bug was introduced in #31299, which replaced the channel name
with a string id. It's still valid to send the channel id to the
server, but it shouldn't be a string, it should be a number.
(See https://zulip.com/api/construct-narrow#channel-and-user-ids)

In the future, we hope to update NarrowTerm to allow for integer
operands for channel terms.
2024-09-20 14:55:50 -07:00
Anders Kaseorg 57c39fc257 stream_data: Simplify ApiGenericStreamSubscription type.
The removed alternative is a subtype of NeverSubscribedStream and thus
already included.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-20 14:46:32 -07:00
Lauryn Menard 137f4fccde billing: Highlight manual license management errors for admins.
In the billing portal UI for manual license management, limit
decreasing the number of licenses for the next billing period to
be less than the currently used licenses. If the customer is exempt
from license number checks, then this limit is not applied.

Also, visually highlight manual license management errors so that
the billing admin is aware of potential issues.

As of these changes, current licenses can be under the seat count
when a guest user is changed to a non-guest user. And next billing
period licenses can be under the seat cout when a user joins with a
currently available, purchased license after a billing admin has
decreased the number of licenses set for the next billing period.
2024-09-20 12:02:39 -07:00
Lauryn Menard 900a7fa3ac billing: Remove settings tab from billing urls.
In commit 89003dcb25, we removed the tabs from the billing page.
2024-09-20 12:02:39 -07:00
Aman Agrawal ea4e48afa7 filter: Add function to check if we can show the next unread button.
These function will be used when we add `Next unread conversation`
button below message list.
2024-09-20 11:54:18 -07:00
Aman Agrawal 0fb63eeddf filter: Rename local variable.
`term_types` is consistently used to store return value of
sorted_term_types in the file.
2024-09-20 11:54:18 -07:00
Aman Agrawal 56d4bad92b filter: Fix filter variable not updated as per new terms. 2024-09-20 11:54:18 -07:00
Karl Stolley 3d875bd140 integration_events: Restore checkbox in events modal. 2024-09-20 11:53:01 -07:00
Aman Agrawal a35c8a08de message_edit: Attach keydown to $form instead of textarea.
This allows any event handlers that are attached to textarea
like typeahead to handle the keypress and stop propagation if
they successfully handle it.

This fixes a bug where message edit form gets saved on enter keypress
instead of selecting the active item in the message edit typeahead.

Introduced in 0696e234bd.
2024-09-20 09:50:38 -07:00
Inge ffbf2aaaff right-sidebar: Others collapsed by default
"Others" will on default be collapsed. If it is expanded it will be preserved when switching view.

Fixes #31628
2024-09-20 09:09:03 -07:00
Sayam Samal 19c29af4bb icons: Cleanup redundant `.fa-group` related styling.
This also fixes the opacity of the `.zulip-icon-triple-users` icon in
the recent view.
2024-09-20 09:07:05 -07:00
Sayam Samal 030f93595e icons: Replace previous bot icon with new single antenna bot icon.
Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2024-09-20 09:07:05 -07:00
evykassirer 3e2efc736c stream_data: Add test cases for getting stream id from slug. 2024-09-19 19:52:18 -07:00
evykassirer 50b43421f1 search: Hide outline unless focus-visible.
Followup to https://github.com/zulip/zulip/pull/31647#discussion_r1767352535
2024-09-19 19:51:43 -07:00
Karl Stolley d73044ee57 compose: Decouple compose buttons from button classes.
In the 2024 redesigned button configurations, the compose buttons
become outliers. This retains their previous style inherited from
.button, allowing that base component class to move forward.
2024-09-19 16:16:11 -07:00
evykassirer 5ddcbb8516 buddy_list: Show offline subscribed users for small channels in big orgs.
Previously, for big orgs, we hid all offline users in the buddy list to cut down
its size. But this can be weird for small channels where you might want to see
who's in the channel. This commit makes a tweak to show offline users in big
orgs for channels of size <= 50.
2024-09-19 15:43:28 -07:00
Tim Abbott 9dd8de64a9 message_list: Add should_trigger_message_selected_event to type. 2024-09-19 15:43:28 -07:00
evykassirer deb5d90941 message_list: Convert module to typescript. 2024-09-19 15:31:16 -07:00
evykassirer 620db3057b message_list: Fix bug accessing filter incorrectly.
I checked this with Aman who wrote this originally, and he said
this is what he meant to write.
2024-09-19 15:31:16 -07:00
evykassirer c9f49cefdd message_list: Remove unused preserve_rendered_state attribute.
Aman said  we should be running this even if it wasn’t running before.
https://github.com/zulip/zulip/pull/31591#pullrequestreview-2300886181
2024-09-19 15:31:16 -07:00
Aman Agrawal fd441fd3d3 hashchange: Extract function to get home view hash. 2024-09-19 13:50:47 -07:00
Aman Agrawal 02f84bda34 message_list: Avoid recursive calls to message_selected event.
Note that even though we no longer trigger message selection
events from within the rerender calls with their different `opts`,
it doesn't effect the scroll position and selected id since
the events are triggered synchronously and the final message
selection event call has the opts of the initial caller.
2024-09-19 13:20:49 -07:00
Alex Vandiver 94dad72b75 upload: Use @uppy/tus to upload files through tusd.
Replace the XHRUpload plugin for Uppy with the Tus plugin, to make use
of the new tusd endpoint.  This allows for resumable files, as well as
files which are larger than comfortably fit in memory (the source of
the old 25MB limit).

MAX_FILE_UPLOAD_SIZE is still applied, but can safely be raised above
25MB.

Fixes: #9391.

Co-authored-by: Brijmohan Siyag <brijsiyag@gmail.com>
2024-09-19 11:37:29 -07:00
evykassirer 56adeb335f search: Fix cutoff focus outline. 2024-09-19 10:50:21 -07:00
Sahil Batra 1f16c0fdb7 popovers: Increase contrast of deactivated information text.
This commit increases the contrast for "This user has been deactivated"
text in user popover and "This group has been deactivated" text in
group popover in both light and dark mode by making the opacity 1 as
this is important information and should be clearly visible.

The text color and opacity matches with the role text shown in user
popover.
2024-09-19 10:50:02 -07:00
Sayam Samal 4ed27a9a5f tooltips: Fix hotkey hints wrapping when next to longer tooltip labels.
Earlier, mostly in non-English languages, the tooltip labels would
force the tooltip hotkey hints to wrap. This commit adds the
`white-space: nowrap` property to ensure that the hotkey hint texts
are forced to be in a single line.
2024-09-19 10:49:15 -07:00
evykassirer 86564381cf message_view_header: Rename current_stream to more accurate current_sub. 2024-09-19 10:06:57 -07:00
Sahil Batra 63a7c9061b settings: Use new pills UI for can_manage_group setting.
This UI enables the user to set can_manage_group setting to a
combination of users and groups, replacing the old dropdown UI
which just allowed setting user to a single system group.

Fixes part of #28808.
2024-09-19 09:08:33 -07:00
Sahil Batra 8068b6e55e group_setting_pill: Add code for showing typeahead.
This commit adds code to show typeahead for group setting
pill container. We add a separate function as we only
want to show groups and users in the typeahead and the
options are also sorted in a different order compared
to other typeaheads.
2024-09-19 09:08:33 -07:00
Sahil Batra 053686669a composebox_typeahead: Use query_matches_group_name to match group.
Though we can use query_matches_name for groups as we do not allow
system groups in the composebox typeahead and the other groups have
same display_name and name values, but still would be better for
consistency.

And with this change, query_matches_name function is only used for
streams, so updated that accordingly.
2024-09-19 09:08:33 -07:00
Sahil Batra def78ddf09 user_groups: Do not show "role:" prefix for system groups.
Instead of showing the actual names like "role:everyone",
"role:moderators", etc. for system groups, we show
"Everyone", "Moderators", etc. for system user group in
pills, typeaheads and popovers.

Though system groups are not shown in typeahead as of
this commit, we update the typeahead code as well to
not conside "role:" prefix while matching with the
query as we would soon show system groups in typeahead
when we would add new UI for group-based settings.

Previously, only "role:everyone" group was shown as
"Everyone" in popover and pills but for other system
groups their original names for shown and this commit
changes that behavior to be same for all system groups.

The original display_name field for
settings_config.system_user_groups_list objects, which
was used for dropdown widgets, is also renamed so that
we can use display_name field for the names to be used
in other places.
2024-09-19 09:08:33 -07:00
Sahil Batra 2fff124ec9 settings: Add new module to handle pills for group settings.
This commit creates a new module similar to add_subscribers_pill
for handling the pill widget to be used for group settings.
2024-09-19 09:08:33 -07:00
Anders Kaseorg 2c8ad219b1 styles: Fix invalid CSS generated due to @extend misusage.
@extend can only be used in an element selector, not directly within
@media.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:33:28 -07:00
Anders Kaseorg dc6ba1c9e2 localstorage: Remove unused expiry feature.
This was introduced by commit 8b22b94ab1
with no actual cleanup mechanism, and has never been used.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:32:07 -07:00
Anders Kaseorg 97ffccb45f reload: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:31:41 -07:00
Anders Kaseorg 0be5cc232c reload: Remove obsolete location.reload(true) usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:31:41 -07:00
Anders Kaseorg 16d37eb80a tests: Call reload.is_stale_refresh_token correctly.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:31:41 -07:00
Karl Stolley c3b13654a7 left_sidebar: Ensure brackets are not shown while zoomed in. 2024-09-18 15:29:20 -07:00
Sahil Batra 5f3a8334be user_groups: Do not allow deleting user groups. 2024-09-18 13:41:13 -07:00
Sahil Batra 6a739e263f user_groups: Allow deactivating groups from webapp. 2024-09-18 13:41:13 -07:00
Sahil Batra c53563d0e7 user_groups: Handle deactivated groups in webapp. 2024-09-18 13:41:13 -07:00
Anders Kaseorg 782fa2a803 localstorage: Fix removeDataRegexWithCondition to check parsed data.
Commit bca41fd29f (#23028) introduced
this for reload.is_stale_refresh_token, which had always returned true
because it was operating on the raw JSON string rather than the parsed
data.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 13:16:25 -07:00
evykassirer dba1af84e0 filter: Use stream id instead of stream name. 2024-09-18 13:08:14 -07:00
evykassirer 2be181c367 stream_data: Check for null more explicitly.
Otherwise 0 is treated specially, different from other numbers.
2024-09-18 13:08:14 -07:00
evykassirer 2ad1dc7014 stream_data: Make slug regex a bit more readable.
This clarifies that the second group is purely for use internal
to the regexp (it's there for the ? to act on) and won't be saved
as a substring for the surrounding code to look at (like match[2]).
In a hot path that could be a performance savings; here it just
makes things a bit more explicit for the reader.
2024-09-18 13:08:14 -07:00
Sahil Batra 7a6135371e settings: Handle guests separately for group-based settings.
This commit adds code to handle guests separately for group
based settings, where guest will only have permission if
that particular setting can be set to "role:everyone" group
even if the guest user is part of the group which is used
for that setting. This is to make sure that guests do not
get permissions for actions that we generally do not want
guests to have.

Currently the guests do not have permission for most of them
except for "Who can delete any message", where guest could
delete a message if the setting was set to a user defined
group with guest being its member. But this commit still
update the code to use the new function for all the settings
as we want to have a consistent pattern of how to check whether
a user has permission for group-based settings.
2024-09-18 11:51:11 -07:00
sujal shah fcbb1cd558 todo_widget: Add `type`` as Optional in `new_task_inbound_data_schema`.
This commit corrects the `type` parameter in
`new_task_inbound_data_schema`, which was previously optional
but not added as such.
2024-09-18 10:06:00 -07:00
evykassirer 13e3ced486 message edit: Fix bug preventing messages from being edited.
More context in this thread on CZO:
https://chat.zulip.org/#narrow/stream/9-issues/topic/Blueslip.20error.20on.20editing.20a.20message/near/1943476
2024-09-17 15:50:33 -07:00
Karl Stolley 708d07a885 lightbox: Address edge case where media may be unavailable. 2024-09-17 11:55:18 -07:00
Karl Stolley ead6f29200 lightbox: Restore centered media list. 2024-09-17 11:55:18 -07:00
Aman Agrawal 5e084a2128 message_view: Fix load_local_messages called without superset_data.
This was missed in the migration that happend in #31326.

Fixes error when pressing `Home` button in message list.
2024-09-17 09:14:36 -07:00
Sahil Batra ccddbba7a3 user_groups: Extract code to check system groups allowed for setting. 2024-09-16 16:28:52 -07:00
Sahil Batra 5fda195eab user_groups: Refactor function to get groups to be used for settings.
This commit refactors the code to get groups to be used for settings
as we would now have two UIs for settings for some time - dropdown
widget and pills, so we can just have a single function which just
returns the valid UserGroup objects and then a separate function to
get the appropriate format to be used for dropdown widgets and pills.
2024-09-16 16:28:52 -07:00
Sahil Batra 6482f0c2ea user_groups: Pass correct group object for adding new group to UI.
We previously passed the UserGroupRaw type object received in
the user group creation event to user_group_edit.add_group_to_table
instead of the UserGroup type object.

The add_group_to_table function is called after receiving creation
event only, but other functions called later in the flow are called
at other times as well like when opening edit panel for a particular
group and they expect UserGroup type object, so this commit fixes it.
2024-09-16 16:28:52 -07:00
Sahil Batra f3fafc719f settings: Add function to check permission for anonymous setting group. 2024-09-16 16:28:52 -07:00
Sahil Batra ffeb542b22 settings_components: Remove unnecessary toString calls.
The value for which the toString is called is already a string, so
there is no need to call it. It would have been added to make sure
that linter does not complain, so added an assert statement for it.
2024-09-16 16:28:52 -07:00
Prakhar Pratyush 764083d31b settings: Add 'allow_private_data_export' user setting.
This commit adds a user-setting to allow users to decide
whether to let administrators export their private data.

Fixes part of #31201.
2024-09-16 15:48:40 -07:00
Karl Stolley da91ebc592 checkboxes: Render border-color-matched SVGs in light and dark modes.
This obviates the need for the buggy use of a brightness filter,
which causes rendering problems on iOS devices and possibly others.
2024-09-16 15:43:47 -07:00
Karl Stolley 8741c9e43f dark_mode: Introduce higher-contrast, opaque text.
Fixes: #31615
2024-09-16 15:43:47 -07:00
Sayam Samal b8d4bddacf echo: Fix handling of `locally_echoed` flag after successful msg resend.
The `on_success` function within `echo.resend_message` is executed when
the server successfully acknowledges a resent message. In this scenario,
the `locally_echoed` flag should be set to false, as the message has
been confirmed by the server.

This behavior is already correctly handled within the
`echo.reify_message_id()` function, which is triggered through the
`compose.send_message_success()` flow.

However, the on_success function incorrectly sets the `locally_echoed`
flag to true, which is unnecessary and likely a mistake. This led to
the bug where message controls would disappear from the resent messages
on slow networks.

This commit removes the erroneous line to ensure proper flag handling
during message resend.
2024-09-16 13:06:30 -07:00
Sayam Samal 5583ddd3bf echo: Update message controls dynamically for failed messages.
Previously, the message controls for failed messages was present for
all messages, regardless of their status, and was being rendered
unconditionally; only being hidden for successfully sent messages.

This commit adds dynamic rendering for the failed message controls,
only rendering them via the handlebars template when a message is
confirmed to be failed.

Fixes #31132.
2024-09-16 13:06:30 -07:00
sujal shah 614caf111e user_groups: Add `creator` and `date_created` field in user groups.
This commit introduced 'creator' and 'date_created'
fields in user groups, allowing users to view who
created the groups and when.

Both fields can be null for groups without creator data.
2024-09-13 18:44:58 -07:00
sujal shah 3b69f2e5d9 stream_settings: Extract `creator_detail` section.
Extract display_pill and date code to separate
'creator_detail.hbs' file.
Rename 'stream_creator_details' to 'creator_details'.
2024-09-13 18:44:58 -07:00
opmkumar d4b1d0a68e stream_data: Add can_edit_description function.
Added can_edit_description function in stream_data to check if the user has permission to edit the description of the stream.
2024-09-13 15:51:39 -07:00
Lauryn Menard f31371969d integration-docs: Limit client-side error reporting to 40x errors. 2024-09-13 08:56:03 -07:00
evykassirer ed42e971ed search: Switch to pressing tab able to select typeahead item.
By request:
https://chat.zulip.org/#narrow/stream/9-issues/topic/search.3A.20press.20tab.20to.20select.20item.20in.20autocomplete/near/1936714
2024-09-12 09:46:34 -07:00
Vector73 0cd51f2fea settings: Remove `delete_own_message_policy` realm property.
Removed `delete_own_message_policy` realm property as the permission
to delete own messages is controlled by `can_delete_own_message_group`
setting.
2024-09-12 09:36:02 -07:00
Vector73 28c7a04734 settings: Add `can_delete_own_message_group` realm setting.
Added `can_delete_message_group` realm setting to replace
`delete_own_message_policy` property.
2024-09-12 09:36:02 -07:00
evykassirer 26da3300ec message_list_view: Remove undefined option for two parameters. 2024-09-12 09:34:29 -07:00
evykassirer d0c63be9be message_list_view: Add TODO for followup for later.
From comments from #31576.
2024-09-12 09:34:29 -07:00
evykassirer c19b3b0826 message_list_view: Simplify type of mention_classname. 2024-09-12 09:34:29 -07:00
evykassirer 0c4186d91f message_list_view: Use more specific type for message_id_to_focus. 2024-09-12 09:34:29 -07:00
evykassirer 93d8db11bf message_list_view: Change moved and modified to pure booleans, not optional. 2024-09-12 09:34:29 -07:00
evykassirer 97705efb5a message_list_view: Remove unused edited_* vars. 2024-09-12 09:34:29 -07:00
evykassirer 09de447dd9 message_list_view: Move relevant types to module. 2024-09-11 14:59:31 -07:00
evykassirer e41e365085 message_list_view: Convert module to typescript. 2024-09-11 14:59:31 -07:00
evykassirer bf64ac7918 message_list_view: Create group and message container all at once.
To be able to convert this module to typescript, we can't create
these objects iteratively, we have to collect the property values
and create it all at once. Partially formed objects aren't very
easy to type.
2024-09-11 14:59:31 -07:00
evykassirer e65bf5cbe2 message_list_view: Set up new group in start_group function.
This will make the upcoming refactor a bit easier to read.
2024-09-11 14:59:31 -07:00
evykassirer 22d2111130 message_list_view: Check message type instead of stream_id. 2024-09-11 14:59:31 -07:00
evykassirer 1ff5bc0fca message_list_view: Remove stale reference to rerender_messages. 2024-09-11 14:59:31 -07:00
Karl Stolley 554221e3c8 cleanup: Remove structural .new-style references. 2024-09-11 14:22:45 -07:00
Karl Stolley d91321a2c4 cleanup: Remove singleton .new-style class refs. 2024-09-11 14:22:45 -07:00
Karl Stolley 7b7e21384f cleanup: Remove remaining CSS, JS .new-style references. 2024-09-11 14:22:45 -07:00
Karl Stolley c43aaed37c settings: Leverage .settings_text_input class. 2024-09-11 14:22:45 -07:00
Karl Stolley a0fc663490 todo_widget: Replicate necessary checkbox styles. 2024-09-11 14:22:45 -07:00