Commit Graph

26720 Commits

Author SHA1 Message Date
Steve Howell a6e7520819 node tests: Use run_test helper in submessage.js. 2018-05-30 13:53:11 -07:00
Shubham Dhama 5ce58d3cc5 Revert "i18n: Revert pieces of recent settings changes."
This reverts commit ef9681caa3.
2018-05-30 23:52:09 +05:30
Shubham Dhama 19bee9ed52 settings_ui: Move `settings_ui.strings` to top-level. 2018-05-30 23:36:16 +05:30
Shubham Dhama b002ef26b7 i18n: Fix reference error for localstorage. 2018-05-30 23:28:21 +05:30
Shubham Dhama d6c2160a3d admin: Move 'admin_settings_label' to top-level. 2018-05-30 23:28:21 +05:30
Shubham Dhama 402bd4a4c6 settings_org: Move 'time_limit_dropdown_values' to top-level. 2018-05-30 23:28:18 +05:30
Shubham Dhama 0caf55f2f0 settings_bots: Move bot_creation_policy_values to top-level.
Since ensure_i18n is dead we don't need to explictly load them.
2018-05-30 23:25:02 +05:30
Shubham Dhama d1bfb59872 home: Make `translations` load before `app` bundle. 2018-05-30 23:20:57 +05:30
Rhea Parekh 25ac6e812f Matrix: Create 'install-matrix' macro.
'install-matrix' is used twice, in 'integrations/irc.md'
and 'integrations/matrix.md'. Hence we create a macro for
it.
2018-05-30 10:47:02 -07:00
Rhea Parekh dffb23afc2 Matrix: update the integration documentation. 2018-05-30 10:47:02 -07:00
Rhea Parekh e2f2ea7248 test_export: Add tests for 'do_export_user'. 2018-05-30 10:28:10 -07:00
Rhea Parekh 74cc07bb2f test_export: Add tests for export of files.
Thanks @Zachary-Jackson for some preliminary work
on this.
2018-05-30 10:28:10 -07:00
Tim Abbott ef9681caa3 i18n: Revert pieces of recent settings changes.
Apparently, i18n isn't declared/exported at module load time, so we
still need some of these gymnastics.

Sorry for the sloppy merging!
2018-05-30 10:10:46 -07:00
Tim Abbott 8c100f45f0 docs: Update development environment docs for Ubuntu bionic.
We also clean up some flows in the documentation that were somewhat
confusing that I noticed while working on this.
2018-05-30 10:00:41 -07:00
Tim Abbott 5a35507a7a success-http-headers: Add X-Frame-Options. 2018-05-30 09:41:50 -07:00
Tim Abbott f8e8d1fb27 upload: Suppress coverage warnings for now. 2018-05-30 09:31:47 -07:00
Tim Abbott afdfdf775c nginx: Set X-Frame-Options header to DENY.
While there are legitimate use cases for embedded Zulip in an iFrame,
they're rare, and it's more important to prevent this category of
attack by default.

Sysadmins can switch this to a whitelist when they want to use frames.
2018-05-30 09:24:17 -07:00
Tim Abbott bbcdf8ca99 upload: Fix logic for orientation when uploading avatars.
The previous logic was broken for an avatar without exif data.
2018-05-30 09:22:36 -07:00
Tim Abbott 3f0a1e7c54 translations: Clean up indentation for initialization code. 2018-05-30 09:14:20 -07:00
Tim Abbott d9347dea3e i18n: Remove now-unused ensure_i18n function. 2018-05-30 09:13:48 -07:00
Tim Abbott 269b5202d9 gear_menu: Remove now-unnecessary ensure_i18n call. 2018-05-30 09:13:12 -07:00
Tim Abbott 00411e712f settings: Remove now-unnecessary ensure_i18n gymnastics. 2018-05-30 09:12:22 -07:00
Tim Abbott 276b70ffb8 subs: Remove now-unnecssary call to ensure_i18n. 2018-05-30 09:10:43 -07:00
Tim Abbott c5b4dacd3b info_overlay: Remove unnecessary ensure_i18n call. 2018-05-30 09:09:17 -07:00
Tim Abbott 04b0e225c7 unread_ui: Remove now-unnecessary ensure_i18n call. 2018-05-30 09:07:49 -07:00
Tim Abbott b88ec552cf settings_notifications: Remove now-unnecessary ensure_i18n. 2018-05-30 09:06:59 -07:00
Tim Abbott a087b34f12 drafts: Eliminate now-unnecessary ensure_i18n. 2018-05-30 09:06:13 -07:00
Tim Abbott a1f5fe4f92 settings_ui: Remove now-unnecessary ensure_i18n. 2018-05-30 09:05:46 -07:00
Tim Abbott 41b1dcbfe0 settings_org: Eliminate now-unnecessary ensure_i18n. 2018-05-30 09:03:34 -07:00
Tim Abbott 1e6564308f settings_toggle: Remove now-unnecessary ensure_i18n. 2018-05-30 09:02:29 -07:00
Tim Abbott f67d0d3f91 admin: Remove now-unnecessary ensure_i18n. 2018-05-30 09:01:56 -07:00
Tim Abbott 7b2fc95c6a settings: Remove ensure_i18n from display settings. 2018-05-30 09:00:41 -07:00
Shubham Dhama cff40c557b translations: Load translations from page_params.translation_data.
With this commit, we change how we deal with translation for strings.
Previously we used to fetch the translations data after loading which
created a lot of unpleasant race bugs.

So we changed this to use the `translation_data` sent in `page_params`
which is available at load time. The previous fetching can be useful if
we want to change the string to the changed language without reloading
the page but since we ask the user to reload the page after changing
the default language so fetching after loading isn't useful for us and
hence we can add resource only once.

Ultimately, we can remove the i18next plugins too.  We leave the logic
for clearing local storage, patched to fully clear it.

Fixes: #9087.
2018-05-30 08:57:27 -07:00
Tim Abbott 99c6a82b7f i18n: Clean up logic for picking language in app.
We now have a simple algorithm: First, look at the URL path
(e.g. /de/, which is intended to be an override).  Second, look at the
language the user has specified in their settings.
2018-05-30 08:57:26 -07:00
Shubham Dhama 1d9afc7328 i18n: Pass translation data in page_params.
This is a preliminary step to make translation_data available as a
resource to `i18next.init()`.
2018-05-30 08:57:26 -07:00
Robert Hönig 647c63050f botserver: Add outgoing webhook tokens to botserverrc.
The tokens will be used to authorize the server when sending
messages to the Botserver.
2018-05-30 10:00:19 -04:00
Shubham Padia 0ffcb7fccf search: Remove blueslip warnings for invalid emails in 'pm-with' filter.
Fixes #3380.
The blueslip warning mentioned in #3380 were from paths ending at
people.email_list_to_user_ids_string. Some additional blueslip warnings
were raised after using that function.
Although we can put a validation check somewhere in the call stack of
people.email_list_to_user_ids_string, this function itself is used to
validate the operand by the higher order functions, so it wouldn't make
sense to put a validation check before that. Instead, removing the
blueslip warning altogether was chosen.
people.email_list_to_user_ids_string was replaced by
people.reply_to_to_user_ids_string which is a blueslip-free version
of the same. Other blueslip warnings were removed.
2018-05-30 07:49:59 -04:00
Eeshan Garg 9157b217f0 webhooks/jira: Update docs to conform to style guide.
I spend a lot of time on this. One of our users had reported that
this webhook wasn't working at all. So I tested this with a local
ngrok instance and made sure that it was working. I also took this
opportunity to rewrite the docs for this, which were quite outdated.

With a few changes by Rishi Gupta!
2018-05-29 17:16:52 -07:00
Yashashvi Dave 47aaf4e20a users: Replace duplication with generic func to validate bot id.
This adds a common function `access_bot_by_id` to access bot id within
same realm.  It probably fixes some corner case bugs where we weren't
checking for deactivated bots when regenerating API keys.
2018-05-29 15:47:27 -07:00
Yashashvi Dave 07b63e4886 jquery-form: Remove jquery-form plugin dependency.
Fixes #9430.
2018-05-29 15:44:40 -07:00
Yashashvi Dave b94986b1e1 jquery-form: Remove use of jquery-form from invite-user form. 2018-05-30 03:14:39 +05:30
Yashashvi Dave 3654d4f92d jquery-form: Remove jquery-form use from get-API-key form in user settings. 2018-05-30 03:14:39 +05:30
novokrest 9278cdf75b mercurial: Update mercurial.md documentation. 2018-05-29 11:51:05 -07:00
Tim Abbott 059537e00f irc: Improve the IRC and Matrix documentation.
The big changes here are:
* Making the install instructions easier to copy/paste.
* Adding numbering for the IRc integration.  We probably want to do a
  similar thing with Matrix, too.
2018-05-29 11:24:47 -07:00
Rhea Parekh 1db442acd4 IRC: Add integration documentation. 2018-05-29 10:59:53 -07:00
Rhea Parekh 25e3515d9b Matrix: Add integration documentation. 2018-05-29 10:59:53 -07:00
Tim Abbott 0fabff6dda setup_venv: Clean up VENV_DEPENDENCIES using parsed lsb_release.
This is mostly a cleanup, but it should also save 50ms in the runtime
of create-production-venv.
2018-05-29 10:57:36 -07:00
Raymond Akornor 5d39a0f0fc scripts: Replace calls to lsb release with our own parsing.
This improves the performance of these operations, by saving a ~50ms
Python process startup.  While not a major performance improvement, it
seems worth it, given how often these commands get run.

Fixes #9571.
2018-05-29 10:57:36 -07:00
Shubham Padia 8b8a9be377 upload: Rotate image according to exif data when resizing avatar and emojis.
Fixes the avatar/emoji part of #8177.

Does not address the issue with uploaded images, since we don't do
anything with them.

Also adds 3 images with different orientation exif tags to
test-images.
2018-05-29 10:39:39 -07:00
Tim Abbott 7ccefc3e5d migrations: Remove dependence on PRIVATE_STREAM_HISTORY_FOR_SUBSCRIBERS.
We don't want to keep around a declaration of
PRIVATE_STREAM_HISTORY_FOR_SUBSCRIBERS forever, so we should just move
this to a getattr; if the user has set it on their server, we'll use
the value; otherwise, we just use False.
2018-05-29 07:36:53 -07:00