Commit Graph

1432 Commits

Author SHA1 Message Date
Karl Stolley 73fbca7ae9
tests: Correct the spelling of 'caret'. 2023-08-03 12:54:43 -05:00
Anders Kaseorg 6632eca2dc stream_data: Use yield*.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-02 19:01:20 -07:00
Junyao Chen 8df9828ed1 ts: Migrate `alert_words.js` to TypeScript.
Added type annotations for function params, return values and
local variables.
2023-08-02 18:38:58 -07:00
Lalit Singh 2893685890 people: Revert to using `ignore_missing` parameter.
We revert to use `ignore_missing` parameter for `maybe_get_user_by_id`
function to avoid sending unnecessary `blueslip.error()` calls to
sentry.
2023-08-02 17:25:14 -07:00
Aman Agrawal 875d564f2d stream_settings: Migrate to new DropdownWidget.
Also, remove old DropdownListWidget since it is no longer used.
2023-07-27 14:10:08 -07:00
Aman Agrawal aa8e94ca6d settings_org: Migrate dropdowns to new DropdownWidget.
This also moves [Disabled] button inside the dropdown.
2023-07-27 14:10:08 -07:00
Aman Agrawal 6efcb7a349 dropdown_widget: Refactor to use Class. 2023-07-27 14:10:08 -07:00
Anders Kaseorg d91d6d1fd1 settings_profile_fields: Simplify convoluted sort algorithm to max.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-27 14:06:25 -07:00
evykassirer ec25baa344 compose: Return focus to DM input after pill selection.
Before this change, the cursor left the DM recipient box after
selecting a pill from the typeahead. This was only the case with
mouse clicks and not with keyboard selection.

This change ensures we always return focus to the input field
after selection.
2023-07-26 21:05:38 -07:00
Karl Stolley 3b63faf33c bot_icon: Correct vertical alignment. 2023-07-26 12:15:11 -07:00
Ujjawal Modi fbcc3b5c84 user_groups: Rename `can_mention_group_id` parameter.
Earlier the API endpoints related to user_group accepts and returns a
field `can_mention_group_id` which represents the ID
of user_group whose members can mention the group.

This commit renames this field to `can_mention_group`.
2023-07-25 18:33:04 -07:00
Ujjawal Modi c8bcb422f5 streams: Rename `can_remove_subscribers_group_id` parameter.
Earlier the API endpoints related to streams accepts and returns a
field `can_remove_subscribers_group_id` which represents the ID
of user_group whose members can remove subscribers from stream.

This commit renames this field to `can_remove_subscribers_group`.
2023-07-25 18:33:04 -07:00
Karl Stolley 61f30fa347 print: Add print styles targeted at topics. 2023-07-25 17:30:40 -07:00
Sahil Batra befcb46ba3 dialog_widget: Rename "dialog_cancel_button" to "dialog_exit_button".
This commit renames "dialog_cancel_button" class in the exit button
of modals to "dialog_exit_button", which seems a much better name
for a button that is used to close a modal.
2023-07-25 10:25:12 -07:00
Sahil Batra 8db9093d0b stream: Change button text to "Close" in copy email address modal.
This commit changes the button text from "Cancel" to "Close" in
copy email address modal, since it is weird to click on "Cancel"
button after having copied the email address and might confuse
users. Using "Close" makes it clear that the button is to just
close the modal.
2023-07-25 10:25:12 -07:00
Tim Abbott 213387249e css: Fix prettier error and reorganize some colors. 2023-07-24 18:06:25 -07:00
evykassirer 92e24a9727 compose: Don't select compose input field after focus.
Fixes #25950.

Focus area is mostly determined by finding the first
relevant field that is *empty*, and selecting empty
fields has no effect.

The only situation where the field might not be empty
is when the textarea already has text in it, since
that's the default option. We don't want to select
the composebox textarea because this can lead to
people losing their messages if they start typing
right away.
2023-07-24 17:53:46 -07:00
Ishita Gupta aa86533f22 UI redesign: more-less message interaction.
This commit encompasses the following changes:
* Replace the [More...] link with a button titled "Show more".
* Replace the [Show Less...] link with a button titled "Show less".
* Add various on-hover interactions to the buttons.
* In the condensed view, add fading to the bottom of the message to
  visually communicate that the message is truncated.
* Update /help/ description.

Fixes #22801.

Co-authored-by: Evy Kassirer <evy.kassirer@gmail.com>
2023-07-24 17:42:08 -07:00
Zixuan James Li fe1a2f6f02 realm_playgrounds: Refactor error handling for validation on creation.
Previously, the view function was responsible for doing a first pass of
the validations done for RealmPlayground. It is no longer true now. This
refactors do_add_realm_playground to check_add_realm_playground and make
it responsible for validating the playground fields and doing error
handling for the ValidationError raised.
2023-07-24 17:40:59 -07:00
Zixuan James Li 000761ac0c realm_playgrounds: Replace url_prefix with url_template.
Dropping support for url_prefix for RealmPlayground, the server now uses
url_template instead only for playground creation, retrieval and audit
logging upon removal.

This does the necessary handling so that url_template is expanded with
the extracted code.

Fixes #25723.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-07-24 17:40:59 -07:00
evykassirer c4bc0ad589 message feed: Change color of zulip logo at top of feed. 2023-07-24 17:27:59 -07:00
Junyao Chen 30c535fc63 ts: Migrate `vdom.js` to TypeScript.
Added type annotations for variables, function params, and return
values. Created custom types that help with clean type annotations.

Notes on `attrs` field in custom `Option` type:
 `attrs` is an `Iterable` where each element is a pair of string, i.e
a string array with two elements. `attrs` is tranformed into a `Map`
at some point. `Map` constructor takes in `Iterable` object so has
no problem unifying with `attrs`. However, at some point `attrs` is
transfomed using `.map(...)` which is an array method, and `Iterable`
does not support `.map(...)`. So at this point, I cast `attrs` into
array before using `.map(...)` by this syntax:
`[..attrs].map(...)`
2023-07-24 16:49:53 -07:00
Karl Stolley 5d819ea254 grid: Remove unnecessary mobile-scale padding.
This also removes padding on .message_content that wasn't actually
rendered due to its low specificity. It was likely also leftover
from an earlier, non-grid-based layout.
2023-07-24 16:47:14 -07:00
Junyao Chen c693816d66 ts: Migrate `huddle_data.js` to TypeScript.
Added type annotations.
2023-07-24 16:45:30 -07:00
Anders Kaseorg bc1e953f0f dark_theme: Remove Firefox override for dropdown appearance.
We get the right background-color from line 487 in the same way as
Chrome.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-24 13:43:17 -07:00
lapaz 5d5e1963b9 settings: Add "Copied" tooltip in bots/streams copy feedback.
This provides a bit nicer feedback to the user that the copy worked.

Fixes #26181
2023-07-24 13:21:43 -07:00
Anders Kaseorg 1b72d5c413 styles: Remove Firefox override for dropdown appearance.
The default appearance in modern Firefox is totally fine, and our
override was incorrectly changing the dropdown triangle to black for
the dark theme.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-24 13:10:03 -07:00
Hardik Dharmani cd24620c4a js: Rename top_left_corner.js to left_sidebar_navigation_area.js.
This provides a much clearer and more consistent codebase name for
this part of the app.

Fixes part of #25902.
2023-07-24 13:02:28 -07:00
Lalit bd6184305a realm_playground: Iterate over `playgrounds_data` directly.
Using `Object.values(playgrounds_data)` for iterating over an array is
unnecessary when we can just directly loop over the array here.
2023-07-24 12:49:53 -07:00
Lalit 829caae189 ts: Migrate `realm_playground` to typescript. 2023-07-24 12:49:53 -07:00
Lalit 4a4d23a548 realm_playground: Remove `generated_pygments_data` parameter for
initialization function.

We are already importing `generated_pygments_data.json` directly in
`realm_playground.js` so there is no need to pass it via initialization
method.
2023-07-24 12:49:53 -07:00
Lalit 8c12494c16 realm_playground: Cut dependency on `typeahead_helper.js`. 2023-07-24 12:49:53 -07:00
Sahil Batra 6cb080c447 bootstrap: Remove bootstrap CSS for blockquote elements.
We have added the bootstrap CSS rules for blockquote elements
to the specific elements in previous commits and thus we can
safely remove these from bootstrap.css.
2023-07-23 15:44:58 -07:00
Sahil Batra 2926337404 templates: Re-add bootstrap CSS for tweet blockquote elements.
This CSS will only be used if somehow the tweet is renderd as
a simple quote without iframe either due to network problem
or if the actual tweet is deleted.
2023-07-23 15:44:58 -07:00
Sahil Batra fdc0fc9d97 markdown: Re-add bootstrap CSS for blockquote used in markdown.
This commit re-adds bootstrap CSS rules for blockquote elements
used in various markdown pages including the ones which are
rendered during message formatting like when quoting a message.

This is a prep commit to remove the blockquote CSS rules from
bootstrap.css.
2023-07-23 15:44:58 -07:00
Sahil Batra 30dec9822b landing_page: Re-add bootstrap CSS for blockquote in testimonials.
This commit re-adds bootstrap CSS rules for blockquote elements
used for testimonials in the landing page.

This is a prep commit to remove the blockquote CSS rules from
bootstrap.css.
2023-07-23 15:44:58 -07:00
Sahil Batra 1c98252a85 portico: Re-add bootstrap CSS for blockquote in markdown pages.
This commit re-adds bootstrap CSS rules for blockquote written
using ">" in case study pages and some other pages like
"/why-zulip", "/history", etc.

We also remove the unnecessary CSS for "blockquote::after"
selector in this commit.

This is a prep commit to remove the blockquote CSS rules from
bootstrap.css.
2023-07-23 15:44:58 -07:00
Sahil Batra d15222db22 corporate: Re-add bootstrap CSS for blockquotes in "for/" pages.
This commit re-adds the required bootstrap CSS for blockquote
elements used in "for/businesd", "for/research", "for/events"
and "for/open-source" pages.

This commit only handles the blockquote elements inside ".quote"
and ".intro-quote" elements and not "blockquote.twitter-tweet"
elements which will be handled separately. The blockquote
elements rendered using markdown using ">" will also be handled
separately.

This commit also updates blockquotes in self-hosting page as
blockquote element on this page is also inside ".quote" element.

This is a prep commit to remove the blockquote CSS rules from
bootstrap.css.
2023-07-23 15:44:58 -07:00
Sahil Batra fab29eb779 landing_page: Remove unnecessary CSS.
We use "testimonials" class only to show the testimonials
in landing page, i.e. hello.html and that page does not
use "why-page" class. So, the CSS with selectors including
".portico-landing.why-page .testimonials" is not required
and this commit removes it.

The removed CSS was added in fc6833e46a when we used
"testimonials" class for quotes in why-zulip.html page
but this changed since we moved the quotes to markdown file.
2023-07-23 15:44:58 -07:00
Sahil Batra ae7db86b79 bootstrap: Remove CSS for ".label" elements.
The "label" class was only used for the labels shown in
activity support page. This commit adds the required CSS
rules to activity.css and removes them from bootstrap.css.
2023-07-23 15:44:58 -07:00
Sahil Batra 861312e120 bootstrap: Remove bootstrap CSS for "small" element.
We use "small" element only to show secondary details in
a typeahead option. This commit re-adds bootstrap CSS
rule to the specific element in compose.css and removes
the CSS from bootstrap.css.

Also, we do not use small elements inside any of h1, h2,
h3, h4 and blockquote elements, so the CSS for those can
be safely removed.
2023-07-23 15:44:58 -07:00
Sahil Batra b95d23bb07 bootstrap: Remove bootstrap CSS for input-append class.
We use input-append class only for some search elements
in the app and the CSS rules applied by bootstrap which
are really used are "white-space" and "margin-bottom"
for a couple of ".input-append" elements and "margin-left"
property on clear button which is re-added to the CSS for
specific elements in this commit.

Others are either redundant or overridden by the other CSS
for the specific elements.

The border-radius property for the clear button was applied
but since we use "x" for it, there is no border for that
button and hence it is redundant.
2023-07-23 15:44:58 -07:00
Sahil Batra 08dfebafcf bootstrap: Removed unused CSS from bootstrap-btn.css.
We can remove CSS for btn-large, btn-group-large, btn-small,
btn-group-small, btn-mini and btn-group-mini classes since
we do not use them anywhere.
2023-07-23 15:44:58 -07:00
evykassirer aa9d5935ae search: Rename search_arrows to searchbox_container.
The terminology "arrows" comes from historical functionality
that is no longer relevant, so searchbox_container is a more
clear and accurate name.

It would be nice in the future to see if we can remove
some of the nesting of HTML (#searchbox, #searchbox_form,
and #searchbox_container).
2023-07-23 15:27:53 -07:00
Anders Kaseorg 7746e11486 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-21 15:58:42 -07:00
Anders Kaseorg 1a13ede0d7 eslint: Fix @typescript-eslint/no-redundant-type-constituents.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-21 15:58:42 -07:00
Lauryn Menard 02c279c6b6 narrow: Add hotkey trigger for navigation to new topic/direct message.
Adds including a trigger to the opts for narrow_to_next_topic and
narrow_to_next_pm_string when called from `web/src/hotkey.js`.
2023-07-21 14:21:29 -07:00
evykassirer 0652efc473 topic generator test: Use strings for stream name instead of numbers.
This function takes the stream name (a string) and using numbers
makes it seem like it's actually using a stream id, which is
confusing. This change adjusts `stream` to always be a string.
2023-07-21 14:19:55 -07:00
evykassirer 834f759e8b message view: Don't mark message as read in mentions view. 2023-07-21 13:10:07 -07:00
Lauryn Menard 1cccdd8103 realm-settings: Make default_code_block_language empty string as default.
Updates the realm field `default_code_block_language` to have a default
value of an empty string instead of None. Also updates the web-app to
check for the empty string and not `null` to indicate no default is set.

This means that both new realms and existing realms that have no default
set will have the same value for this setting: an empty string.

Previously, new realms would have None if no default was set, while realms
that had set and then unset a value for this field would have an empty
string when no default was set.
2023-07-21 18:54:02 +02:00
Lauryn Menard 3255281a83 narrow: Support string and integer encoding of "id" operator.
Expands support for the message ID operand for id" operator to be either
a string or an integer. Previously, this operand was always validated as
a string.
2023-07-20 13:14:20 -07:00
Lalit a871d7d90e poll_data: Revert to using "canned" instead of -1.
We revert to using "canned" instead of -1 when populating
`key_to_option` map so that it does not break for the old polls.
2023-07-20 09:55:09 -07:00
Alex Vandiver ba7492a314 web: Do not assume error responses are valid, or our, JSON.
Partially fixes #24815.
2023-07-19 16:18:31 -07:00
Alex Vandiver 7efe989a72 web: Switch from JSON.parse(xhr.responseText) to xhr.responseJSON. 2023-07-19 16:18:31 -07:00
Alex Vandiver d05a1e9efa web: Remove nonsense round-trip through JSON.parse() + JSON.stringify(). 2023-07-19 16:18:31 -07:00
Alex Vandiver d05a9d4000 reactions: Do not send server error reports for duplicate requests. 2023-07-19 16:18:31 -07:00
Aman Agrawal b7fcce305e recent_topics: Fix clear search button misaligned.
Looks like some changes actually improved aligned of this icon so
that we don't need this hacky margin.
2023-07-19 11:09:24 -07:00
Prakhar Pratyush 1a2831059d notifications: Enable audible notifications for the FOLLOWED topic.
This commit adds support for triggering audible desktop
notifications when:

* A message is sent to a followed topic with the global user setting
'enable_followed_topic_audible_notifications' enabled.

* A message with wildcard mentions is sent to a followed topic with
the global user setting
'enable_followed_topic_wildcard_mentions_notify' enabled.
2023-07-17 17:39:17 -07:00
Prakhar Pratyush 67d4334bf1 notifications: Enable desktop notifications for the FOLLOWED topic.
This commit adds support for triggering visual desktop
notifications when:

* A message is sent to a followed topic with the global user setting
'enable_followed_topic_desktop_notifications' enabled.

* A message with wildcard mentions is sent to a followed topic with
the global user setting
'enable_followed_topic_wildcard_mentions_notify' enabled.
2023-07-17 17:39:17 -07:00
Prakhar Pratyush 237f9f4799 topic_popover: Add support to follow a topic from the topic_popover.
This commit adds support for following a topic from the topic
three-dot menu in the left sidebar.

Three options, i.e., 'Mute topic', 'Unmute topic', and 'Follow topic',
are shown at the top of the menu (in the mentioned order), regardless
of whether the stream is muted or unmuted.

We can no longer set the topic's visibility_policy to INHERIT
(the default value) from this menu.

The changes are visible in the development environment only.

Fixes #25917.

Co-authored-by: Prakhar Pratyush <prakhar841301@gmail.com>
Co-authored-by: Hardik Dharmani <Ddharmani99@gmail.com>
2023-07-17 17:39:17 -07:00
Prakhar Pratyush 93a18b999a settings: Update SETTINGS/TOPICS panel to include followed topics.
This commit updates the existing 'Topics' settings UI
to add support for followed topics.

Changes:
- Add "Followed" as the first option in the topic status dropdowns.
- Modify the intro text.
- Replace the "Learn more." link with a question mark linking to
'/help/mute-a-topic' on the "Topic settings" heading.

The changes are visible in the development environment only.

Fixes #25918.
2023-07-17 17:39:17 -07:00
Prakhar Pratyush 352c48f7c6 user_topics: Fix live-update bug in the 'SETTINGS / TOPICS' panel.
The change in the visibility_policy or status of a topic from
the topic popover, message header bar, or recent conversations
is not live-reflected in the 'SETTINGS / TOPICS' panel.

This commit fixes the above-mentioned bug by updating
the 'handle_topic_updates' function to update the settings panel.
2023-07-17 17:39:17 -07:00
Prakhar Pratyush 08c952a2a3 user_topics: Add the missing node tests.
This commit adds the missing node tests for the case
when the visibility policy is UNMUTED.

This should have been included in c526543.
2023-07-17 17:39:17 -07:00
Prakhar Pratyush 32b201d5e0 user_topics: Rename 'muted_topics_ui' to 'user_topics_ui'.
This commit renames the file 'muted_topics_ui.js' to
'user_topics_ui.js', as we also support visibility policies
other than MUTED.
2023-07-17 17:39:17 -07:00
AcKindle3 1aeab40779 ts: Convert `stream_settings_containers.js` to TypeScript.
Added assertion to enforce `sub` is not `undefined` and thus type
safe for the rest.
Added type annotation to function parameter and return value.
2023-07-17 17:24:15 -07:00
evykassirer d293e869bd search: Bold search operands in the first search result.
Specifically when it's the last operand of the search
filter. This makes the first line of search results
more consistent with the lines that come after.
2023-07-17 17:19:08 -07:00
evykassirer 8f5305a4ce search: Create a template for search descriptions. 2023-07-17 17:19:08 -07:00
evykassirer 6346110b56 search: Remove unused base_query variable. 2023-07-17 17:19:08 -07:00
evykassirer 7116526492 compose: Use compose_state.stream_id when name isn't needed.
This partially fixes #25742.
2023-07-17 16:30:39 -07:00
evykassirer afd703fe77 compose: Fix buggy recipient id code.
`selected_recipient_id` is supposed to be an id,
not a stream name. This function is currently
only ever called for direct messages, so there's
no present user-facing bug.
2023-07-17 16:30:39 -07:00
evykassirer 91d32d9f16 stream data: Store stream subscriptions by id instead of name.
This commit has no functional changes. An extra dict has been
added to preserve previous lookup times.
2023-07-17 16:30:39 -07:00
Lalit a240280c12 message_overlay_ui: Fix eslint errors for rule no-unnecessary-condition
This mainly fixes error related to if checks like - `if ($jquery[0] !==
undefined)` which is not a good way to check for existence of jquery
objects instead we should check the length of jquery collections for
these if checks.
2023-07-17 16:24:16 -07:00
Lalit c0c4c2e1e7 ts: Migrate `message_overlay_ui` to TypeScript. 2023-07-17 16:24:16 -07:00
Lalit b97926ba0c messages_overlay_ui: Remove support for `_e` parameter for
`modals_handle_events`.

We are not using the `_e` parameter here since this commit `4a3211d`, so
I removed this parameter from the `modals_handle_events` function.
2023-07-17 16:24:16 -07:00
Lalit ad10c77919 settings_user: Pass data of correct type to `list_widget.render_item`.
Since `list_widget.render_item` accepts the parameter of type `Item` and
not `Key`, therefore we should pass the actual item instead of just
plain id to the `render_item` function here.
2023-07-17 11:31:51 -07:00
Lalit d58085dde2 list_widget: Check length of JQuery collection instead of collection
itself.

We were checking for the undefined value of `$html_item` but this
variable is always true since `$.find` never returns an undefined value
and it returns a JQuery collection instead.

So we need to check the length of that JQuery collection here to make
sure that the condition works as expected.
2023-07-17 11:31:51 -07:00
Lalit ed7588152e list_widget: Remove over defensive validation code.
After migrating to TypeScript, we don't need to manually validate the
configuration passed to the `ListWidget`, that's what typescript complier
will do for us, hence I removed `validate_opts` and `valid_filter_opts`
functions.
2023-07-17 11:31:51 -07:00
Lalit b51bdd33bb ts: Migrate `list_widget` to TypeScript. 2023-07-17 11:31:51 -07:00
Lalit 08f84f0a45 list_widget: Set $scroll_container directly in `meta` object.
We should directly set the value of `$scroll_container` when making the
`meta` object in `list_widget` instead of setting it up later in
`set_up_event_handlers` function which gets called anyways on
widget initialization. This allows us to not make an incomplete type
object which typescript will complain about when we migrates this module to
TypeScript.
2023-07-17 11:31:51 -07:00
Lalit b04dfd8c29 list_widget: Explicitly pass generic sort functions to the list widget.
This is a prep commit for typescript migration of this module. In this commit
I made all the users of ListWidget pass generic sort functions like 'alphabetic'
and 'numeric' explicitly to avoid type conversions which we may need when moving
to typescript, also it simplifies our `set_sorting_function` a bit more.
2023-07-17 11:31:51 -07:00
Lalit 3720fd5c76 list_widget: Make `get_item` option required and pass a default where needed.
This is a prep commit for moving towards typescript migration of this module.
We should make `get_item` required on `list_widget` because its intended to be
used with a set of keys and then hydrate the keys lazily. Also this will help
us to avoid writing messy if-conditions while filtering and sorting and make
our life much easier when we migrate to TypeScript.

I added a `default_get_item` function which is just n identity function and
also refactored some code to make use of default get item.
2023-07-17 11:31:51 -07:00
Lalit 7176590eea list_widget: Add new parameter for getting insert index in `insert_rendered_row`.
We should keep methods of `list_widget` generic and independent of outer modules
data types and hence I added this parameter to get insert index to make
`insert_rendered_row` work with any list we create and not only `topic_list`.
2023-07-17 11:31:51 -07:00
Lalit e8390a529a list_widget: Refactor `widget` object.
This is a prep commit for migrating `list_widget` to TypeScript, In this
commit we declare all our methods for the widget directly inside `widget`
object to avoid making an incomplete object when we add a type for our widget.
2023-07-17 11:31:51 -07:00
Karl Stolley de23949a36 message_edit: Use CSS to manage preview scroll.
Fixes #26135.
2023-07-17 11:28:55 -07:00
evykassirer 24a2ff5016 loading: Show error when spectator fails to register.
Fixes #25683.
2023-07-17 10:49:45 -07:00
evykassirer cb5441a6b0 search: Link messages in search results to near view.
Previously clicking on a message in search results opened
the compose box. This was not great, because search views
show messages outside of their context, and replying to a
message without the context of possible more recent
messages sent to that narrow can result in a bad experience.

This commit prevents the composebox from opening on click and instead
moves the user to a near view for the message, and similarly with the
enter keyboard shortcut.

Fixes #21217.
2023-07-17 10:39:43 -07:00
Lalit 61d4670f9a user_group_pill: Add test coverage for `append_user_group`. 2023-07-17 10:38:24 -07:00
Lalit 8aa6ddfe68 ts: Migrate `user_group_pill` module to TypeScript. 2023-07-17 10:38:24 -07:00
Lalit e06726a5cf peer_data: Remove over defensive `assert_number` function.
Removes the `assert_number` over defensive function which was being used
for validating the type of `stream_id` but now that this module is
converted to TypeScript we do not need this function anymore since
typescript compiler will do the type checking for us.
2023-07-17 10:37:29 -07:00
Lalit de6f21545b ts: Migrate `peer_data.js` to TypeScript. 2023-07-17 10:37:29 -07:00
Hemant Umre 7036b0d466 left_sidebar: Avoid zooming out when toggling stream subscription.
In this commit, we have replaced `build_stream_list()` with
`update_streams_sidebar()`. This change avoids zooming out from the
"more topics" view when toggling your subscription to a different stream.
It also triggers a forced rerender of the left sidebar only when
unsubscribing from the currently active stream. The stream list will be
updated once the user zooms out.
2023-07-17 10:13:53 -07:00
Hemant Umre 30ab2781b1 left_sidebar: Fix exception exiting "more topics".
The `stream_list.build_stream_list()` function is responsible for
rendering the stream list in the left sidebar. Previously, it uses
`topic_list.clear()` to clear the `active_widgets` that tracks active
stream(s) in the left sidebar. This led to a bug where rendering stream
list after adding or removing a stream through `build_stream_list()`
while a stream was zoomed in ("more topics" clicked) didn't fully exit
the "more topics" view. So clicking "BACK TO STREAMS" throws an exception
with the message "Error: Unexpected number of topic lists to zoom out"
because `active_widgets`, cleared by `topic_list.clear()`, became
inaccessible.

To address this issue, instead of clearing the topics list with
`topic_list.clear()`, the code now ensures the closure of the zoomed
stream by using `topic_zoom.clear_topics()`. This change ensures a
proper exit from the "more topics" view and avoids the exception.

Fixes #25670.
2023-07-17 10:13:53 -07:00
Prakhar Pratyush 4c9d26ce17 mention: Send notifications for @topic wildcard mentions.
This commit completes the notifications part of the @topic
wildcard mention feature.

Notifications are sent to the topic participants for the
@topic wildcard mention.
2023-07-17 09:39:24 -07:00
Karl Stolley 1cd587d24b me_message: Center first line with center of avatar.
This commit also demonstrates how precise line-heights contribute
to a design: by matching the line-height on the avatar's grid area
to the dimensions of the square avatar image, it's possible to
center the first line of text (me-messages, in this case) with a
non-text element.
2023-07-15 09:55:42 -07:00
Karl Stolley b13f6a6127 message_grid: Refactor row grid for readability.
This satisfies the linter's desire for the `grid-template`
shorthand while keeping the illustrative template areas in
their own little diagram-like property.
2023-07-13 14:02:21 -07:00
Karl Stolley 8b528de452 info_overlay: Align me-message example with rendered classes. 2023-07-13 14:01:32 -07:00
Karl Stolley ce04c98b47 me_messages: Clean up unused .sender_name-in-status class. 2023-07-13 14:01:32 -07:00
Prakhar Pratyush 0891f9f65a mention: Determine @topic mention during message rendering.
This commit adds a boolean field `mentions_topic_wildcard`
to the `MessageRenderingResult` dataclass.

The field is set to true only if message rendering determines
the message has an actual topic wildcard mention in it (and not,
e.g., topic wildcard mention syntax inside a code block).

The rendered content for topic wildcard mention is
'<span class="topic-mention">{wildcard}</span>'.

The 'topic-mention' class is the identifier for the wildcard
mention being a topic wildcard mention.

We don't use 'data-user-id="*"' and "user-mention" class for
topic wildcard mentions and eventually plan to remove them for
stream wildcard mentions too in a separate mini-project.
2023-07-13 11:34:48 -07:00
Prakhar Pratyush 2b42df4ef1 mention: Replace 'wildcard' with 'stream_wildcard'.
This is a prep commit to replace 'wildcard' with 'stream_wildcard'.

This wasn't included in 179d5cb because we didn't decide to
use a different rendered_content for topic wildcard mention,
i.e., ''<span class="user-mention topic-mention">{wildcard}</span>'.

Our intention was not to create separate tests for both stream
and topic wildcard mentions, as they were expected to have the
same rendered content format.
2023-07-13 11:34:48 -07:00
Karl Stolley ddaebb3255 message_grid: Use a 'dead' column to space controls and time.
This commit adds a 3px column between the `controls` and `time`
areas, which keeps the controls from crowding the time for
languages with longer time markers.

To make the layout easier to reason about, this includes the
minimum width for the time column as part of the message-box
grid definition.
2023-07-13 09:02:00 -07:00
Karl Stolley 42919ed2e1 message_avatar: Preserve clickable area from image to user name. 2023-07-13 09:02:00 -07:00
Karl Stolley 0058cc5f92 message_overlays: Apply grid to drafts and scheduled messages.
This also removes duplicate, unreachable CSS that probably
should have been removed in a941545523.
2023-07-13 09:02:00 -07:00
Karl Stolley 497ad9471a message_grid: Preserve grid layout in edit mode. 2023-07-13 09:02:00 -07:00
Karl Stolley b6d072a8d9 message_grid: Share same message grid with me-messages. 2023-07-13 09:02:00 -07:00
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