This commit adds width property CSS rule for text inputs in
integrations_dev_panel.css to 206px, as we are going to remove
the bootstrap CSS rule which sets width in further commits.
This commit adds width property CSS rule for text inputs
in billing.css to 206px, as we are going to remove the
bootstrap CSS rule which sets width to 206px in further
commits.
This commit adds width property CSS rule for text
inputs in activity.css to 206px, as we are going to
remove the bootstrap CSS rule which sets width to
206px in further commits.
This commit adds CSS to set width of text inputs in
poll and todo widgets to 206px as we will be removing
the bootstrap CSS rule which sets width of inputs to
206px in further commits.
This commit adds width property to CSS for "#inline_topic_edit"
element in zulip.css to set it to 206px, as we will be removing
the bootstrap CSS for it in further commits.
This commit adds settings_text_input class to text inputs in
settings, stream settings and user group settings pages. This
class is used to set the width of inputs to 206px, as we will
be removing the boostrap rule which sets width of the input
in further commits.
This commit adds modal_text_input class to text inputs
in modals to set width of them as set by bootstrap.
This class is used to set the width of inputs to 206px,
as we will be removing the boostrap rule which sets width
of the input in further commits.
This commit increases the width of url field, displayed for
custom external account type fields, in edit profile field
form. The width of the input is increased as urls are generally
long enough and did not fit in the width set previously in most
cases. We increase the width to match the width in add custom
profile field form.
This commit converts "portico/team.js" to TypeScript as well
as adds the required type definitions.
Some values were extracted into variables for type-checking.
The `tab_name` parameter is supposed to ensure that if you're looking
at a tab for repository that's not zulip/zulip, that the GitHub links
for authors without an associated GitHub username goes to the commits
for that repository.
This also fixes the color on these icons in the stream-specific rows
of the notification settings table.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
For some reason, browser is treating clicking on the button as
submitting the form, which results in the page getting redirected
to the same page with an additional empty query `?` in the URL.
In previous commits, we updated the realm creation flow to show
the realm name, type and subdomain fields in the first form
when asking for the email of the user. This commit updates the
user registration form to show the already filled realm details
as non-editable text and there is also a button to edit the
realm details before registration.
We also update the sub-heading for user registration form as
mentioned in the issue.
Fixes part of #24307.
We now show inputs for realm details like name, type and URL
in the create_realm.html template opened for "/new" url and
these information will be stored in PreregistrationRealm
objects in further commits.
We add a new class RealmDetailsForm in forms.py for this
such that it is used as a base class for RealmCreationForm
and we define RealmDetailsForm such that we can use it as
a subclass for RegistrationForm as well to avoid duplication.
This commit updates the ID for form element in create_realm.html
to "create_realm" as we would need to update the error handling
for this page in further commits and we do not want to break it
for other forms using "send_confirm" as ID.
Uptil now, 1 new line was added before and 1 after a quoted message. Now
for more breathing room around a quoted message, new lines are inserted
to space it from any content before and after by at least 2 new lines.
Fixes: #23608.
Forms using upload widget were using the
same css for image preview.
We fix this by assigning a class to the
widget and applying specific styles to it.
Previously, there is a bug where the position of the typeahead is off
whenever the user switches from stream typeahead to topic typeahead
in the compose box. The typeahead header was not hidden before
calculation of the position based on container height. These changes
will include the header before calculating for the position.
Previously this was only available on the upgrade page - meaning an
organization that already bought a plan wouldn't be able to request a
sponsorship to get a discount or such, even if qualified.
Added a width for the Change Email and Password dialogs at
sm_min (576px) and ml_min (425px) to make them more responsive
on narrow screens.
Fixes: #24339.
This bug made it impossible to scrub realms where the string_id was a
number, e.g. 123.zulipchat.com because
confirmed_string_id === actual_string_id comparison failed due to one
being a string and the other a number.
Per http://api.jquery.com/data/#data-html5:
Every attempt is made to convert the attribute's string value to a
JavaScript value (this includes booleans, numbers, objects, arrays, and
null).
To retrieve a data-* attribute value as an unconverted string, use the
attr() method.
postcss-preset-env transpiles this back as necessary. (It does a
better job than we did, in fact: we had several four-argument hsl()
calls that should have been hsla().)
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This adds a new search icon which we prefer over the one made
available from bootstrap, and replaces search icons in navbar
search with the Ionic icon.
Changed the id name of the <i></i> tag to user_profile_edit_button_icon
in the user profile modal, as earlier it was edit-button, which is too
vague of a selector name.
Close user profile modal on clicking the space around edit button, by
calling hide_user_profile() on clicking the hover box around the edit
button.
Also, modified the hover box to center around the edit button.
Some well-intentioned adblockers also block Sentry client-side error
reporting. Provide an endpoint on the Zulip server which forwards to
the Sentry server, so that these requests are not blocked.
Added condition for when a user clicks anywhere in a typeahead menu, be
it the header or empty space at the top and bottom, to not collapse the
compose box.
This fixes the bug where clicking anywhere on the typeahead except the
options would result in the compose box collapsing, but the typeahead
menu staying open and still working (on selecting a option in this state,
it would be inserted at the start, as visible on reopening the compose box).
The localstorage machinery can fail for totally arbitrary reasons,
including filesystem breakages on the part of the client, or
capricious access control.
Wrap accesses to localstorage with try/catch blocks to do our best,
but continue execution in the event that the localstorage API errors
out; it is better to continue with the rest of our intended actions
than get hung up on those failures.
This improves the error message captured, from the mildly inscrutable
"Non-Error promise rejection captured with keys: currentTarget,
isTrusted, target, type".
We have the information about all of these failures from the server
side, and Sentry groups all 5xx failures together with no stacktrace,
which makes them very difficult to get signal out of.
The CSS for our first Tippy popover, actions_popover, incorrectly did
not split the CSS that is meant to be applied to all popovers from
that CSS that is only for that specific popover.
Reorganize this with some clarifying comments.
Safari denies user from playing audio without an interactive
trigger like a button by default. So, when user received a
notification in Zulip via Safari, it triggers an error when
trying to play the notification sound.
Our goal for this commit is to simply handle the error.
When marking an unread topic as read with `unread` filter selected,
we don't need to move user a row down since removing the selected row
will automatically move the user down.
Without this, the user goes down twice which is not intended.
Removed a redundant call to bootstrap typeahead's `lookup` function when
the `automated` function returns true, which was causing the streams
typeahead to show up briefly before the topic typeahead on pressing `>`
immediately after a stream name.
When we converted the change email form to a dialog widget modal,
in commit f43d3b9986, the page_params value for delivery email
that was being referenced in the handlebars template
`change_email_modal.hbs` was not set, so instead an empty string
was the initial input value. Because the email change dialog
widget post_render callback sets the input value to the same
delivery email, the fact that the email was not being set when
the template was initially rendered was not noticable.
Passes the page_params.delivery_email to the html parameter in
dialog_widget.launch so that the template has the initial value
set when the form is initially rendered. Removes the now redundant
post_render callback, which resets the initial input value to the
same delivery email.
When the password change form was converted to a dialog widget
modal, in commit f5fbf5f0e0, the page_params values for
password_min_length and password_min_guesses that were referenced
in the handlebars template `dialog_change_password.hbs` had no
value to set, which meant the password quality bar was no longer
checking the input value against those organization settings.
Passes the page_params values for password_min_length and
password_min_guesses to the html parameter in dialog_widet.launch
for the password change modal so that those values are available
and set when the template is rendered.
The previous hide-date CSS class had a semantic meaning of "this
recipient row has the same date as the previous one"; since we're now
having logic read that value, it's worth giving it a semantic name
that makes that code easier to understand.
Previously, when a user view the message source of a message at the
very top with the blue box around, the tooltip for the button will
be partially hidden by the recipient bar. Ths cause is some legacy
CSS from, for example, 3cd33c0fea,
which increased the z-index for the bodies of selected messages.
The intent of that code appeared to be something around handling overlaps
between unread indicators and the blue selected message box. It's logically
incorrect, and testing demonstrates that the blue box works fine next to unread
messages without this change, so we can safely remove these z-index values.
webpack-dev-server 4.12.0 introduced a global handler that shows a
full-screen overlay for all runtime errors, but it’s redundant with
our blueslip_stacktrace handler and less functional at this time.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit adds a period ('.') at the end of the default banner
in the narrow empty search for multiple filters. This is required
to maintain consistency among all banners, as for most banners, we
use punctuation at the end of the banner to create complete and
meaningful sentences.
This commit improves the display of the narrow banner when there are
multiple filters used in a narrow search and no results are found.
The banner will now only display the title 'No search results'
The node tests have been updated to reflect this change.
Removing browser_history.js import in overlays.js
helps to completely solve the dependency cycle issue for
importing dialog_widget.js in upload_widget.ts in PR #24426.
Removed the only use of browser_history in overlays.js
which was 'browser_history.exit_overlay()'cin open_settings
function by defining open_settings_overlay function in settings.js
and calling 'browser_history.exit_overlay()' in settings.js.
also removed overlays.js import in admin.js as the only use of
overlays was to call open_settings function which is now shifted
to settings.js and is called as settings.open_settings_overlay.
Moved the initialize function in popover.js at end of file to
follow 'no-use-before-define' for function 'hide_all' being called
in initialize function and to follow convention to put
initialize at the end of the file.
The import of recent_topics_ui.js from unread.js generates an import
loop. To remove this, we need to move the logic for rerendering recent
topics after update_message_for_mention out of the low-level unread.js
data module.
Since the logic was conditional on `content_edited` being true, and
that parameter is only passed in the message_events.js code path, we
can do this by just making the function return a boolean for whether
this rerender may be required, and moving the rerender logic to that
calling module.
The mutation handler was correct for user list in the right
sidebar but was incorrect for pms list in the left sidebar.
Since the left sidebar is updated differently, we need to
check for mutations on the element actually being updated.
This also required using a target node that is always present
for the pms list which otherwise throws an exception.
The `.integration-lozenges` children may contain
non-`.integration-lozenge` elements; if there were no matching
integrations, attempting to fetch the css `display` property of those
failed.
Switch to using jQuery to find the full set of visible lozenges
directly; this does the right thing if there are no such elements.
With the autocomplete dropdown, some users face trouble or uncertainty
while selecting topics. The autocomplete dropdown may encourage users
to find and select an existing topic rather than starting a new topic.
The changes adds a hint text to the topic typeahead dropdown to
encourage users to either start a new topic or select an existing
topic.
Fixes#23295.
This gives more comprehensive support of new and future CSS features
that can be transpiled for older browsers.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This reverts commit e16e7630e6 (#19542).
This was compiling to
a.messagebox-content .message_time {
z-index: 1;
}
which did nothing, because .messagebox-content is a <div>, not an <a>.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Since the message time of locally echoed messages were not displayed
and their width was restricted by `notvisible` CSS class, it
resulted in width available to message text changing after the message
was successfully sent and the time was displayed.
To fix this, we just try to set opacity of the message time to 0
for locally echoed messages.
`{{#tr}}` supports HTML and allows translators to accidentally
introduce HTML, so it’s safer to use the `{{t}}` helper unless HTML is
needed.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This implements a helper that parses an array that possibly contains
falsy elements into undefined when it does have at least one falsy
element, or returns a type narrowed array of non-undefined elements.
We use this in people.js, which achieves the same check we have using
"arr.every(Boolean)", but with type safety since it is not based on
validation.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Returning undefined as opposed to false makes more sense in the context
of this function. This also will simplify the type annotation.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Fixes#23588
When a new message arrives in an inactive stream, it will lead
to stream being marked as active from inactive which leads to
stream list being rearranged which zooms out the user since the
active stream is reset momentarily. To avoid this, we delay the
stream list redraw until user zooms out and only update the topics
list.
Having active streams greyed out can be confusing to the user. This
is especially useful when the app is still fetching messages on
a reload and the active stream has no messages and is thus marked
as `inactive`.
This makes our frontend code less verbose, and makes this name
consistent with the names of other visibility policies (which
do not have the `VISIBILITY_POLICY` prefix).
Currently, there is a checkbox setting for whether to
"Include realm name in subject of message notification emails".
This commit replaces the checkbox setting with a dropdown
having values: Automatic [default], Always, Never.
The Automatic option includes the realm name if, and only if,
there are multiple Zulip realms associated with the user's email.
Tests are added and(or) modified.
Fixes: #19905.
Prevents multiple simultaneous requests to the API when adding or
removing reactions. This commit blocks emoji state changes until
the request is executed.
Fixes part of #21213
The loading message that appears at the
top of the page when loading the Bots/
Uploaded Files/Users/Deactivated Users
page under Settings appears to be misaligned.
We fix this by changing the height of the
loading-spinner to match the line-height
of loading text.
We now set the width of dropdown menu opened for dropdown-list-widget
elements such that it is enough for all the options. For smaller
screens the dropdown menus are wide since the settings panel and
modal content can be scrolled horizontally.
This change is done only for dropdown-list-widget elements in
"Organization settings" panel and in bot-owner widget in bot edit
modal.
We don't do this change for move topic modal now as it cannot be
scrolled horizontally and appears beneath the button due to position
property.
This commit sets width of toggle buttons for dropdown list
widget elements same as select elements in both organization
settings. We set the min-width to be 325px and max-width to
100%.
The height of stream edit panel in stream settings panel was set
incorrectly for width less than "$md_min" so one could not scroll
to the bottom. This commit fixes the height to set it same as it
is for normal width screens since the height of elements above
the scrollable container does not change with screen width.
We make settings page horizontally scrollable such that
the user can see the complete dropdown by scrolling in
case the dropdown is wider than the screen.
This commit fixes width of dropdown-list-widget used for
can_remove_subscribers_group stream setting. The button width
is set as per the selected option with min-width being 325px.
The dropdown-menu width is set as per the longest option and
the menu becomes scrollable if the whole menu doesn't fit on
screen.
We also change the position of dropdown-menu slightly such that
its top border matches with the top border of button.
This commit sets width of select elements in stream settings
page to "auto" such that the width adjusts to fit the options
as required in different languages and we also keep minimum
width of 325px to maintain consistency of width across elements
in the page to not look ugly.
This commit sets width of select elements in settings page
to "auto" such that the width adjusts as required in different
languages and we also keep minimum width of 325px to maintain
consistency of width across elements in the page to not look
ugly.
We also remove the CSS for overriding width of various role
based select elements and a couple of others which was added
to adjust the widths for different languages. Since we have
now set the width to auto, the browser will automatically
adjust width to fit the options.
Picking up the work from where 65aa1070 left off, this commit adds a
meta state to the hotspots module. This allows us to keep track of
whether or not a hotspot's overlay is currently open from within
javascript. With this in place, is_open is then modified to look at this
new state rather than query the DOM, providing a significant performance
boost.
Fixes#24261
In preparation of fixing the performance issues associated with
hotspots.is_open, this commit moves the various handlers for hotspots'
overlay from click_handlers.js into the hotspots module. This will set
us up to cleanly keep track of the open state from within the module
(instead of needing to look at the DOM).
Since we are migrating from JavaScript to TypeScript
some files in the documentation are still with their
old extension. This commit changes those file extensions.
Added a separate template file for banner
messages in bots panel under personal and organisation
settings.
Banners for bots panel under personal
settings are shown only when user cannot add bots.
Banners for bots panel under organisation settings are shown
only when user cannot add bots or user is administrator.
Fixes#24155
Added a 1000ms fadeout timer to the success banners for the 'Emoji'
theme and 'user-list-style' checkbox, to match the other banners in
display settings.
Fixes: #23288.
Move the 'user-list-style' checkbox from the 'Emoji' section to the
'Advanced' section, and update the 'settings_display.js' file by
replacing the 'theme-settings' classname with 'advanced-settings'
classname to display the success banner of 'user-list-style' checkbox
with the 'Advanced' title.
Rename 'Sync with computer' to 'Automatic (follows system settings)',
'Light Theme' to 'Light' and 'Dark Theme' to 'Dark', and rename the
color scheme label to 'Theme'.
Reorder the dropdown menu to have light theme before dark theme.
Rename the 'Theme' section to 'Emoji'. Since there is no 'Theme' section
anymore, replace the 'theme-settings' classname with
'emoji-display-settings' in the 'settings_display.js' file.
The existing "Theme" selector dropdown is moved from the now the
'Emoji' section to the 'General' section.
Rename the 'language-time' title to 'General'. As the 'language-time'
section no longer exists, replace the 'lang-time-settings' classname
with the 'general-settings' classname in the 'settings_display.js' file.
Updated the 'change-the-time-format.md' and 'change-your-language.md'
documentation files to reflect these changes.
To pass the puppeteer_test Replaced the 'lang-time-settings-status'
classname to 'general-settings-status' inside 'settings.test.ts' file.
This is a Prep PR for #24426.
Removes direct dependency cycle between 'popover.js'
and overlays.js by creating popover.initialize method
called from 'ui_init.js' that calls
overlays.register_pre_open_hook(hide_all) and
overlays.register_pre_close_hook(hide_all).
Created a function call_hook that loop call all
registered hooks at the start of 'open_overlay' and
'close_overlay'.
This commit changes the "Show API key" modal to use a more intuitive
description of the user's password field, and also to put the reset password
option, which should be the less common case, at the end.
Fixes: #24506.
When the 1st line of a draft message took up the maximum horizontal space
possible, the last character was way too close to the pencil icon. More
noticeably, when a message began with a code block, it's right edge would
touch the icon.
To space the message contents and the restore draft button, now a margin
of 5px has been added to the draft message content. This makes the message
content narrower by 5px.
Until now, whenever the hash was updated using the `set_hash` function,
the new url was always pushed into the browser history, even if the current
hash was same as the new hash. This lead to multiple duplicate entries in
the browser history, when using the `z` hotkey to zoom to a message
repeatedly, which is very inconvenient when navigating through history.
This is now fixed by simply returning prematurely from `set_hash` if the
new hash is same as the current one. This fix will also prevent any future
features like `z` from causing duplicate browser history entries.
Fixes: #24468.
In narrow screens, the save/discard widget was incorrectly shown
even with no changes, due to the CSS intended to switch it from `inline-block`
to `block display.
Fixed by adding `display: none` to `.hide` class for @media(width < 575px)
to hide buttons on screen width less than 575px.
Fixes#24589.
Zulip already has integrations for server-side Sentry integration;
however, it has historically used the Zulip-specific `blueslip`
library for monitoring browser-side errors. However, the latter sends
errors to email, as well optionally to an internal `#errors` stream.
While this is sufficient for low volumes of users, and useful in that
it does not rely on outside services, at higher volumes it is very
difficult to do any analysis or filtering of the errors. Client-side
errors are exceptionally noisy, with many false positives due to
browser extensions or similar, so determining real real errors from a
stream of un-grouped emails or messages in a stream is quite
difficult.
Add a client-side Javascript sentry integration. To provide useful
backtraces, this requires extending the pre-deploy hooks to upload the
source-maps to Sentry. Additional keys are added to the non-public
API of `page_params` to control the DSN, realm identifier, and sample
rates.
Currently, when a user marks messages as unread in a stream/topic
and unsubscribes from the stream, both subscribe button and compose
banner will remain visible. This change will hide the compose banner
when the user unsubscribes from the stream and hopes to create a
better flow and reduce confusion.
Previously, when you did a "mark as unread from here" operation, we triggered
a full rerender of both the recent topics view and the message feed. This was
needlessly expensive, on and a large server with a somewhat busy CPU from
other applications, can cause a visible lag, even when the message feed that
you're looking at only has like 3 messages in it.
Improve this by passing the set of modified messages to the rerender.
There's likely further improvements to be made here -- we shouldn't need to
do more than toggle the unread markers -- but this should be good enough to
eliminate the visible lag.
Fixes#24263.
Previously the 'Support Zulip' option linked to Github Sponsors.
We now link to our own https://zulip.com/help/support-zulip-project,
which describes more options for how to support the project.
Fixes#24230.
Adds a `div` wrapper with the `rendered_markdown` class to the
content in `confirm_emoji_settings_warning.hbs`, so that the
inline code element has the intended CSS rules applied.
Because the `p` element also has the `rendered_markdown` class,
the margins for this element in the modal are slightly changed
(3px on top/bottom). Previously, the margins for this element were
being set from a bootstrap rule (10px on bottom).
This function was mistyped; it was used in practice both accepting
string[] and number[], with the implementation taking advantage of the
fact that number.parseInt(<int>, 10) = <int>.
The only string[] callers were some overly defensive typing_data tests
that don't match the actual typing_data interface, so we remove the
string[] support and adjust the function's type, as well as those
tests.
When someone hovers over the Github username in the popover
with dark theme, a background will appear. These changes
ensures that the `background-color` isn't overwritten by
other CSS.
This commit adds inline_decorated_stream_name component
which is used to show stream name along with its privacy
type icon. This component is added such that we can align
the icon and stream name properly as there are many
instances where the icon and name are not aligned in the
current UI.
This component is only used in "Archive stream" modal for
now and will be used for other UIs as well in future.
Revises descriptive text and examples at the top of the code
playgrounds tab in the organization settings overlay to be shorter,
have only one example that includes the name field.
Also, adds the `rendered_markdown` class to the HTML code elements,
via an HTML span element so that the specific CSS rules for code
elements with that class will be applied to these examples.
Revises descriptive text and examples at the top of the linkifiers
tab in the organization settings overlay to be shorter, have only
one example and updates help center link text for capitalization.
Adds a link to the help center in the form/input area for adding
a new linkifier, which is consitent with the code playgrounds tab,
and means the link would be there if the form was converted to a
modal.
Also, adds the `rendered_markdown` class to the HTML code elements,
via an HTML span element so that the specific CSS rules for code
elements with that class will be applied to these examples.
Updates `markdown.css` to remove border styling from code
elements, and instead use background-color (as well as
font-family) to visually highlight inline code elements
as distinct from regular text.
Updates code element font-family to be the same as in
`zulip.css`.
Makes padding on the left and right the symmetrical for
inline code elements. Previously there was 4px padding on
the right, but not on the left.
Maintains anchor font-color styling for code elements that
are also links.
Updates `markdown.css` and `rendered_markdown.css` for the rules
in `bootstrap.css` that were being used to style code elements and
removes the now redundant/ignored rules from `bootstrap.css`.
After b21f533af, we now update the organization bots
list on receiving realm_user events since non-admins
can also see bots not owned by them in the list.
But the functions to update bot list should be called
only for bot users and not for others, otherwise it
results in an error.
This can be reproduced by first opening the organization
bots list and then just updating the name of the user.
Calling `redraw_bots_list` on receiving "realm_user/add"
event for non bot users will not raise any error but
still we avoid redrawing the whole list when not required.
This commit fixes the code to call functions to update
bot list only when the event is received for a bot.
This added functionality will be used to compare pygment_language from
Code Playgrounds.
There is a choice of how to sort languages with popularity versus
without popularity. I chose to sort the Code Playground custom language
after other pygment languages based on the reasoning in the comments.
In preparation for adding logic for Code Playground languages, which has
no popularity score, extracting the popularity comparison part of the
logic out to evolve it in future diffs.
compare_by_popularity() actually does two things:
1. compare A and B by their popularity
2. then if needed, compare alphabetically to break ties
Someone reading the function name might not be clear about that detail.
I'm renaming this function to remove the "by_popularity" wording, which
can mislead readers. I also added comments to clarify the detail.
The goal in future diffs is to break this up and make it more self
explanatory.