Граф коммитов

160 Коммитов

Автор SHA1 Сообщение Дата
Jarek aea89555b1 Bug 1541252: Fix deployment on Heroku by removing requirements/python2.txt (#1309) 2019-06-07 08:54:02 +02:00
Jarek 46910e3e9d Fix bug 1537613: Update deps to versions compatible with Python 3 (#1252)
* Introduce requirements/python2.txt
* Move Mercurial to requirements/python2.txt
* Update Silme to the version with support for Python 3
2019-04-09 23:12:01 +02:00
Matjaž Horvat cb50ff5d4a Fix bug 1527507: Add requirements.txt file (#1225) 2019-03-12 16:27:56 +01:00
Jarek 6da1f3524b Fix bug 1527507 - Refactor all dependencies (#1204)
Newer versions of Pip (7.1+) allow to create a constraints file which keeps track of versions of all sub-dependencies.

* All requirements files are renamed and moved into a separate directory.
* All sub-dependencies are moved to a constraints file.
2019-03-07 09:51:37 +01:00
Matjaž Horvat feb89ef27d
Fix bug 1529895: Serve static files with HSTS header (#1218) 2019-03-05 17:06:18 +01:00
Vishal Sharma 37b18fe367 Bug 1522520: Store homepage as html in database (#1206) 2019-03-04 15:01:20 +01:00
Matjaž Horvat 29c55afbb7
Upgrade to Django 1.11.20 (#1201) 2019-02-12 10:05:06 +01:00
Matjaž Horvat 6885c8bf3d
Fix bug 1509079: Update fluent libraries to support fluent syntax 0.8 (#1141)
* JS part
- update lib
- use `fluentSerializer.serializeExpression()` for all expression types but `SelectExpression`
- use official Fluent element expression type names in tooltips (no space)
- add space around expressions within {}

* Python part
- update lib
- use `fluentSerializer.serialize_expression()` for all expression types but `SelectExpression`
- use isinstance
2019-01-21 10:06:37 +01:00
Matjaž Horvat 3d4357dddf
Update to Django 1.11.18, r=me (#1166) 2019-01-15 10:00:07 +01:00
Adrian Gaudebert f9514fdfd2 Fix bug 1518749 - Put back webencodings dependency. (#1161) 2019-01-09 14:49:03 +01:00
Adrian Gaudebert 62c207803a
Fix bug 1518749 - Update bleach to version 3.0.2. (#1160)
* Fix bug 1518749 - Update bleach to version 3.0.2.

Note that from version 3, bleach does not require html5lib anymore, as it vendors it. We thus remove it from our requirements as well.
2019-01-09 13:43:45 +01:00
Axel Hecht 2abb32d4f4 Update compare-locales to pick up fixes for Android. (#1147)
Notably, we're picking up the checker file pattern, and bug 1512709, to
keep namespace prefixes on Android documents.

https://github.com/Pike/compare-locales/compare/RELEASE_5_0_0...RELEASE_5_0_3
2018-12-14 17:00:14 +01:00
Matjaž Horvat fd4cfa151f
Update urllib3, r=me (#1146) 2018-12-12 15:24:22 -05:00
Jarek ce9db869a6 Fix bug 1469010 - Process all strings above 255 characters length in (#1121)
* Fix bug 1469010 - Process all strings above 255 characters length in
Python.
2018-11-20 10:49:47 +01:00
Matjaž Horvat 7e95a4c7b6
Fix bug 1473022: Add support for XML file format used in Android (#1111)
This patch brings support for Android String resources (strings.xml),
complete with parser, serializer and checks.

For the first time we use compare-locales for working with l10n files,
and we'll see more of it in the future as we plan to move most of the
file formats to it.

In addition to that, the patch includes some cleanups and fixes:
- Unused properties have been removed
- Unused imports have been removed
- A typo in a method name has been fixed
2018-11-12 19:23:31 +01:00
Matjaž Horvat 627678b609 Update requests to 2.20.0 (#1117) 2018-10-30 11:23:04 +01:00
Matjaž Horvat 88f05d2eba
Fix bug 1501262: Upgrade to Fluent Syntax 0.7 (#1114) 2018-10-26 10:36:12 +02:00
Matjaž Horvat 0050a1dd7b
Fix bug 1497858: Expose localizable files through project config (#1103)
We expose localizable files (on dashboards and in translate view) by
creating corresponding TranslatedResource objects. This patch splits
the existing update_translated_resources() method into two methods:

1. An existing one that uses a built-in algorithm to decied when to
   create a TranslatedResource instance.

2. A new one that uses project config to decide when to create a
   TranslatedResource instance.

Also included:
* Required update to compare-locales 4.0.2.
* Project config checkout in tests.
2018-10-24 12:06:34 +02:00
Matjaž Horvat 61898ea6c1
Update mercurial to 4.7.2 (#1102) 2018-10-16 14:33:40 +02:00
pyup.io bot 33ff030b13 Update requests from 2.18.4 to 2.19.1 (#1101) 2018-10-16 09:47:58 +00:00
Jarek 16dec4001d Fix bug 1496449: Change the cache backend (#1097)
Replace django-pylibmc with django-bmemcached, which is recommended by
other Heroku users. We also update app.js (used during Deploy with
Heroku button) and docs to use Memcachier add-on instead of Memcached
Cloud.
2018-10-10 11:04:06 +02:00
Matjaž Horvat 6db15d17c9
Fix bug 1481175: Store active translation in the DB (#1072)
This patch introduces a Translations.active field. It is Boolean and
has a constraint to be True for a maximum of one unique combination of
(locale, entity, plural_form). Active translations are displayed in the
string list and as the first entry in the History tab.

The idea is to store active translations in the DB, instead of
calculating them on the fly, which is expensive. Hence, we're adding a
data migration to set Translation.active to True where needed for
existing translations. We also make sure that the active field is
updated properly when translations are changed. And finally, we're
making use of the active field instead of calculating it in the code.

For practical reasons, we're also fixing two other bugs:
* Bug 1477581: Unfuzzy on mass reject (and approve). These changes
  prevent translations from being in double state: fuzzy and approved
  or rejected.
* Bug 1397138: Adding suggestions must not unfuzzy strings.

The patch also removes the Translation.entity_document field and
related trigger and function, which were introduced earlier and aren't
used anymore.

It also makes code for unapproving, unfuzzying and rejecting
translations more consistent and maintainable.
2018-09-05 22:53:38 +02:00
Matjaž Horvat d530830acd
Fix bug 1465121: Update to Fluent Syntax 0.6 (#1026)
* Update libraries
* Rename NumberExpression to NumberLiteral
* Rename StringExpression to StringLiteral
* Rename ExternalArgument to VariableReference
* Rename element.expression.expression to element.expression.selector
* Add support for TermReference
* Add support for VariantLists to as_simple_translation filter
* Add support for VariantLists in frontend through a custom parseEntry()

Also:
* Simplify attribute serialization
* #ftl-original should not overflow (scrollbar on parent element)
* Enforce = sign for strings without value in tests
* Replace hasattr() with isinstance()
* Placeables are guaranteed to have the expression field
2018-08-08 16:52:22 +02:00
Adrian Gaudebert c362294caa
Fix bug 1481384 - Update dependencies. (#1047)
* Fix bug 1481384 - Update dependencies.
2018-08-08 09:51:26 +02:00
pyup-bot 07becc9670 Update django from 1.11.11 to 1.11.15 2018-08-06 19:58:42 +02:00
Matjaž Horvat d7a8437ece
Fix bug 1480184: Upgrade to silme 0.9.4 (#1040)
We upgraded silme to fix its .inc parser to properly support empty
translations.
2018-08-03 22:36:37 +02:00
Matjaž Horvat 7dbef699d3
Replace django-sslify with SECURE_SSL_REDIRECT (#1023) 2018-07-24 11:19:55 +02:00
Adrian Gaudebert 43becde477
Fix bug 1473330 - Translate.Next architecture (#989)
* Add React frontend for Translate app.
This has been set up using create-react-app.

* Integrate new Translate app into django.
This provides a working prod and dev environment. In production, django will serve the index.html file as a template, and files built by webpack will be collected and distributed with other django static files. In development, all requests are proxied to the dev webpack server, allowing all dev niceties to be used.

* Add support for websockets.

* Add a bit of documentation specific to our use case.

* Add redux for state management.

* Show a very basic list of entities.

* Enable absolute path import.

* Add links to various resources.

* Rearchitecture code into modules.

All features should be self-contained into a module in src/modules/. All code that is shared amongst several modules should go into a module in src/core/.

* Remove unused assets.

* Add some architecture documentation.

* Add Flow to current code for type checking.

* Add unit testing with jest, enzyme and sinon.

* Extend documentation, talk about type checking, modules, and list tools we use.

* Move CSS rules closer to actual component.

* Add django-waffle and hide translate.next behind a switch.

* Better structure for the README file.

* Build and test frontend in travis.

* Of course it is better if dependencies are installed.

* Use pushd to run commands in frontend.

* Configure eslint and fix errors.

* Add more code comments.

* Improve documentation around local dev and Flow.

* Add tests for the Translate view.

* Improve documentation.

* Fix serving static files for development.

* Integrate Translate.Next with out docker setup.

* Remove debug.

* Use DEV instead of DEBUG.

* Much review.
          Many comments.
    Wow better!

* Flatter module public interfaces.

* Import correctly from modules.

* Fix docker webapp run.
2018-07-18 11:39:52 +02:00
Matjaž Horvat f39b33eb37
Fix bug 1426676: Support for WebExtensions' JSON format (#786)
WebExtensions' JSON format support includes:
* JSON validation using jsonschema
* Marking JSON placeholders as placeables
* Displaying and linkifying placeholder examples as string metadata
* Factoring out create_parent_directory()
2018-05-28 23:49:23 +02:00
Jarek 340559fe8f Fix bug 1461630: Update django-cookies-samesite to 0.1.2 (#966)
And fix the order of dependencies in requirements.txt.
2018-05-17 14:26:28 +02:00
Jarek 3cc5146fa1 Bug 1461630 - Set SameSite flag for session and csrf cookies. (#964) 2018-05-17 12:51:59 +02:00
Jarek 7293a0c0e7 Fix bug 1458343 - Run compare-locales checks in Translate view (#856)
In addition to Translate Toolkit checks, we now also run compare-locales
checks when submitting a translation and also some pontoon-specific
checks, which were previously spread around the codebase. As of now, all
the checks code is located in the newly created pontoon.checks module.

Failed checks are either errors (prevent translations from being
submitted) or warnings (can be bypassed). Errors are detected using
compare-locales library and Pontoon’s internal checks, while warnings
are a product of compare-locales and Translate Toolkit libraries.

Since Translate Toolkit checks may result in many false positives in some
scenarios, they can be turned off using the Translate Toolkit Checks
toggle (previously called Quality Checks).

Other notable changes:
* Added tests for integration with compare-locales and Translate Toolkit.
* Added ability to disable specific Translate Toolkit checks (e.g. if
  the same check is already handled by compare-locales).
* Slight UI Refresh: Prevent long check messages from being hidden behind
  the button and visually separate errors and warnings.
* Move checks execution on the top of the /update/ view to reduce
  complexity and simplify testing.
* Update to Fluent 0.7.0.
2018-05-01 22:26:56 +02:00
Adrian Gaudebert d3960f37de
Fix bug 1454394 - Update requirements raising warnings. (#929) 2018-04-17 17:24:06 +02:00
Ryan Northey 34a13d9159 Touch #1416256: String tiers admin view #823
- Add tags admin view
- Add tests for tags admin view
- Use data not result in AjaxFormView
- Add permission_required decorator
- Wraps decorator from django guardian of the same name.
  If the user is anon and the request is not permitted returns 404,
  otherwise returns 403
- Add admin user in env
- Update django-guardian to latest version
2018-03-20 14:03:45 +00:00
Ryan Northey aa28e667d6 Fix Bug 1446295: Fix py linters #900
- Update pylama and add dependencies
- Switch pylama config pep8 -> pycodestyle
  and exclude settings dir from linting
- Rename vars named `l`
  This creates a `E741 ambiguous variable name 'l' [pycodestyle]`
- Add requirements-test.txt to dev install instructions
2018-03-16 10:39:17 +00:00
Matjaž Horvat 956cb27c6f
Fix bug 1442201: Update Fluent libraries to 0.6.4 (#889)
Reason: make serializer consistent with the rest of Mozilla L10n stack
2018-03-12 12:14:47 +01:00
Matjaž Horvat 1b8615cc8b
Update do Django 1.11.11 (#892) 2018-03-12 10:23:41 +01:00
pyup.io bot 8864bbcaa0 Update newrelic from 2.50.0.39 to 2.106.1.88 (#886) 2018-03-09 01:12:56 +01:00
Matjaž Horvat f8749dcb25
Upgrade to mercurial 4.5.2 (#884) 2018-03-07 14:15:05 +01:00
Vishal Sharma 1c7a491663 Fix Bug 1434554: Upgrade to Django 1.11 #879
- Upgrade to Django.1.11
- Fixed pontoon/db/tests/test_lookups.py test failure.
- Add collation lookup tests for İ, and for fields other than `string`
2018-03-07 06:26:15 +00:00
Greg Guthe f31a2b865e Bug 1442745 upgrade bleach to 2.1.3 (#880)
Updated bleach to fix a security issue affecting versions from 2.1
to 2.1.2. In pontoon this is mitigated by CSP.
2018-03-06 09:42:44 +01:00
Matjaž Horvat b76c53a78e
Update to fluent libraries to 0.6.2 (#840)
Includes:
* Switch to PyPI install
* Support for Terms (treated same as Messages)
* Support for GroupComments as a replacement for Section comments
* Remove reference to Tags
* Reflect the introduction of type Placeable
* Replace serializeExpression() with fluentSerializer.serializeExpression()
* Use `isinstance` instead of `type`
* Factor out isSelectExpressionElement()
* In unsaved changes check, if translation cannot be parsed, return source editor value
* If no textarea has focus, select first
* Add check for matching Message keys
* runChecks() as a standalone function
* Run checks when switching from source view to rich mode
* Properly render multiple selectors
2018-02-13 17:38:43 +01:00
Ryan Northey e4a3758e59 Touch Bug 1243129: Es6 webpack support
- Add django-webpack-loader to requirements
- Update settings to include webpack
- Add babel and webpack to package.json
- Dont use system node in docker as its too old
- Add webpack configuration
- Add es6 placeholder
- Add a webpack run to travis
- Add babel configuration
2018-01-17 17:36:48 +00:00
Matjaž Horvat f6629de4f4
Update to latest psycopg2 to avoid breaking travis (#780) 2017-12-15 10:47:28 +01:00
Adrian Gaudebert 4dd65d581f
Fix bug 1407623 - New source input for short-term projects (#745)
* Fixes bug 1407623 - Add direct input for projects with no repository.
This is the first step of allowing a new source of strings for projects. It permits to create projects without any repositories, and to enter string in a textarea. This commit also enables string management, to edit source strings and comments.

* Re-styling for coherence with general code.

* Added a button to download all translations as CSV.

* Enable strings management only for projects with no repository.

* Enable adding new strings. Better UI and styles.

* Fix small issues.

* Add a data_source field to projects, choices being repository or database.
This allows to explicitely mark projects for which we want to manage strings in Pontoon as "database". It makes the logic of showing the manage strings page clearer.

This commit also adds a textarea on the project creation page, allowing users to send the first batch of strings directly during the creation, instead of having to go to the manage strings page afterwards. The links move around a bit as well.

* Better link names.

* Hide repositories when data source is database.

* Add option to remove a string. Rename path to "database" from "all". Fix conflict on migration.

* Do not run sync on database sourced projects.

* Restore section padding

* Move textarea label to top for consistency. Use semantic HTML. Remove en-US note (true for all projects)

* Data Source and Strings sections in a single line

* Use example in Placeholder to avoid duplicating the label

* Separate page action (New string) from navigation buttons

* I doubt this action is needed on this page and I dont like duplicating functionality. Feel free to revert if you disagree.

* Adding action to the Action button

* White space is nice

* use plural for new strings placeholder.
2017-11-28 15:21:44 +01:00
Staś Małolepszy 6f74f4af6d Fix Bug 1411955 - Upgrade to Graphene 2.0 (#764) 2017-11-27 20:25:55 +01:00
Ryan Northey 4e15f803cd Bump caighdean requirement to fix Heroku 2017-11-17 10:54:59 +00:00
Ryan Northey b2642393e7 Fix 1416237 - Caighdean integration #753
- Add machine-translation-caighdean view
- Add Caighdean MT to javascript
- Add python-caighdean to requirements
- Add Caighdean to machinery CSS
- Add Caighdean MT tests
2017-11-16 11:01:51 +00:00
phlax 28806fd8a0 Fixes bug 1416269 - Add coverage config (#755)
- Add config for codecov
- Add coverage to travis test runner
- Add test requirements
- Set requirements to use latest requests package
2017-11-13 16:16:56 +01:00
pyup.io bot 6f5085b0c4 Update django-allauth from 0.28.0 to 0.34.0 (#747)
Also fix compatibility issue with new django-allauth version.
2017-11-01 23:15:04 +01:00