Commit Graph

38110 Commits

Author SHA1 Message Date
Anders Kaseorg bc7bec9a95 landing-page: Clean up ready callbacks.
jQuery’s $(callback) already checks document.readyState to decide
whether to run the callback immediately (that’s like, jQuery’s entire
value proposition).  We probably don’t need ready callbacks at all
anymore thanks to <script defer>, but that’s a larger change.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 15:48:33 -07:00
Anders Kaseorg e9df82ac31 landing-page: Remove onunload hack.
This was there for the page transition animation that was removed in
commit a0dacea811 (#9334).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 15:48:33 -07:00
Anders Kaseorg 498fe285fa js: Access ‘disabled’ as a property, not an attribute.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 12:20:23 -07:00
Anders Kaseorg 6800c3363f message_edit: Use the jQuery css method for style, not removeAttr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 12:20:23 -07:00
Anders Kaseorg 0f76e98963 typeahead: Replace various deprecated jQuery methods.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 12:20:23 -07:00
Anders Kaseorg a2a5871088 js: Replace deprecated $.trim method.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 12:20:23 -07:00
Anders Kaseorg 611f2a4321 js: Replace deprecated $.unbind method.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 12:20:23 -07:00
Anders Kaseorg 7ba3a26cd5 search: Replace deprecated jQuery event trigger shorthand.
$.fn.typeahead, on the other hand, returns the jQuery object back (not
the Typeahead object, which also happens to have a select method), so
this should be converted.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 12:20:23 -07:00
Emilio López 7b35234c7b
email_mirror: Fix exception handling unstructured headers.
This commit rewrites the way addresses are collected. If
the header with the address is not an AddressHeader (for instance,
Delivered-To and Envelope-To), we take its string representation.

Fixes: #15864 ("Error in email_mirror - _UnstructuredHeader has no attribute addresses").
2020-07-22 12:11:25 -07:00
Anders Kaseorg a8bef38151 js: Fix incorrectly converted blur, click, focus method calls.
Commit a9ca5f603b (#15863) incorrectly
converted these.  e.target is a DOM element, not a jQuery element;
likewise for the elem parameter of activate_element.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 20:01:57 -07:00
Anders Kaseorg 2d8cab2cee stream_sidebar_actions: Rename toggle_home to toggle_stream_muted.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 18:26:20 -07:00
Anders Kaseorg e6a66063a9 stream_edit: Restore keyboard accessibility to checkboxes.
Listen to change events from the checkbox and pay attention to its
actual value, rather than simulating it by toggling booleans on click
events.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 18:26:20 -07:00
Anders Kaseorg 11bde22cb3 ui_util: Fix incorrectly converted focus method call.
Commit a9ca5f603b (#15863) incorrectly
converted this; el is a DOM element, not a jQuery element.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 18:26:05 -07:00
Anders Kaseorg 79d20c7c21 version: Bump PROVISION_VERSION for :slight_smile: rename.
Commit 45e19dd6b9 (#15627) required an
emoji rebuild.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 18:25:18 -07:00
Gittenburg 45e19dd6b9 emoji: Rename :slight_smile: to 😄.
Zulip converts :) to the 1F642 Unicode emoji and promotes the same emoji
in the popular section of the emoji picker.

Previously Zulip has labeled 1F642 as "slight smile". While that name
conforms to the Unicode standard (which describes the code point as
SLIGHTLY SMILING FACE), it didn't match our use case of the emoji.

If a user types :) or selects the first smile in the emoji picker they
probably mean to express a regular "smile" and not a "slight smile",
which raises the question why they are only smiling slightly.

This commit relabels 1F642 as 😄 and our previous 😄 263A as
:smiling_face:. Note that 263A looks different in our three supported
emoji sets, so it is not suited to be our "default smile".

This change does not require a migration since our emoji system stores
both unicode points and names and handles name changes transparently.
2020-07-21 16:49:54 -07:00
Anders Kaseorg 308883302d lint: Make prettier quieter when fixing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 16:31:18 -07:00
Mohit Gupta c65729511a tests: Mock print() for management command tests.
This avoids spam in test-backend output.
2020-07-21 16:22:36 -07:00
Mohit Gupta a7db38c6c9 tests: Verify error logs in mirror dummy user tests.
This commit verify that error logs are logging using assertLogs to avoid
spam in the output in ./tools/test-backend.
2020-07-21 16:22:26 -07:00
jagansivam28 dac8f4f20f upload widget: Realign upload widget text to center. 2020-07-21 16:19:21 -07:00
jagansivam28 5f874a51f7 upload widget: Rename image upload widget upload text CSS class.
Previously, image upload widget delete text CSS class name was
`settings-page-upload-text`.
We can change the CSS class name to `image-upload-text`
so that the name can be more generic.
2020-07-21 16:19:21 -07:00
jagansivam28 ad0ff10598 upload widget: Rename image upload widget delete text CSS class.
Previously, image upload widget delete text CSS class name was
`settings-page-delete-text`.
We can change the CSS class name to `image-delete-text`
so that the name can be more generic.
2020-07-21 16:19:21 -07:00
jagansivam28 90cb72b103 upload widget: Rename image upload widget delete button CSS class.
Previously, image upload widget delete button CSS class name was
`settings-page-delete-button`.
We can change the CSS class name to `image-delete-button`
so that the name can be more generic.
2020-07-21 16:19:20 -07:00
jagansivam28 d1b0a12c2d upload widget: Rename image upload widget background css class. 2020-07-21 16:13:24 -07:00
jagansivam28 1702f7f802 upload widget: Change image upload widget CSS class name.
Previously, image upload widget CSS class name was
`avatar-icon-logo-settings`  it is not relevant to the widget so
we can change the CSS class name to `image_upload_widget`
so that the name can be more generic.
2020-07-21 16:13:23 -07:00
Clara Dantas 8b30e03d4b models.py: Add get_role_name function in UserProfile class.
This function returns the name of the user role that we can use
to display in error report emails.
2020-07-21 16:12:16 -07:00
Tim Abbott 51d4d210d4 stream_edit: Use preventDefault and stopPropagation.
We should be using these patterns consistently in our click handlers.
2020-07-21 13:32:31 -07:00
SiddharthVarshney fb3484df52 stream-settings: Change checkbox UI.
These checkboxes will now be more consistent
in design as we have in other part of the UI.

e.preventDefault() is added inside the
stream_is_muted_clicked function will disable
the default checkbox and make sure click event
come from only <span> part of the checkbox.
2020-07-21 13:27:21 -07:00
SiddharthVarshney a179648f0b compose: Change style of `Press Enter to send` checkbox.
This checkbox style will now be more consistent
with checkboxes used in settings modal.
2020-07-21 13:27:21 -07:00
Tim Abbott b350c6ffb7 lint: Add DevAuthBackend to capitalized strings. 2020-07-21 13:23:58 -07:00
Tim Abbott 9efec1f929 auth: Clean up DevAuthBackend error messages.
We had a user confused by these error messages, which suggested they
needed to enable something rather than using a development
environment.
2020-07-21 12:55:11 -07:00
Anders Kaseorg 96dcc0ce6e js: Use ES6 object literal shorthand syntax.
Generated by ESLint.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:42:22 -07:00
Mohit Gupta b2745f6e41 tests: Verify info logs logging in test_fix_unreads.
This commit verifies info logging in test_fix_unreads using assertLogs
so that the logging do not spam ./tools/test-backend output.
2020-07-21 12:22:21 -07:00
Mohit Gupta 363cd8c099 tests: Make errors stream for ERROR_BOT to report in test_report_error.
ERROR_BOT setting is not None during testing, so running
test_report_error without making errors stream was causing exception.
This commit make a stream name errors thus removes exception and error
log spam caused by it in ./tools/test-backend output.
2020-07-21 12:22:21 -07:00
Mohit Gupta 4c561653b3 tests: Verify info logs while testing send_to_email_mirror command.
This commit tests if info logs are logging using assertLogs so that the
log do not spam the test output.
2020-07-21 12:22:21 -07:00
Mohit Gupta c02e011be4 tests: Verify error logging of Internal Server Error in simulate_error.
This commits verify error logs while simulate_error simulates an error
using assertLogs so that the logs do not spam the test ouptut.
2020-07-21 12:22:21 -07:00
Mohit Gupta 40d59f7cf4 tests: Verify error logs while data export for zulip.
This commit verify that error logging while testing data export in
test_notify_realm_export_on_failure using assertLogs so that the logs
do not spam test output.
2020-07-21 12:22:21 -07:00
Mohit Gupta ef5ad080e2 tests: Verify logging on error in check_send_webhook_fixture_message.
This commit tests if error logs are logged when an error occurs during
testing of check_send_webhook_fixture_message using assertlogs. Using
assertlogs ensure logs are not printed as spam in test output.
2020-07-21 12:22:21 -07:00
Mohit Gupta c7a68216cd tests: Verify logs of incoming webhook profile api key validation.
This commit verify warning logs while testing validate_api_key and
profile is incoming webhook but is_webhook is not set to True.
Verification is done using assertLogs so that logs does not cause spam
by printing in the test output.
2020-07-21 12:22:21 -07:00
Mohit Gupta 60ee3ce68a tests: Verify error logs by log_and_report function.
This commit verify error logs printed during testing of log_and report
function using assertLogs without printing it in test output and hence
avoiding spam.
2020-07-21 12:22:21 -07:00
Mohit Gupta 4ef0d0b40c tests: Add assertLogs for test_auth_backends.
This commit tests logging of warning log using assertLogs instead of
printing it in test output hence avoiding spam in test output.
2020-07-21 12:22:07 -07:00
Tim Abbott 9b8255d741 compose: Rename blur_textarea to better describe its purpose.
This blurs all the input elements in the compose area, not just the
textarea for the message body.
2020-07-21 12:08:40 -07:00
Gittenburg ed5a56ce53 composebox: Blur PM recipient input after close.
Previously the private_message_recipient input remained focused after
closing the composebox with Escape. On Firefox this resulted in it
gobbling up all further keyboard shortcuts until you clicked
somewhere. On Chromium this bug didn't occur because it automatically
blurs hidden inputs.

Introduced in 3a1bf04a56.

Fixes #15849.
2020-07-21 12:02:31 -07:00
Anders Kaseorg ae497c68ab zjsunit: Remove support for deprecated jQuery event shorthand.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:01:26 -07:00
Anders Kaseorg a9ca5f603b js: Replace deprecated jQuery event trigger shorthand.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:01:26 -07:00
Anders Kaseorg 4e42137bd9 js: Replace deprecated jQuery event handler shorthand.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:01:26 -07:00
Anders Kaseorg 97feea42a1 js: Replace deprecated jQuery.fn.hover.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:01:26 -07:00
Anders Kaseorg 25883d7827 copy_and_paste: Replace deprecated jQuery.fn.bind.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:01:26 -07:00
Anders Kaseorg 3510dcbe5e node_tests: Remove useless .select(noop) calls.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:01:26 -07:00
Anders Kaseorg ded548ad16 zjquery: Refactor generic_event to wrap on.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:01:26 -07:00
Anders Kaseorg 9102c5a519 node_tests: Trigger events instead of mocking handler installation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-21 12:01:26 -07:00