From 36a87bb72577461a5c807e81526d6b1801493333 Mon Sep 17 00:00:00 2001 From: Scott O'Hara Date: Mon, 27 Nov 2017 16:01:00 +1100 Subject: [PATCH] Upgrade to eslint@4.12.0 --- karma-bdd.conf.js | 26 +- karma.common.js | 12 +- karma.conf.js | 26 +- package-lock.json | 340 ++++++++++-------- package.json | 4 +- spec/public/categories/views/edit_spec.js | 3 + spec/public/loot/views/layout_spec.js | 74 ++-- spec/public/mocks/accounts/models/account.js | 6 +- spec/public/mocks/loot/directivetest.js | 8 +- .../node_modules/angular/services/uibmodal.js | 6 +- .../models/og-lru-cache-factory.js | 4 +- spec/public/payees/views/edit_spec.js | 2 + spec/public/schedules/views/edit.js | 6 +- spec/public/schedules/views/edit_spec.js | 267 +++++++------- spec/public/securities/views/edit_spec.js | 2 + spec/public/transactions/views/edit.js | 6 +- spec/public/transactions/views/edit_spec.js | 267 +++++++------- src/loot/index.js | 18 +- src/loot/providers/states.js | 116 +++--- .../directives/og-input-calculator.js | 3 +- .../directives/og-table-navigable.js | 6 +- src/schedules/controllers/edit.js | 9 +- src/schedules/controllers/index.js | 6 +- src/transactions/controllers/edit.js | 21 +- src/transactions/controllers/index.js | 6 +- webpack.common.js | 18 +- webpack.prod.js | 12 +- 27 files changed, 676 insertions(+), 598 deletions(-) diff --git a/karma-bdd.conf.js b/karma-bdd.conf.js index e32179f6..a2a1de8f 100644 --- a/karma-bdd.conf.js +++ b/karma-bdd.conf.js @@ -3,8 +3,10 @@ const common = require("./karma.common"), module.exports = config => { config.set(Object.assign(common, { - // Preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + /* + * Preprocess matching files before serving them to the browser + * available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + */ preprocessors: { "spec/public/index.js": ["webpack", "sourcemap"] }, @@ -12,20 +14,26 @@ module.exports = config => { // Webpack configuration webpack, - // Test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter + /* + * Test results reporter to use + * possible values: 'dots', 'progress' + * available reporters: https://npmjs.org/browse/keyword/karma-reporter + */ reporters: ["mocha"], // Enable / disable watching file and executing tests whenever any file changes autoWatch: true, - // Start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + /* + * Start these browsers + * available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + */ browsers: ["Chrome"], - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits + /* + * Continuous Integration mode + * if true, Karma captures browsers, runs the tests and exits + */ singleRun: false })); }; diff --git a/karma.common.js b/karma.common.js index 7a100ab6..54ddab99 100644 --- a/karma.common.js +++ b/karma.common.js @@ -2,8 +2,10 @@ module.exports = { // Base path that will be used to resolve all patterns (eg. files, exclude) basePath: "", - // Frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + /* + * Frameworks to use + * available frameworks: https://npmjs.org/browse/keyword/karma-adapter + */ frameworks: ["mocha", "chai-as-promised", "chai-sinon"], // List of files / patterns to load in the browser @@ -21,7 +23,9 @@ module.exports = { // Enable / disable colors in the output (reporters and logs) colors: true, - // Level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + /* + * Level of logging + * possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + */ logLevel: "INFO" }; \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 4e71f530..49422a07 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,8 +3,10 @@ const common = require("./karma.common"), module.exports = config => { config.set(Object.assign(common, { - // Preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + /* + * Preprocess matching files before serving them to the browser + * available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + */ preprocessors: { "spec/public/index.js": "webpack" }, @@ -12,9 +14,11 @@ module.exports = config => { // Webpack configuration webpack, - // Test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter + /* + * Test results reporter to use + * possible values: 'dots', 'progress' + * available reporters: https://npmjs.org/browse/keyword/karma-reporter + */ reporters: ["mocha", "coverage"], coverageReporter: { @@ -30,12 +34,16 @@ module.exports = config => { // Enable / disable watching file and executing tests whenever any file changes autoWatch: false, - // Start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + /* + * Start these browsers + * available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + */ browsers: ["ChromeHeadless"], - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits + /* + * Continuous Integration mode + * if true, Karma captures browsers, runs the tests and exits + */ singleRun: true })); }; diff --git a/package-lock.json b/package-lock.json index a41d8d51..235cec44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -121,9 +121,9 @@ } }, "ajv-keywords": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", "dev": true }, "align-text": { @@ -164,9 +164,9 @@ "integrity": "sha512-yzcHpPMLQl0232nDzm5P4iAFTFQ9dMw0QgFLuKYbDj9M0xJ62z0oudYD/Lvh1pWfRsukiytP4Xj6BHOSrSXP8A==" }, "ansi-escapes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", - "integrity": "sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", "dev": true }, "ansi-regex": { @@ -1238,6 +1238,12 @@ "supports-color": "2.0.0" } }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", @@ -1303,9 +1309,9 @@ } }, "cli-width": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", - "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, "cliui": { @@ -1941,21 +1947,12 @@ } }, "doctrine": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", + "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } + "esutils": "2.0.2" } }, "dom-converter": { @@ -2339,33 +2336,33 @@ } }, "eslint": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.5.0.tgz", - "integrity": "sha1-u3XTuL3pf7XhPvzVOXRGd/6wGcM=", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.12.0.tgz", + "integrity": "sha512-Ohv4NU0FffkEe4so8DBrdfRUbGUtM4XnBTDll2pY7OdW3VkjBOZPerx3Bmuhg6S6D6r8+cli0EezN0xawUfYwg==", "dev": true, "requires": { - "ajv": "5.2.2", + "ajv": "5.5.0", "babel-code-frame": "6.22.0", - "chalk": "2.1.0", + "chalk": "2.3.0", "concat-stream": "1.6.0", "cross-spawn": "5.1.0", - "debug": "2.6.8", - "doctrine": "2.0.0", + "debug": "3.1.0", + "doctrine": "2.0.2", "eslint-scope": "3.7.1", - "espree": "3.5.0", + "espree": "3.5.2", "esquery": "1.0.0", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.3", + "globals": "11.0.1", + "ignore": "3.3.7", "imurmurhash": "0.1.4", - "inquirer": "3.2.2", + "inquirer": "3.3.0", "is-resolvable": "1.0.0", - "js-yaml": "3.9.1", - "json-stable-stringify": "1.0.1", + "js-yaml": "3.10.0", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", "minimatch": "3.0.4", @@ -2373,26 +2370,26 @@ "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", - "pluralize": "4.0.0", + "pluralize": "7.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", "semver": "5.4.1", "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "4.0.1", + "table": "4.0.2", "text-table": "0.2.0" }, "dependencies": { "ajv": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.2.tgz", - "integrity": "sha1-R8aNaehvXZUxA7AHSpQw3GPaXjk=", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.0.tgz", + "integrity": "sha1-6yhAdG6dxIvV4GOjbj/UAMXqtak=", "dev": true, "requires": { "co": "4.6.0", "fast-deep-equal": "1.0.0", - "json-schema-traverse": "0.3.1", - "json-stable-stringify": "1.0.1" + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, "ansi-regex": { @@ -2411,14 +2408,23 @@ } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.2.1" + "supports-color": "4.5.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" } }, "esprima": { @@ -2427,6 +2433,12 @@ "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, + "globals": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.0.1.tgz", + "integrity": "sha1-Eqh7sBDlFUOWrMU14eQ/x1Ow5eg=", + "dev": true + }, "has-flag": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", @@ -2434,9 +2446,9 @@ "dev": true }, "js-yaml": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", - "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", "dev": true, "requires": { "argparse": "1.0.9", @@ -2465,9 +2477,9 @@ } }, "supports-color": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { "has-flag": "2.0.0" @@ -2476,9 +2488,9 @@ } }, "eslint-config-oharagroup": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/eslint-config-oharagroup/-/eslint-config-oharagroup-2.2.0.tgz", - "integrity": "sha512-l0sKPkWVJNzWWPWIiRUz4QUAWR+fmfdtmp53HNg2kLJ8zHw7QG2HcpZB6jAtEmnM4E11Am1vqakZkBYoWs79Ug==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-oharagroup/-/eslint-config-oharagroup-2.3.0.tgz", + "integrity": "sha512-LwrkjoLhs+022HJSv/Gz79vjXvNPahS3+SG+iF53GBhFWUiJ+4b0YKIcNJlZk1CDoUVV+YKmdfvT9e8TnO4XkA==", "dev": true }, "eslint-scope": { @@ -2492,19 +2504,19 @@ } }, "espree": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz", - "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", "dev": true, "requires": { - "acorn": "5.1.1", + "acorn": "5.2.1", "acorn-jsx": "3.0.1" }, "dependencies": { "acorn": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz", - "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", + "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", "dev": true } } @@ -2657,21 +2669,30 @@ "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" }, "external-editor": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.4.tgz", - "integrity": "sha1-HtkZnanL/i7y96MbL96LDRI2iXI=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", "dev": true, "requires": { - "iconv-lite": "0.4.18", - "jschardet": "1.5.1", - "tmp": "0.0.31" + "chardet": "0.4.2", + "iconv-lite": "0.4.19", + "tmp": "0.0.33" }, "dependencies": { "iconv-lite": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.18.tgz", - "integrity": "sha512-sr1ZQph3UwHTR0XftSbK85OvBbxe/abLGzEnPENCQwmHf7sck8Oyu4ob3LgBxWWxRoM+QszeUyl7jbqapu2TqA==", + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } } } }, @@ -2750,7 +2771,7 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.2.2", + "flat-cache": "1.3.0", "object-assign": "4.1.1" } }, @@ -2823,52 +2844,15 @@ } }, "flat-cache": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", - "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { "circular-json": "0.3.3", "del": "2.2.2", "graceful-fs": "4.1.11", "write": "0.2.1" - }, - "dependencies": { - "del": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", - "dev": true, - "requires": { - "globby": "5.0.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.0", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "rimraf": "2.6.1" - } - }, - "globby": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", - "dev": true, - "requires": { - "array-union": "1.0.2", - "arrify": "1.0.1", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - } } }, "flatten": { @@ -4194,9 +4178,9 @@ "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=" }, "ignore": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.3.tgz", - "integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, "ignore-loader": { @@ -4263,16 +4247,16 @@ "dev": true }, "inquirer": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.2.tgz", - "integrity": "sha512-bTKLzEHJVATimZO/YFdLrom0lRx1BHfRYskFHfIMVkGdp8+dIZaxuU+4yrsS1lcu6YWywVQVVsfvdwESzbeqHw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "ansi-escapes": "2.0.0", - "chalk": "2.1.0", + "ansi-escapes": "3.0.0", + "chalk": "2.3.0", "cli-cursor": "2.1.0", - "cli-width": "2.1.0", - "external-editor": "2.0.4", + "cli-width": "2.2.0", + "external-editor": "2.1.0", "figures": "2.0.0", "lodash": "4.17.4", "mute-stream": "0.0.7", @@ -4300,14 +4284,14 @@ } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.2.1" + "supports-color": "4.5.0" } }, "has-flag": { @@ -4348,9 +4332,9 @@ } }, "supports-color": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { "has-flag": "2.0.0" @@ -4734,12 +4718,6 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "optional": true }, - "jschardet": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz", - "integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==", - "dev": true - }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", @@ -4768,6 +4746,12 @@ "jsonify": "0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -6257,9 +6241,9 @@ } }, "pluralize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-4.0.0.tgz", - "integrity": "sha1-WbcIwcAZCi9pLxx2GMRGsFL9F2I=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "postcss": { @@ -7535,10 +7519,21 @@ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" }, "slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } }, "sntp": { "version": "1.0.9", @@ -7913,25 +7908,63 @@ } }, "table": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.1.tgz", - "integrity": "sha1-qBFsEz+sLGH0pCCrbN9cTWHw5DU=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", + "ajv": "5.5.0", + "ajv-keywords": "2.1.1", + "chalk": "2.3.0", "lodash": "4.17.4", - "slice-ansi": "0.0.4", + "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { + "ajv": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.0.tgz", + "integrity": "sha1-6yhAdG6dxIvV4GOjbj/UAMXqtak=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -7962,6 +7995,15 @@ "requires": { "ansi-regex": "3.0.0" } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } } } }, diff --git a/package.json b/package.json index f8bd07bd..4d84d291 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "angular-mocks": "1.6.7", "chai": "3.5.0", "chai-as-promised": "5.3.0", - "eslint": "4.5.0", - "eslint-config-oharagroup": "2.2.0", + "eslint": "4.12.0", + "eslint-config-oharagroup": "2.3.0", "ignore-loader": "0.1.2", "istanbul-instrumenter-loader": "3.0.0", "karma": "1.7.1", diff --git a/spec/public/categories/views/edit_spec.js b/spec/public/categories/views/edit_spec.js index e456de68..dbddb297 100644 --- a/spec/public/categories/views/edit_spec.js +++ b/spec/public/categories/views/edit_spec.js @@ -40,11 +40,14 @@ describe("categoryEditView", () => { }); // MISSING - category name, parent & direction should show red cross when invalid + // MISSING - form group around category name & parent should have 'has-error' class when invalid + // MISSING - parent should behave like non-editable typeahead }); // MISSING - error message should display when present + // MISSING - category name & parent text should be selected when input gets focus } diff --git a/spec/public/loot/views/layout_spec.js b/spec/public/loot/views/layout_spec.js index 43c8746a..fc36d545 100644 --- a/spec/public/loot/views/layout_spec.js +++ b/spec/public/loot/views/layout_spec.js @@ -1,36 +1,38 @@ -/* Not implemented yet -describe.skip("layoutView", () => { - const layoutView = require("./layout.js"); - - it("should navigate to the accounts list when the home button is clicked", () => { - layoutView.homeButton.click(); - browser.getCurrentUrl().should.eventually.equal(`${browser.baseUrl}#!/accounts`); - }); - - describe("accounts menu", () => { - it("should show the accounts menu items when clicked", () => { - layoutView.accountsMenu.click(); - layoutView.accountListMenuItem.isDisplayed().should.eventually.be.true; - }); - - it("should navigate to the accounts list when the list item is clicked", () => { - layoutView.accountListMenuItem.click(); - browser.getTitle().should.eventually.equal("Loot - Accounts"); - }); - - describe("recent accounts", () => { - const oldestItem = layoutView.recentAccountMenuItems.last(); - - it("should navigate to the account ledger when clicked", () => { - oldestItem.click(); - browser.getTitle().should.eventually.equal("Loot - Account Transactions"); - }); - - it("should move the account to the top of the recent list when clicked", () => { - layoutView.recentAccountMenuItems.first().getText().should.eventually.equal(oldestItem.getText()); - browser.getTitle().should.eventually.equal("Loot - Account Transactions"); - }); - }); - }); -}); -*/ +/* + * Not implemented yet + * + *describe.skip("layoutView", () => { + * const layoutView = require("./layout.js"); + * + * it("should navigate to the accounts list when the home button is clicked", () => { + * layoutView.homeButton.click(); + * browser.getCurrentUrl().should.eventually.equal(`${browser.baseUrl}#!/accounts`); + * }); + * + * describe("accounts menu", () => { + * it("should show the accounts menu items when clicked", () => { + * layoutView.accountsMenu.click(); + * layoutView.accountListMenuItem.isDisplayed().should.eventually.be.true; + * }); + * + * it("should navigate to the accounts list when the list item is clicked", () => { + * layoutView.accountListMenuItem.click(); + * browser.getTitle().should.eventually.equal("Loot - Accounts"); + * }); + * + * describe("recent accounts", () => { + * const oldestItem = layoutView.recentAccountMenuItems.last(); + * + * it("should navigate to the account ledger when clicked", () => { + * oldestItem.click(); + * browser.getTitle().should.eventually.equal("Loot - Account Transactions"); + * }); + * + * it("should move the account to the top of the recent list when clicked", () => { + * layoutView.recentAccountMenuItems.first().getText().should.eventually.equal(oldestItem.getText()); + * browser.getTitle().should.eventually.equal("Loot - Account Transactions"); + * }); + * }); + * }); + *}); + */ diff --git a/spec/public/mocks/accounts/models/account.js b/spec/public/mocks/accounts/models/account.js index c8c57817..86099d89 100644 --- a/spec/public/mocks/accounts/models/account.js +++ b/spec/public/mocks/accounts/models/account.js @@ -1,7 +1,9 @@ export default class AccountModelMockProvider { constructor(accountMockProvider, accountsMockProvider, accountsWithBalancesMockProvider, $qMockProvider) { - // Success/error = options for the stub promises - // all/allWithBalances = promise-like responses + /* + * Success/error = options for the stub promises + * all/allWithBalances = promise-like responses + */ const success = { args: {id: 1}, response: {data: accountMockProvider.$get()} diff --git a/spec/public/mocks/loot/directivetest.js b/spec/public/mocks/loot/directivetest.js index 7d1aadaa..1f771bf5 100644 --- a/spec/public/mocks/loot/directivetest.js +++ b/spec/public/mocks/loot/directivetest.js @@ -28,9 +28,11 @@ export default class DirectiveTest { this.scope = this.$rootScope.$new(); } - // Compiles the directive and returns an array containing - // - the DOM element into which the directive was compiled - // - the scope object that it was compiled with + /* + * Compiles the directive and returns an array containing + * - the DOM element into which the directive was compiled + * - the scope object that it was compiled with + */ compile(options = {}, replace) { let directive; diff --git a/spec/public/mocks/node_modules/angular/services/uibmodal.js b/spec/public/mocks/node_modules/angular/services/uibmodal.js index 04348ebe..b3cd01ae 100644 --- a/spec/public/mocks/node_modules/angular/services/uibmodal.js +++ b/spec/public/mocks/node_modules/angular/services/uibmodal.js @@ -14,8 +14,10 @@ export default class UibModalMockProvider { }, {}); } - // Return a result object that is promise-like, but instead of invoking the callbacks it just stores them - // for later use by close() and dismiss() + /* + * Return a result object that is promise-like, but instead of invoking the callbacks it just stores them + * for later use by close() and dismiss() + */ return { result: { then(callback) { diff --git a/spec/public/og-components/og-lru-cache-factory/models/og-lru-cache-factory.js b/spec/public/og-components/og-lru-cache-factory/models/og-lru-cache-factory.js index 56260d27..fcece1f9 100644 --- a/spec/public/og-components/og-lru-cache-factory/models/og-lru-cache-factory.js +++ b/spec/public/og-components/og-lru-cache-factory/models/og-lru-cache-factory.js @@ -172,8 +172,8 @@ describe("ogLruCacheFactory", () => { ogLruCache.tail = id; ogLruCache.remove(id); - (Boolean(ogLruCache.head)).should.be.false; - (Boolean(ogLruCache.tail)).should.be.false; + Boolean(ogLruCache.head).should.be.false; + Boolean(ogLruCache.tail).should.be.false; }); it("should remove an item from the head of the list", () => { diff --git a/spec/public/payees/views/edit_spec.js b/spec/public/payees/views/edit_spec.js index 0d7fd247..7ce452ec 100644 --- a/spec/public/payees/views/edit_spec.js +++ b/spec/public/payees/views/edit_spec.js @@ -27,10 +27,12 @@ describe("payeeEditView", () => { it("should not enable the save button", () => payeeEditView.saveButton.isEnabled().should.eventually.be.false); // MISSING - payee name should show red cross when invalid + // MISSING - form group around payee name should have 'has-error' class when invalid }); // MISSING - error message should display when present + // MISSING - payee name text should be selected when input gets focus } diff --git a/spec/public/schedules/views/edit.js b/spec/public/schedules/views/edit.js index 1bad6901..ac0fc3c1 100644 --- a/spec/public/schedules/views/edit.js +++ b/spec/public/schedules/views/edit.js @@ -169,8 +169,10 @@ class ScheduleEditView { this.frequencyTypeahead.clear(); // Next due date - // MISSING - can't clear date input (https://github.com/angular/protractor/issues/562) - // this.nextDueDateInput.clear(); + /* + * MISSING - can't clear date input (https://github.com/angular/protractor/issues/562) + * this.nextDueDateInput.clear(); + */ // Payee this.payeeTypeahead.clear(); diff --git a/spec/public/schedules/views/edit_spec.js b/spec/public/schedules/views/edit_spec.js index 35d5e64b..a4b8d605 100644 --- a/spec/public/schedules/views/edit_spec.js +++ b/spec/public/schedules/views/edit_spec.js @@ -37,39 +37,42 @@ describe("scheduleEditView", () => { it("should not enable the save button", () => scheduleEditView.saveButton.isEnabled().should.eventually.be.false); // MISSING - category name, parent & direction should show red cross when invalid + // MISSING - form group around category name & parent should have 'has-error' class when invalid + // MISSING - parent should behave like non-editable typeahead }); // MISSING - error message should display when present + // MISSING - category name & parent text should be selected when input gets focus } // Edits the target index row /* - function editRow() { - targetRow.evaluate("$index").then(index => { - // Enter an existing schedule - scheduleIndexView.enterSchedule(index); - waitForScheduleEditView("Enter"); - }); - } - */ + * function editRow() { + * targetRow.evaluate("$index").then(index => { + * // Enter an existing schedule + * scheduleIndexView.enterSchedule(index); + * waitForScheduleEditView("Enter"); + * }); + * } + */ // Checks the values in the edit form against the values from an index row /* - function checkEditFormMatchesIndexRow(row) { - scheduleIndexView.getRowValues(row).then(values => { - // MISSING - scheduleEditView.categoryNameInput.getAttribute("value").should.eventually.equal(values.categoryName); - if (!values.isSubcategory) { - scheduleEditView.directionRadioButton(values.direction, true).isPresent().should.eventually.be.true; - } else { - scheduleEditView.categoryParentInput.getAttribute("value").should.eventually.equal(values.categoryParent); - } - }); - } - */ + * function checkEditFormMatchesIndexRow(row) { + * scheduleIndexView.getRowValues(row).then(values => { + * // MISSING + * scheduleEditView.categoryNameInput.getAttribute("value").should.eventually.equal(values.categoryName); + * if (!values.isSubcategory) { + * scheduleEditView.directionRadioButton(values.direction, true).isPresent().should.eventually.be.true; + * } else { + * scheduleEditView.categoryParentInput.getAttribute("value").should.eventually.equal(values.categoryParent); + * } + * }); + * } + */ beforeEach(() => { scheduleIndexView = require("./index"); @@ -337,115 +340,117 @@ describe("scheduleEditView", () => { }); }); - /* Not implemented yet - describe("editing a category", () => { - describe("parent", () => { - describe("expense", () => { - beforeEach(() => scheduleIndexView.lastCategory().then(row => targetRow = row)); - - beforeEach(editRow); - - beforeEach(() => { - // Check that the edit form is correctly populated - checkEditFormMatchesIndexRow(targetRow); - - expected = {categoryName: "AA Test category (edited)", direction: "inflow"}; - scheduleEditView.enterCategoryDetails(expected); - }); - - commonBehaviour(); - - it("should update an existing category when the save button is clicked", () => { - scheduleEditView.save(); - - // Row count should not have changed - scheduleIndexView.table.rows.count().should.eventually.equal(originalRowCount); - - // After editing, the row should now be the first category - scheduleIndexView.firstCategory().then(row => scheduleIndexView.checkRowValues(row, expected)); - }); - }); - - describe("income", () => { - beforeEach(() => scheduleIndexView.firstCategory().then(row => targetRow = row)); - - beforeEach(editRow); - - beforeEach(() => { - // Check that the edit form is correctly populated - checkEditFormMatchesIndexRow(targetRow); - - expected = {categoryName: "ZZZ Test category (edited)", direction: "outflow"}; - scheduleEditView.enterCategoryDetails(expected); - }); - - commonBehaviour(); - - it("should update an existing category when the save button is clicked", () => { - scheduleEditView.save(); - - // Row count should not have changed - scheduleIndexView.table.rows.count().should.eventually.equal(originalRowCount); - - // After editing, the row should now be the last category - scheduleIndexView.lastCategory().then(row => scheduleIndexView.checkRowValues(row, expected)); - }); - }); - }); - - describe("subcategory", () => { - describe("income", () => { - beforeEach(() => scheduleIndexView.firstSubcategory().then(row => targetRow = row)); - - beforeEach(editRow); - - beforeEach(() => { - // Check that the edit form is correctly populated - checkEditFormMatchesIndexRow(targetRow); - - expected = {categoryName: "ZZZ Test subcategory (edited)", categoryParent: "ZZZ Test category (edited", direction: "outflow", isSubcategory: true}; - scheduleEditView.enterCategoryDetails(expected); - }); - - commonBehaviour(); - - it("should update an existing category when the save button is clicked", () => { - scheduleEditView.save(); - - // Row count should not have changed - scheduleIndexView.table.rows.count().should.eventually.equal(originalRowCount); - - // After editing, the row should now be the last subcategory - scheduleIndexView.lastSubcategory().then(row => scheduleIndexView.checkRowValues(row, expected)); - }); - }); - - describe("expense", () => { - beforeEach(() => scheduleIndexView.lastSubcategory().then(row => targetRow = row)); - - beforeEach(editRow); - - beforeEach(() => { - // Check that the edit form is correctly populated - checkEditFormMatchesIndexRow(targetRow); - - expected = {categoryName: "AAA Test subcategory (edited)", categoryParent: "AAA Test categor", direction: "inflow", isSubcategory: true}; - scheduleEditView.enterCategoryDetails(expected); - }); - - commonBehaviour(); - - it("should update an existing category when the save button is clicked", () => { - scheduleEditView.save(); - - // Row count should not have changed - scheduleIndexView.table.rows.count().should.eventually.equal(originalRowCount); - - // After editing, the row should now be the first subcategory - scheduleIndexView.firstSubcategory().then(row => scheduleIndexView.checkRowValues(row, expected)); - }); - }); - }); - }); - */ + /* + * Not implemented yet + * + * describe("editing a category", () => { + * describe("parent", () => { + * describe("expense", () => { + * beforeEach(() => scheduleIndexView.lastCategory().then(row => targetRow = row)); + * + * beforeEach(editRow); + * + * beforeEach(() => { + * // Check that the edit form is correctly populated + * checkEditFormMatchesIndexRow(targetRow); + * + * expected = {categoryName: "AA Test category (edited)", direction: "inflow"}; + * scheduleEditView.enterCategoryDetails(expected); + * }); + * + * commonBehaviour(); + * + * it("should update an existing category when the save button is clicked", () => { + * scheduleEditView.save(); + * + * // Row count should not have changed + * scheduleIndexView.table.rows.count().should.eventually.equal(originalRowCount); + * + * // After editing, the row should now be the first category + * scheduleIndexView.firstCategory().then(row => scheduleIndexView.checkRowValues(row, expected)); + * }); + * }); + * + * describe("income", () => { + * beforeEach(() => scheduleIndexView.firstCategory().then(row => targetRow = row)); + * + * beforeEach(editRow); + * + * beforeEach(() => { + * // Check that the edit form is correctly populated + * checkEditFormMatchesIndexRow(targetRow); + * + * expected = {categoryName: "ZZZ Test category (edited)", direction: "outflow"}; + * scheduleEditView.enterCategoryDetails(expected); + * }); + * + * commonBehaviour(); + * + * it("should update an existing category when the save button is clicked", () => { + * scheduleEditView.save(); + * + * // Row count should not have changed + * scheduleIndexView.table.rows.count().should.eventually.equal(originalRowCount); + * + * // After editing, the row should now be the last category + * scheduleIndexView.lastCategory().then(row => scheduleIndexView.checkRowValues(row, expected)); + * }); + * }); + * }); + * + * describe("subcategory", () => { + * describe("income", () => { + * beforeEach(() => scheduleIndexView.firstSubcategory().then(row => targetRow = row)); + * + * beforeEach(editRow); + * + * beforeEach(() => { + * // Check that the edit form is correctly populated + * checkEditFormMatchesIndexRow(targetRow); + * + * expected = {categoryName: "ZZZ Test subcategory (edited)", categoryParent: "ZZZ Test category (edited", direction: "outflow", isSubcategory: true}; + * scheduleEditView.enterCategoryDetails(expected); + * }); + * + * commonBehaviour(); + * + * it("should update an existing category when the save button is clicked", () => { + * scheduleEditView.save(); + * + * // Row count should not have changed + * scheduleIndexView.table.rows.count().should.eventually.equal(originalRowCount); + * + * // After editing, the row should now be the last subcategory + * scheduleIndexView.lastSubcategory().then(row => scheduleIndexView.checkRowValues(row, expected)); + * }); + * }); + * + * describe("expense", () => { + * beforeEach(() => scheduleIndexView.lastSubcategory().then(row => targetRow = row)); + * + * beforeEach(editRow); + * + * beforeEach(() => { + * // Check that the edit form is correctly populated + * checkEditFormMatchesIndexRow(targetRow); + * + * expected = {categoryName: "AAA Test subcategory (edited)", categoryParent: "AAA Test categor", direction: "inflow", isSubcategory: true}; + * scheduleEditView.enterCategoryDetails(expected); + * }); + * + * commonBehaviour(); + * + * it("should update an existing category when the save button is clicked", () => { + * scheduleEditView.save(); + * + * // Row count should not have changed + * scheduleIndexView.table.rows.count().should.eventually.equal(originalRowCount); + * + * // After editing, the row should now be the first subcategory + * scheduleIndexView.firstSubcategory().then(row => scheduleIndexView.checkRowValues(row, expected)); + * }); + * }); + * }); + * }); + */ }); diff --git a/spec/public/securities/views/edit_spec.js b/spec/public/securities/views/edit_spec.js index bb6ba755..0b8de32a 100644 --- a/spec/public/securities/views/edit_spec.js +++ b/spec/public/securities/views/edit_spec.js @@ -29,10 +29,12 @@ describe("securityEditView", () => { it("should not enable the save button", () => securityEditView.saveButton.isEnabled().should.eventually.be.false); // MISSING - security name should show red cross when invalid + // MISSING - form group around security name should have 'has-error' class when invalid }); // MISSING - error message should display when present + // MISSING - security name text should be selected when input gets focus } diff --git a/spec/public/transactions/views/edit.js b/spec/public/transactions/views/edit.js index a62bbc5b..823d3a6d 100644 --- a/spec/public/transactions/views/edit.js +++ b/spec/public/transactions/views/edit.js @@ -149,8 +149,10 @@ class TransactionEditView { } // Transaction date - // MISSING - can't clear date input (https://github.com/angular/protractor/issues/562) - // this.transactionDateInput.clear(); + /* + * MISSING - can't clear date input (https://github.com/angular/protractor/issues/562) + * this.transactionDateInput.clear(); + */ // Payee this.payeeTypeahead.isPresent().then(isPresent => { diff --git a/spec/public/transactions/views/edit_spec.js b/spec/public/transactions/views/edit_spec.js index 68ccc490..4836f6c9 100644 --- a/spec/public/transactions/views/edit_spec.js +++ b/spec/public/transactions/views/edit_spec.js @@ -234,39 +234,42 @@ describe("transactionEditView", () => { it("should not enable the save button", () => transactionEditView.saveButton.isEnabled().should.eventually.be.false); // MISSING - category name, parent & direction should show red cross when invalid + // MISSING - form group around category name & parent should have 'has-error' class when invalid + // MISSING - parent should behave like non-editable typeahead }); // MISSING - error message should display when present + // MISSING - category name & parent text should be selected when input gets focus } // Edits the target index row /* - function editRow() { - targetRow.evaluate("$index").then(index => { - // Enter an existing transaction - transactionIndexView.enterTransaction(index); - waitForTransactionEditView("Edit"); - }); - } - */ + * function editRow() { + * targetRow.evaluate("$index").then(index => { + * // Enter an existing transaction + * transactionIndexView.enterTransaction(index); + * waitForTransactionEditView("Edit"); + * }); + * } + */ // Checks the values in the edit form against the values from an index row /* - function checkEditFormMatchesIndexRow(row) { - transactionIndexView.getRowValues(row).then(values => { - // MISSING - transactionEditView.categoryNameInput.getAttribute("value").should.eventually.equal(values.categoryName); - if (!values.isSubcategory) { - transactionEditView.directionRadioButton(values.direction, true).isPresent().should.eventually.be.true; - } else { - transactionEditView.categoryParentInput.getAttribute("value").should.eventually.equal(values.categoryParent); - } - }); - } - */ + * function checkEditFormMatchesIndexRow(row) { + * transactionIndexView.getRowValues(row).then(values => { + * // MISSING + * transactionEditView.categoryNameInput.getAttribute("value").should.eventually.equal(values.categoryName); + * if (!values.isSubcategory) { + * transactionEditView.directionRadioButton(values.direction, true).isPresent().should.eventually.be.true; + * } else { + * transactionEditView.categoryParentInput.getAttribute("value").should.eventually.equal(values.categoryParent); + * } + * }); + * } + */ beforeEach(() => { accountIndexView = require("../../accounts/views/index"); @@ -322,117 +325,119 @@ describe("transactionEditView", () => { }); }); - /* Not implemented yet - describe("editing a category", () => { - describe("parent", () => { - describe("expense", () => { - beforeEach(() => transactionIndexView.lastCategory().then(row => targetRow = row)); - - beforeEach(editRow); - - beforeEach(() => { - // Check that the edit form is correctly populated - checkEditFormMatchesIndexRow(targetRow); - - expected = {categoryName: "AA Test category (edited)", direction: "inflow"}; - transactionEditView.enterCategoryDetails(expected); - }); - - commonBehaviour(); - - it("should update an existing category when the save button is clicked", () => { - transactionEditView.save(); - - // Row count should not have changed - transactionIndexView.table.rows.count().should.eventually.equal(originalRowCount); - - // After editing, the row should now be the first category - transactionIndexView.firstCategory().then(row => transactionIndexView.checkRowValues(row, expected)); - }); - }); - - describe("income", () => { - beforeEach(() => transactionIndexView.firstCategory().then(row => targetRow = row)); - - beforeEach(editRow); - - beforeEach(() => { - // Check that the edit form is correctly populated - checkEditFormMatchesIndexRow(targetRow); - - expected = {categoryName: "ZZZ Test category (edited)", direction: "outflow"}; - transactionEditView.enterCategoryDetails(expected); - }); - - commonBehaviour(); - - it("should update an existing category when the save button is clicked", () => { - transactionEditView.save(); - - // Row count should not have changed - transactionIndexView.table.rows.count().should.eventually.equal(originalRowCount); - - // After editing, the row should now be the last category - transactionIndexView.lastCategory().then(row => transactionIndexView.checkRowValues(row, expected)); - }); - }); - }); - - describe("subcategory", () => { - describe("income", () => { - beforeEach(() => transactionIndexView.firstSubcategory().then(row => targetRow = row)); - - beforeEach(editRow); - - beforeEach(() => { - // Check that the edit form is correctly populated - checkEditFormMatchesIndexRow(targetRow); - - expected = {categoryName: "ZZZ Test subcategory (edited)", categoryParent: "ZZZ Test category (edited", direction: "outflow", isSubcategory: true}; - transactionEditView.enterCategoryDetails(expected); - }); - - commonBehaviour(); - - it("should update an existing category when the save button is clicked", () => { - transactionEditView.save(); - - // Row count should not have changed - transactionIndexView.table.rows.count().should.eventually.equal(originalRowCount); - - // After editing, the row should now be the last subcategory - transactionIndexView.lastSubcategory().then(row => transactionIndexView.checkRowValues(row, expected)); - }); - }); - - describe("expense", () => { - beforeEach(() => transactionIndexView.lastSubcategory().then(row => targetRow = row)); - - beforeEach(editRow); - - beforeEach(() => { - // Check that the edit form is correctly populated - checkEditFormMatchesIndexRow(targetRow); - - expected = {categoryName: "AAA Test subcategory (edited)", categoryParent: "AAA Test categor", direction: "inflow", isSubcategory: true}; - transactionEditView.enterCategoryDetails(expected); - }); - - commonBehaviour(); - - it("should update an existing category when the save button is clicked", () => { - transactionEditView.save(); - - // Row count should not have changed - transactionIndexView.table.rows.count().should.eventually.equal(originalRowCount); - - // After editing, the row should now be the first subcategory - transactionIndexView.firstSubcategory().then(row => transactionIndexView.checkRowValues(row, expected)); - }); - }); - }); - }); - */ + /* + * Not implemented yet + * + * describe("editing a category", () => { + * describe("parent", () => { + * describe("expense", () => { + * beforeEach(() => transactionIndexView.lastCategory().then(row => targetRow = row)); + * + * beforeEach(editRow); + * + * beforeEach(() => { + * // Check that the edit form is correctly populated + * checkEditFormMatchesIndexRow(targetRow); + * + * expected = {categoryName: "AA Test category (edited)", direction: "inflow"}; + * transactionEditView.enterCategoryDetails(expected); + * }); + * + * commonBehaviour(); + * + * it("should update an existing category when the save button is clicked", () => { + * transactionEditView.save(); + * + * // Row count should not have changed + * transactionIndexView.table.rows.count().should.eventually.equal(originalRowCount); + * + * // After editing, the row should now be the first category + * transactionIndexView.firstCategory().then(row => transactionIndexView.checkRowValues(row, expected)); + * }); + * }); + * + * describe("income", () => { + * beforeEach(() => transactionIndexView.firstCategory().then(row => targetRow = row)); + * + * beforeEach(editRow); + * + * beforeEach(() => { + * // Check that the edit form is correctly populated + * checkEditFormMatchesIndexRow(targetRow); + * + * expected = {categoryName: "ZZZ Test category (edited)", direction: "outflow"}; + * transactionEditView.enterCategoryDetails(expected); + * }); + * + * commonBehaviour(); + * + * it("should update an existing category when the save button is clicked", () => { + * transactionEditView.save(); + * + * // Row count should not have changed + * transactionIndexView.table.rows.count().should.eventually.equal(originalRowCount); + * + * // After editing, the row should now be the last category + * transactionIndexView.lastCategory().then(row => transactionIndexView.checkRowValues(row, expected)); + * }); + * }); + * }); + * + * describe("subcategory", () => { + * describe("income", () => { + * beforeEach(() => transactionIndexView.firstSubcategory().then(row => targetRow = row)); + * + * beforeEach(editRow); + * + * beforeEach(() => { + * // Check that the edit form is correctly populated + * checkEditFormMatchesIndexRow(targetRow); + * + * expected = {categoryName: "ZZZ Test subcategory (edited)", categoryParent: "ZZZ Test category (edited", direction: "outflow", isSubcategory: true}; + * transactionEditView.enterCategoryDetails(expected); + * }); + * + * commonBehaviour(); + * + * it("should update an existing category when the save button is clicked", () => { + * transactionEditView.save(); + * + * // Row count should not have changed + * transactionIndexView.table.rows.count().should.eventually.equal(originalRowCount); + * + * // After editing, the row should now be the last subcategory + * transactionIndexView.lastSubcategory().then(row => transactionIndexView.checkRowValues(row, expected)); + * }); + * }); + * + * describe("expense", () => { + * beforeEach(() => transactionIndexView.lastSubcategory().then(row => targetRow = row)); + * + * beforeEach(editRow); + * + * beforeEach(() => { + * // Check that the edit form is correctly populated + * checkEditFormMatchesIndexRow(targetRow); + * + * expected = {categoryName: "AAA Test subcategory (edited)", categoryParent: "AAA Test categor", direction: "inflow", isSubcategory: true}; + * transactionEditView.enterCategoryDetails(expected); + * }); + * + * commonBehaviour(); + * + * it("should update an existing category when the save button is clicked", () => { + * transactionEditView.save(); + * + * // Row count should not have changed + * transactionIndexView.table.rows.count().should.eventually.equal(originalRowCount); + * + * // After editing, the row should now be the first subcategory + * transactionIndexView.firstSubcategory().then(row => transactionIndexView.checkRowValues(row, expected)); + * }); + * }); + * }); + * }); + */ }); }); }); diff --git a/src/loot/index.js b/src/loot/index.js index eecf623c..ff4cc93f 100644 --- a/src/loot/index.js +++ b/src/loot/index.js @@ -37,18 +37,16 @@ angular.module("lootApp", [ .config(["$urlServiceProvider", "lootStatesProvider", $urlServiceProvider => $urlServiceProvider.rules.otherwise("/accounts")]) // Runtime initialisation - .run(["$rootScope", "$window", "$state", "ogNavigatorServiceWorkerService", - ($rootScope, $window, $state, ogNavigatorServiceWorkerService) => { - // Ensure that jQuery is available on the $window service - $window.$ = $; + .run(["$rootScope", "$window", "$state", "ogNavigatorServiceWorkerService", ($rootScope, $window, $state, ogNavigatorServiceWorkerService) => { + // Ensure that jQuery is available on the $window service + $window.$ = $; - // Ensure that the $state service is accessible from the $rootScope - $rootScope.$state = $state; + // Ensure that the $state service is accessible from the $rootScope + $rootScope.$state = $state; - // ServiceWorker registration - ogNavigatorServiceWorkerService.register("/service-worker.js"); - } - ]); + // ServiceWorker registration + ogNavigatorServiceWorkerService.register("/service-worker.js"); + }]); angular.module("lootStates", [ "ui.bootstrap", diff --git a/src/loot/providers/states.js b/src/loot/providers/states.js index f6538885..0806a8d7 100644 --- a/src/loot/providers/states.js +++ b/src/loot/providers/states.js @@ -30,19 +30,13 @@ export default class LootStatesProvider { title: `${parentContext.charAt(0).toUpperCase() + parentContext.substring(1)} Transactions` }, resolve: { - contextModel: ["authenticated", `${parentContext}Model`, - (authenticated, contextModel) => authenticated && contextModel - ], - context: ["authenticated", "$stateParams", "contextModel", - (authenticated, $stateParams, contextModel) => authenticated && contextModel.find($stateParams.id) - ], - transactionBatch: ["authenticated", "transactionModel", "contextModel", "context", - (authenticated, transactionModel, contextModel, context) => { - const unreconciledOnly = contextModel.isUnreconciledOnly ? contextModel.isUnreconciledOnly(context.id) : false; + contextModel: ["authenticated", `${parentContext}Model`, (authenticated, contextModel) => authenticated && contextModel], + context: ["authenticated", "$stateParams", "contextModel", (authenticated, $stateParams, contextModel) => authenticated && contextModel.find($stateParams.id)], + transactionBatch: ["authenticated", "transactionModel", "contextModel", "context", (authenticated, transactionModel, contextModel, context) => { + const unreconciledOnly = contextModel.isUnreconciledOnly ? contextModel.isUnreconciledOnly(context.id) : false; - return authenticated && transactionModel.all(contextModel.path(context.id), null, "prev", unreconciledOnly); - } - ] + return authenticated && transactionModel.all(contextModel.path(context.id), null, "prev", unreconciledOnly); + }] }, views: transactionViews }; @@ -64,24 +58,22 @@ export default class LootStatesProvider { title: "Welcome" }, resolve: { - authenticated: ["$uibModal", "authenticationModel", - ($uibModal, authenticationModel) => { - // Check if the user is authenticated - if (!authenticationModel.isAuthenticated) { - // Not authenticated, show the login modal - return $uibModal.open({ - templateUrl: AuthenticationEditView, - controller: "AuthenticationEditController", - controllerAs: "vm", - backdrop: "static", - size: "sm" - }).result.then(() => authenticationModel.isAuthenticated).catch(() => false); - } - - // User is authenticated - return true; + authenticated: ["$uibModal", "authenticationModel", ($uibModal, authenticationModel) => { + // Check if the user is authenticated + if (!authenticationModel.isAuthenticated) { + // Not authenticated, show the login modal + return $uibModal.open({ + templateUrl: AuthenticationEditView, + controller: "AuthenticationEditController", + controllerAs: "vm", + backdrop: "static", + size: "sm" + }).result.then(() => authenticationModel.isAuthenticated).catch(() => false); } - ] + + // User is authenticated + return true; + }] } }) .state("root.accounts", { @@ -93,9 +85,7 @@ export default class LootStatesProvider { title: "Accounts" }, resolve: { - accounts: ["authenticated", "accountModel", - (authenticated, accountModel) => authenticated && accountModel.allWithBalances() - ] + accounts: ["authenticated", "accountModel", (authenticated, accountModel) => authenticated && accountModel.allWithBalances()] } }) .state("root.accounts.account", basicState()) @@ -110,9 +100,7 @@ export default class LootStatesProvider { title: "Schedules" }, resolve: { - schedules: ["authenticated", "scheduleModel", - (authenticated, scheduleModel) => authenticated && scheduleModel.all() - ] + schedules: ["authenticated", "scheduleModel", (authenticated, scheduleModel) => authenticated && scheduleModel.all()] } }) .state("root.schedules.schedule", basicState()) @@ -125,9 +113,7 @@ export default class LootStatesProvider { title: "Payees" }, resolve: { - payees: ["authenticated", "payeeModel", - (authenticated, payeeModel) => authenticated && payeeModel.allList() - ] + payees: ["authenticated", "payeeModel", (authenticated, payeeModel) => authenticated && payeeModel.allList()] } }) .state("root.payees.payee", basicState()) @@ -142,9 +128,7 @@ export default class LootStatesProvider { title: "Categories" }, resolve: { - categories: ["authenticated", "categoryModel", - (authenticated, categoryModel) => authenticated && categoryModel.allWithChildren() - ] + categories: ["authenticated", "categoryModel", (authenticated, categoryModel) => authenticated && categoryModel.allWithChildren()] } }) .state("root.categories.category", basicState()) @@ -159,9 +143,7 @@ export default class LootStatesProvider { title: "Securities" }, resolve: { - securities: ["authenticated", "securityModel", - (authenticated, securityModel) => authenticated && securityModel.allWithBalances() - ] + securities: ["authenticated", "securityModel", (authenticated, securityModel) => authenticated && securityModel.allWithBalances()] } }) .state("root.securities.security", basicState()) @@ -173,39 +155,29 @@ export default class LootStatesProvider { title: "Search Transactions" }, resolve: { - previousState: ["$state", - $state => { - if (!$state.includes("root.transactions")) { - return { - name: $state.current.name, - params: Object.assign({}, $state.params) - }; - } - - return null; + previousState: ["$state", $state => { + if (!$state.includes("root.transactions")) { + return { + name: $state.current.name, + params: Object.assign({}, $state.params) + }; } - ], + + return null; + }], contextModel: () => null, - context: ["$stateParams", - $stateParams => $stateParams.query - ], - transactionBatch: ["authenticated", "transactionModel", "context", - (authenticated, transactionModel, context) => authenticated && transactionModel.query(context, null, "prev") - ] + context: ["$stateParams", $stateParams => $stateParams.query], + transactionBatch: ["authenticated", "transactionModel", "context", (authenticated, transactionModel, context) => authenticated && transactionModel.query(context, null, "prev")] }, views: transactionViews, - onEnter: ["$stateParams", "queryService", "previousState", - ($stateParams, queryService, previousState) => { - queryService.previousState = previousState || queryService.previousState; - queryService.query = $stateParams.query; - } - ], - onExit: ["queryService", + onEnter: ["$stateParams", "queryService", "previousState", ($stateParams, queryService, previousState) => { + queryService.previousState = previousState || queryService.previousState; + queryService.query = $stateParams.query; + }], + onExit: ["queryService", queryService => { // Can't use concise function body because implicit return of 'false' causes route transition to cancel in ui-router@1.x - queryService => { - queryService.query = null; - } - ] + queryService.query = null; + }] }) .state("root.transactions.transaction", transactionState()); diff --git a/src/og-components/og-input-calculator/directives/og-input-calculator.js b/src/og-components/og-input-calculator/directives/og-input-calculator.js index 03e0674b..958c8b1d 100644 --- a/src/og-components/og-input-calculator/directives/og-input-calculator.js +++ b/src/og-components/og-input-calculator/directives/og-input-calculator.js @@ -171,8 +171,7 @@ export default class OgInputCalculatorDirective { // Declare key handler to detect operators and actions scope.keyHandler = event => { - // Check if the key pressed was an action key, and there is a pending calculation - // (otherwise, let the event propagate) + // Check if the key pressed was an action key, and there is a pending calculation (otherwise, let the event propagate) if (!event.shiftKey && Object.getOwnPropertyDescriptor(ACTION_KEYS, event.keyCode) && scope.stack.length > 0) { // Invoke the action ACTION_KEYS[event.keyCode](); diff --git a/src/og-components/og-table-navigable/directives/og-table-navigable.js b/src/og-components/og-table-navigable/directives/og-table-navigable.js index 6b46557b..173d05f3 100644 --- a/src/og-components/og-table-navigable/directives/og-table-navigable.js +++ b/src/og-components/og-table-navigable/directives/og-table-navigable.js @@ -89,8 +89,7 @@ export default class OgTableNavigableDirective { } }; - // Helper function to determine the parent TR element (that is a direct descendent of the element for this directive) - // where an event occurred + // Helper function to determine the parent TR element (that is a direct descendent of the element for this directive) where an event occurred function closestRow(target) { return $window.$(target).closest("[og-table-navigable] > tbody > tr"); } @@ -222,8 +221,7 @@ export default class OgTableNavigableDirective { } }; - // Attach the event handlers - // (The handlers are wrapped in functions to aid with unit testing) + // Attach the event handlers (the handlers are wrapped in functions to aid with unit testing) function clickHandler(event) { scope.clickHandler(event); } diff --git a/src/schedules/controllers/edit.js b/src/schedules/controllers/edit.js index 62435365..b89dfeb7 100644 --- a/src/schedules/controllers/edit.js +++ b/src/schedules/controllers/edit.js @@ -201,8 +201,7 @@ export default class ScheduleEditController { }); } - // Handler for category changes - // (index) is the subtransaction index, or null for the main schedule + // Handler for category changes (`index` is the subtransaction index, or null for the main schedule) categorySelected(index) { const transaction = isNaN(index) ? this.transaction : this.transaction.subtransactions[index]; let type, @@ -249,8 +248,10 @@ export default class ScheduleEditController { break; } - // If we have switched to a Split, Payslip or Loan Repayment and there are currently no subtransactions, - // create some stubs, copying the current transaction details into the first entry + /* + * If we have switched to a Split, Payslip or Loan Repayment and there are currently no subtransactions, + * create some stubs, copying the current transaction details into the first entry + */ switch (type) { case "Split": case "Payslip": diff --git a/src/schedules/controllers/index.js b/src/schedules/controllers/index.js index b3242c52..e8023636 100644 --- a/src/schedules/controllers/index.js +++ b/src/schedules/controllers/index.js @@ -108,8 +108,10 @@ export default class ScheduleIndexController { // Resort the array this.schedules.sort(byNextDueDateAndId); - // If we entered or skipped a transaction, refocus the schedule now at the original index, - // otherwise refocus the schedule that was edited + /* + * If we entered or skipped a transaction, refocus the schedule now at the original index, + * otherwise refocus the schedule that was edited + */ this.focusSchedule(schedule.skipped ? this.schedules[index].id : schedule.data.id); }).finally(() => (this.ogTableNavigableService.enabled = true)); } diff --git a/src/transactions/controllers/edit.js b/src/transactions/controllers/edit.js index e971b80d..a7f16657 100644 --- a/src/transactions/controllers/edit.js +++ b/src/transactions/controllers/edit.js @@ -175,8 +175,7 @@ export default class TransactionEditController { }); } - // Handler for category changes - // (index) is the subtransaction index, or null for the main transaction + // Handler for category changes (`index` is the subtransaction index, or null for the main transaction) categorySelected(index) { const transaction = isNaN(index) ? this.transaction : this.transaction.subtransactions[index]; let type, @@ -223,8 +222,10 @@ export default class TransactionEditController { break; } - // If we have switched to a Split, Payslip or Loan Repayment and there are currently no subtransactions, - // create some stubs, copying the current transaction details into the first entry + /* + * If we have switched to a Split, Payslip or Loan Repayment and there are currently no subtransactions, + * create some stubs, copying the current transaction details into the first entry + */ switch (type) { case "Split": case "Payslip": @@ -420,8 +421,10 @@ export default class TransactionEditController { let resolve = true; - // Compare each facet of the saved transaction with the original values - // For any that have changed, invalidate the original from the $http cache + /* + * Compare each facet of the saved transaction with the original values + * For any that have changed, invalidate the original from the $http cache + */ angular.forEach(Object.keys(models), key => { const originalValue = (this.originalTransaction[key] && this.originalTransaction[key].id) || null, savedValue = (savedTransaction[key] && savedTransaction[key].id) || null; @@ -431,8 +434,10 @@ export default class TransactionEditController { } }); - // For subtransactions, we can't be sure if the values have changed or not (as the ordering may have changed) - // so just invalidate any categories or accounts + /* + * For subtransactions, we can't be sure if the values have changed or not (as the ordering may have changed) + * so just invalidate any categories or accounts + */ switch (this.originalTransaction.transaction_type) { case "Split": case "LoanRepayment": diff --git a/src/transactions/controllers/index.js b/src/transactions/controllers/index.js index b27a9aa0..3a653cbe 100644 --- a/src/transactions/controllers/index.js +++ b/src/transactions/controllers/index.js @@ -548,8 +548,10 @@ export default class TransactionIndexController { // Helper function for switching states switchTo($event, state, id, transaction) { - // For Subtransactions, don't switch to the parent - // (only applies when switching between Category <=> Subcategory transaction lists) + /* + * For Subtransactions, don't switch to the parent + * (only applies when switching between Category <=> Subcategory transaction lists) + */ if ("Sub" === transaction.transaction_type) { transaction.parent_id = null; } diff --git a/webpack.common.js b/webpack.common.js index 20006e6d..23c81d47 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -75,16 +75,20 @@ const path = require("path"), // Cleans the build directory cleanBuildDirectory = new CleanWebpackPlugin(["./public"]), - // Exposes a global jQuery object (Bootstrap expects this global to exist) - // window.jQuery is needed to prevent Angular from using jqLite + /* + * Exposes a global jQuery object (Bootstrap expects this global to exist) + * window.jQuery is needed to prevent Angular from using jqLite + */ providejQuery = new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", "window.jQuery": "jquery" }), - // Ensures all vendor dependencies are bundled separately to app code, and that the webpack manifest is kept - // separate so that changes to app code don't change the hash of the vendor chunk (or vice versa) + /* + * Ensures all vendor dependencies are bundled separately to app code, and that the webpack manifest is kept + * separate so that changes to app code don't change the hash of the vendor chunk (or vice versa) + */ separateBundles = new webpack.optimize.CommonsChunkPlugin({ names: [ "vendor", @@ -177,8 +181,10 @@ function defineEnvironment(env) { return new webpack.DefinePlugin({"process.env.NODE_ENV": JSON.stringify(`${env}`)}); } -// Creates external *.css files from any imported styles (e.g. import "./my-styles.css";) -// Note: HtmlWebpackPlugin injects tags in the order listed in the plugins array, so vendor must be first +/* + * Creates external *.css files from any imported styles (e.g. import "./my-styles.css";) + * Note: HtmlWebpackPlugin injects tags in the order listed in the plugins array, so vendor must be first + */ function extractAppCss(hashFilename) { return new ExtractTextPlugin({ filename: hashFilename ? "app-[contenthash:6].css" : "app.css", diff --git a/webpack.prod.js b/webpack.prod.js index 2eee51ce..3f586de4 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -44,8 +44,10 @@ module.exports = merge(config, { devtool: "source-map", plugins: [ - // Ensure that bundles only change when necessary by using a hash of the content for the module id - // instead of a numbers derived from the order of dependencies in the graph + /* + * Ensure that bundles only change when necessary by using a hash of the content for the module id + * instead of a numbers derived from the order of dependencies in the graph + */ new webpack.HashedModuleIdsPlugin(), defineEnvironment("production"), @@ -67,8 +69,10 @@ module.exports = merge(config, { performance: { hints: "error", - // Needed temporarily because BabelMinifyWebpackPlugin doesn't support dead-code elimination - // (remove after switching to UglifyJSWebpackPlugin) + /* + * Needed temporarily because BabelMinifyWebpackPlugin doesn't support dead-code elimination + * (remove after switching to UglifyJSWebpackPlugin) + */ maxEntrypointSize: 1000000, maxAssetSize: 630000 }