From 669b825bdd531fa9a56a1216293d863293046c4c Mon Sep 17 00:00:00 2001 From: "John N. Milner" Date: Tue, 23 Oct 2018 01:25:10 -0400 Subject: [PATCH 1/3] Update formpack for `ValidationStatusCopyField` --- dependencies/pip/dev_requirements.txt | 2 +- dependencies/pip/external_services.txt | 2 +- dependencies/pip/requirements.in | 2 +- dependencies/pip/requirements.txt | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dependencies/pip/dev_requirements.txt b/dependencies/pip/dev_requirements.txt index fa2c624495..46132afea0 100644 --- a/dependencies/pip/dev_requirements.txt +++ b/dependencies/pip/dev_requirements.txt @@ -5,7 +5,7 @@ # pip-compile --output-file dependencies/pip/dev_requirements.txt dependencies/pip/dev_requirements.in # -e git+https://github.com/dimagi/django-digest@0eb1c921329dd187c343b61acfbec4e98450136e#egg=django_digest --e git+https://github.com/kobotoolbox/formpack.git@c94751b25f315e15db6d32fa2ebf816263cb6c56#egg=formpack +-e git+https://github.com/kobotoolbox/formpack.git@b9f00374d65391dd456fc117d5321461b7acdc42#egg=formpack amqp==2.1.4 anyjson==0.3.3 argparse==1.4.0 # via unittest2 diff --git a/dependencies/pip/external_services.txt b/dependencies/pip/external_services.txt index 28316c200b..5f0d934871 100644 --- a/dependencies/pip/external_services.txt +++ b/dependencies/pip/external_services.txt @@ -5,7 +5,7 @@ # pip-compile --output-file dependencies/pip/external_services.txt dependencies/pip/external_services.in # -e git+https://github.com/dimagi/django-digest@0eb1c921329dd187c343b61acfbec4e98450136e#egg=django_digest --e git+https://github.com/kobotoolbox/formpack.git@c94751b25f315e15db6d32fa2ebf816263cb6c56#egg=formpack +-e git+https://github.com/kobotoolbox/formpack.git@b9f00374d65391dd456fc117d5321461b7acdc42#egg=formpack amqp==2.3.2 anyjson==0.3.3 argparse==1.4.0 # via unittest2 diff --git a/dependencies/pip/requirements.in b/dependencies/pip/requirements.in index 6c2b537ad9..e3f6c10764 100644 --- a/dependencies/pip/requirements.in +++ b/dependencies/pip/requirements.in @@ -2,7 +2,7 @@ # https://github.com/bndr/pipreqs is a handy utility, too. # Formpack --e git+https://github.com/kobotoolbox/formpack.git@c94751b25f315e15db6d32fa2ebf816263cb6c56#egg=formpack +-e git+https://github.com/kobotoolbox/formpack.git@b9f00374d65391dd456fc117d5321461b7acdc42#egg=formpack # More up-to-date version of django-digest than PyPI seems to have. # Also, python-digest is an unlisted dependency thereof. diff --git a/dependencies/pip/requirements.txt b/dependencies/pip/requirements.txt index ebc9538261..4473026f0e 100644 --- a/dependencies/pip/requirements.txt +++ b/dependencies/pip/requirements.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile # To update, run: # -# pip-compile --output-file requirements.txt requirements.in +# pip-compile --output-file dependencies/pip/requirements.txt dependencies/pip/requirements.in # -e git+https://github.com/dimagi/django-digest@0eb1c921329dd187c343b61acfbec4e98450136e#egg=django_digest --e git+https://github.com/kobotoolbox/formpack.git@c94751b25f315e15db6d32fa2ebf816263cb6c56#egg=formpack +-e git+https://github.com/kobotoolbox/formpack.git@b9f00374d65391dd456fc117d5321461b7acdc42#egg=formpack amqp==2.3.2 anyjson==0.3.3 argparse==1.4.0 # via unittest2 From 6d744cfbd6643ee3a4713310b4278e18c3f8b500 Mon Sep 17 00:00:00 2001 From: "John N. Milner" Date: Tue, 23 Oct 2018 01:32:33 -0400 Subject: [PATCH 2/3] Add _validation_status to exports; closes #1851 Also improves handling of formpack `UNTRANSLATED` and `UNSPECIFIED_TRANSLATION` constants; closes #2037 --- jsapp/js/components/formEditors.es6 | 23 +++++++++++- kpi/models/import_export_task.py | 37 +++++++++++++++---- kpi/tests/test_api_assets.py | 4 +- ...t_mock_data_conflicting_version_exports.py | 2 +- 4 files changed, 53 insertions(+), 13 deletions(-) diff --git a/jsapp/js/components/formEditors.es6 b/jsapp/js/components/formEditors.es6 index 9e437e0be0..9e2406272b 100644 --- a/jsapp/js/components/formEditors.es6 +++ b/jsapp/js/components/formEditors.es6 @@ -159,6 +159,25 @@ export class ProjectDownloads extends React.Component { dataInterface.getAssetExports(this.props.asset.uid).done((data)=>{ if (data.count > 0) { data.results.reverse(); + data.results.map(result => { + switch(result.data.lang) { + case '_default': + case null: // The value of `formpack.constants.UNTRANSLATED`, + // which shouldn't be revealed here, but just in case... + result.data.langDescription = t('Default'); + break; + case '_xml': + case false: // `formpack.constants.UNSPECIFIED_TRANSLATION` + // Exports previously used `xml` (no underscore) for this, which + // works so long as the form has no language called `xml`. In + // reality, we shouldn't bank on that: + // https://en.wikipedia.org/wiki/Malaysian_Sign_Language + result.data.langDescription = t('XML'); + break; + default: + result.data.langDescription = result.data.lang; + } + }); this.setState({exports: data.results}); // Start a polling Interval if there is at least one export is not yet complete @@ -232,7 +251,7 @@ export class ProjectDownloads extends React.Component {