Commit Graph

1278 Commits

Author SHA1 Message Date
Karl Stolley fad4429712 message_grid: Use baseline groups to align EDITED, time, etc. 2023-07-13 09:02:00 -07:00
Karl Stolley 93dba7f381 message_grid: Let the avatar participate in CSS Grid.
This also ensures that sender info flexes and participates
in the grid's baseline group.
2023-07-13 09:02:00 -07:00
Karl Stolley 1d1a2e3c75 message_grid: Add named grid areas to .messagebox-content. 2023-07-13 09:02:00 -07:00
Karl Stolley 2bbf357f0e message_grid: Remove positioning cruft.
Because the message box is a CSS Grid, its children elements do not
need to continue to use positioning properties removed in this
commit.
2023-07-13 09:02:00 -07:00
Karl Stolley 762934896a css: Consolidate .message_edit_notice in row file. 2023-07-13 09:02:00 -07:00
Tim Abbott 654fb18832 message_formatting: Use more work-focused /todo example.
Fixes #25780.
2023-07-12 17:01:25 -07:00
Satyam Bansal 0c656731ac message_formatting: Expand the tips list with additional suggestions.
Fixes #25780.
2023-07-12 12:17:04 -07:00
Satyam Bansal 18229f7e54 message_formatting: Remove some unnecessary tips.
Fixes part of #25780.
2023-07-12 12:17:04 -07:00
Satyam Bansal d364cfbfc1 message_formatting: Improve wording of a formatting tip.
Fixes part of #25780.
2023-07-12 12:17:04 -07:00
lapaz 6143466122 narrow: Hide inconsequential buttons while renaming topic.
Users won't press accidentally "mark topic as resolved" and
"mute this topic" buttons while renaming topic.

Fixes #25840.
2023-07-12 11:35:23 -07:00
nimish c238327899 settings: Change "Display settings" to "Preferences".
This includes changing the URL to #settings/preferences, with a
transparent redirect so that existing links, like the one from Welcome
Bot, continue to work.
2023-07-12 07:09:03 -07:00
Lalit a18b1662cb narrow: Cut dependency on `message_scroll.js` module. 2023-07-11 22:34:00 -07:00
Lalit a434523d1f search: Cut dependency on `narrow.js` module. 2023-07-11 22:34:00 -07:00
Lalit 452db76b24 reactions: Cut dependency on `emoji_picker.js`. 2023-07-11 22:33:59 -07:00
Lalit 65d49b5ad8 recent_topics_ui: Cut dependency on `muted_topics_ui.js`. 2023-07-11 22:33:59 -07:00
Lalit 9447381d03 echo: Cut dependency on `message_events.js`. 2023-07-11 22:33:59 -07:00
Satyam Bansal 9f1fcfb3a7 compose: Allow flatpickr to automatically choose the direction.
Previously the flatpickr was always set to show at the top but this
led to it being cut off when the message was at the top of the
screen -- should happen only when someone is editing a message.
2023-07-11 22:28:34 -07:00
Lalit 59e78f96ba
ts: Migrate people.js to TypeScript.
We use `get_by_user_id` instead of directly accessing the global dict, because
when accessing person objects directly from one of the global dicts we
need callers to check for undefined values, this can be fixed by using
`get_by_user_id` method to get person objects because that functions
makes sure to assert that we indeed have a valid user id, so it will
never return undefined values.

Co-authored-by: Zixuan James Li <p359101898@gmail.com>
2023-07-11 22:22:30 -07:00
Kartik Desai fcede32420 scheduled_messages: Store in a dictionary by ID.
This is the more natural and efficient data structure.

Fixes #25557.
2023-07-11 18:17:34 -07:00
Palash Baderia ef9645a509 message_feed: Improve edited/moved tooltip.
This commit improves the edited/moved tippy tooltip to now include a
second italic line: "Click to view history" This line is visible
only when 'realm_allow_edit_history' is true for any organization
settings. Additionally, the first line is changed to display
"Last edited today at 00:00 AM" The date is in lowercase if it
doesn't contain a number for example 'today' unless the first
alphabet is uppercase.

'tippy-zulip-delayed-tooltip' was used as a common class to
implement tippy tooltips in addition to other elements in the
'edited_notice.hbs' file. However, now we need to make some
changes in tippyjs inside the onShow function to decide whether
to show the second line of a tooltip or not. Therefore, we need
to use a unique class for the edited_notice tooltips. Hence, removed
the 'tippy-zulip-delayed-tooltip' class from the edited_notice.hbs
file and used the 'message_edit_notice' class instead.

Fixes: #23075
2023-07-11 17:33:06 -07:00
Lauryn Menard 561902b180 message-list-view: Update sticky header in rerender_messages.
When a message list view rerenders a locally echoed message the
message recipient header is also rerendered, which then removes
the "sticky_header" class if it was present. If rerendering the
message triggers a non-user initiated scroll event, then the
"sticky_header" class is updated.

But it is possible that the rerendering of the message will not
trigger a scroll event, which means the recipient header is no
longer updated and the next calculation for the message list
view's _scroll_limit for the top of the feed will not include the
sticky header and the currently selected message may be scrolled
partially or completely under the message header recipient bar.

In message_list_view.rerender_messages, adds a check, after calling
_rerender_header in a loop, for the current message list and calls
update_sticky_recipient_headers if the message feed is visible.

Adds a comment to _rerender_header that we expect it to only be
called in rerender_messages so that the "sticky_header" class is
updated if needed.
2023-07-11 14:20:19 -07:00
Sahil Batra 2e4f7f6336 user_groups: Remove "@" from name of role-based system groups.
This commit removes "@" from name of role-based system groups
since we have added a restricion on having user group names
starting with "@" in the previous commit as they look odd in
mention syntax.

We also add a migration in this commit to update the name of
role-based system groups in existing realms to remove "@"
from the name. This migration also updates the names of
non-system user groups by removing the invalid prefixes
from their names and if there is a group already with that
name, we insted name the group as "group:{group_id}".

Fixes #26148.
2023-07-11 13:46:02 -07:00
Aman Agrawal 445819e110 stream_data: Simplify compare code. 2023-07-11 13:37:50 -07:00
Aman Agrawal fcac413138 move_topic_to_stream: Migrate to use tippy dropdown widget. 2023-07-11 13:37:50 -07:00
Aman Agrawal 29b3769b59 stream_data: Extract function to get stream options for dropdown.
To be used by various dropdown widgets in the app.
2023-07-11 13:37:50 -07:00
Aman Agrawal 0024e88fcb css: Remove unused `float` property.
Ths is already alingned corrected using flex, so no need to use float.
2023-07-11 13:37:50 -07:00
xoldyckk a062a82f06 ts: Migrate setup.js to typescript.
Also added global type definition for `get_offset_to_window`
helper function.
2023-07-10 13:49:26 -07:00
xoldyckk 1584668dde jquery: Replace `safeOuterWidth` and `safeOuterHeight` functions.
Replaced all instances of `safeOuterWidth()` and `safeOuterHeight()`
methods from the codebase with the safe counterparts `outerWidth() ?? 0`
and `outerHeight() ?? 0`. Removed custom safeOuterWidth/safeOuterHeight
method definitions from global JQuery object instance.
2023-07-10 13:49:26 -07:00
Akshat d302ac4a18 message_view_header: Fix bad rendering of stream links in description.
This bad rendering was the result of unwanted css applied
in the stream description. In message view header, the stream
link (title) we have defined has css defined but the markdown
rendered stream link in stream description had the same class
resulting in unwanted css applied to it.

Fixes: #25961.

Signed-off-by: Akshat <akshat25iiit@gmail.com>
2023-07-10 13:47:22 -07:00
Sahil Batra f00dcf5674 billing: Fix licenses input in "Pay by invoice" section of upgrade page.
The bootstrap CSS was not re-added to the input for number of licenses
in "Pay by invoice" section of upgrade page while removing the bootstrap
CSS for "number" type inputs from bootstrap.css.

This commit fixes it by re-using the existing CSS for other number type
inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra f717aa99a0 bootstrap: Remove CSS for "text" type input elements.
This commit removes the CSS for "text" type input elements
from bootstrap.css as we have already added the required
CSS rules to the specific elements in their specific files.
2023-07-07 10:10:28 -07:00
Sahil Batra 5442bfb07c templates: Add filter_text_input class to inputs used for filtering.
This commit adds filter_text_input class to various search inputs
used across the app. This new class is used to re-add the bootstrap
CSS rules such that we can remove the CSS from bootstrap.css.
2023-07-07 10:10:28 -07:00
Sahil Batra f5208a7db6 settings: Re-add bootstrap CSS to custom time limit inputs.
This commit re-adds bootstrap CSS for custom time limit inputs
used by various settings by using more specific selector in
settings.css.

This is a prep commit for removing bootstrap CSS for text type
inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra aef557054e templates: Add settings_text_input class to various inputs.
This commit adds settings_text_input class to inputs in the
playground and linkifier panels, excluding the search inputs
as they are handled by filter_text_input class, and also to
the description input in the new user group creation form.

After adding this class, the bootstrap CSS rules to these
inputs are applied using the "settings_text_input" class.
2023-07-07 10:10:28 -07:00
Sahil Batra 96014c1123 settings: Re-add bootstrap CSS rules to ".settings_text_input" selector.
This commit re-adds bootstrap CSS rules to ".settings_text_input"
selector in settings.css and this helps in adding the bootstrap
CSS to text inputs used in settings.

This is a prep commit to remove bootstrap CSS for text type inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra 87fd7b3810 integrations: Re-add bootstrap CSS for search input.
This commit re-adds bootstrap CSS for search input in
integrations page using a more specific selector in
integrations.css. We also change the selector to use
a class name instead of "input".

This is a prep commit for removing bootstrap CSS for text type
inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra ec2826188b integrations_dev_panel: Re-add bootstrap CSS for text inputs.
This commit re-adds bootstrap CSS for text inputs in devtools
integrations page using a more specific selector in
integrations_dev_panel.css.

This is a prep commit for removing bootstrap CSS for text type
inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra 8ae71c8f90 email_log: Re-add boostrap CSS for text inputs.
This commit re-adds bootstrap CSS for the input
used to set the email to which emails will be
forwarded in the development environment "/emails"
page by using a more specific selector in
email_log.css.

This commit also increases the width of input to be
consistent with many other text type inputs and this
also helps in viewing the full placeholder text.

This is a prep commit for removing bootstrap CSS for
text type inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra 83e747d757 billing: Re-add bootstrap CSS for inputs in sponsorship page.
This commit re-adds bootstrap CSS for "Organization website"
input in sponsorship page using a more specific selector in
billing.css. This change is done by re-using the existing
CSS for number type inputs and also removes the height
property which is not required.

This is a prep commit for removing bootstrap CSS for text
type inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra 0454be5d26 activity: Re-add bootstrap CSS for inputs in realm details page.
This commit re-adds bootstrap CSS for text inputs in realm details
page by using a more specific selector in activity.css. The CSS
added for search input includes bootstrap CSS applied using
".search-query" and "input[type="text"]" selectors.

We remove the CSS for search-query CSS from bootstrap.css
as the search element in app navbar already overrides the
bootstrap CSS.

This is a prep commit for removing bootstrap CSS for text type
inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra f122c05b9c widgets: Re-add bootstrap CSS for text inputs in poll and todo widgets.
This commit re-adds bootstrap CSS for text inputs used in poll and
todo widgets by using a more specific selector in widgets.css.

This is a prep commit for removing bootstrap CSS for text type inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra 924879a049 css: Re-add bootstrap CSS for inline topic edit input.
This commit re-adds the required bootstrap CSS rules for inline
topic edit input to the specific selector in zulip.css.

This is a prep commit for removing bootstrap CSS for text type
inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra 918d00c2d4 search: Re-add bootstrap CSS for search input.
This commit re-adds required bootstrap CSS rules for
search box input element.

We also need to add the code to handle dark theme CSS
here to make sure the CSS for dark theme is prioritized
correctly.
2023-07-07 10:10:28 -07:00
Sahil Batra 1db5ebae53 invite: Re-add bootstrap CSS for custom expiration text input.
This commit re-adds bootstrap CSS for custom expiration time
input in invite modal.

We also need to add the code to handle dark theme CSS here to
make sure the CSS for dark theme is prioritized correctly.

This commit also refactors the CSS to modify the selectors to
be simple and remove unnecessary IDs.
2023-07-07 10:10:28 -07:00
Sahil Batra 04debf72df templates: Add modal_text_input class where it is missing.
This commit adds modal_text_input class to:

- Input for payload url in new bot form. We add
modal_text_input class as type attribute for it has
been set to "text".

- Inputs in old user group creation modal.

- Input in set status modal.

- Inputs in linkifier edit modal.

- Inputs for options for "List of options" type
custom profile field.

This change is needed as we would be removing the
bootstrap CSS for text inputs and further commits
and the required CSS is added to modal_text_input
class.
2023-07-07 10:10:28 -07:00
Sahil Batra b51bce7c90 bootstrap: Re-add bootstrap CSS for modal_text_input class.
This commit re-adds bootstrap CSS rules to ".modal_text_input"
selector in modal.css and this helps in adding the bootstrap
CSS to text inputs used in modals.

This is a prep commit to remove bootstrap CSS for text type inputs.
2023-07-07 10:10:28 -07:00
Sahil Batra 8c3421c7f4 settings: Remove unnecessary CSS.
There is no text type input element inside
"#service_name_list" element.
2023-07-07 10:10:28 -07:00
Aman Agrawal 233b486618 css: Use variable font when using Source Sans 3.
This is to overcome the limitations of previous static font,
which didn't allow us to use various font widths.
2023-07-06 17:57:37 -07:00
Aman Agrawal 8cea85523b landing_page: Set `hero-text` to have 400 font-weight.
In this context, bolder resolves to 400 font-weight, so we directly
use it so reduce complications.
2023-07-06 17:57:37 -07:00
Aman Agrawal bed6ca92ca portico: Remove unused class `landing-page`. 2023-07-06 17:57:37 -07:00
Aman Agrawal 503f4b9bfd css: Use 200 font weight for dropdown chevron-down icon.
`font-weight: lighter` converts here to `100` which converts 200
since that is what we support.
2023-07-06 17:57:37 -07:00
Aman Agrawal 5d1cd2d62f css: Use 200 font weight instead of 100.
We don't support 100 font weight, so it defaults to 200 which we
support.
2023-07-06 17:57:37 -07:00
Aman Agrawal 1557c4d112 css: Use 400 font weight instead of 500.
500 font weight defaults to 400 which is what we support.
2023-07-06 17:57:37 -07:00
Aman Agrawal ef4454ab7e css: Default 550 font weight to 600.
Since we support 600 font weight, 550 defaults to 600, so we
directly use it here.
2023-07-06 17:57:37 -07:00
Aman Agrawal 98ee387197 css: Use 700 font weight for 800 since they default to it.
We don't have 800 font weight available, so the font weight defaults
to 700, so we use it directly here to avoid any changes when
we convert to variable font.
2023-07-06 17:57:37 -07:00
Aman Agrawal b236902ec7 save_discard_widget_icon: Use 400 font-weight directly.
`Lighter` for this icon gets converted to 100 font weight, but the
visual difference starts to appear only after 500 font weight so,
we keep at 400 to begin with, which is what we support.
2023-07-06 17:57:37 -07:00
Daniil Fadeev 533f929591 upload: Delete Uppy files when message editing is canceled. 2023-07-06 17:48:22 -07:00
Daniil Fadeev c959ac5849 upload: Simplify the query for the "send_button". 2023-07-06 17:48:22 -07:00
evykassirer cbd4aad0a5 upload: Append file markdown to textarea when placeholder is missing.
Fixes #26037.
2023-07-06 17:46:51 -07:00
nicmar-8 362a63ea5d pill_typeahead: Remove bots in person picker custom profile fields.
In `user_pill.js` add parameter to allow for excluding bots
when getting the users for the pill typeahead.
For `custom_user_field` typeahead exclude bots by default.

Fixes #25092.
2023-07-06 16:32:08 -07:00
nicmar-8 f688dc4c85 people: Add new function `get_realm_active_human_users`.
There was no function to retrieve users while excluding bots,
this was needed to allow for typeahead user fields that require
to exclude bots from the autocomplete suggestions.

Fixes part of #25092.
2023-07-06 16:32:08 -07:00
nicmar-8 7be72e65e5 people: Rename get_active_human_ids function for clarity.
Rename `get_active_human_ids` to `get_realm_active_human_user_ids`
to better fit naming conventions and to be more clear about the
detail that it only includes active users.

Fixes part of #25092.
2023-07-06 16:32:08 -07:00
lapaz 87932e1eef compose: Show wildcard mentions according to policy.
Users are permitted to see  wildcard mentions for all/everyone
during message composition in large streams according to
`restrict wildcard mentions` policy.
Fixes #25429
2023-07-06 16:29:37 -07:00
Ganesh Pawar fff9b334ff default_streams: Convert inline form to modal.
Fixes #20838.
2023-07-06 16:24:44 -07:00
Ganesh Pawar e993140660 custom_profile_fields: Sort array numerically.
Javascript's `sort()` function sorts the array lexicographically.
2023-07-06 16:24:44 -07:00
Ganesh Pawar e38d4cb7dd dropdown_list_widget: Pass the event object to the `update` function. 2023-07-06 16:24:44 -07:00
Lalit ae6063807b ts: Convert `poll_data` to typescript.
Used zod schemas to validate inbound data types and removed some over
defensive code.
2023-07-06 16:21:52 -07:00
Lalit 3fb27c9b1c poll_data: Move `handler` class property inside the constructor.
Declares the `handler` property inside the class constructor and not
after the constructor to avoid eslint and typescript errors when we
convert this module to typescript.
2023-07-06 16:21:52 -07:00
Wladimir Ramos b80a205dbe
portico: Polish UI for portico pages copy-codeblock button.
* Add a Copy code tooltip.
* Add cursor pointer.
* Add a hover effect.
* Move variables to snake_case.

Fixes: #25962.
2023-07-06 16:18:59 -07:00
palashb01 4ce720f0da upload: Rename the switch case of close button to hide button.
With the previous commit, we now have two buttons. One button cancels
the upload, while the other simply hides the upload banner. This
commit renames the switch case inside upload.js so that instead of
'upload_banner_close_button', it is now called
'upload_banner_hide_button', which appears to be more aligned with
the actual functionality of the icon.
2023-07-06 16:11:09 -07:00
Palash Baderia 624fea2e8e upload_banner: Add a cancel button.
This commit adds a cancel button to the upload banner, replacing
the previous close icon. Now, the cancel button is used to cancel
the upload process, while the close icon is used to remove the
upload banner without interrupting the upload.

A new case has been added to the switch statement in the 'upload.js'
file to handle the functionality of hiding the banner called
'upload_banner_hide_button'.

Replaced the functionality of the 'compose_banner_close_banner' case
inside the switch statement with a new case called
'upload_banner_cancel_button'. The cancel button is now assigned
the selector 'upload_banner_cancel_button'.

`Cancel` button is only preset for banner which tracks
progress while a file is being uploaded.

To maintain consistency with other banners, the cancel button's
dimensions and color have been adjusted to match the style of other
buttons present in different banners.

Fixes: #21156
2023-07-06 16:11:09 -07:00
Ujjawal Modi a45853d313 streams: Warn when archiving a notification stream.
Archiving a user/stream notification stream disables
user/stream notifications.This commit adds a warning
that notifications will be disabled while archiving
any notification stream.

Fixes #22110.

Co-authored-by: Victor Fróes <71036803+vfroes21@users.noreply.github.com>
Co-authored-by: Isabella Carmo <isabella.carmo@hotmail.com>
2023-07-06 16:04:11 -07:00
Lalit 3b270ed159 popovers: Fix giphy being mocked but not used.
While running test for `popovers.js` we get warning that `giphy` is
mocked but never used.
This bug was introduced in #25676.
2023-07-06 10:34:40 -07:00
Aman Agrawal fa9fa9f7f2 stream_ui_updates: Check if sub/unsub button is rendered.
It might be possible that an event can come while we are in the
middle of rendering the stream settings overlay. This can cause
`hash_util.is_editing_stream(sub.stream_id)` to be `true` while
the `sub/unsub` button still hasn't been rendered yet.
2023-07-06 09:29:41 -07:00
Daniil Fadeev 9c675ce62d giphy: Migrate Giphy popover to Tippy. 2023-07-05 14:43:19 -07:00
Daniil Fadeev 4976655dda compose: Remove unused styles for `compose_gif_icon`. 2023-07-05 14:43:19 -07:00
Daniil Fadeev 37b9e96790 compose: Remove unused `hide` styles for `compose_control_button`.
We use the styles from `app_components.css`.
2023-07-05 14:43:19 -07:00
Lalit d44f7da1e1 dialog_widget: Remove redundant `preventDefault` calls.
Removes redundant `preventDefault` and `stopPropagation` calls for the
users of `dialog_widget.ts` module since we are already calling those
functions in the submit button click handler now.
2023-07-05 14:25:10 -07:00
Lalit d14caa8400 dialog_widget: Prevent default action when submitting the form.
We should prevent the default html behavior when submitting the forms
in the dialog_widgets to avoid reloading the whole page when the user
clicks the submit button.

Fixes: #26104
2023-07-05 14:25:10 -07:00
Joelute 086d6be8e2 unread_banner: Update all unread banners to an info/notice banner.
Previously, some unread banners were warning banners, but it made more sense
for all the unread banners to match and display as more of an info/notice
banners instead. This change matches all unread banners to be info/notice
banners.
2023-07-04 11:51:31 -07:00
Karl Stolley b98bae948c message_edit: Suppress message controls popover in edit views. 2023-07-03 21:51:20 -07:00
Karl Stolley 2508081a64 blueslip: Simplify expectOne error message.
This error is logged if there are 0 or 2+ elements, so the generic
language here is meant to cover both cases.
2023-07-03 21:50:38 -07:00
Sahil Batra e4dad94cba portico: Define variable for modal background color.
The CSS for modals uses "--color-background-color" to set
background color of modal. But the variable is defined in
zulip.css which is not available for portico pages and thus
the email visibility modal was not rendering as expected in
"Terms of service" page.

This commit defines the "--color-background-color" variable
in portico.css such that it is available for portico pages
as well.
2023-07-03 21:49:34 -07:00
Aman Agrawal 7b6d549604 compose_pm_pill: Fix `compose_recipient` being mocked but not used.
While running test for `compose_pm_pill` we get warning that
`compose_recipient` is mocked but never used.
This bug was introduced in #26052.
2023-07-03 21:48:58 -07:00
Aman Agrawal d547b838ac theme: Change recipient bar color and theme in the same paint.
`update_recipient_bar_background_color` changes in a paint
after change in theme without using `requestAnimationFrame` to
make sure they happen in the same paint..

Replaced `setTimeout` with `requestAnimationFrame` in
`server_events_dispatch` since `requestAnimationFrame` already
ensures that they happen in the next paint, assuming that was the
intention of `setTimeout` being preset there.
2023-07-03 21:47:45 -07:00
Lalit 1c8bf4f050 people: Make `get_by_user_id` type-safe.
We should make `get_by_user_id` type-safe in the sense that it's caller
should not expect undefined values and hence it's caller should not
need to validate the user ids.

To do this I extracted a method `maybe_get_user_by_id` which is
type-unsafe version of this function which will allow undefined values
and will behave exactly the same as the previous version. So the callers
which expects the undefined values from this function should use this
new function `maybe_get_user_by_id`.

Probably about half of these callers are implicitly iterating through
all users in the people.js data set and thus by construction should
never fail, but it's simpler to just convert all existing callers than
do that audit.
2023-07-02 16:57:16 -07:00
Lalit 9b0e7a3eae people: Add `make_user` helper function.
Made this function to avoid having incomplete `people` objects floating
around resulting in better type safety when using TypeScript. This function
has three required parameters - `user_id`, `email` and `full_name` and adds
default values to all other required properties.
2023-07-02 16:57:16 -07:00
Lalit 21ec6ff97f people: Extract `get_involved_people` function.
Also removed the `user_id` field in case of `stream` type messages in favor
of `id` field because it will help us to form a well-defined object for involved
people.
2023-07-02 16:57:16 -07:00
Lalit 5140b76f71 people: Use `location.origin` instead of just `location`.
Used `location.origin` instead of plain `location` because even though
passing just `location` is valid here and works because it has a
stringifier but still it will give us type error when we move this
module to TypeScript because of the expected `string` type here.
2023-07-02 16:57:16 -07:00
Anders Kaseorg 407c16fc77 eslint: Expand no-unused-vars check to all function parameters.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-02 16:16:38 -07:00
Sahil Batra 95f8ab1626 templates: Improve email confirmation page.
This commit updates the text on email confirmation page to
make it more clear what's going on and why the user needs
to check their email.

Fixes #25900.
2023-07-02 16:14:41 -07:00
Palash Baderia 987bbb641f message_feed: Fix edited notice to appear for disabled edit_history.
This commit fixes the bug where the edited notice is not displayed
for edited/moved messages when the edit_history is disabled for
the organization. However, this is incorrect because the edited
notice should still be shown for messages that are edited/moved,
even if the edit_history is disabled. This issue occurred because
the edit_history variable was not set in the message object when
the edit_history is disabled. Therefore, in this case, we check
for the availability of last_edit_timestr. If it is available, we
display the edited notice. Since we cannot determine if the message
was moved or edited, we show the edited notice for both cases.
2023-06-30 17:33:45 -07:00
Sahil Batra 632191b8c4 composebox_typeahead: Hide user groups from mention typeahead.
This commit adds code to hide the user groups which a user is
not allowed to mention from the mention typeahead.

Fixes a part of #25927.
2023-06-30 17:28:33 -07:00
Sahil Batra 767c2ebbe4 user_groups: Add can_mention_group_id field to user_group objects.
This commit adds can_mention_group_id field to user_group objects
in webapp.

Fixes a part of #25927.
2023-06-30 17:28:33 -07:00
Sahil Batra e6accb0ad9 user_groups: Add can_mention_group_id field to UserGroup objects.
This commit adds code to include can_mention_group_id field to
UserGroup objects passed with response of various endpoints
including "/register" endpoint and also in the group object
send with user group creation event.

Fixes a part of #25927.
2023-06-30 17:28:33 -07:00
evykassirer 9265954fd2 search: Fix bug where textarea placeholder text didn't update for DMs.
When c0e9e463fb was merged, the
placeholder text started updating *before* we updated the recipient
information, so it wasn't updating with correct data. This commit
fixes that by moving the onPillCreate() call below the update.
2023-06-30 12:20:26 -07:00
evykassirer 367030ebfe search: Stop disabling and enabling the search close button.
This is logic from 10 years ago (dbc4798594)
that is no longer relevant. It seems like we used to show the
search bar open all the time and only showed the buttons when
there was focus in the search bar. Now we close the search bar
when it's not being used, and no longer need to update button
visibility or disable the search close button.
2023-06-30 12:05:30 -07:00
Anders Kaseorg a07bdb3fdb recent_topics_data: Simplify .entries() loop to .values().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-06-29 15:54:40 -07:00
Karl Stolley 7f4fe7282f search: Adjust text in has: message suggestions. 2023-06-29 13:02:06 -07:00
Karl Stolley 0c55fb7e89 stream_settings: Fix scroll at max-height.
Simplebar seems unaware of the `max-height: 1000px` on
`.subscriptions-container`, and therefore does not properly provide
a scrollbar when it's needed.

This commit adds a `max-height` to the stream Simplebar container,
ensuring that otherwise hidden content that Simplebar believes to
be visible can be scrolled to.

Finally, rather than rely on magic numbers or math done in comments,
this commit establishes CSS variables for all relevant modal-element
heights, doing the math inline using CSS calc().

Fixes #26107.
2023-06-29 11:19:01 -07:00
Lalit 1676d0b638 settings_emoji: Fix file upload bug in upload emoji modal.
Before this commit if a user pressed enter to submit the add emoji form
the uploaded emoji was getting cleared.

This was happening because when we pressed enter the browser tried to
submit the form, because we had two buttons inside that form one for
clearing uploaded emoji and one for uploading emoji they were being
treated as "submit" button and hence their callback ran which in result
was responsible for the bug.

Fixed this by explicitly setting the `type` attribute for those buttons
to `type=button` so that they will not be treated as "submit" button.
Also added the `form_id` option for `dialog_widget` which is needed if
we do want to correctly submit the form by pressing enter.

Fixes: #24972
2023-06-29 10:16:28 -07:00
Lauryn Menard 0d1c43d1d9 server-events: Remove unused home_view_loaded.zulip event trigger.
In commit 92ad988144, we removed the local echo code that tried
to re-render locally echoed messages that were rendered right before
a server/browser restart. These changes removed the only event
triggered by `"home_view_loaded.zulip"`.

This removes the remaining `"home_view_loaded.zulip"` event trigger
in web/src/server_events.js since it no longer triggers any events.
2023-06-27 18:04:04 -07:00
evykassirer c4de46d910 navbar: Fix background-color inconsistency in dark theme. 2023-06-27 11:28:49 -07:00
Daniil Fadeev 74c8852233 giphy: Set focus to the query input after clearing it.
These changes improve keyboard navigation in the Giphy popover.

Fixes: #26096.
2023-06-27 11:06:28 -07:00
Lauryn Menard 0d16683c5f rendered-markdown: Update reference to "private message" in comment.
Updates a code comment to use "direct message" instead of "private
message".
2023-06-27 11:03:17 -07:00
Evy Kassirer adcf088740
filter: Rename describe to search_description_as_html.
Changing this since wobbly naming on HTML variables is dangerous.
2023-06-26 11:11:17 -07:00
Lauryn Menard c8b04fc562 web-shared: Update references to "private message" and "PM".
Updates any use of "private message" and "PM" in the `web/shared`
directory to instead use "direct messages".
2023-06-26 11:07:28 -07:00
Lauryn Menard 85096cfb4d web-styles: Update references to "private message" and "PM".
Updates any use of "private message" and "PM" in the `web/styles`
directory to instead use "direct messages".
2023-06-26 11:07:28 -07:00
Lauryn Menard 73e5812831 node-tests: Update references to "private message" and "PM".
Updates any use of "private message" and "PM" in the `web/tests`
directory to instead use "direct messages".
2023-06-26 11:07:28 -07:00
Lauryn Menard 7c47616ffa web-e2e-tests: Update references to "private message" and "PM".
Updates any use of "private message" and "PM" in the `web/e2e-tests`
directory to instead use "direct messages" or "DM".
2023-06-26 11:07:28 -07:00
Lauryn Menard 4d3d9bcefa web-src: Update comments with "private message" or "PM".
Updates comments in files the `web/src` directory to use "direct
message" instead of "private message" or "PM".
2023-06-26 11:07:28 -07:00
Lauryn Menard 5be0f80135 recent-topics-ui: Rename constant for direct message columns.
Renames constant for the number of direct message columms from
`MAX_SELECTABLE_PM_COLS` to `MAX_SELECTABLE_DIRECT_MESSAGE_COLS`.
2023-06-26 11:07:28 -07:00
Lauryn Menard 842623c294 unread: Update class name for unread direct message counter.
Renames the class name in `web/src/unread.js` from `UnreadPMCounter`
to `UnreadDirectMessageCounter` and renames the associated instance
of `unread_pm_counter` to `unread_direct_message_counter`.
2023-06-26 11:07:28 -07:00
Lauryn Menard 4b2b278a53 dm-conversations: Update direct message data structure name.
Updates data structure class name in `web/src/pm_conversations.js`
from `RecentPrivateMessages` to `RecentDirectMessages`.
2023-06-26 11:07:28 -07:00
Lauryn Menard 3c6d283aa9 compose-actions: Update trigger for composing a new direct message.
Updates the trigger in the compose box from "new private message"
to "new direct message".
2023-06-26 11:07:28 -07:00
Zixuan James Li dd3fad4b30 mute users: Remove leftover check for muting bot users.
This was missed in #26005. The user popover button does not appear
for bot users. We complete the TODO here and simplify the
calculation for show_manage_menu so that we always show it if not in
spectator view and not showing the popover for self.
2023-06-26 11:01:40 -07:00
evykassirer 87649ddbab condense: Replace $.fn.height with using the DOM API.
This increases performance by at least 10x. See discussion
on CZO for more details:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/resize.20undo.20redo.20condense/near/1581598
2023-06-26 10:59:53 -07:00
evykassirer ca6e93ac7d condense: Remove _message_content_height_cache.
Since `scrollHeight` is very quick, we don't need
the cache anymore, and the code is easier to reason
about without it.

Profiling checks described on CZO here:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/resize.20undo.20redo.20condense/near/1581520
2023-06-26 10:59:53 -07:00
evykassirer 43b18eabf1 condense: Avoid layout thrashing.
More information on layout thrashing
[here](https://web.dev/avoid-large-complex-layouts-and-layout-thrashing/#avoid-layout-thrashing).
2023-06-26 10:59:53 -07:00
evykassirer 8d0fa236c8 more/less: Fix bug where messages rapidly condense and uncondense.
This commit changes a few things:

* Using `scrollHeight` instead of `offsetHeight`, which explicitly
  also measures content not visible on the screen due to overflow.
* Measures the height of `.message_content` which is the div with
  the full message height.
* Only resizes messages that are visible on the screen, i.e. only
  those in `message_lists.current`.
2023-06-26 10:59:53 -07:00
Karl Stolley d6c21c2237 docs: Correct scope of copied material from copy button.
This traverses the DOM to the <pre> element containing the
copyable material of interest.

The button is attached to the .codehilite element to ensure
that the button does not move with horizontally-scrolling
code content that exceeds the width of the content column,
as happens frequently at mobile scales or for very long
lines of content.

Fixes #26093.
2023-06-24 07:51:54 -07:00
David Rosa 0e0512df92 widgets: Rename confusing variable name in `tabbed_instructions.ts`.
The `tabbed_instructions` widget used for both language toggles in our
API documentation and app toggles in our Help Center documentation
misleadingly calls the identifier for the tab `language` in local
variables and its interface.

- Renames local variables `language` -> `tab_key`.
- Renames HTML data attributes `data-language` -> `data-tab-key`.

Fixes #24669.
2023-06-24 07:47:25 -07:00
Karl Stolley a9bc5e94e7 bot_icon: Adjust bot-icon color for light and dark modes. 2023-06-23 14:43:22 -07:00
tyler ed1431f1bd gear_menu: Rename tooltip to reflect name change from 'Menu' to 'Main menu'. 2023-06-23 14:42:34 -07:00
tyler 0ce0995e49 gear_menu: Add accessibility label to gear menu toggle. 2023-06-23 14:42:34 -07:00
evykassirer 22d6d9455a header: Fix dark mode header box-shadow.
Followup to 239b6737c0
2023-06-23 14:41:16 -07:00
Sahil Batra db825ad202 settings: Remove settings_text_input class from url type inputs.
This commit removes settings_text_input class from url type inputs
and we instead add the width property to settings_url_input.

Note that we might instead have a single class for all type of inputs
instead of having different classes for url, password and text type
inputs in further commits.
2023-06-23 11:53:38 -07:00
Sahil Batra 7d0da75430 modal: Remove modal_text_input class from password and url type inputs.
We remove the modal_text_input class from password and url type inputs
in modals and add the width property CSS to modal_password_input and
modal_url_input instead.

Note that we might instead have a single class for all type of inputs
instead of having different classes for url, password and text type
inputs in further commits.
2023-06-23 11:53:38 -07:00
Sahil Batra a860e717bb bootstrap: Remove bootstrap CSS for url type inputs.
We use url type inputs in the add and edit custom field modals
and also to show the url type custom fields in "Profile" panel
and "Manage user" modal.

This commit re-adds the bootstrap CSS rules to these specific
input elements using modal_url_input and settings_url_input
class and thus removes the CSS for url type inputs from
bootstrap.css.

We might replace the new class added here with a common class
for all type of inputs in further commits.
2023-06-23 11:53:38 -07:00
Sahil Batra 9cf214a7cb bootstrap: Remove bootstrap CSS for email type inputs.
We use email type inputs only in portico pages and
the bootstrap CSS is already overridden by CSS
defined in portico_signin.css. Only outline property
was being applied by bootstrap on focusing the input
which has been added to CSS in portico_signin.css in
the previous commit as password and email type inputs
have common CSS.

Thus, we can remove the bootstrap CSS for email type
inputs safely.
2023-06-23 11:53:38 -07:00
Sahil Batra 631eba09ee css: Remove bootstrap CSS for password type inputs.
We use password type inputs for API key and password
change modal in the main app and in login, register
and password reset pages.

For the portico pages, i.e. login, register and
password reset pages, the bootstrap CSS is already
overridden by our custom CSS defined in
portico_signin.css and some of the CSS added by
bootstrap is redundant. Only outline property was
being applied by bootstrap on focusing the input
which has been added to CSS in portico_signin.css
in this commit.

For the inputs used in app, i.e. API key and password
change modal, we have already added the CSS rules of
Bootstrap using "modal_password_input" class.

Thus, we can remove the CSS for password type inputs
from bootstrap.css.
2023-06-23 11:53:38 -07:00
Sahil Batra 5ac72eedd9 modals: Re-add bootstrap CSS to password inputs in modals.
This commit adds specific CSS styles from bootstrap to password
type inputs in modals using modal_password_input class. This
change helps us in removing the bootstrap CSS for password type
inputs in further commits.

We might replace the new added class with a single class which
will be used for all type of inputs in further commits.
2023-06-23 11:53:38 -07:00
Sahil Batra 954f605514 bootstrap: Remove CSS image type inputs.
We do not use any image type inputs in our app.
2023-06-23 11:53:38 -07:00
Sahil Batra 4703292c35 bootstrap: Remove CSS for file type inputs.
This commit removes bootstrap CSS for file type inputs
and we can safely do so all file type inputs are hidden.
2023-06-23 11:53:38 -07:00
Sahil Batra 35f252f5b2 templates: Remove pull-left class and its bootstrap CSS.
The "pull-left" class was used for hidden file type input
in compose_control_buttons.hbs and in the copy code button
in codeblocks. It was only used to set the float property
in CSS, but we do not need to set it and removing it does
not make any change in the position of these elements.
So, this commit removes the pull-left class and its CSS
from bootstrap.css as well.

For the file type input, it is already hidden and after
removing the float property also, it is positioned at the
same place due to ordering of elements in HTML.

For the copy code button in codeblocks, it is postioned
using "position" and "right" attributes and removing
"float" property has no effect.
2023-06-23 11:53:38 -07:00
Sahil Batra 8c0ff704df bootstrap: Remove bootstrap CSS for pull-right class.
We use pull-right class for copy button with the multi-use
invite link only and this commit adds CSS for that specific
element. This commit then removes the bootstrap CSS for
pull-right class and also removes pull-right class from the
copy button since it is no longer required.
2023-06-23 11:53:38 -07:00
Sahil Batra f4d082a5ff bootstrap-btn: Remove CSS for fieldset elements.
All the CSS for fieldset elements in bootstrap-btn.css
was for disabled fieldset elements and we do not use
them anywhere in the app.
2023-06-23 11:53:38 -07:00
Sahil Batra cbcbfef396 bootstrap: Remove CSS for fieldset element from bootstrap.css.
This commit adds the required bootstrap CSS rules for fieldset
elements to the specific selector in portico_signin.css and
removes the CSS from bootstrap.css.
2023-06-23 11:53:38 -07:00
Sahil Batra 0c3076b7d6 bootstrap: Remove CSS for input-block-level class.
We use input-block-level class only for search input
and this commit adds the required bootstrap rules for
it to the specific elements in search.css. So, we can
safely remove the CSS defined for this class in
bootstrap.css.
2023-06-23 11:53:38 -07:00
Lauryn Menard c5fbd3f085 narrow: Mark as read in `by_recipient` based on case ("dm" or "stream").
In commit #25837, we added in a check for the user's mark as read
policy in the frontend for `by_topic` and `by_recipient` narrowing.
In that change, the assumption was that for both functions, it was
sufficient to check only for whether the user policy was to never
mark as read.

But because the `by_recipient` function may narrow to an interleaved
stream view, it is possible that message will be marked as read
when the user did not expect it to be (e.g. they marked all the
messages in a topic narrow as unread and then used the `S` key
shortcut to navigate back to the stream view) when they have
conversation views only as their mark as read  policy.

Here we move the check for the user's mark as read policy to be in
the two cases for `by_recipient` so that the mark as read behavior
here matches the user's setting.
2023-06-23 11:51:14 -07:00
Daniil Fadeev daab1d4265
compose_banner: Remove uploads banners when clearing compose box.
Upload banners were not cleared after closing compose box, which meant
that they would remain present in a paused state after compose was reopened.

https://chat.zulip.org/#narrow/stream/9-issues/topic/Incomplete.20Upload.20banner.20remains.20on.20closing.20compose/near/1582602
2023-06-23 11:45:04 -07:00
Lalit 13187ff8f6 ts: Convert `web/src/billing` module to TypeScript.
Converted all files inside `web/src/billing` to TypeScript.
2023-06-23 11:42:29 -07:00
Lalit 1f4dd0705d page_params: Make seperate `page_params` for billing module.
This commit introduces a seperate `page_params` file for billing module
since we only use certain page_params in billing module only that it does
not make sense to include them in the main `page_params.ts`.

Also introduced `zpage_billing_params` for proper testing new `page_params`
in billing module.
2023-06-23 11:42:29 -07:00
evykassirer e360a896f6 message view header: Don't initalize multiple times.
The `initialize` function registers a click handler, and
previously it was being registered another time each time
one of these calls to `initialize()` happened. The only
other thing that happens in `initialize` is a call to
`render_title_area`, so this commit replaces the extra
calls to initialize with that.
2023-06-23 11:33:44 -07:00
evykassirer 7ee827a24b search: Remove unused `search_open` classname. 2023-06-23 11:33:03 -07:00
evykassirer 84a066cb48 search: Invert double negative with De Morgan's law.
No functional changes. This change is more consistent with how this
expressions looks in other parts of the codebase.
2023-06-23 11:32:42 -07:00
Akarsh Jain 92ea4a02a1 stream_edit: Replace saving notice with spinner editing stream name.
This commit remove the Saving/Saved notices when editing the stream
name and/or description. Instead, it replaces the "Save changes" button
with a spinner while the changes are being saved.

Fixes #24535.
2023-06-23 11:28:12 -07:00
Akarsh Jain 132c4245d0 modal: Fix button height issue on modals with long text on submit button.
This commit fixes an issue where the button height increases while
it has the spinner on modals with long text on the submit button. The
issue occurred due to the button height being calculated after hiding
the span element, which resulted in an incorrect height. To overcome
this, the commit suggests computing the span element's height before
hiding it to ensure that the button height is accurately set.
2023-06-23 11:27:52 -07:00
Aman Agrawal 5efa32be66 wildcard_mention: Don't highlight for unsubbed users. 2023-06-23 11:20:28 -07:00
Sahil Batra b119ff68c3 stream_settings: Fix height of select elements.
Previously, we used to have top and bottom paddings of 4px to
the select elements but it was removed in a208da9c4d to make
sure that text for the selected option is aligned properly.

All other select elements have height set to 30px, but the
select elements in stream settings page had height set to
"fit-content" and so they looked ugly after removing the
padding.

This commit sets the height of select elements in stream
settings to 30px.
2023-06-23 11:04:19 -07:00