Commit Graph

46397 Commits

Author SHA1 Message Date
Alya Abbott 1572e097d9 docs: Add a section on code review communication style. 2022-03-03 16:42:23 -08:00
Julia Bichler 24673b7a69 settings: Grey out muted streams in personal settings.
Muted streams are now greyed out in the personal settings,
also changes to the notification settings of a muted stream are
not possible anymore.

Also, add a bell-slash icon after the stream name of muted streams,
clicking on it unmutes the stream.

Fixes #19780.
2022-03-03 14:51:15 -08:00
Tim Abbott 76e5715c26 stream_edit: Fix live update for toggling muting.
Previously, updating the UI when streams are muted was split between
two places: The server_events.js code path, which updated the checkbox
state and other parts of the app, and checkbox click handler, which
toggled the disabling of the notification settings checkboxes.

Move these to all live in a single place.
2022-03-03 14:51:15 -08:00
Tim Abbott a93e8d37d4 stream_edit: Extract update_muting_rendering. 2022-03-03 14:51:15 -08:00
Austin Riba 75a29d6b82 lightbox: Remove Pan/Zoom enable button.
With the recent changes to lightbox image handling in #21145 and #20788
it is no longer necessary to have panning and zooming disabled by
default. This commit removes the enable/disable button and instead
replaces it with a "Reset Image" button, and enables panning and zooming
as the default state of the lightbox.
2022-03-03 13:48:32 -08:00
Austin Riba eae0975b63 lightbox: Prevent long titles from altering layout.
This commit attempts to prevent images with long filenames,
descriptions, or author names displayed in the lightbox from altering
the layout of the page.

It also adds a title prop to both the filename and author, allowing a
user to hover and see a tooltip of the full text in the case where the
text is truncated.

Fixes #21058.
2022-03-03 13:48:32 -08:00
Tim Abbott aa2d66d2a4 i18n: Update translation data from Transifex.
This includes a new Welsh translation!
2022-03-03 11:47:18 -08:00
Dinesh 59e057c9d1 puppeteer: Resurrect test_change_password.
353d0f9 removed this test as it was causing alert words test
fail non-deterministically. See 353d0f9's commit message for
some more details.

Rearranging the order to make this test run in the end can
eliminate the non-deterministic failures due to this test.

Because we reset the test database in between test files, we don't
expect there to be any issues with test files running after this.
2022-03-03 10:17:13 -08:00
Anders Kaseorg 44767dd653 tippyjs: Avoid unsafe allowHTML API in favor of <template> elements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-03 10:13:24 -08:00
Steve Howell 8c1ed7359f manage streams: Promote "Announce stream" in UI.
The option to announce streams is tied to whether
it's public or not, so it makes sense to move it
here.
2022-03-03 10:08:08 -08:00
Steve Howell 353d0f9e4f puppeteer flake: Remove call to test_change_password().
Changing the password seems to randomly cause one of
our calls to /json/events to return a 401.

The symptom of this is that when you update alert words,
we don't get the event, and the alert words list does
not get updated.

More context here:

    https://chat.zulip.org/#narrow/stream/43-automated-testing/topic/alert.20word.20flakes/near/1334824

It is possible that this reflects an actual problem in
our system when you update passwords.

For now, though, the goal is simply to make this test
reliable, so that we don't have to chase down this flake
any more. It was a particularly tricky flake to debug,
since the alert words test really wasn't at fault here.

It's plausible that we don't want to have the app declare
success when the server acks an alert word POST, and the
app should instead wait for the event to come back before
giving any confirmation to the user.
2022-03-03 08:10:28 -05:00
NerdyLucifer a5d22b1d1e message_feed_ui: Make unread marker line continuous.
Make the unread marker lines at the side of messages continuous by
adding "height: 100%" to ".unread-marker".

This provides a nicer visual experience by not highlighting the
boundaries between messages. (One can see that information using the
timestamps or by moving the selection cursor, where appropriate).

Fixes #20981.
2022-03-02 17:21:30 -08:00
NerdyLucifer c355feea0e dropdown_list_widget: Hide 'disable' button when nothing is selected.
Hides 'disable' button of any kind when nothing is selected
in dropdown list widgets  by removing ':enabled' selector from
the button, the button is not actually a button, it's an <a> tag which
doesn't support "disabled" attribute.

Fixes part of #20831.
2022-03-02 17:18:50 -08:00
Austin Riba df1d395d4e shared: Add flow types for internal_url.
Adds flow type declarations for the shared internal_url module making
it integrate better with zulip-mobile.
2022-03-02 16:42:45 -08:00
Anders Kaseorg 3848050456 ci: Temporarily disable Ubuntu 22.04.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-02 16:00:35 -08:00
Dinesh 36cc322525 tooling: Add --loop option to test-js-with-puppeteer. 2022-03-02 12:57:09 -05:00
Dinesh 02cf8e831f refactor: Extract code of running a single puppeteer test into a function. 2022-03-02 12:57:09 -05:00
Dinesh a529dc8c76 tooling: Make test-js-with-puppeteer fail fast on passing invalid file names.
fixes: #20970
2022-03-02 12:57:09 -05:00
jai2201 a8b948c086 tippy: Fix `cancel button` tooltip in compose box.
Add `data-tippy-allowHTML="true"` in button tag and fix the tooltip
for cancel button in compose box.
2022-03-02 09:39:15 -08:00
Anders Kaseorg bdcd9da7e9 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 23:09:46 -08:00
Anders Kaseorg c09bca34b8 frontend_tests: Fix unicorn/text-encoding-identifier-case.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 23:09:46 -08:00
Anders Kaseorg d4d277bd1f styles: Remove legacy IE gradient filters.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 23:09:46 -08:00
Anders Kaseorg bff2741499 install-shfmt: Upgrade shfmt from 3.4.2 to 3.4.3.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 23:09:46 -08:00
Anders Kaseorg 60e943b92e install-node: Upgrade Node.js from 16.13.2 to 16.14.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 23:09:46 -08:00
Anders Kaseorg 9bdf230642 docs: Fix another case of Git capitalization.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 22:26:29 -08:00
Tim Abbott ee7f56724b CONTRIBUTING: Advertise Git guide more clearly. 2022-03-01 22:18:42 -08:00
Yogesh Sirsat 67870090f5
settings: Use "Label" consistently for custom profile field label.
We use Label as the heading for the field label column in the custom profile
fields table; but for some reason the edit UI called this "Name" instead.

Fixes #21260.
2022-03-01 21:08:34 -08:00
Alya Abbott e2683b7f09 docs: Update contributing guide to clearly point to code review doc. 2022-03-01 21:04:42 -08:00
Alya Abbott d90907b006 docs: Rewrite code review documentation. 2022-03-01 21:04:42 -08:00
Aman Agrawal e0aba4c639 recent_topics: Center align globe icon. 2022-03-01 21:00:36 -08:00
Austin Riba b22578f975 hash_util: Rename _uri functions to _url.
It's 2022 and the WHATWG no longer recognizes the term URI. Everything
is now a URL or a type of URL. Which is great because it's way less
confusing. Details here:
https://url.spec.whatwg.org/
2022-03-01 18:14:31 -08:00
Austin Riba b39d47995d hash_util: Move stream uri functions to shared.
Moves hash_util.by_stream_uri and hash_util.by_stream_topic_uri to
internal_url so they can be used by external codebases. Due to these
functions being called in many places in the web codebase, wrappers
for both functions are left in hash_util in order to keep these
calls simple.

Also adds test for explicitly testing each function.
2022-03-01 18:14:31 -08:00
Austin Riba 9f1c184311 hash_util: Move encode_stream_id to shared.
Move hash_util.encode_stream_id to internal_url, so it can be shared
with external codebases. Also add a test that explicitly tests escaping
special characters in stream names.
2022-03-01 18:14:31 -08:00
Austin Riba 403310a9e2 hash_util: Move stream_id_to_slug to shared.
Move stream_data.id_to_slug to internal_url, making it shareable. The
function has been renamed to stream_id_to_slug to reflect that it
operates on a stream id.
2022-03-01 18:14:31 -08:00
Austin Riba c0828f118b hash_util: Move enc/decodeHashComponent to shared.
Moves the encodeHashComponent and decodeHashComponent functions out of
hash_util and into internal_url which belongs to shared. This is to
accommodate sharing of this code with mobile or any other codebases that
do not wish to duplicate logic.
2022-03-01 18:14:31 -08:00
Austin Riba f6d9a0b5a4 hash_util: Pass up decoding exception.
In order to accommodate the sharing of hash_util with other codebases
including mobile, UI and web specific code should be removed. In this
commit, we remove exception handling for the decodeHashComponent
function and instead add the UI handling of it further up the call
stack.
2022-03-01 18:14:31 -08:00
Austin Riba 980fd2f976 streams: Fix malformed stream name slugs.
The stream_data.id_to_slug and stream_data.name_to_slug
functions mistakenly used Javascript's String.replace method,
this commit changes it to use String.replaceAll, the result
being slugs generated from streams with names greater than
2 words are now properly formatted.
2022-03-01 18:14:31 -08:00
Anders Kaseorg 8ed7dcf4c0 rendered_markdown: Appease zjquery.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 15:19:15 -08:00
Anders Kaseorg e24036565b node_tests: Adjust for other_sender_names rename.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 15:02:20 -08:00
Anders Kaseorg d22fca7a78 timerender: Fix object-shorthand ESLint error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 14:37:48 -08:00
Anders Kaseorg e090027adc CVE-2022-23656: Fix cross-site scripting vulnerability in tooltips.
An attacker could maliciously craft a full name for their account and
send messages to a topic with several participants; a victim who then
opens an overflow tooltip including this full name on the recent
topics page could trigger execution of JavaScript code controlled by
the attacker.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 14:26:42 -08:00
Tim Abbott 05a17e5854 spectator: Use display: revert for only-visible-to-spectators.
Inherit uses the settings of the parent element; we actually want to
just undo the `display: none` we'd set for this CSS property, which is
what revert is for.
2022-03-01 11:55:24 -08:00
Tim Abbott 7cc553b75d spectators: Add divider before sidebar login/signup buttons.
This slightly improves the visuals of this component.
2022-03-01 11:51:46 -08:00
Tim Abbott c710d18ec5 spectators: Use display: inherit for only-visible-to-spectators.
The previous `display: unset` logic didn't work with dividers in the
gear menu. This new version should be correct -- what we want to do
here is just override the `display: none` default for this class, not
revert to the default browser styling for that element type.
2022-03-01 11:45:54 -08:00
Aman Agrawal 7e365f7ee3 icons: Replace fa-globe icon with a custom globe icon. 2022-03-01 11:36:38 -08:00
Anders Kaseorg de1fb2b8d0 check-database-compatibility: Ignore guardian, django.contrib.sites.
We can safely ignore the presence of the extra tables that could be
left behind in the database from when we had these installed (before
Zulip 1.7.0 and 2.0.0, respectively).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 10:30:23 -08:00
yogesh sirsat 1a15d60de4 settings: Fix external account profile field initialization order.
In open_edit_form, we had an initialization order bug where we called
set_up_external_account_field_edit_form, which clears the field name
field if the external account is of the "custom" type, after
populating the initial values for edit form.

This resulted in these fields being displayed as empty in the UI for
this field type. Fix the issue by reordering the initialization.

Fixes: #21262.
2022-02-28 16:30:49 -08:00
Anders Kaseorg 3ba444096b Revert "docs: Temporarily disable parallel building."
This reverts commit b7561049b765946d612069b52330695e8489bc7f.

The bug it worked around was fixed with the previous commit’s
upgrade.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-28 16:28:31 -08:00
Anders Kaseorg 75c182cb2a requirements: Upgrade MyST-Parser.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-28 16:28:31 -08:00
Anders Kaseorg 75525f5b53 docs: Convert .html#fragment links to .md#fragment.
This uses the myst_heading_anchors option to automatically generate
header anchors and make Sphinx aware of them.  See
https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#auto-generated-header-anchors.

Note: to be compatible with GitHub, MyST-Parser uses a slightly
different convention for .md fragment links than .html fragment links
when punctuation is involved.  This does not affect the generated
fragment links in the HTML output.

Fixes #13264.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-28 16:28:31 -08:00