Commit Graph

39476 Commits

Author SHA1 Message Date
Steve Howell def3dac6ae event_schema: Add comments to top of the file.
The comments basically explain the common coding
patterns for making the checkers.
2020-09-28 12:19:28 -07:00
Tim Abbott 3242fc7388 soft_deactivation: Fix typo in logging output. 2020-09-28 12:12:04 -07:00
palash 7a7db69935 test_push_notifications: Refactor mock.patch to assertLogs.
Replaced mock.patch with assertLogs for testing log outputs
in file zerver/tests/test_push_notifications.py
2020-09-28 12:12:00 -07:00
palash 0c18113910 soft_deactivation: Change root logger to zulip.soft_deactivation.
Update logger in the following files using this logger:
test_soft_deactivation, test_home, test_push_notifications
2020-09-28 12:12:00 -07:00
Tim Abbott 899cb41857 MessageDict: Remove _finalize_payload for simplicity.
finalize_payload already has a few options; there's little benefit to
this one being implemented as a separate helper function.
2020-09-28 12:00:18 -07:00
Tim Abbott 99396b25a6 MessageDict: Add a bit of docstring documentation. 2020-09-28 11:50:02 -07:00
Tim Abbott 90ff62aabc actions: Rename message local variable to message_dict.
This is a preparatory refactor to make it easy to see the changes
using `git show` in the next commit.
2020-09-28 11:14:59 -07:00
sahil839 ae74f8aafb actions: Remove unnecessary comment in do_send_messages function.
This commit removes the unnecessary comment which was added in
9454683108, when we were using message.get() for keys which
were also passed as args in do_send_messages, but there are no
such keys in the current code.
2020-09-28 10:58:35 -07:00
sahil839 76c75fea92 actions: Remove unnecessary line from do_send_messages.
This commit removes the unnecessary line of code to get
rendered_content from message dict sent by check_message
when it actually does not inlcude 'rendered_content' key.

This line was added in 9454683108, but now we do not send
rendered_content in the message dict as we render the message
in do_send_messages itself.
2020-09-28 10:58:35 -07:00
Anders Kaseorg e78e526d06 browserslist: Drop 0.2% usage threshold to 0.15%.
This adds back Chrome 72, Chrome 70, Firefox 68, Opera 68, Safari
12.1, and Samsung 9.2.  Firefox 68 is still Debian stable’s default
browser.  This probably has no practical effects with IE 11 still
listed.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-28 10:57:49 -07:00
Anders Kaseorg f644bf2063 webpack: Use Webpack’s mode option rather than repurposing env.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-28 10:57:08 -07:00
Anders Kaseorg f628282c9e webpack: Improve comment about devtool.
Chrome breakpoints and stack traces work fine with the eval-* options;
all that breaks is that stacktrace-gps can’t extract the source
snippets from the source map with eval-*.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-28 10:57:08 -07:00
Anders Kaseorg b386e6e0f7 webpack: Name the server configuration.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-28 10:57:08 -07:00
Anders Kaseorg 9131b4f282 webpack: Include devServer settings unconditionally.
These are unused in production but there’s no harm in including them.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-28 10:57:08 -07:00
Anders Kaseorg 5006255069 webpack: Use assets object immutably.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-28 10:57:08 -07:00
Anders Kaseorg fa3ea59833 emojisets: Prefetch the octopus via Webpack.
As of commit 1cdab5ae61 we use the
octopus image through Webpack, so the prefetch needs to be from the
same Webpack URL for it to do any good.  We don’t want to waste more
bandwidth on this [AWESOME CRITICAL FEATURE] than we have to.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-28 10:57:08 -07:00
Dinesh ade7cc4ef3 puppeteer: Fix typing issue in settings test.
The failures saying incorrect password were caused due to
change in focus. Some actual code of ours calls focus on
the modal when opened but puppeteer was starting to type
before this occurs due to which the test was only able
to enter a part of string.

This was happening with change full name too but less
frequently as it's a relatively shorter string.

As a fix, we wait till the focus is on the modal and then
start typing.
2020-09-28 10:54:53 -07:00
Anders Kaseorg f033d5c3c5 puppeteer_tests: Migrate deprecated waitFor call to waitForFunction.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-28 10:54:14 -07:00
Anders Kaseorg e4931c5bc4 people: Remove unorm polyfill.
We no longer support IE11.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 16:54:25 -07:00
Gittenburg b245e1e49a compose: Display Formatting button as "Help".
The Formatting button that opens our Markdown help popover previously
had an "A" as its icon (the Font Awesome icon for font). This commit
changes the link to spell out "Help" to make it more discoverable.
2020-09-25 16:47:44 -07:00
Gittenburg 0c6df114f6 compose: Reorder message action buttons.
Now that they are tab accessible, we should order them by importance.
Previously the order was:

1. Add emoji
2. Formatting
3. Attach files
4. Add video call
5. Preview
6. Drafts

This commit changes the order to:

1. Attach files
2. Preview
3. Add video call
4. Add emoji
5. Drafts
6. Formatting

The "Add emoji" button is moved back because emojis can be more
conveniently entered using the typeahead triggered with ":" or the
emoticon conversions.
2020-09-25 16:47:43 -07:00
Dinesh acca870480 tests: Add a dummy request to self.client.login().
A later commit alters `authenticate` of EmailAuthBackend to
add a store `needs_to_change_password` variable to session
which is useful to insist users on changing their weak password.

The tests start failing with that change because client.login()
runs `authenticate` without a `request` object. So, this commit
sends a request object with `request.session=self.client.session`
to self.client.login() in tests wherever needed.
2020-09-25 16:24:18 -07:00
Dinesh 043146fa83 reset_password: Change reset password page heading. 2020-09-25 16:24:18 -07:00
Abhijeet Prasad Bodas b82bda9fb8 stats: Fix i18n not working in stats page.
Part of #16094.

Strings tagged with i18n were not being translated on the stats page.
This was because the translation data wasn't being sent to the front
end for this page.  That logic will be required in any page with a
bundle containing i18n JavaScript.
2020-09-25 16:22:34 -07:00
Abhijeet Prasad Bodas d9d51e32c1 i18n: Simplify logic for translation data in page_params.
This refactors the get_translation_data function to return an empty
dict when 'en' language is passed, to avoid repetition of code in
stats and home.
2020-09-25 16:21:37 -07:00
Abhijeet Prasad Bodas 4e6c0989db stats: Fix a string not tagged for translation.
Part of #16094.
2020-09-25 16:20:53 -07:00
Dinesh 232eb8b7cf auth: Render config error page on configuration error.
We previously used to to redirect to config error page with
a different URL. This commit renders config error in the same
URL where configuration error is encountered. This way when
conifguration error is fixed the user can refresh to continue
normally or go back to login page from the link provided to
choose any other backend auth.

Also moved those URLs to dev_urls.py so that they can be easily
accessed to work on styling etc.

In tests, removed some of the asserts checking status code to be 200
as the function `assert_in_success_response` does that check.
2020-09-25 16:16:17 -07:00
Clara Dantas 8674287192 digest: Support digest of web public streams for guest users.
This change requires some basic plumbing for test code creating
web-public streams.
2020-09-25 16:11:04 -07:00
Vishnu KS a888e65ea4 i18n: Don't include email tags in translation strings. 2020-09-25 15:53:26 -07:00
Vishnu KS 2d2ea9af6e i18n: Tag confirmation templates for translation. 2020-09-25 15:53:26 -07:00
Anders Kaseorg d72423ef21 eslint: Replace empty-returns with consistent-return.
Instead of prohibiting ‘return undefined’ (#8669), we require that a
function must return an explicit value always or never.  This prevents
you from forgetting to return a value in some cases.  It will also be
important for TypeScript, which distinguishes between undefined and
void.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:17:59 -07:00
Anders Kaseorg fe66aef0ad blueslip: Replace fatal with throw new Error(…).
This makes it clear to humans and ESLint that execution will not
continue.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:17:36 -07:00
Anders Kaseorg 93a0680881 integrations: Use namespace import for blueslip.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:33 -07:00
Anders Kaseorg df9140ae69 emoji_picker: Rename render_emoji_popover() to build_emoji_popover().
It would conflict with the imported render_emoji_popover function
after migration to an ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:33 -07:00
Anders Kaseorg 70d4674c6a buddy_data: Rename my_user_status() to get_my_user_status().
It would conflict with the my_user_status variable after migration to
an ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:33 -07:00
Anders Kaseorg 1d1eed2f17 starred_messages: Rename count() to get_count().
It would conflict with the count variable after migration to an ES6
module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:33 -07:00
Anders Kaseorg 03b05de7d5 starred_messages: Rename ids to starred_ids.
It would conflict with local variables named ids after migration to an
ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:33 -07:00
Anders Kaseorg 7c683609bd floating_recipient_bar: Rename frb_bottom() to get_frb_bottom().
It would conflict with the frb_bottom variable after migration to an
ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:33 -07:00
Anders Kaseorg 03c409da35 compose_pm_pill: Don’t reference nonexistent input_pull members.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:33 -07:00
Anders Kaseorg d206f68182 dropdown_list_widget: Move require to top level.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:24 -07:00
Anders Kaseorg 7408f6bd3d setup: Add setter for password_change_in_progress.
After migration to an ES6 module, `password_change_in_progress` would
no longer be mutable from outside the module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:24 -07:00
Anders Kaseorg 30d7090621 activity.js: Add setter for new_user_input.
After migration to an ES6 module, `new_user_input` would no longer be
mutable from outside the module.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-09-25 15:12:24 -07:00
Anders Kaseorg ff8351fb71 notifications: Rename window_has_focus variable and function.
They would conflict after migration to an ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:24 -07:00
Anders Kaseorg cf0ee63fa9 narrow_state: Remove stream_id().
It would conflict with the stream_id variable after migration to an
ES6 module, and adds no real convenience over stream_sub().

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:24 -07:00
Anders Kaseorg cb68964926 narrow_state: Rename pm_string to current_filter_pm_string.
It would conflict with the pm_string() function after migration to an
ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:24 -07:00
Anders Kaseorg b9acc5ee9a message_scroll: Rename actively_scrolling() to is_actively_scrolling().
It would conflict with the actively_scrolling variable after migration
to an ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-25 15:12:24 -07:00
Alex Vandiver 79931051bd puppet: Permit outgoing mail from postfix.
The configuration change made in 1c17583ad5 only allowed delivery to
those specific Zulip addresses.  However, they also prevent the
mailserver from being used as an outgoing email relay from Zulip,
since all mail that passed through the mailserver (from any
originator) was required to have a `RCPT TO` that matched those
regexes.

Allow mail originating from `mynetworks` to have an arbitrary
addresses in `RCPT TO`.
2020-09-25 15:09:27 -07:00
Tim Abbott 089225ea36 version: Update latest desktop release version. 2020-09-25 13:00:46 -07:00
Tim Abbott 94a9fa1891 event_schema: Add documentation and rename a few functions.
This should help make this revised subsystem readable for more new
contributors.  We still need to make updates to the high-level
documentation.
2020-09-25 12:53:00 -07:00
Steve Howell 5b7c9c4714 test_events: Add check_realm_user_remove. 2020-09-25 11:43:20 -07:00