Commit Graph

39466 Commits

Author SHA1 Message Date
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
Steve Howell 7bb7f2943f event_schema: Finish extraction with realm_emoji/update.
We now no longer define any schemas in test_events--all
of them are in event_schema, which helps our tooling
cross-check schemas for openapi and node tests.
2020-09-25 11:43:20 -07:00
Steve Howell ae4d083a5a event_schema: Extract check_realm_domains_*. 2020-09-25 11:43:20 -07:00
Steve Howell 298bed9fa1 event_schema: Split check_update_message_flags. 2020-09-25 11:43:20 -07:00
Steve Howell f6e0171d02 event_schema: Split check_reaction into add/remove.
It happens that whether you add a reaction or remove
a reaction, we send the exact same fields, just using
a different op code.

This sort of symmetry is actually kind of rare, as
usually "add" events have more fields, and "remove" events
might just send an id of something to remove.

Our openapi schema treats these as two seperate events,
so we are more consistent with it, and it helps our
schema-checking tooling for node fixtures, too.

Note that we now have to exempt the two events from
our openapi checks, due to the is_mirror_dummy field
in the deprecated user block.  We can decide how to
handle this later--one possibility is to just add it
as an optional field on the event_schema side.
2020-09-25 11:43:20 -07:00
Steve Howell b7b2546f44 event_schema: Extract check_subscription_update.
Note that we use value_type for value instead of
bool, since properties can be non-bool things
like color, which we just don't test now.  We
should test them.

We more than compensate for this by checking
the actual value of the value in
check_subscription_update.
2020-09-25 11:43:20 -07:00
Steve Howell b920ebce81 event_schema: Extract check_has_zoom_token. 2020-09-25 11:43:20 -07:00
Steve Howell 0c4286222f event_schema: Extract check_realm_update_dict. 2020-09-25 11:43:20 -07:00
Steve Howell 6ec6525624 event_schema: Extract check_delete_message.
There is a legacy format where we send
singular "message_id" instead of plural
"message_ids".

Then there are different fields for "private"
and "stream" message types.
2020-09-25 11:43:20 -07:00
Steve Howell 88165aee6b event_schema: Extract check_user_group_update. 2020-09-25 11:43:20 -07:00
Steve Howell aaaac11661 event_schema: Extract check_user_group_remove. 2020-09-25 11:43:20 -07:00