Commit Graph

1278 Commits

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