Commit Graph

14797 Commits

Author SHA1 Message Date
Alex Vandiver e0a7658db7 ts: Pull in static assets via import. 2023-02-14 17:17:06 -05:00
Alex Vandiver ea2a0a7632 js: Pull in static assets via import. 2023-02-14 17:17:06 -05:00
Alex Vandiver 1f47d7793d landing-page: Stop relying on image paths. 2023-02-14 17:17:06 -05:00
Alex Vandiver 10b1e11410 styles: Remove unnecessary ../static/ in image path. 2023-02-14 17:17:06 -05:00
Alex Vandiver ab9f974f48 emoji_settings: Stop using the avatar as placeholder; it is never seen.
The design of this element was changed midway through #22504, and
despite a separate placeholder icon using used, the preview was still
reset to the default avatar -- but is always hidden when so set.
2023-02-14 17:17:06 -05:00
Anders Kaseorg 4cd847ac44 styles: Fix horizontal SimpleBar height for SimpleBar 6.
030b89b94e

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-13 15:45:12 -08:00
David Rosa 2b9b0acaa4 help: Update URL references to new "Configure email visibility" page. 2023-02-10 18:15:56 -08:00
Sahil Batra 9d1dc20e6e settings: Remove realm-level email_address_visibility setting.
This was replaced by the new user-level version in recent commits.

Fixes #20035.
Fixes #18149.
2023-02-10 17:40:33 -08:00
Sahil Batra f4065b587b settings: Add dropdown for email_address_visibility setting.
This commit adds dropdown for user-level and realm-level
default of email address visibility setting.
2023-02-10 17:35:50 -08:00
Sahil Batra b84885184e settings: Use user-level email_address_visibility setting in UI.
This commit basically updates the frontend code to directly use
delivery_email field instead of functions like show_email or
email_for_user_settings at places where we want to show email.
We can do this change since we recently updated the server code
to always pass "delivery_email" code in the user objects with its
value being null if the real email is not accessible.

Showing email or "hidden" or nothing at various places in UI like
in users list, subscriber list, user profile popover and modal is
same as before.

Major points -

- Removed show_email and email_for_user_settings functions since we
directly use delivery_email field now as explained above.

- While sorting by emails in the users list, users with real emails
hidden are always shown in last when sorting alphabetically and at
the top when sorting reverse alphabetically. Also, those users with
real emails hidden, are sorted by name among themselves. As we did
before, we do not allow sorting by email when all emails are hidden.

- There is no change in typeahead behavior at this point. We either
hide the email completely or show the real or fake email based on
user level setting.

- Added code to handle delivery_email events and appropriately add/remove
delivery_email field from person objects.
2023-02-10 17:35:50 -08:00
Ujjawal Modi a2bcf3a77c css: Use span rather than div for status_emoji elements.
These being possibly `display: block` in some settings resulted in
them taking up visible space oddly if the asset failed to load.

tabbott could not reproduce the original bug, perhaps because changes
in the emoji CSS do `display: inline-block` on div.emoji, but the
logical intent for this component suggests it should be a span in any
case.

Fixes #23516.
2023-02-10 17:29:24 -08:00
Tim Abbott 29c6b4b9f2 recent topics: Fix exception displaying PMs with 5+ senders.
The previous logic incorrectly tried to map elements of the list of
user IDs beyond 4 senders to their `.id` fields, which were undefined;
the correct thing to do is just use the list of user IDs that we
already have.
2023-02-10 17:16:20 -08:00
Aman Agrawal 39255a5ed0 portico_signin: Fix content wrapping too much.
Due to `max-width: min-content` being used and `min-width: max-content`
not being applied since it is not present outside of development
environment, the text wrapped after every word.

The intention of this CSS was to restrict the max-width of the
`white-box` and I think 800px is a good max-width after which
content should wrap.
2023-02-10 15:58:04 -08:00
David Rosa 3254023fa3 help: Update URLs to match "Restrict message editing and deletion" title.
Updates all references to the new URL and adds a URL redirect.

Follow up to #24329.
2023-02-10 15:56:16 -08:00
Lauryn Menard 1ddc27d91b pm-list-data: Remove unused `is_all_privates` function.
In commit 6f9e97921, the last use of `pm_list_data.is_all_privates`
was removed when we restructured how private messages are shown
in the left sidebar. Removes the function since it is now no longer
relevant.
2023-02-10 10:38:55 -08:00
Zixuan James Li 53aa3f6c71 typeahead: Add typescript type definitions for typeahead.
This allows us to import typeahead from people.ts with types. This is
possible since #22586 was merged.

And since "sort_emojis" is always supposed to be called with valid emoji
objects that have "reaction_type" with an optional "emoji_code", we add
a check before we see if the emoji is popular to avoid poking
popular_set with an undefined value.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-02-09 16:51:40 -08:00
Zixuan James Li 9808bdf1d3 typeahead: Ensure presence of is_realm_emoji.
The implementation of the emoji sorter relies on the presence of the
"is_realm_emoji" property. We want to be consistent with this
assumption.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-02-09 16:51:40 -08:00
Zixuan James Li 6e9079f876 typeahead: Remove is_unicode_emoji.
This avoids the type narrowing problem when we call "is_unicode_emoji"
on an emoji object and access "emoji.emoji_code", which might be
"undefined".

In places where these helpers are accessed, we expect that
"reaction_type" is always present so that we can later correctly type
narrow Emoji into UnicodeEmoji. This updates the test cases to
respect that.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-02-09 16:51:40 -08:00
Zixuan James Li 45fdfcd6d4 typeahead: Remove default value for triage.
"get_item"'s default value is not type-safe as we require its return
value to always be a "string". Note that since the mobile app does not
rely on this function directly, it is sufficient to only refactor the web
app for this transition.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-02-09 16:51:40 -08:00
evykassirer d91d3146ce compose banners: Lighten banner text in dark mode. 2023-02-09 15:45:10 -08:00
Anders Kaseorg 7eb2cffcb4 templates: Update comments referencing Mustache to Handlebars.
(We switched to Handlebars very early in commit
4793cee888431b41f0aaf5341e2d8c77a155e8b8.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-09 14:12:54 -08:00
Sahil Singh 4c4491cdcf design: Remove misaligned loading text on smaller devices.
The loading message that occurs at the top of the narrow when first
loading the Zulip app (posted to the right of the centered Z spinner)
looked misaligned on smaller screen devices.

We fix this by just removing the 'Loading...' message, since the text
was unnecessary to communicate the idea that we're loading content.

(The text was also missing translation tags).
2023-02-09 10:13:19 -08:00
Aman Agrawal 7dacbc934f recipient_bar: Add box shadow at top.
We add a box shadow at top of the recipient bar to hide message
text that are partially visible above the recipient bar. At 100%
zoom, this issue is not visible but it has been reported by a user
at 150% zoom.

Following this change we don't need to do change any of our JS
calculations since `y` position of header remains the same
and when determining if a header `is_sticky` that is the only
thing we verify.
2023-02-09 10:05:42 -08:00
Anders Kaseorg 9efbfa22f2 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-08 17:05:58 -08:00
Tim Abbott b9fc5da350 tooltips: Fix hotkey-hint CSS class reuse.
The "hotkey-hint" class name used internally in
d66f2d900f conflicted with the
preexisting class name for hotkey hints into popovers, introduced in
80ff3d8da5.

Given that the new class is for a styling of hotkey hints designed for
use in tooltips, it was a bad name anyway, so just rename it to
tooltip-hotkey-hint. We rename the related cluster of variable names
to match this.
2023-02-08 13:13:35 -08:00
N-Shar-ma d2ea65da10 compose: Clean code to fix `up` hotkey to edit previous message.
This is a follow up to 875ad8e implementing a better approach. We call
`cursor_at_start_of_whitespace_in_compose` from `focus_in_empty_compose`
itself if and when needed.
2023-02-08 12:51:38 -08:00
Sahil Batra 34fa712220 settings: Clarify message-delete-time-limit setting rule.
This commit adds note to the message-delete-time-limit
setting label that the time limit does not apply to
administrators.
2023-02-08 12:46:05 -08:00
Sahil Batra 2fcaf88305 message_edit: Add code to live-update inline-topic edit icon.
This commit adds code to live-update the inline-topic edit
icon on changing move_messages_within_stream_limit_seconds
or edit_topic_policy. We simply rerender the message list
as it becomes difficult to check for each recipient row
and update it because topic edit permission depends on
when the message was sent.

This also live-updates the resolve topic icon as it depends
on topic edit permission only.
2023-02-08 12:46:05 -08:00
Sahil Batra 2eb204f699 settings: Add move_messages_between_streams_limit_seconds element in UI.
This commit adds dropdown for move_messages_between_streams_limit_seconds
setting which is used to control for how long the user is allowed to
edit stream.
2023-02-08 12:46:05 -08:00
Sahil Batra 4378b1639d settings: Add move_messages_within_stream_limit_seconds element in UI.
This commit adds dropdown for move_messages_within_stream_limit_seconds
setting which is used to control for how long the user is allowed to
edit topic.
2023-02-08 12:46:05 -08:00
Sahil Batra 03df1c16f1 message_edit: Use move_messages_between_streams_limit_seconds in webapp.
This commit adds code to check time limit as per recently added
move_messages_between_streams_limit_seconds setting when moving
messages between streams in webapp. There is no time limit for
admins and moderators.

We add a new function "is_stream_editable" (similar to already
existing is_topic_editable function) to check whether user is
allowed to move message between streams.
2023-02-08 12:46:05 -08:00
Sahil Batra d514f2455f message_edit: Use move_messages_within_stream_limit_seconds in webapp.
We now use realm_move_messages_within_stream_limit_seconds setting in
webapp to check topic edit permission replacing the 3-day limit.
As was the case previously, there is no limit for admins and
moderators.
2023-02-08 12:46:05 -08:00
Sahil Batra ebafe541dc settings: Add live-update code for move_messages_between_streams_policy.
This commit adds code to update move_messages_between_streams_policy
in page_params dict and also call sync_realm_settings which updates
the setting element in UI.
2023-02-08 10:59:28 -08:00
Aman Agrawal 4dfe3d36e0 floating_recipient_bar: Replace with sticky header. 2023-02-07 16:25:39 -08:00
Aman Agrawal 00be770d38 css: Use variables for changed header height in smaller widths.
In addition to the benefit of using variables, this change makes
it more noticeable that the header has a different height on smaller
widths.
2023-02-07 16:25:39 -08:00
Aman Agrawal b7ea924876 css: Combine box-shadows for selected message.
There are no visual changes since we are replacing 4 single borders
with a single box.
2023-02-07 16:25:39 -08:00
Aman Agrawal 2be3cbc00e message_list_view: Remove wrong `$` prefix in message_viewport variable.
Since `message_viewport` library is not jQuery object, it should
not have `$` prefix before it.
2023-02-07 16:25:39 -08:00
Pranav2612000 c58f38dae3 compose: Show resolve topic banner only once per narrow.
Previously, when sending a message to a resolved topic, if you disissed
the 'You are sending a message to a resolved topic' banner, it would
reappear as soon as the user enters another character.

Fix this by showing the banner at most once per narrow. It does not
reappear if the user closes the banner and continues typing.  It will
only be shown again if the user closes compose, changes stream/topic,
sends a message or otherwise clears the compose box state.

We also remove the existing check for whether this banner is already
visible; this is essentially a more precise version of the same logic.

Fixes #24245.
2023-02-07 15:53:25 -08:00
N-Shar-ma 0e55b2aed9 unread: Show unread count for only 1:1 human PMs for right sidebar icon.
Uptil now, the right sidebar user list unread count included bot and group
PMs which sometimes resulted in the confusing state of the user list icon
indicating unread messages but on expanding the user list, no username
had a counter beside it, since the list only has individual human users.

Now this right sidebar unread count too excludes bots and groups, so the
unread count and the user list are consistent, without any ghost counts.
2023-02-07 15:38:32 -08:00
SameepAher 8efa3965fd css: Fix long name overflow in user profile modal.
Set width of the heading tag displaying user profile name heading, which
doesn't let the edit button get pushed off the user profile modal.

Ellipsis property is applied to user profile name on text overflow.

Fixes: #23781.
2023-02-07 15:36:51 -08:00
Palash Baderia 0ca5d11670 settings: Improve column widths in settings > uploaded files.
Changed the width of the file column to show the names properly,
while making sure that the table UI remains consistent in different
languages too (checked the same for Russian language).

Drop the file size column if the viewport is less than 992px (lg_min)
to ensure that the size word doesn't break when there are no uploaded files.
Discussed on CZO thread.

Changed the position of the Date uploaded arrow to stay visible
in all view ports and added word-break to prevent spill over of Mentioned-in
and date uploaded.

Fixes: #23738
2023-02-07 15:15:40 -08:00
m-e-l-u-h-a-n 8f29f81539 user groups: Fix incorrect checking for open groups overlay.
Overlays.js incorrectly checked for whether `#groups` overlay
was open, so it re-assigned the global `open_overlay_name`
variable. As a consequence unwanted bluslip errors were thrown
when closing the groups overlay after any group event was
received while the `#groups` overlay was open.
2023-02-07 15:12:56 -08:00
m-e-l-u-h-a-n 9d6cc8142b user groups: Add support for add_member and remove member events. 2023-02-07 15:12:56 -08:00
m-e-l-u-h-a-n 1f03042a48 user groups: Add support for removing user groups.
The new `#groups` overlay had no way for user groups to be deleted.
This commit adds UI support for removing user groups along with
adding support for live update of `#groups` overlay on remove
event for user groups.
2023-02-07 15:12:56 -08:00
m-e-l-u-h-a-n c0cd6f7f04 user groups: Add support for user group update event. 2023-02-07 15:12:56 -08:00
m-e-l-u-h-a-n 6147f2bd7a user groups: Add live update support for user_group add event.
We add live update support for user group events as part of
https://github.com/zulip/zulip/issues/19526.
This however has a few TODOs:
1. Deciding on how we want to sort the group list on left of
   #groups overlay.
2. How we highlight the newly created groups after it is added
   to the list.
These will be covered as we add support for more groups events.
2023-02-07 15:12:56 -08:00
Purushottam Tiwari fdd9f018ad user groups: Add `+` button to navigate to create user group. 2023-02-07 15:12:56 -08:00
Purushottam Tiwari 637bbf638e user groups: Enable remove button for user creating the user group. 2023-02-07 15:12:56 -08:00
Purushottam Tiwari 4a91bf8f5b user groups: Add margins to user group create alert info.
Since we do not currently have live update on newly
created ui for user group management, alert shown
after successful creation of user group apeared across
full width of right panel of #groups overlay. Which
made it look a bit awkward, so we add margins to that
alert info.
2023-02-07 15:12:56 -08:00
Aman Agrawal 7a8ddf90cd css: Remove focus outline on simplebar wrapper elements.
This removes the focus outline on `simplebar-content-wrapper` in
the left sidebar and other places in the app when focused since
it doesn't look visually nice.
2023-02-07 11:06:13 -08:00