From 6ecfc83d0761a6af60372ea5c29917f1647756c2 Mon Sep 17 00:00:00 2001 From: Alex Anderson Date: Wed, 23 Aug 2017 13:03:28 +0000 Subject: [PATCH] Update to latest enketo * Add jr:choice-name() demo form * Update to latest enketo * Patch enketo to fix jr:choice-name() issue * Patch enketo-core's date css source file to fix imports * Update enketo XSLT to support new style of repeat groups Closes #3487 Closes #3804 --- Gruntfile.js | 16 +- demo-forms/jr-choice-name.xml | 56 + package-lock.json | 1367 +++++++++++++---- package.json | 4 +- patches/3804_jr-choice-name.patch | 20 + ...keto-datepicker-extended-sass-import.patch | 13 + static/css/enketo/_widgets.scss | 16 +- static/css/enketo/enketo.scss | 26 +- static/js/enketo/main.js | 2 +- static/js/enketo/widgets.js | 14 +- .../js/enketo/widgets/android-datepicker.js | 4 +- .../widgets/bikram-sambat-datepicker.js | 4 +- static/js/enketo/widgets/countdown-widget.js | 4 +- static/js/enketo/widgets/db-object-widget.js | 4 +- static/js/enketo/widgets/notewidget.js | 4 +- static/js/enketo/widgets/phone-widget.js | 6 +- static/js/enketo/widgets/simprints.js | 4 +- .../js/enketo/widgets/unselectable-radios.js | 4 +- static/js/enketo/widgets/z-score.js | 4 +- static/js/services/enketo.js | 4 +- 20 files changed, 1215 insertions(+), 361 deletions(-) create mode 100644 demo-forms/jr-choice-name.xml create mode 100644 patches/3804_jr-choice-name.patch create mode 100644 patches/enketo-datepicker-extended-sass-import.patch diff --git a/Gruntfile.js b/Gruntfile.js index 97d98a3d511..28c8bb8a82e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -50,12 +50,13 @@ module.exports = function(grunt) { 'session': './packages/session/session', 'kujua-sms/utils': './packages/kujua-sms/kujua-sms/utils', 'views/lib/objectpath': './packages/kujua-sms/views/lib/objectpath', - 'text!enketo-config': './static/js/enketo/config.json', + 'enketo-config': './static/js/enketo/config.json', 'widgets': './static/js/enketo/widgets', './xpath-evaluator-binding':'./static/js/enketo/OpenrosaXpathEvaluatorBinding', 'extended-xpath': './node_modules/openrosa-xpath-evaluator/src/extended-xpath', 'openrosa-xpath-extensions': './node_modules/openrosa-xpath-evaluator/src/openrosa-xpath-extensions', 'translator': './static/js/enketo/translator', // translator for enketo's internal i18n + '../../js/dropdown.jquery': 'bootstrap/js/dropdown', // enketo currently duplicates bootstrap's dropdown code. working to resolve this upstream https://github.com/enketo/enketo-core/issues/454 'libphonenumber/utils': './packages/libphonenumber/libphonenumber/utils', 'libphonenumber/libphonenumber': './packages/libphonenumber/libphonenumber/libphonenumber', 'worker-pouch/workerified': './node_modules/worker-pouch/lib/workerified/', @@ -143,6 +144,7 @@ module.exports = function(grunt) { cwd: 'node_modules', src: [ 'bootstrap-daterangepicker/**', + 'enketo-core/**', 'font-awesome/**', 'moment/**', 'pouchdb-adapter-idb/**', @@ -173,9 +175,6 @@ module.exports = function(grunt) { } }, exec: { - dedupe_jquery: { - cmd: 'rm -rf node_modules/@medic/enketo-core/node_modules/jquery' - }, deploy: { cmd: 'kanso push $COUCH_URL' }, @@ -217,6 +216,7 @@ module.exports = function(grunt) { cmd: function() { var modulesToPatch = [ 'bootstrap-daterangepicker', + 'enketo-core', 'font-awesome', 'moment', 'pouchdb-adapter-idb', @@ -254,6 +254,13 @@ module.exports = function(grunt) { // patch pouch to improve safari checks // https://github.com/medic/medic-webapp/issues/2797 'patch node_modules/pouchdb-adapter-idb/lib/index.js < patches/pouchdb-ignore-safari-check.patch', + + // patch enketo to support cascading of jr:choice-name() update results + // https://github.com/medic/medic-webapp/issues/3804 + 'patch node_modules/enketo-core/src/js/output.js < patches/3804_jr-choice-name.patch', + + // patch enketo's bootstrap-datepicker dependency so that sass compiles properly + 'patch node_modules/enketo-core/src/widget/date/datepicker-extended.scss < patches/enketo-datepicker-extended-sass-import.patch', ]; return patches.join(' && '); } @@ -414,7 +421,6 @@ module.exports = function(grunt) { grunt.registerTask('mmnpm', 'Update and patch npm dependencies', [ 'exec:undopatches', 'auto_install:npm', - 'exec:dedupe_jquery', 'copy:librariestopatch', 'exec:applypatches' ]); diff --git a/demo-forms/jr-choice-name.xml b/demo-forms/jr-choice-name.xml new file mode 100644 index 00000000000..63fc463d22a --- /dev/null +++ b/demo-forms/jr-choice-name.xml @@ -0,0 +1,56 @@ + + + + + + + Test Issue 3281 + + + + Default Value + clinic + + + + + + + + + + + + + + + + + + + + + + + district_hospital + + + + health_center + + + + clinic + + + + + + + + + + diff --git a/package-lock.json b/package-lock.json index 6df6e57a237..0fc115f1092 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,22 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@medic/enketo-core": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@medic/enketo-core/-/enketo-core-4.27.3.tgz", - "integrity": "sha512-2Qe7J0qQYxFGUlP/S1TsBEqN3qhdNEouzZYFrkdd3RXx03eijKkFAMOag9I6H3coZPSLr91FGznayStxVlwMVw==", - "requires": { - "bootstrap-datepicker": "1.6.4", - "bootstrap-slider-basic": "3.3.0", - "bootstrap-timepicker": "0.5.2", - "enketo-xpathjs": "1.4.0", - "jquery": "3.2.1", - "jquery-touchswipe": "1.6.15", - "leaflet": "0.7.7", - "lie": "3.1.0", - "mergexml": "1.1.2" - } - }, "@types/node": { "version": "6.0.85", "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.85.tgz", @@ -624,38 +608,6 @@ "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, - "body-parser": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.14.2.tgz", - "integrity": "sha1-EBXLH+LEQ4WCWVgdtTMy+NDPUPk=", - "dev": true, - "requires": { - "bytes": "2.2.0", - "content-type": "1.0.2", - "debug": "2.2.0", - "depd": "1.1.0", - "http-errors": "1.3.1", - "iconv-lite": "0.4.13", - "on-finished": "2.3.0", - "qs": "5.2.0", - "raw-body": "2.1.7", - "type-is": "1.6.15" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.13", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", - "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=", - "dev": true - }, - "qs": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.tgz", - "integrity": "sha1-qfMRQq9GjLcrJbMBNrokVoNJFr4=", - "dev": true - } - } - }, "boom": { "version": "2.10.1", "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", @@ -669,14 +621,6 @@ "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.3.7.tgz", "integrity": "sha1-WjiTlFSfIzMIdaOxUGVldPip63E=" }, - "bootstrap-datepicker": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/bootstrap-datepicker/-/bootstrap-datepicker-1.6.4.tgz", - "integrity": "sha1-iJ6+ztjqov8V7B8nPksHUxzEPaA=", - "requires": { - "jquery": "3.2.1" - } - }, "bootstrap-daterangepicker": { "version": "2.1.25", "resolved": "https://registry.npmjs.org/bootstrap-daterangepicker/-/bootstrap-daterangepicker-2.1.25.tgz", @@ -694,11 +638,6 @@ "jquery": "3.2.1" } }, - "bootstrap-timepicker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/bootstrap-timepicker/-/bootstrap-timepicker-0.5.2.tgz", - "integrity": "sha1-EO2fKi8LjMrvzeD89qBzi5GaODU=" - }, "bootstrap-tour": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/bootstrap-tour/-/bootstrap-tour-0.10.3.tgz", @@ -1062,12 +1001,6 @@ } } }, - "bytes": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.2.0.tgz", - "integrity": "sha1-/TVGSkA/b5EXwt42Cez/nK4ABYg=", - "dev": true - }, "cached-path-relative": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", @@ -1230,6 +1163,7 @@ "requires": { "anymatch": "1.3.0", "async-each": "1.0.1", + "fsevents": "1.1.2", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -2260,10 +2194,36 @@ "wtf-8": "1.0.0" } }, - "enketo-xpathjs": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/enketo-xpathjs/-/enketo-xpathjs-1.4.0.tgz", - "integrity": "sha1-fNUBRG+3UNRzvFrB2oPiffJeoR4=" + "enketo-core": { + "version": "4.38.2", + "resolved": "https://registry.npmjs.org/enketo-core/-/enketo-core-4.38.2.tgz", + "integrity": "sha1-x+q6hZMpge/4yMexxIh/2totRcw=", + "requires": { + "bootstrap-datepicker": "1.7.1", + "bootstrap-slider-basic": "3.3.0", + "enketo-xpathjs": "1.6.0", + "jquery": "3.2.1", + "jquery-touchswipe": "1.6.15", + "leaflet": "0.7.7", + "lie": "3.1.0", + "mergexml": "1.1.2", + "signature_pad": "2.2.1" + }, + "dependencies": { + "bootstrap-datepicker": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/bootstrap-datepicker/-/bootstrap-datepicker-1.7.1.tgz", + "integrity": "sha1-Tuf680iI2+x4NPv52+fEJ34B3a8=", + "requires": { + "jquery": "3.2.1" + } + }, + "enketo-xpathjs": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/enketo-xpathjs/-/enketo-xpathjs-1.6.0.tgz", + "integrity": "sha1-pJV9RCY3j0iyeFjFqYuXSYnihGg=" + } + } }, "ent": { "version": "2.2.0", @@ -2455,15 +2415,6 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=" }, - "faye-websocket": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", - "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", - "dev": true, - "requires": { - "websocket-driver": "0.6.5" - } - }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", @@ -2530,145 +2481,1044 @@ "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "findup-sync": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "dev": true, + "requires": { + "glob": "5.0.15" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "follow-redirects": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.2.4.tgz", + "integrity": "sha512-Suw6KewLV2hReSyEOeql+UUkBVyiBm3ok1VPrVFRZnQInWpdoZbbiG5i8aJVSjTr0yQ4Ava0Sh6/joCg1Brdqw==", + "dev": true, + "requires": { + "debug": "2.6.8" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "font-awesome": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", + "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=" + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreground-child": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "dev": true, + "requires": { + "cross-spawn": "4.0.2", + "signal-exit": "3.0.2" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "formatio": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.2.0.tgz", + "integrity": "sha1-87IWfZBoxGmKjVH092CjmlTYGOs=", + "dev": true, + "requires": { + "samsam": "1.2.1" + } + }, + "fs-access": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", + "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", + "dev": true, + "requires": { + "null-check": "1.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", + "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.6.2", + "node-pre-gyp": "0.6.36" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.36", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" - } - }, - "findup-sync": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", - "dev": true, - "requires": { - "glob": "5.0.15" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", "once": "1.4.0", - "path-is-absolute": "1.0.1" + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" } - } - } - }, - "follow-redirects": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.2.4.tgz", - "integrity": "sha512-Suw6KewLV2hReSyEOeql+UUkBVyiBm3ok1VPrVFRZnQInWpdoZbbiG5i8aJVSjTr0yQ4Ava0Sh6/joCg1Brdqw==", - "dev": true, - "requires": { - "debug": "2.6.8" - }, - "dependencies": { - "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, "dev": true, + "optional": true, "requires": { - "ms": "2.0.0" + "safe-buffer": "5.0.1" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, "dev": true } } }, - "font-awesome": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", - "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=" - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, - "foreground-child": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", - "dev": true, - "requires": { - "cross-spawn": "4.0.2", - "signal-exit": "3.0.2" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" - } - }, - "formatio": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.2.0.tgz", - "integrity": "sha1-87IWfZBoxGmKjVH092CjmlTYGOs=", - "dev": true, - "requires": { - "samsam": "1.2.1" - } - }, - "fs-access": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", - "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", - "dev": true, - "requires": { - "null-check": "1.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", @@ -3151,24 +4001,6 @@ } } }, - "grunt-contrib-watch": { - "version": "github:scdf/grunt-contrib-watch#896dba3fed7874ed85074f787a5baf60db80d12f", - "dev": true, - "requires": { - "async": "1.5.2", - "gaze": "1.1.2", - "lodash": "4.17.4", - "tiny-lr": "0.2.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - } - } - }, "grunt-couch": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/grunt-couch/-/grunt-couch-1.5.1.tgz", @@ -3805,16 +4637,6 @@ } } }, - "http-errors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", - "integrity": "sha1-GX4izevUGYWF6GlO9nhhl7ke2UI=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "statuses": "1.3.1" - } - }, "http-proxy": { "version": "1.16.2", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", @@ -4703,12 +5525,6 @@ "immediate": "3.0.6" } }, - "livereload-js": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-2.2.2.tgz", - "integrity": "sha1-bIclfmSKtHW8JOoldFftzB+NC8I=", - "dev": true - }, "load-grunt-tasks": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-3.5.2.tgz", @@ -4997,9 +5813,9 @@ "dev": true }, "medic-enketo-xslt": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/medic-enketo-xslt/-/medic-enketo-xslt-1.3.0.tgz", - "integrity": "sha1-60A2Ty6XT1M/qAWCbYzF++kxKZk=" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/medic-enketo-xslt/-/medic-enketo-xslt-1.4.1.tgz", + "integrity": "sha512-KDnDayfeuHgE8NdM/j3aUeNjB+fBR6T7kH9XpsQHCLHMDiRdMpRjwzSa6v3Bdf76NKPxnPNJ2lGLZP6NaN5w/g==" }, "medic-nootils": { "version": "1.0.3", @@ -8232,31 +9048,6 @@ "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", "dev": true }, - "raw-body": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.1.7.tgz", - "integrity": "sha1-rf6s4uT7MJgFgBTQjActzFl1h3Q=", - "dev": true, - "requires": { - "bytes": "2.4.0", - "iconv-lite": "0.4.13", - "unpipe": "1.0.0" - }, - "dependencies": { - "bytes": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", - "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=", - "dev": true - }, - "iconv-lite": { - "version": "0.4.13", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", - "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=", - "dev": true - } - } - }, "read-only-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", @@ -8693,6 +9484,11 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "signature_pad": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/signature_pad/-/signature_pad-2.2.1.tgz", + "integrity": "sha512-GKWN1Qkxd8qd35r2lKAEefKy+GnVbZr08gZmNCCmWr29Ug+l9AVuAqAzDaVTVhNRIGmWYJZ7Dh9/LnOklSVMSg==" + }, "simple-fmt": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/simple-fmt/-/simple-fmt-0.1.0.tgz", @@ -9311,28 +10107,6 @@ "process": "0.11.10" } }, - "tiny-lr": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-0.2.1.tgz", - "integrity": "sha1-s/26gC5dVqM8L28QeUsy5Hescp0=", - "dev": true, - "requires": { - "body-parser": "1.14.2", - "debug": "2.2.0", - "faye-websocket": "0.10.0", - "livereload-js": "2.2.2", - "parseurl": "1.3.1", - "qs": "5.1.0" - }, - "dependencies": { - "qs": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-5.1.0.tgz", - "integrity": "sha1-TZMuXH6kEcynajEtOaYGIA/VDNk=", - "dev": true - } - } - }, "title-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/title-case/-/title-case-2.1.1.tgz", @@ -9693,21 +10467,6 @@ } } }, - "websocket-driver": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz", - "integrity": "sha1-XLJVbOuF9Dc8bYI4qmkchFThOjY=", - "dev": true, - "requires": { - "websocket-extensions": "0.1.1" - } - }, - "websocket-extensions": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.1.tgz", - "integrity": "sha1-domUmcGEtu91Q3fC27DNbLVdKec=", - "dev": true - }, "which": { "version": "1.2.14", "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", diff --git a/package.json b/package.json index 1b6d5ef6a77..3e3acbb81bb 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "url": "git://github.com/medic/medic-webapp.git" }, "dependencies": { - "@medic/enketo-core": "4.27.3", "angular": "^1.6.5", "angular-cookie": "^4.1.0", "angular-nvd3": "^1.0.9", @@ -24,11 +23,12 @@ "bootstrap": "^3.3.7", "bootstrap-daterangepicker": "^2.1.24", "bootstrap-tour": "^0.10.3", + "enketo-core": "^4.38.2", "font-awesome": "^4.7.0", "google-libphonenumber": "^3.0.0", "jquery": "^3.2.1", "json2xml": "^0.1.3", - "medic-enketo-xslt": "^1.1.1", + "medic-enketo-xslt": "^1.4.1", "medic-nootils": "^1.0.3", "messageformat": "^1.0.0", "moment": "^2.17.1", diff --git a/patches/3804_jr-choice-name.patch b/patches/3804_jr-choice-name.patch new file mode 100644 index 00000000000..c9e8e15901a --- /dev/null +++ b/patches/3804_jr-choice-name.patch @@ -0,0 +1,20 @@ +*** node_modules/enketo-core/src/js/output.js 2017-04-20 00:28:05.000000000 +0200 +--- static/js/enketo/core/output.js 2017-08-23 15:35:19.000000000 +0200 +*************** +*** 64,69 **** +--- 64,78 ---- + } + if ( $output.text() !== val ) { + $output.text( val ); ++ ++ // MEDIC CHANGES : BEGIN ++ // For s that are children of choice-groups, trigger ++ // dependent calculations in case one is using a jr:choice-name. ++ var owName = $output.closest( '.option-wrapper' ).find( 'input' ).attr( 'name' ); ++ if ( owName ) { ++ that.form.calc.update( owName ); ++ } ++ // MEDIC CHANGES : END + } + } ); + } diff --git a/patches/enketo-datepicker-extended-sass-import.patch b/patches/enketo-datepicker-extended-sass-import.patch new file mode 100644 index 00000000000..f3b32a09cdd --- /dev/null +++ b/patches/enketo-datepicker-extended-sass-import.patch @@ -0,0 +1,13 @@ +*** original 2017-08-29 12:51:04.000000000 +0200 +--- patched 2017-08-29 12:50:57.000000000 +0200 +*************** +*** 1,4 **** +! @import "../../../../../node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker"; + + /** fixes by martijn **/ + +--- 1,4 ---- +! @import "../../../node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker"; + + /** fixes by martijn **/ + diff --git a/static/css/enketo/_widgets.scss b/static/css/enketo/_widgets.scss index a5b20763082..80858af2a3a 100644 --- a/static/css/enketo/_widgets.scss +++ b/static/css/enketo/_widgets.scss @@ -1,8 +1,8 @@ -@import "../../../node_modules/@medic/enketo-core/src/widget/note/notewidget.scss"; -@import "../../../node_modules/@medic/enketo-core/src/widget/geo/geopicker.scss"; -@import "../../../node_modules/@medic/enketo-core/src/widget/table/tablewidget.scss"; -@import "../../../node_modules/@medic/enketo-core/src/widget/radio/radiopicker.scss"; -@import "../../../node_modules/@medic/enketo-core/src/widget/date/datepicker-extended.scss"; -@import "../../../node_modules/@medic/enketo-core/src/widget/time/timepicker-extended.scss"; -@import "../../../node_modules/@medic/enketo-core/src/widget/datetime/datetimepicker-extended.scss"; -@import "../../../node_modules/@medic/enketo-core/src/widget/horizontal-choices/horizontalchoices.scss"; +@import "../../../node_modules/enketo-core/src/widget/note/notewidget.scss"; +@import "../../../node_modules/enketo-core/src/widget/geo/geopicker.scss"; +@import "../../../node_modules/enketo-core/src/widget/table/tablewidget.scss"; +@import "../../../node_modules/enketo-core/src/widget/radio/radiopicker.scss"; +@import "../../../node_modules/enketo-core/src/widget/date/datepicker-extended.scss"; +@import "../../../node_modules/enketo-core/src/widget/time/timepicker-extended.scss"; +@import "../../../node_modules/enketo-core/src/widget/datetime/datetimepicker-extended.scss"; +@import "../../../node_modules/enketo-core/src/widget/horizontal-choices/horizontalchoices.scss"; diff --git a/static/css/enketo/enketo.scss b/static/css/enketo/enketo.scss index 85700974746..925ccd5d240 100644 --- a/static/css/enketo/enketo.scss +++ b/static/css/enketo/enketo.scss @@ -1,17 +1,17 @@ @import "fonts"; @import "variables"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/variables"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/mixins"; -@import "../../../node_modules/@medic/enketo-core/src/sass/formhub/mixins"; +@import "../../../node_modules/enketo-core/src/sass/core/variables"; +@import "../../../node_modules/enketo-core/src/sass/core/mixins"; +@import "../../../node_modules/enketo-core/src/sass/formhub/mixins"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/reset"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/utilities"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/icons"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/layout"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/buttons"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/main"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/pages"; +@import "../../../node_modules/enketo-core/src/sass/core/reset"; +@import "../../../node_modules/enketo-core/src/sass/core/utilities"; +@import "../../../node_modules/enketo-core/src/sass/core/icons"; +@import "../../../node_modules/enketo-core/src/sass/core/layout"; +@import "../../../node_modules/enketo-core/src/sass/core/buttons"; +@import "../../../node_modules/enketo-core/src/sass/core/main"; +@import "../../../node_modules/enketo-core/src/sass/core/pages"; @import "widgets"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/slider"; -@import "../../../node_modules/@medic/enketo-core/src/sass/core/responsive"; -@import "../../../node_modules/@medic/enketo-core/src/sass/formhub/main"; +@import "../../../node_modules/enketo-core/src/sass/core/slider"; +@import "../../../node_modules/enketo-core/src/sass/core/responsive"; +@import "../../../node_modules/enketo-core/src/sass/formhub/main"; diff --git a/static/js/enketo/main.js b/static/js/enketo/main.js index 6433adde464..6c24fafb55d 100644 --- a/static/js/enketo/main.js +++ b/static/js/enketo/main.js @@ -1,3 +1,3 @@ -window.EnketoForm = require('@medic/enketo-core/src/js/Form'); +window.EnketoForm = require('enketo-core/src/js/Form'); $.fn.datepicker.defaults.container = '.content-pane .enketo'; $.fn.datepicker.defaults.orientation = 'bottom'; diff --git a/static/js/enketo/widgets.js b/static/js/enketo/widgets.js index 57f00226359..b40dd21ab82 100644 --- a/static/js/enketo/widgets.js +++ b/static/js/enketo/widgets.js @@ -6,13 +6,13 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { var widgets = [ - require( '@medic/enketo-core/src/widget/geo/geopicker' ), - require( '@medic/enketo-core/src/widget/table/tablewidget' ), - require( '@medic/enketo-core/src/widget/radio/radiopicker' ), - require( '@medic/enketo-core/src/widget/date/datepicker-extended' ), - require( '@medic/enketo-core/src/widget/time/timepicker-extended' ), - require( '@medic/enketo-core/src/widget/datetime/datetimepicker-extended' ), - require( '@medic/enketo-core/src/widget/horizontal-choices/horizontalchoices' ), + require( 'enketo-core/src/widget/geo/geopicker' ), + require( 'enketo-core/src/widget/table/tablewidget' ), + require( 'enketo-core/src/widget/radio/radiopicker' ), + require( 'enketo-core/src/widget/date/datepicker-extended' ), + require( 'enketo-core/src/widget/time/timepicker-extended' ), + require( 'enketo-core/src/widget/datetime/datetimepicker-extended' ), + require( 'enketo-core/src/widget/horizontal-choices/horizontalchoices' ), require( './widgets/notewidget' ), require( './widgets/countdown-widget' ), require( './widgets/db-object-widget' ), diff --git a/static/js/enketo/widgets/android-datepicker.js b/static/js/enketo/widgets/android-datepicker.js index 0468391e2b6..09115535447 100644 --- a/static/js/enketo/widgets/android-datepicker.js +++ b/static/js/enketo/widgets/android-datepicker.js @@ -21,9 +21,9 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; - var Widget = require( '@medic/enketo-core/src/js/Widget' ); + var Widget = require( 'enketo-core/src/js/Widget' ); var $ = require( 'jquery' ); - require( '@medic/enketo-core/src/js/plugins' ); + require( 'enketo-core/src/js/plugins' ); var pluginName = 'androiddatepicker'; diff --git a/static/js/enketo/widgets/bikram-sambat-datepicker.js b/static/js/enketo/widgets/bikram-sambat-datepicker.js index e73b992aff5..ba59e80f927 100644 --- a/static/js/enketo/widgets/bikram-sambat-datepicker.js +++ b/static/js/enketo/widgets/bikram-sambat-datepicker.js @@ -6,9 +6,9 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; - var Widget = require( '@medic/enketo-core/src/js/Widget' ); + var Widget = require( 'enketo-core/src/js/Widget' ); var $ = require( 'jquery' ); - require( '@medic/enketo-core/src/js/plugins' ); + require( 'enketo-core/src/js/plugins' ); var bikram_sambat_bs = require( 'bikram-sambat-bootstrap' ); var pluginName = 'bikramsambatdatepicker'; diff --git a/static/js/enketo/widgets/countdown-widget.js b/static/js/enketo/widgets/countdown-widget.js index 3afa4ab242c..f245e29e4a3 100644 --- a/static/js/enketo/widgets/countdown-widget.js +++ b/static/js/enketo/widgets/countdown-widget.js @@ -21,9 +21,9 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; - var Widget = require( '@medic/enketo-core/src/js/Widget' ); + var Widget = require( 'enketo-core/src/js/Widget' ); var $ = require( 'jquery' ); - require( '@medic/enketo-core/src/js/plugins' ); + require( 'enketo-core/src/js/plugins' ); var pluginName = 'timerwidget'; diff --git a/static/js/enketo/widgets/db-object-widget.js b/static/js/enketo/widgets/db-object-widget.js index 2bf8fe089df..562e63daf68 100644 --- a/static/js/enketo/widgets/db-object-widget.js +++ b/static/js/enketo/widgets/db-object-widget.js @@ -7,10 +7,10 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; var _ = require('underscore'); - var Widget = require('@medic/enketo-core/src/js/Widget'); + var Widget = require('enketo-core/src/js/Widget'); var $ = require('jquery'); - require('@medic/enketo-core/src/js/plugins'); + require('enketo-core/src/js/plugins'); var pluginName = 'dbobjectwidget'; diff --git a/static/js/enketo/widgets/notewidget.js b/static/js/enketo/widgets/notewidget.js index 61bf033990a..ed5bd779e58 100644 --- a/static/js/enketo/widgets/notewidget.js +++ b/static/js/enketo/widgets/notewidget.js @@ -21,9 +21,9 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; - var Widget = require( '@medic/enketo-core/src/js/Widget' ); + var Widget = require( 'enketo-core/src/js/Widget' ); var $ = require( 'jquery' ); - require( '@medic/enketo-core/src/js/plugins' ); + require( 'enketo-core/src/js/plugins' ); var pluginName = 'notewidget'; diff --git a/static/js/enketo/widgets/phone-widget.js b/static/js/enketo/widgets/phone-widget.js index 019d5c6d652..93ca8e9ccfb 100644 --- a/static/js/enketo/widgets/phone-widget.js +++ b/static/js/enketo/widgets/phone-widget.js @@ -6,11 +6,11 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; - var FormModel = require( '@medic/enketo-core/src/js/Form-model' ); - var Widget = require( '@medic/enketo-core/src/js/Widget' ); + var FormModel = require( 'enketo-core/src/js/Form-model' ); + var Widget = require( 'enketo-core/src/js/Widget' ); var $ = require( 'jquery' ); var libphonenumber = require( 'libphonenumber/utils' ); - require( '@medic/enketo-core/src/js/plugins' ); + require( 'enketo-core/src/js/plugins' ); var pluginName = 'phonewidget'; diff --git a/static/js/enketo/widgets/simprints.js b/static/js/enketo/widgets/simprints.js index 7a9fef8f337..b18597ac7c8 100644 --- a/static/js/enketo/widgets/simprints.js +++ b/static/js/enketo/widgets/simprints.js @@ -6,9 +6,9 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; - var Widget = require('@medic/enketo-core/src/js/Widget'); + var Widget = require('enketo-core/src/js/Widget'); var $ = require( 'jquery' ); - require('@medic/enketo-core/src/js/plugins'); + require('enketo-core/src/js/plugins'); var pluginName = 'simprintswidget'; diff --git a/static/js/enketo/widgets/unselectable-radios.js b/static/js/enketo/widgets/unselectable-radios.js index b9184801fa4..83308bc2aa6 100644 --- a/static/js/enketo/widgets/unselectable-radios.js +++ b/static/js/enketo/widgets/unselectable-radios.js @@ -21,9 +21,9 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; - var Widget = require( '@medic/enketo-core/src/js/Widget' ); + var Widget = require( 'enketo-core/src/js/Widget' ); var $ = require( 'jquery' ); - require( '@medic/enketo-core/src/js/plugins' ); + require( 'enketo-core/src/js/plugins' ); var pluginName = 'unselectableradios'; diff --git a/static/js/enketo/widgets/z-score.js b/static/js/enketo/widgets/z-score.js index ea4003ba29f..d0fb2b252bb 100644 --- a/static/js/enketo/widgets/z-score.js +++ b/static/js/enketo/widgets/z-score.js @@ -7,10 +7,10 @@ if ( typeof exports === 'object' && typeof exports.nodeName !== 'string' && type define( function( require, exports, module ) { 'use strict'; - var Widget = require('@medic/enketo-core/src/js/Widget'); + var Widget = require('enketo-core/src/js/Widget'); var $ = require('jquery'); - require('@medic/enketo-core/src/js/plugins'); + require('enketo-core/src/js/plugins'); var pluginName = 'zscorewidget'; diff --git a/static/js/services/enketo.js b/static/js/services/enketo.js index 650241a0d9d..6a261e8149b 100644 --- a/static/js/services/enketo.js +++ b/static/js/services/enketo.js @@ -267,7 +267,7 @@ angular.module('inboxServices').service('Enketo', $wrapper.find('.btn.next-page') .off('.pagemode') .on('click.pagemode', function() { - form.getView().pages.next() + form.pages.next() .then(function(newPageIndex) { if(typeof newPageIndex === 'number') { window.history.pushState({ enketo_page_number: newPageIndex }, ''); @@ -292,7 +292,7 @@ angular.module('inboxServices').service('Enketo', var targetPage = event.originalEvent.state.enketo_page_number; if ($wrapper.find('.container').not(':empty')) { - var pages = form.getView().pages; + var pages = form.pages; pages.flipTo(pages.getAllActive()[targetPage], targetPage); } }