diff --git a/package-lock.json b/package-lock.json index 477b9e33e3..7307e0f326 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@angular/router": "^16.2.5", "@apollo/client": "^3.6.9", "@luomus/label-designer": "^4.0.16", - "@luomus/laji-form": "^15.1.23", + "@luomus/laji-form": "^15.1.24", "@luomus/laji-form-builder": "^1.1.3", "@luomus/laji-map": "^5.1.1", "@ng-select/ng-select": "^11.1.1", @@ -123,7 +123,6 @@ "eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-rxjs": "^5.0.2", "globby": "^11.1.0", - "husky": "^4.3.8", "jszip": "^3.10.1", "ng-packagr": "^16.2.3", "ngx-bootstrap": "^6.2.0", @@ -3571,10 +3570,9 @@ } }, "node_modules/@luomus/laji-form": { - "version": "15.1.23", - "resolved": "https://registry.npmjs.org/@luomus/laji-form/-/laji-form-15.1.23.tgz", - "integrity": "sha512-ziyPWwZL29BEegRo3cHGYQolAC/sng0/WLxYyjVO7fsitmv2Z+SCvnaNHc6rfUiL+qPkG3RG0aBt8SE1YXav9w==", - "license": "MIT", + "version": "15.1.24", + "resolved": "https://registry.npmjs.org/@luomus/laji-form/-/laji-form-15.1.24.tgz", + "integrity": "sha512-mqDj7arovXr0I36O3rTMJ/AeC9wejOtjKqJUdLRSW9xIRamjw6UBlOo8sYgTtoBLP/QV2Vd3FhgfH8QqdHljAg==", "dependencies": { "@luomus/laji-map": "^5.0.2", "@luomus/laji-validate": "^0.0.121", @@ -5141,12 +5139,6 @@ "integrity": "sha512-vPmpmigVdMYgdPJLUbQJgpFIQCeRnoUQW4bT/l9u1yajJLSx2BUKFhURvdTDxJWYFA/+oqMeXfJl2/NLhPZq7A==", "dev": true }, - "node_modules/@types/parse-json": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.1.tgz", - "integrity": "sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng==", - "dev": true - }, "node_modules/@types/proj4": { "version": "2.5.5", "resolved": "https://registry.npmjs.org/@types/proj4/-/proj4-2.5.5.tgz", @@ -7992,12 +7984,6 @@ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, - "node_modules/compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "node_modules/compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -8287,22 +8273,6 @@ "node": ">= 0.10" } }, - "node_modules/cosmiconfig": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", - "dev": true, - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/crc-32": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", @@ -10950,21 +10920,6 @@ "node": ">=8" } }, - "node_modules/find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", - "dev": true, - "dependencies": { - "semver-regex": "^3.1.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/find-yarn-workspace-root": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", @@ -11905,179 +11860,6 @@ "ms": "^2.0.0" } }, - "node_modules/husky": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^4.0.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^5.0.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, - "bin": { - "husky-run": "bin/run.js", - "husky-upgrade": "lib/upgrader/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/husky" - } - }, - "node_modules/husky/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/husky/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/husky/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/husky/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/husky/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/pkg-dir": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", - "dev": true, - "dependencies": { - "find-up": "^5.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/husky/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -16254,15 +16036,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true, - "bin": { - "opencollective-postinstall": "index.js" - } - }, "node_modules/opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -17244,15 +17017,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "dependencies": { - "semver-compare": "^1.0.0" - } - }, "node_modules/pngjs": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", @@ -19575,12 +19339,6 @@ "node": ">=10" } }, - "node_modules/semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true - }, "node_modules/semver-dsl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/semver-dsl/-/semver-dsl-1.0.1.tgz", @@ -19599,18 +19357,6 @@ "semver": "bin/semver" } }, - "node_modules/semver-regex": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", - "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -22645,15 +22391,6 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" }, - "node_modules/which-pm-runs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/which-typed-array": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", @@ -25327,9 +25064,9 @@ } }, "@luomus/laji-form": { - "version": "15.1.23", - "resolved": "https://registry.npmjs.org/@luomus/laji-form/-/laji-form-15.1.23.tgz", - "integrity": "sha512-ziyPWwZL29BEegRo3cHGYQolAC/sng0/WLxYyjVO7fsitmv2Z+SCvnaNHc6rfUiL+qPkG3RG0aBt8SE1YXav9w==", + "version": "15.1.24", + "resolved": "https://registry.npmjs.org/@luomus/laji-form/-/laji-form-15.1.24.tgz", + "integrity": "sha512-mqDj7arovXr0I36O3rTMJ/AeC9wejOtjKqJUdLRSW9xIRamjw6UBlOo8sYgTtoBLP/QV2Vd3FhgfH8QqdHljAg==", "requires": { "@fortawesome/fontawesome-svg-core": "^6.2.0", "@fortawesome/free-solid-svg-icons": "^6.2.0", @@ -26556,12 +26293,6 @@ "integrity": "sha512-vPmpmigVdMYgdPJLUbQJgpFIQCeRnoUQW4bT/l9u1yajJLSx2BUKFhURvdTDxJWYFA/+oqMeXfJl2/NLhPZq7A==", "dev": true }, - "@types/parse-json": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.1.tgz", - "integrity": "sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng==", - "dev": true - }, "@types/proj4": { "version": "2.5.5", "resolved": "https://registry.npmjs.org/@types/proj4/-/proj4-2.5.5.tgz", @@ -28767,12 +28498,6 @@ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -29004,19 +28729,6 @@ "vary": "^1" } }, - "cosmiconfig": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - } - }, "crc-32": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", @@ -31116,15 +30828,6 @@ "path-exists": "^4.0.0" } }, - "find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", - "dev": true, - "requires": { - "semver-regex": "^3.1.2" - } - }, "find-yarn-workspace-root": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", @@ -31817,121 +31520,6 @@ "ms": "^2.0.0" } }, - "husky": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^4.0.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^5.0.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "pkg-dir": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", - "dev": true, - "requires": { - "find-up": "^5.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -34997,12 +34585,6 @@ "is-wsl": "^2.2.0" } }, - "opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true - }, "opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -35723,15 +35305,6 @@ "integrity": "sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==", "dev": true }, - "please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "requires": { - "semver-compare": "^1.0.0" - } - }, "pngjs": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", @@ -37514,12 +37087,6 @@ } } }, - "semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true - }, "semver-dsl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/semver-dsl/-/semver-dsl-1.0.1.tgz", @@ -37537,12 +37104,6 @@ } } }, - "semver-regex": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", - "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", - "dev": true - }, "send": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", @@ -39797,12 +39358,6 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" }, - "which-pm-runs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", - "dev": true - }, "which-typed-array": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", diff --git a/package.json b/package.json index aa71d3abfb..b6e1e57458 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "@angular/router": "^16.2.5", "@apollo/client": "^3.6.9", "@luomus/label-designer": "^4.0.16", - "@luomus/laji-form": "^15.1.23", + "@luomus/laji-form": "^15.1.24", "@luomus/laji-form-builder": "^1.1.3", "@luomus/laji-map": "^5.1.1", "@ng-select/ng-select": "^11.1.1", diff --git a/projects/iucn/src/environments/environment.ts b/projects/iucn/src/environments/environment.ts index 56268b9342..793686d9dd 100644 --- a/projects/iucn/src/environments/environment.ts +++ b/projects/iucn/src/environments/environment.ts @@ -15,9 +15,9 @@ export const environment = { sourceKotka: 'KE.3', systemID: 'KE.389', apiBase: 'https://dev.laji.fi/api', - loginCheck: 'https://fmnh-ws-test.it.helsinki.fi/laji-auth/loginInfo', - loginUrl: 'https://fmnh-ws-test.it.helsinki.fi/laji-auth/login', - selfPage: 'https://fmnh-ws-test.it.helsinki.fi/laji-auth/self', + loginCheck: 'https://fmnh-ws-test-24.it.helsinki.fi/laji-auth/loginInfo', + loginUrl: 'https://fmnh-ws-test-24.it.helsinki.fi/laji-auth/login', + selfPage: 'https://fmnh-ws-test-24.it.helsinki.fi/laji-auth/self', kerttuApi: 'https://staging-kerttu-backend.laji.fi', protaxApi: 'https://protax-api-dev.laji.fi', geoserver: 'https://geoserver-dev.laji.fi/geoserver', diff --git a/projects/kerttu-global/src/environments/environment.dev.ts b/projects/kerttu-global/src/environments/environment.dev.ts index 69043af00e..406e1c810f 100644 --- a/projects/kerttu-global/src/environments/environment.dev.ts +++ b/projects/kerttu-global/src/environments/environment.dev.ts @@ -11,8 +11,8 @@ export const environment = { systemID: 'KE.1181', apiBase: '/api', loginCheck: '', - loginUrl: 'https://fmnh-ws-test.it.helsinki.fi/laji-auth/login', - selfPage: 'https://fmnh-ws-test.it.helsinki.fi/laji-auth/self', + loginUrl: 'https://fmnh-ws-test-24.it.helsinki.fi/laji-auth/login', + selfPage: 'https://fmnh-ws-test-24.it.helsinki.fi/laji-auth/self', kerttuApi: 'https://staging-kerttu-backend.laji.fi', protaxApi: 'https://protax-api-dev.laji.fi', geoserver: 'https://geoserver-dev.laji.fi/geoserver', diff --git a/projects/kerttu-global/src/environments/environment.ts b/projects/kerttu-global/src/environments/environment.ts index 256a0b65f1..508509c3c0 100644 --- a/projects/kerttu-global/src/environments/environment.ts +++ b/projects/kerttu-global/src/environments/environment.ts @@ -15,8 +15,8 @@ export const environment = { systemID: 'KE.542', apiBase: 'https://dev.laji.fi/api', loginCheck: '', - loginUrl: 'https://fmnh-ws-test.it.helsinki.fi/laji-auth/login', - selfPage: 'https://fmnh-ws-test.it.helsinki.fi/laji-auth/self', + loginUrl: 'https://fmnh-ws-test-24.it.helsinki.fi/laji-auth/login', + selfPage: 'https://fmnh-ws-test-24.it.helsinki.fi/laji-auth/self', // kerttuApi: 'http://localhost:5000', kerttuApi: 'https://staging-kerttu-backend.laji.fi', protaxApi: 'https://protax-api-dev.laji.fi', diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-censuses/wbc-censuses.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-censuses/wbc-censuses.component.ts index 5b69eabc7a..de4c353cba 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-censuses/wbc-censuses.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-censuses/wbc-censuses.component.ts @@ -13,10 +13,10 @@ export class WbcCensusesComponent implements OnInit { activeIndex = 0; loadedTabs = new LoadedElementsStore(['list', 'map']); - activeYear: number; - activeSeason: SEASON; + activeYear?: number; + activeSeason?: SEASON; - rows: any[]; + rows!: any[]; selected = [ 'document.namedPlace.name', 'document.namedPlace.municipalityDisplayName', @@ -31,8 +31,8 @@ export class WbcCensusesComponent implements OnInit { ]; loading = false; - queryKey: string; - resultSub: Subscription; + queryKey!: string; + resultSub!: Subscription; filterBy = ''; constructor( diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-result-filters/wbc-result-filters.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-result-filters/wbc-result-filters.component.ts index 8c12063b54..536f5fcf64 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-result-filters/wbc-result-filters.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-result-filters/wbc-result-filters.component.ts @@ -18,9 +18,9 @@ export class WbcResultFiltersComponent implements OnInit, OnChanges { seasons: SEASON[] = ['fall', 'winter', 'spring']; areaTypes = Area.AreaType; - activeYear: number; - activeSeason: SEASON; - activeArea: string; + activeYear?: number; + activeSeason?: SEASON; + activeArea?: string; toHtmlSelectElement = toHtmlSelectElement; @Output() yearChange = new EventEmitter(); @@ -58,7 +58,7 @@ export class WbcResultFiltersComponent implements OnInit, OnChanges { } } - onYearChange(newYear: string) { + onYearChange(newYear: string | undefined) { this.activeYear = newYear ? parseInt(newYear, 10) : undefined; this.yearChange.emit(this.activeYear); if (!this.activeYear) { @@ -68,13 +68,13 @@ export class WbcResultFiltersComponent implements OnInit, OnChanges { } } - onSeasonChange(newSeason: string) { + onSeasonChange(newSeason: string | undefined) { this.activeSeason = newSeason as SEASON; this.seasonChange.emit(newSeason as SEASON); this.onFiltersChange(); } - onAreaChange(newArea: string) { + onAreaChange(newArea: string | undefined) { if (newArea === 'all') { newArea = undefined; } diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-result.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-result.component.ts index 3d04938258..9429914050 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-result.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-result.component.ts @@ -17,13 +17,13 @@ enum Tabs { }) export class WbcResultComponent implements OnInit, OnDestroy { - @Input() form: Form.SchemaForm; + @Input() form!: Form.SchemaForm; - tab$: Observable; + tab$!: Observable; Tabs = Tabs; // eslint-disable-line @typescript-eslint/naming-convention - defaultTabSubscription: Subscription; + defaultTabSubscription!: Subscription; constructor( private route: ActivatedRoute, diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-result.service.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-result.service.ts index faf37b62ad..5a8d759f83 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-result.service.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-result.service.ts @@ -29,9 +29,9 @@ export class WbcResultService { spring: [2, 3] }; - private yearCache: number[]; - private yearObs: Observable; - private speciesListCache: any[]; + private yearCache?: number[]; + private yearObs?: Observable; + private speciesListCache?: any[]; constructor( private warehouseApi: WarehouseApi @@ -41,7 +41,7 @@ export class WbcResultService { const yearMonth = year ? (Array.isArray(year) ? year : [year]).map(y => this.getYearMonthParam(y, season)) : []; return { collectionId: [this.collectionId], - birdAssociationAreaId: [birdAssociationArea], + birdAssociationAreaId: birdAssociationArea ? [birdAssociationArea] : undefined, yearMonth, taxonId: taxonId ? (Array.isArray(taxonId) ? taxonId : [taxonId]) : [] }; @@ -249,14 +249,14 @@ export class WbcResultService { getCountsByYearForSpecies(taxonId: string, birdAssociationArea?: string, taxonCensus?: string): Observable { return forkJoin([ this.warehouseApi.warehouseQueryGatheringStatisticsGet( - {...this.getFilterParams(undefined, undefined, birdAssociationArea), taxonCensus: [taxonCensus]}, + {...this.getFilterParams(undefined, undefined, birdAssociationArea), taxonCensus: taxonCensus ? [taxonCensus] : undefined}, ['gathering.conversions.year', 'gathering.conversions.month'], undefined, 10000, 1 ), this.warehouseApi.warehouseQueryStatisticsGet( - {...this.getFilterParams(undefined, undefined, birdAssociationArea), taxonId: [taxonId], taxonCensus: [taxonCensus]}, + {...this.getFilterParams(undefined, undefined, birdAssociationArea), taxonId: [taxonId], taxonCensus: taxonCensus ? [taxonCensus] : undefined}, ['gathering.conversions.year', 'gathering.conversions.month'], undefined, 10000, @@ -265,7 +265,7 @@ export class WbcResultService { false ) ]).pipe(map(data => { - const result = {fall: {}, winter: {}, spring: {}}; + const result: CountsPerYearForTaxon = {fall: {}, winter: {}, spring: {}}; this.addCounts(data[1].results, 'count', result, false, 'individualCountSum'); this.addCounts(data[0].results, 'censusCount', result, true); return result; @@ -285,7 +285,7 @@ export class WbcResultService { ) ).pipe( map(list => { - const statsByDocumentId = {}; + const statsByDocumentId: any = {}; list.map(l => { statsByDocumentId[l['document.documentId']] = l; }); @@ -383,7 +383,7 @@ export class WbcResultService { } private parseObservationStatsList(resultList: any[], result: ObservationStats, isMammal = false, isLoxia = false) { - const currentState = {}; + const currentState: Record = {}; for (const season of ['fall', 'winter', 'spring']) { currentState[season] = {taxonId: '', foundYears: [], row: undefined}; } @@ -424,7 +424,7 @@ export class WbcResultService { } private addStatisticsToObservationStats(result: ObservationStats) { - const addStatisticsToObj = (obj, years) => { + const addStatisticsToObj = (obj: any, years: number[]) => { let min = Number.MAX_VALUE; let max = 0; @@ -465,7 +465,7 @@ export class WbcResultService { } } - private addCounts(counts, key, result, addToExistingOnly = false, countKey = 'count') { + private addCounts(counts: any[], key: string, result: CountsPerYearForTaxon, addToExistingOnly = false, countKey = 'count') { counts.map(count => { const month = parseInt(count.aggregateBy['gathering.conversions.month'], 10); const year = parseInt(count.aggregateBy['gathering.conversions.year'], 10); @@ -477,7 +477,7 @@ export class WbcResultService { if (addToExistingOnly) { return; } - result[season][startYear] = {}; + result[season][startYear] = {} as any; } this.addCount(result[season][startYear], key, count[countKey]); @@ -530,7 +530,7 @@ export class WbcResultService { return month < 10 ? '0' + month : '' + month; } - private getSeason(month: number): SEASON { + private getSeason(month: number): SEASON | undefined { if (this.monthIsInSeasonRange(month, 'fall')) { return 'fall'; } else if (this.monthIsInSeasonRange(month, 'winter')) { @@ -549,7 +549,7 @@ export class WbcResultService { return month >= this.seasonRanges[season][0] && month <= this.seasonRanges[season][1]; } - private median(array) { + private median(array: any[]) { array.sort((a, b) => (a - b)); const mid = array.length / 2; return mid % 1 ? array[mid - 0.5] : (array[mid - 1] + array[mid]) / 2; diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-route-table/wbc-route-table.component.html b/projects/laji/src/app/+project-form/results/wbc-result/wbc-route-table/wbc-route-table.component.html index 5e13b41ce3..ad16ca39df 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-route-table/wbc-route-table.component.html +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-route-table/wbc-route-table.component.html @@ -20,7 +20,7 @@ [showFooter]="false" [height]="'calc(80vh - 40px)'" [virtualScrolling]="true" - [rows]="rows" + [rows]="rows ? rows : []" [loading]="!rows" [columnMode]="'standard'" [totalMessage]="'haseka.submissions.total' | translate" diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-route-table/wbc-route-table.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-route-table/wbc-route-table.component.ts index bf47f7e8c8..2b6d56b898 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-route-table/wbc-route-table.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-route-table/wbc-route-table.component.ts @@ -12,10 +12,10 @@ import { BookType } from 'xlsx'; styleUrls: ['./wbc-route-table.component.scss'] }) export class WbcRouteTableComponent implements OnInit { - @Input() routeId: string; - @Input() season: SEASON; + @Input() routeId!: string; + @Input() season!: SEASON; - rows: any[]; + rows: any[] | undefined; columns: DatatableColumn[] = []; _getRowClass: (data: any) => string = this.getRowClass.bind(this); @@ -23,10 +23,10 @@ export class WbcRouteTableComponent implements OnInit { downloadLoading = false; - @LocalStorage() showWbcRouteTableInfo; + @LocalStorage() showWbcRouteTableInfo!: boolean | null; - @ViewChild('textOrTranslationKey', { static: true }) textOrTranslationKeyTpl: TemplateRef; - @ViewChild('numberOrDocumentIds', { static: true }) numberOrDocumentIdsTpl: TemplateRef; + @ViewChild('textOrTranslationKey', { static: true }) textOrTranslationKeyTpl!: TemplateRef; + @ViewChild('numberOrDocumentIds', { static: true }) numberOrDocumentIdsTpl!: TemplateRef; @Output() documentClick = new EventEmitter(); @@ -58,18 +58,18 @@ export class WbcRouteTableComponent implements OnInit { this.showWbcRouteTableInfo = !this.showWbcRouteTableInfo; } - onSort(event) { - const speciesStats = this.rows.slice(0, -3); - const otherStats = this.rows.slice(-3); - event.sorts.forEach((sort) => { + onSort(event: any) { + const speciesStats = this.rows?.slice(0, -3); + const otherStats = this.rows?.slice(-3); + event.sorts.forEach((sort: any) => { const comparator = this.getSortingComparator(sort.prop); const dir = sort.dir === 'asc' ? 1 : -1; - speciesStats.sort((a, b) => dir * comparator(a[sort.prop], b[sort.prop])); + speciesStats?.sort((a, b) => dir * comparator(a[sort.prop], b[sort.prop])); }); - this.rows = speciesStats.concat(otherStats); + this.rows = speciesStats?.concat(otherStats); } - setColumns(data) { + setColumns(data: any) { this.columns = [{ name: 'name', label: 'result.unit.taxonVerbatim', @@ -116,15 +116,16 @@ export class WbcRouteTableComponent implements OnInit { } private getAoa(): string[][] { - const aoa = [[]]; + const aoa: any[] = [[]]; for (const col of this.columns) { - aoa[0].push(this.translate.instant(col.label)); + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + aoa[0].push(this.translate.instant(col.label!)); } - for (let i = 0; i < this.rows.length; i++) { + for (let i = 0; i < (this.rows ? this.rows.length : 0); i++) { aoa.push([]); for (let j = 0; j < this.columns.length; j++) { - let value = this.rows[i][this.columns[j].name]; + let value = this.rows![i][this.columns[j].name!]; if (j === 0 && this.isLastRowName(value)) { value = this.translate.instant('wbc.stats.route.' + value); } @@ -172,7 +173,7 @@ export class WbcRouteTableComponent implements OnInit { return name.indexOf('SpeciesCount') > -1 || name.indexOf('IndividualCount') > -1 || name === 'documentIds'; } - private getSortingComparator(prop: string): (a, b) => number { + private getSortingComparator(prop: string): (a: any, b: any) => number { if (prop === 'name') { return (a, b) => (a).localeCompare(b); } diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-route/wbc-route.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-route/wbc-route.component.ts index 297510043b..457e8d06be 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-route/wbc-route.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-route/wbc-route.component.ts @@ -10,9 +10,9 @@ import { DocumentViewerFacade } from '../../../../shared-modules/document-viewer styleUrls: ['./wbc-route.component.css'] }) export class WbcRouteComponent implements OnInit, OnDestroy { - routeId: string; + routeId!: string; - rows: any[]; + rows?: any[]; selected = ['gathering.eventDate.begin', 'count', 'individualCountSum']; sorts: {prop: string; dir: 'asc'|'desc'}[] = [ {prop: 'gathering.eventDate.begin', dir: 'desc'}, @@ -21,10 +21,10 @@ export class WbcRouteComponent implements OnInit, OnDestroy { loadingCensusList = false; loadingObservationStats = false; - season: SEASON; + season!: SEASON; observationStats: any; - private routeSub: Subscription; + private routeSub!: Subscription; constructor( private resultService: WbcResultService, diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-list/wbc-routes-list.component.html b/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-list/wbc-routes-list.component.html index 92cb3832e9..c662e9cfa8 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-list/wbc-routes-list.component.html +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-list/wbc-routes-list.component.html @@ -11,12 +11,12 @@ [filterBy]="filterBy" [height]="height" [virtualScrolling]="true" - [rows]="rows" + [rows]="rows ? rows : []" [loading]="loading" [columnMode]="columnMode" [totalMessage]="'haseka.submissions.total' | translate" [columns]="columns" - [count]="rows?.length"> + [count]=" rows ? rows.length : 0"> diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-list/wbc-routes-list.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-list/wbc-routes-list.component.ts index 801050cbe0..b394349e77 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-list/wbc-routes-list.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-list/wbc-routes-list.component.ts @@ -10,12 +10,12 @@ import { ColumnMode } from '@achimha/ngx-datatable'; styleUrls: ['./wbc-routes-list.component.scss'] }) export class WbcRoutesListComponent implements OnChanges { - @Input() rows: any[] = []; + @Input() rows: any[] | undefined = []; @Input() height = 'calc(80vh - 100px)'; @Input() columnMode: ColumnMode | keyof typeof ColumnMode = 'standard'; @Input() showFilter = true; @Input() showNameAsLink = true; - @Input() countLabel: string; + @Input() countLabel?: string; @Input() sorts: {prop: string; dir: 'asc'|'desc'}[] = []; @Input() loading = true; @Input() selected: string[] = []; @@ -58,13 +58,13 @@ export class WbcRoutesListComponent implements OnChanges { label: 'wbc.stats.route.individualCountSum' } ]; - columns = []; + columns: DatatableColumn[] = []; filterBy = ''; @Output() rowSelect = new EventEmitter(); - @ViewChild('routeLink', { static: true }) routeLinkTpl: TemplateRef; + @ViewChild('routeLink', { static: true }) routeLinkTpl!: TemplateRef; constructor( private ngZone: NgZone, @@ -83,7 +83,8 @@ export class WbcRoutesListComponent implements OnChanges { } else if (val.name === 'count') { val.label = this.countLabel || 'wbc.stats.routes.count'; } - return this.selected.indexOf(val.name) !== -1; + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + return this.selected.indexOf(val.name!) !== -1; }); } diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-map/wbc-routes-map.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-map/wbc-routes-map.component.ts index 0fa1582455..1519a8ff03 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-map/wbc-routes-map.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-routes/wbc-routes-map/wbc-routes-map.component.ts @@ -13,9 +13,9 @@ export class WbcRoutesMapComponent { @Input() showNameAsLink = true; @Input() countLabel = 'wbc.stats.routeCount'; - geoJsons: any[]; + geoJsons!: any[]; _data: any; - selectedGrid: string; + selectedGrid?: string; breaks = [1, 2, 5, 10, 20]; labels = ['1', '2-4', '5-9', '10-19', '20-']; @@ -24,12 +24,12 @@ export class WbcRoutesMapComponent { @Output() rowSelect = new EventEmitter(); - @Input() set data(data) { + @Input() set data(data: any) { this.geoJsons = []; this._data = {}; this.selectedGrid = undefined; - data.map(item => { + data.map((item: any) => { if (!item['document.namedPlace.ykj10km.lat'] || !item['document.namedPlace.ykj10km.lon']) { return; } @@ -37,7 +37,7 @@ export class WbcRoutesMapComponent { + parseInt(item['document.namedPlace.ykj10km.lon'], 10); const geometry = this.ykjService.convertYkjToGeoJsonFeature( item['document.namedPlace.ykj10km.lat'], item['document.namedPlace.ykj10km.lon'] - ).geometry; + )?.geometry; if (this._data[grid]) { this._data[grid].data.push(item); @@ -55,7 +55,7 @@ export class WbcRoutesMapComponent { private cdr: ChangeDetectorRef ) { } - gridClick(grid) { + gridClick(grid: any) { this.selectedGrid = grid; this.cdr.detectChanges(); } diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-charts.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-charts.component.ts index dbe70ab012..27775b63a7 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-charts.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-charts.component.ts @@ -11,21 +11,21 @@ import { IdService } from '../../../../shared/service/id.service'; styleUrls: ['./wbc-species-charts.component.css'] }) export class WbcSpeciesChartsComponent implements OnInit, OnDestroy { - activeSpeciesId: string; + activeSpeciesId?: string; activeSpecies: any; isMammal = false; - speciesList: any[]; + speciesList!: any[]; - activeYear: number; - activeSeason: SEASON; - activeBirdAssociationArea: string; + activeYear!: number; + activeSeason!: SEASON; + activeBirdAssociationArea!: string; showSeasonComparison = true; loading = false; mammals = 'MX.37612'; - private routeSub: Subscription; + private routeSub!: Subscription; constructor( private route: ActivatedRoute, diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-linecharts/wbc-species-linecharts.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-linecharts/wbc-species-linecharts.component.ts index c4018e6494..9ef5f2b792 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-linecharts/wbc-species-linecharts.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-linecharts/wbc-species-linecharts.component.ts @@ -13,8 +13,8 @@ import { LineWithLine } from '../../../../../shared-modules/chart/line-with-line styleUrls: ['./wbc-species-linecharts.component.css'] }) export class WbcSpeciesLinechartsComponent implements OnInit, OnChanges { - @Input() taxonId: string; - @Input() taxonCensus = undefined; + @Input() taxonId: string | undefined; + @Input() taxonCensus: string | undefined = undefined; @Input() birdAssociationArea: string; counts: any; diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-maps/wbc-species-maps.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-maps/wbc-species-maps.component.ts index b3b09b0ba5..65aa1d8ecf 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-maps/wbc-species-maps.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species-charts/wbc-species-maps/wbc-species-maps.component.ts @@ -21,13 +21,13 @@ import { TileLayerName } from '@luomus/laji-map/lib/defs'; styleUrls: ['./wbc-species-maps.component.css'] }) export class WbcSpeciesMapsComponent implements OnChanges { - @ViewChildren('maps') mapComponents: QueryList; - @Input() taxonId: string; - @Input() taxonCensus = undefined; + @ViewChildren('maps') mapComponents!: QueryList; + @Input() taxonId: string | undefined; + @Input() taxonCensus: string | undefined = undefined; @Input() showSeasonComparison = true; - @Input() year: number; - @Input() season: SEASON; - @Input() birdAssociationArea: string; + @Input() year?: number; + @Input() season!: SEASON; + @Input() birdAssociationArea!: string; layers = TileLayerName; querys: WarehouseQueryInterface[] = []; @@ -35,7 +35,7 @@ export class WbcSpeciesMapsComponent implements OnChanges { data: any = []; loading = false; bounds = []; - lastZoomedArea: string; + lastZoomedArea?: string; private epsilon = Math.pow(2, -52); breaks = [0, this.epsilon, 2, 8, 32, 128, 512]; @@ -45,7 +45,7 @@ export class WbcSpeciesMapsComponent implements OnChanges { differenceLabels = ['≤ -50%', '≤ -1%', '~0%', '≥ 1%', '≥ 100%']; differenceColorRange = ['blue', '#9999ff', 'white', '#ff9999', 'red']; - private maps: any[]; + private maps?: any[]; constructor( private resultService: WbcResultService, diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species-list/wbc-species-list.component.html b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species-list/wbc-species-list.component.html index 88b2feb92c..81a50a1222 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species-list/wbc-species-list.component.html +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species-list/wbc-species-list.component.html @@ -13,7 +13,7 @@ [columnMode]="'standard'" [totalMessage]="'haseka.submissions.total' | translate" [columns]="columns" - [count]="rows?.length"> + [count]="rows.length"> diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species-list/wbc-species-list.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species-list/wbc-species-list.component.ts index 4a79f0be81..72e1ba0759 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species-list/wbc-species-list.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species-list/wbc-species-list.component.ts @@ -21,16 +21,16 @@ import { DatatableColumn } from '../../../../../shared-modules/datatable/model/d styleUrls: ['./wbc-species-list.component.css'] }) export class WbcSpeciesListComponent implements OnInit, OnChanges { - @Input() year: number; - @Input() season: SEASON; - @Input() birdAssociationArea: string; + @Input() year!: number; + @Input() season!: SEASON; + @Input() birdAssociationArea!: string; @Input() onlyCommonSpecies = true; @Input() showStatistics = false; @Input() filterBy = ''; @Output() rowSelect = new EventEmitter(); - @ViewChild('vernacularName', { static: true }) vernacularNameTpl: TemplateRef; - @ViewChild('scientificName', { static: true }) scientificNameTpl: TemplateRef; + @ViewChild('vernacularName', { static: true }) vernacularNameTpl!: TemplateRef; + @ViewChild('scientificName', { static: true }) scientificNameTpl!: TemplateRef; loading = true; @@ -43,8 +43,8 @@ export class WbcSpeciesListComponent implements OnInit, OnChanges { private additionalColumns: DatatableColumn[] = []; private averageCounts: any; - private subList: Subscription; - private queryKey: string; + private subList!: Subscription; + private queryKey?: string; constructor( private resultService: WbcResultService, @@ -128,7 +128,7 @@ export class WbcSpeciesListComponent implements OnInit, OnChanges { this.rows = this.onlyCommonSpecies ? [...this.filteredRows] : [...this.allRows]; } - onSort(event) { + onSort(event: any) { if (event.sorts.length < 1) { this.setRows(); } @@ -142,7 +142,7 @@ export class WbcSpeciesListComponent implements OnInit, OnChanges { .pipe( map(data => { const yearCount = data[0].length; - const countBySpecies = data[1]; + const countBySpecies = data[1] as any; for (const key in countBySpecies) { if (countBySpecies.hasOwnProperty(key)) { countBySpecies[key] = countBySpecies[key] / yearCount; @@ -197,7 +197,7 @@ export class WbcSpeciesListComponent implements OnInit, OnChanges { const routeCountBySpecies = data[0]; const routeCount = data[1]; const routeLengthSum = data[2] / 10000; - const individualCountBySpeciesPrevTenYears = data[3]; + const individualCountBySpeciesPrevTenYears = data[3] as any; const routeLengthSumPrevTenYears = data[4] / 10000; list.map((l) => { diff --git a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species.component.ts b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species.component.ts index cca03721f6..f3c028aeea 100644 --- a/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species.component.ts +++ b/projects/laji/src/app/+project-form/results/wbc-result/wbc-species/wbc-species.component.ts @@ -11,15 +11,15 @@ import { Observable } from 'rxjs'; styleUrls: ['./wbc-species.component.css'] }) export class WbcSpeciesComponent implements OnInit { - activeYear: number; - activeSeason: SEASON; - activeBirdAssociationArea: string; - filterBy: string; + activeYear!: number; + activeSeason!: SEASON; + activeBirdAssociationArea!: string; + filterBy!: string; onlyCommonSpecies = true; showStatistics = false; - species$: Observable; + species$!: Observable; constructor( private router: Router, diff --git a/projects/laji/src/app/shared-modules/app-component/app.component.ts b/projects/laji/src/app/shared-modules/app-component/app.component.ts index e19ff80e45..2490674ff7 100644 --- a/projects/laji/src/app/shared-modules/app-component/app.component.ts +++ b/projects/laji/src/app/shared-modules/app-component/app.component.ts @@ -24,7 +24,7 @@ export class AppComponent { public isEmbedded: boolean; public onFrontPage = false; public displayFeedback = true; - private currentRoute: string; + private currentRoute?: string; constructor( platformService: PlatformService, diff --git a/projects/laji/src/app/shared-modules/app-component/beta-popup/beta-popup.component.ts b/projects/laji/src/app/shared-modules/app-component/beta-popup/beta-popup.component.ts index 57cfb29ff4..f02c258cba 100644 --- a/projects/laji/src/app/shared-modules/app-component/beta-popup/beta-popup.component.ts +++ b/projects/laji/src/app/shared-modules/app-component/beta-popup/beta-popup.component.ts @@ -18,7 +18,7 @@ import { isPlatformBrowser } from '@angular/common'; changeDetection: ChangeDetectionStrategy.OnPush }) export class BetaPopupComponent implements OnInit { - @LocalStorage('betapopup', true) betaPopup; + @LocalStorage('betapopup', true) betaPopup!: boolean; open = false; constructor( diff --git a/projects/laji/src/app/shared-modules/audio-player/audio-player.component.ts b/projects/laji/src/app/shared-modules/audio-player/audio-player.component.ts index f4d9c25d45..df6de0bded 100644 --- a/projects/laji/src/app/shared-modules/audio-player/audio-player.component.ts +++ b/projects/laji/src/app/shared-modules/audio-player/audio-player.component.ts @@ -15,12 +15,11 @@ import { ModalRef, ModalService } from 'projects/laji-ui/src/lib/modal/modal.ser export class AudioPlayerComponent implements OnInit { @Input() audioFiles: any; - @ViewChild('modalSpectrum', { static: true }) modalSpectrum: TemplateRef; - @ViewChild('audio', {static: true}) audio: ElementRef; - @ViewChild('audioPopUp', {static: true}) audioPopUp: ElementRef; - public isPlaying: boolean[]; - public audioContainer: HTMLAudioElement; - public audioContainerPopup: HTMLAudioElement; + @ViewChild('modalSpectrum', { static: true }) modalSpectrum!: TemplateRef; + @ViewChild('audio', {static: true}) audio!: ElementRef; + @ViewChild('audioPopUp', {static: true}) audioPopUp!: ElementRef; + public isPlaying!: boolean[]; + public audioContainer!: HTMLAudioElement; public nowplayingAudioId = -1; @@ -37,9 +36,8 @@ export class AudioPlayerComponent implements OnInit { }; public images: Image [] = []; public popupSpectrum = false; - public audioFile: Audio; - private modalRef: ModalRef; + private modalRef?: ModalRef; constructor( private cd: ChangeDetectorRef, @@ -49,7 +47,7 @@ export class AudioPlayerComponent implements OnInit { ngOnInit(): void { this.nowplayingAudioId = 0; - this.listAudio = this.audioFiles.filter(audio => audio['mediaType'] === 'AUDIO' ); + this.listAudio = this.audioFiles.filter((audio: any) => audio['mediaType'] === 'AUDIO' ); this.listAudio.forEach((element, index) => this.images.push({ id: 'a' + index, fullURL: element.fullURL , thumbnailURL: element.thumbnailURL, intellectualRights: element.licenseId }) @@ -61,7 +59,7 @@ export class AudioPlayerComponent implements OnInit { this.audioContainer.preload = 'auto'; } - audioPlay(index): void { + audioPlay(index: number): void { this.playingAudio = this.listAudio[index]; this.nowplayingAudioId = index; @@ -86,12 +84,12 @@ export class AudioPlayerComponent implements OnInit { } - audioPause(index): void { + audioPause(index: number): void { this.isPlaying[index] = false; this.audioContainer.pause(); } - nextAudio(index): void { + nextAudio(index: number): void { this.cd.markForCheck(); if (this.nowplayingAudioId < this.listAudio.length) { this.nowplayingAudioId = index; @@ -101,7 +99,7 @@ export class AudioPlayerComponent implements OnInit { } } - previousAudio(index): void { + previousAudio(index: number): void { this.cd.markForCheck(); if (this.nowplayingAudioId > 0) { this.nowplayingAudioId = index; @@ -111,7 +109,7 @@ export class AudioPlayerComponent implements OnInit { } } - onAudioEnded(index) { + onAudioEnded(index: number) { this.isPlaying[index] = false; } @@ -128,7 +126,7 @@ export class AudioPlayerComponent implements OnInit { } - openSpectrumPopup(index) { + openSpectrumPopup(index: number) { this.cd.detectChanges(); this.openModal(); if (this.nowplayingAudioId !== -1 || this.nowplayingAudioId === undefined) { @@ -142,7 +140,7 @@ export class AudioPlayerComponent implements OnInit { this.startPopupPlayer(index); } - startPopupPlayer(index) { + startPopupPlayer(index: number) { this.playingAudio = this.listAudio[index]; } diff --git a/projects/laji/src/app/shared-modules/biogeographical-provinces/biogeographical-province/biogeographical-province.component.ts b/projects/laji/src/app/shared-modules/biogeographical-provinces/biogeographical-province/biogeographical-province.component.ts index 8cdbc21851..1df9ed1355 100644 --- a/projects/laji/src/app/shared-modules/biogeographical-provinces/biogeographical-province/biogeographical-province.component.ts +++ b/projects/laji/src/app/shared-modules/biogeographical-provinces/biogeographical-province/biogeographical-province.component.ts @@ -45,7 +45,7 @@ export class BiogeographicalProvinceComponent { borderColor = '#000'; loading = false; - results$: Observable; + results$?: Observable; private colorPalette = [ '#f7fcfd', @@ -73,12 +73,12 @@ export class BiogeographicalProvinceComponent { 100, 1 ).pipe( - map((result) => result.results.map(aggr => ({ + map((result) => result.results.map((aggr: any) => ({ count: aggr.count, key: IdService.getId(aggr.aggregateBy['gathering.interpretations.biogeographicalProvince']) }))), tap(counts => this.initFillColors(counts)), - map(result => result.reduce((cumulative, current) => { + map(result => result.reduce((cumulative: any, current: any) => { if (cumulative[current.key]) { cumulative[current.key] += current.count; } else { @@ -90,12 +90,12 @@ export class BiogeographicalProvinceComponent { } private initFillColors(result: {count: number; key: string}[]) { - const colors = {}; + const colors: BiogeographicalArea = {}; result.forEach(res => { if (res.count > 1000) { - colors[res.key] = this.colorPalette[this.colorPalette.length - 1]; + colors[res.key as keyof BiogeographicalArea] = this.colorPalette[this.colorPalette.length - 1]; } else { - colors[res.key] = this.colorPalette[Math.floor(res.count / 10) % 10]; + colors[res.key as keyof BiogeographicalArea] = this.colorPalette[Math.floor(res.count / 10) % 10]; } }); this.fill = colors; diff --git a/projects/laji/src/app/shared-modules/breadcrumb/theme-breadcrumb/theme-breadcrumb.component.ts b/projects/laji/src/app/shared-modules/breadcrumb/theme-breadcrumb/theme-breadcrumb.component.ts index 30b6f12e07..fad2b34e65 100644 --- a/projects/laji/src/app/shared-modules/breadcrumb/theme-breadcrumb/theme-breadcrumb.component.ts +++ b/projects/laji/src/app/shared-modules/breadcrumb/theme-breadcrumb/theme-breadcrumb.component.ts @@ -15,10 +15,10 @@ export interface Breadcrumb { }) export class ThemeBreadcrumbComponent { - @Input() breadcrumb: Breadcrumb[]; + @Input() breadcrumb?: Breadcrumb[]; @Input() set navLinks(links: Breadcrumb[]) { this.active = links.find(l => l.active === true); } - active: Breadcrumb; + active?: Breadcrumb; } diff --git a/projects/laji/src/app/shared-modules/chart/chart.component.ts b/projects/laji/src/app/shared-modules/chart/chart.component.ts index 4eb091a114..29b3c52f20 100644 --- a/projects/laji/src/app/shared-modules/chart/chart.component.ts +++ b/projects/laji/src/app/shared-modules/chart/chart.component.ts @@ -28,15 +28,15 @@ import { ChartType, ChartDataset, ChartEvent, ChartData, Plugin, ChartOptions } }) export class ChartComponent { - @ViewChild(BaseChartDirective) public barChart: BaseChartDirective; + @ViewChild(BaseChartDirective) public barChart?: BaseChartDirective; - @Input() public data: ChartData; - @Input() public datasets: ChartDataset[]; - @Input() public labels: string[]; + @Input() public data?: ChartData; + @Input() public datasets?: ChartDataset[]; + @Input() public labels?: string[]; @Input() public options: ChartOptions = {}; - @Input() public chartType: ChartType; - @Input() public legend: boolean; - @Input() public plugins: Plugin[]; + @Input() public chartType?: ChartType; + @Input() public legend?: boolean; + @Input() public plugins: Plugin[] = []; @Output() public barClick: EventEmitter<{ event?: ChartEvent; active?: any[]; index: number}> = new EventEmitter(); @Output() public chartClick: EventEmitter<{ event?: ChartEvent; active?: any[] }> = new EventEmitter(); @@ -50,7 +50,7 @@ export class ChartComponent { } private onBarClick(event: { event?: ChartEvent; active?: object[] }) { - const barIndex = (event.active[0] as any)?.index; + const barIndex = (event.active?.[0] as any)?.index; if (barIndex >= 0) { this.barClick.emit({...event, index: barIndex}); } diff --git a/projects/laji/src/app/shared-modules/chart/line-with-line.ts b/projects/laji/src/app/shared-modules/chart/line-with-line.ts index 3ed0127505..972c5a6441 100644 --- a/projects/laji/src/app/shared-modules/chart/line-with-line.ts +++ b/projects/laji/src/app/shared-modules/chart/line-with-line.ts @@ -8,17 +8,19 @@ export class LineWithLine extends LineController { draw() { super.draw(); if ((this.chart.tooltip as any)._active?.length) { - const colWidth = Math.ceil((this['chart'].chartArea['right'] - this['chart'].chartArea['left']) / this['chart'].config.data.labels.length); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const colWidth = Math.ceil((this['chart'].chartArea['right'] - this['chart'].chartArea['left']) / this['chart'].config.data.labels!.length); const activePoint = (this.chart.tooltip as any)._active[0].element; const ctx = this.chart.ctx; const x = Number((activePoint.tooltipPosition().x).toFixed(0)); const y = Number((activePoint.tooltipPosition().y).toFixed(0)); - const topY = this.chart.legend.bottom; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const topY = this.chart.legend!.bottom; const bottomY = this.chart.chartArea.bottom; const gradient = ctx.createLinearGradient(0, 0, 0, 400); gradient.addColorStop(0, 'rgba(70,130,180,1)'); gradient.addColorStop(0.8, 'rgba(70,130,180,0.1)'); - const range = (start, end, step) => Array.from(Array.from(Array(Math.ceil((end - start) / step)).keys()), el => start + el * step); + const range = (start: number, end: number, step: number) => Array.from(Array.from(Array(Math.ceil((end - start) / step)).keys()), el => start + el * step); if (range(x - (colWidth / 2), x + ((colWidth / 2)), 1).indexOf((this.chart.tooltip as any)._eventPosition.x) === -1 && range(y, y, 1).indexOf((this.chart.tooltip as any)._eventPosition.y) === -1) { diff --git a/projects/laji/src/app/shared-modules/collections-select/collections-select.component.ts b/projects/laji/src/app/shared-modules/collections-select/collections-select.component.ts index cc38ec8de4..77d06f638e 100644 --- a/projects/laji/src/app/shared-modules/collections-select/collections-select.component.ts +++ b/projects/laji/src/app/shared-modules/collections-select/collections-select.component.ts @@ -13,17 +13,17 @@ import { WarehouseQueryInterface } from '../../shared/model/WarehouseQueryInterf styleUrls: ['./collections-select.component.scss'] }) export class CollectionsSelectComponent implements OnInit, OnChanges { - @Input() title!: string; - @Input() query!: WarehouseQueryInterface; - @Input() info!: string; - @Input() modalButtonLabel!: string; - @Input() modalTitle!: string; - @Input() browseTitle!: string; - @Input() selectedTitle!: string; - @Input() includedTitle!: string; - @Input() excludedTitle!: string; - @Input() okButtonLabel!: string; - @Input() clearButtonLabel!: string; + @Input({required: true}) title!: string; + @Input({required: true}) query!: WarehouseQueryInterface; + @Input({required: true}) info!: string; + @Input({required: true}) modalButtonLabel!: string; + @Input({required: true}) modalTitle!: string; + @Input({required: true}) browseTitle!: string; + @Input({required: true}) selectedTitle!: string; + @Input({required: true}) includedTitle!: string; + @Input({required: true}) excludedTitle!: string; + @Input({required: true}) okButtonLabel!: string; + @Input({required: true}) clearButtonLabel!: string; @Input() open = false; @Output() collectionIdChange = new EventEmitter<{ collectionId?: string[]; diff --git a/projects/laji/src/app/shared-modules/dataset-metadata/dataset-metadata-viewer/dataset-metadata-viewer-item/dataset-metadata-viewer-item.component.ts b/projects/laji/src/app/shared-modules/dataset-metadata/dataset-metadata-viewer/dataset-metadata-viewer-item/dataset-metadata-viewer-item.component.ts index 07d545b89f..6bd3868548 100644 --- a/projects/laji/src/app/shared-modules/dataset-metadata/dataset-metadata-viewer/dataset-metadata-viewer-item/dataset-metadata-viewer-item.component.ts +++ b/projects/laji/src/app/shared-modules/dataset-metadata/dataset-metadata-viewer/dataset-metadata-viewer-item/dataset-metadata-viewer-item.component.ts @@ -9,7 +9,7 @@ const EMPTY_VALUE = ' '; changeDetection: ChangeDetectionStrategy.OnPush }) export class DatasetMetadataViewerItemComponent implements OnChanges { - @Input() title!: string; + @Input({required: true}) title!: string; @Input() value: string|undefined = EMPTY_VALUE; @Input() showWithoutValue = false; @Input() hideValue = false; diff --git a/projects/laji/src/app/shared-modules/datatable/data-table-footer/data-table-footer.component.ts b/projects/laji/src/app/shared-modules/datatable/data-table-footer/data-table-footer.component.ts index ae026a8d76..d59d042e7f 100644 --- a/projects/laji/src/app/shared-modules/datatable/data-table-footer/data-table-footer.component.ts +++ b/projects/laji/src/app/shared-modules/datatable/data-table-footer/data-table-footer.component.ts @@ -20,11 +20,11 @@ export class DataTableFooterComponent { @Input() top = false; @Output() pageChange = new EventEmitter(); - _count: number; - _pageSize: number; - _page: number; - _start: number; - _end: number; + _count!: number; + _pageSize!: number; + _page!: number; + _start!: number; + _end!: number; constructor(private cdr: ChangeDetectorRef) {} @@ -50,7 +50,7 @@ export class DataTableFooterComponent { this.cdr.detectChanges(); } - onChange(event) { + onChange(event: any) { this.pageChange.emit({ count: this._count, pageSize: this._pageSize, diff --git a/projects/laji/src/app/shared-modules/datatable/datatable-header/datatable-header.component.ts b/projects/laji/src/app/shared-modules/datatable/datatable-header/datatable-header.component.ts index 095943ddc4..d987f6cad1 100644 --- a/projects/laji/src/app/shared-modules/datatable/datatable-header/datatable-header.component.ts +++ b/projects/laji/src/app/shared-modules/datatable/datatable-header/datatable-header.component.ts @@ -9,7 +9,7 @@ import { DownloadComponent } from '../../download-modal/download.component'; }) export class DatatableHeaderComponent { - @ViewChild(DownloadComponent, {static: false}) downloadComponent: DownloadComponent; + @ViewChild(DownloadComponent, {static: false}) downloadComponent?: DownloadComponent; @Input() showSettingsMenu = false; @Input() showDownloadMenu = false; diff --git a/projects/laji/src/app/shared-modules/datatable/datatable-own-submissions/datatable-own-submissions.component.html b/projects/laji/src/app/shared-modules/datatable/datatable-own-submissions/datatable-own-submissions.component.html index 631902ce9d..e812c51044 100644 --- a/projects/laji/src/app/shared-modules/datatable/datatable-own-submissions/datatable-own-submissions.component.html +++ b/projects/laji/src/app/shared-modules/datatable/datatable-own-submissions/datatable-own-submissions.component.html @@ -34,7 +34,7 @@ - @@ -46,7 +46,7 @@ - +