diff --git a/package-lock.json b/package-lock.json index 2bed0da0..b194f3af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1903,6 +1903,13 @@ "integrity": "sha512-dmS6rL38FAWCX9Xry2rtaMEe144MJgZ/8YVR5tVfWNSRmOOnDg+cZTYwt8Qeqm9ndqFBCjGh8PE7mteC8FvUGg==", "requires": { "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } } }, "@ionic-native/geolocation": { @@ -1911,6 +1918,13 @@ "integrity": "sha512-hv8h7sgN57KDBl+hOWB/w2egrS7DEJJLmM098e+Rq/6PEKfV+Spx6fDgGaZvfppoKThayoL3enJoWd3NHcQeDQ==", "requires": { "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } } }, "@ionic-native/network": { @@ -1919,6 +1933,13 @@ "integrity": "sha512-dSN7jaiXXgm8kVcvxcD39wWPFg2NujWTrEnj9Fq7Fx2aGKkxPkocNsxoy02aFVyBp1LQZvp+uiDNmVIVRjrA7A==", "requires": { "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } } }, "@ionic-native/splash-screen": { @@ -1927,6 +1948,13 @@ "integrity": "sha512-F/AvowDaIwlb3+DcR10ezmaFQR7HyiSAu7R4Hf25HPU4PsqCuTezTARbEqa2xM5+5JkkIlIQKG/CPvipG4FV3w==", "requires": { "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } } }, "@ionic-native/status-bar": { @@ -1935,14 +1963,21 @@ "integrity": "sha512-fv4mfH3Fb99fIEOtoxUFYvw+YW10Nk0lUCUkdGTX4LV8Big2o3TfEcUczGQOXJ28Wz1WrAuzh6l9A5JiK3umLw==", "requires": { "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } } }, "@ionic/angular": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-5.4.1.tgz", - "integrity": "sha512-jPUM6Mf7sjYHOevzCHvx5BKbn4gSWDVux6xyh1ZDextQUAEQhoRO/FV6ZjwlzVeoIKzEEN57oaF2zdPw8OFLZg==", + "version": "5.6.9", + "resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-5.6.9.tgz", + "integrity": "sha512-FreCExssGFeifAMFvWbNCJ+x7KPNXt+FrQLh6oDaSr+AfNlYYwDaxfuXmaxeKsRq/Pf2roQKLyL8VAqPohBRcw==", "requires": { - "@ionic/core": "5.4.1", + "@ionic/core": "5.6.9", "tslib": "^1.9.3" } }, @@ -2076,12 +2111,20 @@ } }, "@ionic/core": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-5.4.1.tgz", - "integrity": "sha512-yONXeHjbVGUSL7zPgiCv0fQkw47VHJJ+8zVkYgTg4At+B0VhoLAMgS/ah3EUwSVTOATXdHa6Ak5+71uHPKpViQ==", + "version": "5.6.9", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-5.6.9.tgz", + "integrity": "sha512-OFwlWFsei4r7rVJSQxIB7XbfeU5FI8aIEs9yDEsqBudLquph9b/EA/5MgKxfNX7ahs6/A8Och5zYhXg+dpa3zA==", "requires": { - "ionicons": "^5.1.2", - "tslib": "^1.10.0" + "@stencil/core": "^2.4.0", + "ionicons": "^5.5.1", + "tslib": "^2.1.0" + }, + "dependencies": { + "tslib": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + } } }, "@ionic/storage": { @@ -2423,11 +2466,6 @@ } } }, - "@sindresorhus/is": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-2.1.1.tgz", - "integrity": "sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg==" - }, "@types/glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", @@ -2437,29 +2475,6 @@ "@types/node": "*" } }, - "@types/got": { - "version": "9.6.11", - "resolved": "https://registry.npmjs.org/@types/got/-/got-9.6.11.tgz", - "integrity": "sha512-dr3IiDNg5TDesGyuwTrN77E1Cd7DCdmCFtEfSGqr83jMMtcwhf/SGPbN2goY4JUWQfvxwY56+e5tjfi+oXeSdA==", - "requires": { - "@types/node": "*", - "@types/tough-cookie": "*", - "form-data": "^2.5.0" - } - }, - "@types/mustache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-4.1.1.tgz", - "integrity": "sha512-Sm0NWeLhS2QL7NNGsXvO+Fgp7e3JLHCO6RS3RCnfjAnkw6Y1bsji/AGfISdQZDIR/AeOyzkrxRk9jBkl55zdJw==" - }, - "@types/nodemailer": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-6.4.1.tgz", - "integrity": "sha512-8081UY/0XTTDpuGqCnDc8IY+Q3DSg604wB3dBH0CaZlj4nZWHWuxtZ3NRZ9c9WUrz1Vfm6wioAUnqL3bsh49uQ==", - "requires": { - "@types/node": "*" - } - }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -2471,61 +2486,6 @@ "uri-js": "^4.2.2" } }, - "better-ajv-errors": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-0.7.0.tgz", - "integrity": "sha512-6GtJQ/AwVSo1pI1MDQU/yg8O86gMsrt5RKtELo08Epa2zWJPCOK85v/O8/U5A9JkWmwRkE16JpSgssKSx6moog==", - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/runtime": "^7.0.0", - "chalk": "^2.4.1", - "core-js": "^3.2.1", - "json-to-ast": "^2.0.3", - "jsonpointer": "^4.0.1", - "leven": "^3.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" - } - }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -2535,29 +2495,11 @@ "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, "commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" }, - "core-js": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.12.1.tgz", - "integrity": "sha512-Ne9DKPHTObRuB09Dru5AjwKjY4cJHVGu+y5f7coGn1E9Grkc3p2iBwE9AI/nJzsE29mQF7oq+mhYYRqOMFN1Bw==" - }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -2590,45 +2532,6 @@ "type-fest": "^0.10.0" } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" - }, - "nodemailer": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.5.0.tgz", - "integrity": "sha512-Tm4RPrrIZbnqDKAvX+/4M+zovEReiKlEXWDzG4iwtpL9X34MJY+D5LnQPH/+eghe8DLlAVshHAJZAZWBGhkguw==" - }, - "ts-json-schema-generator": { - "version": "0.70.2", - "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-0.70.2.tgz", - "integrity": "sha512-4miuxRyxYvwzCGGzxGvN39fwlY7HDlj1KRpZq8Hi3IegeAnguc9q4gDvcqMaDKoRiNNnV5fwplRWZFhRrtvr4Q==", - "requires": { - "@types/json-schema": "^7.0.5", - "commander": "~5.1.0", - "glob": "~7.1.6", - "json-stable-stringify": "^1.0.1", - "typescript": "~3.9.5" - }, - "dependencies": { - "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" - }, - "typescript": { - "version": "3.9.9", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", - "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==" - } - } - }, "ts-node": { "version": "8.10.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", @@ -2640,11 +2543,6 @@ "source-map-support": "^0.5.17", "yn": "3.1.1" } - }, - "type-fest": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.10.0.tgz", - "integrity": "sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw==" } } }, @@ -2890,14 +2788,14 @@ "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" }, "@sindresorhus/is": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz", - "integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-2.1.1.tgz", + "integrity": "sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg==" }, "@stencil/core": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.5.2.tgz", - "integrity": "sha512-bgjPXkSzzg1WnTgVUm6m5ZzpKt602WmA/QljODAW1xVN40OHJdbGblzF/F6MFzqv2c5Cy30CB41arc8qADIdcQ==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.6.0.tgz", + "integrity": "sha512-QsxWayZyusnqSZrlCl81R71rA3KqFjVVQSH4E0rGN15F1GdQaFonKlHLyCOLKLig1zzC+DQkLLiUuocexuvdeQ==" }, "@szmarczak/http-timer": { "version": "4.0.5", @@ -2925,13 +2823,6 @@ "@types/keyv": "*", "@types/node": "*", "@types/responselike": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/cli-progress": { @@ -2950,11 +2841,6 @@ "@types/node": "*" } }, - "@types/cordova": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", - "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" - }, "@types/deepmerge": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@types/deepmerge/-/deepmerge-2.2.0.tgz", @@ -3021,6 +2907,16 @@ } } }, + "@types/got": { + "version": "9.6.11", + "resolved": "https://registry.npmjs.org/@types/got/-/got-9.6.11.tgz", + "integrity": "sha512-dr3IiDNg5TDesGyuwTrN77E1Cd7DCdmCFtEfSGqr83jMMtcwhf/SGPbN2goY4JUWQfvxwY56+e5tjfi+oXeSdA==", + "requires": { + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, "@types/http-cache-semantics": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz", @@ -3057,19 +2953,12 @@ "integrity": "sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==", "requires": { "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/lodash": { - "version": "4.14.168", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", - "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==", + "version": "4.14.170", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz", + "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q==", "dev": true }, "@types/lodash-es": { @@ -3156,13 +3045,6 @@ "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", "requires": { "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/selenium-webdriver": { @@ -4349,16 +4231,6 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, "blob": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", @@ -4812,16 +4684,16 @@ } }, "cacheable-request": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.1.tgz", - "integrity": "sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", + "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", "requires": { "clone-response": "^1.0.2", "get-stream": "^5.1.0", "http-cache-semantics": "^4.0.0", "keyv": "^4.0.0", "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", + "normalize-url": "^6.0.1", "responselike": "^2.0.0" } }, @@ -6757,16 +6629,6 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dev": true, - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, "cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", @@ -8591,13 +8453,6 @@ "schema-utils": "^2.6.5" } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, "fileset": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", @@ -9633,6 +9488,11 @@ "responselike": "^2.0.0" }, "dependencies": { + "@sindresorhus/is": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz", + "integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==" + }, "cacheable-lookup": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", @@ -9881,9 +9741,9 @@ "dev": true }, "highlight.js": { - "version": "10.7.2", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.2.tgz", - "integrity": "sha512-oFLl873u4usRM9K63j4ME9u3etNF0PLiJhSQ8rdfuL51Wn3zkD6drf9ZW0dOzjnZI22YYG24z30JcmfCZjMgYg==" + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==" }, "hmac-drbg": { "version": "1.0.1", @@ -11767,6 +11627,16 @@ "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "faye-websocket": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", @@ -11804,11 +11674,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } + "optional": true }, "glob-parent": { "version": "3.1.0", @@ -11902,6 +11768,12 @@ "is-wsl": "^1.1.0" } }, + "proxy-middleware": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/proxy-middleware/-/proxy-middleware-0.15.0.tgz", + "integrity": "sha1-o/3xvvtzD5UZZYcqwvYHTGFHelY=", + "dev": true + }, "readdirp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", @@ -12865,13 +12737,6 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, - "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", - "dev": true, - "optional": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -13075,9 +12940,9 @@ "dev": true }, "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.0.1.tgz", + "integrity": "sha512-VU4pzAuh7Kip71XEmO9aNREYAdMHFGTVj/i+CaTImS8x0i1d3jUZkXhqluy/PRgjPLMgsLQulYY3PJ/aSbSjpQ==" }, "npm-bundled": { "version": "1.1.2", @@ -15151,12 +15016,6 @@ "ipaddr.js": "1.9.1" } }, - "proxy-middleware": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/proxy-middleware/-/proxy-middleware-0.15.0.tgz", - "integrity": "sha1-o/3xvvtzD5UZZYcqwvYHTGFHelY=", - "dev": true - }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -18615,6 +18474,11 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, + "type-fest": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.10.0.tgz", + "integrity": "sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw==" + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -19290,11 +19154,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } + "optional": true }, "glob-parent": { "version": "3.1.0", @@ -19902,11 +19762,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } + "optional": true }, "glob-parent": { "version": "3.1.0", diff --git a/package.json b/package.json index 4b6c7342..588e8d82 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@ionic-native/network": "5.31.1", "@ionic-native/splash-screen": "5.29.0", "@ionic-native/status-bar": "5.29.0", - "@ionic/angular": "5.4.1", + "@ionic/angular": "5.6.9", "@ionic/storage": "2.2.0", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", @@ -96,9 +96,9 @@ "@ionic/angular-toolkit": "2.3.3", "@types/deepmerge": "2.2.0", "@types/form-data": "2.5.0", - "@types/lodash-es": "4.17.4", "@types/jasmine": "3.3.12", "@types/jasminewd2": "2.0.6", + "@types/lodash-es": "4.17.4", "@types/node": "14.14.37", "codelyzer": "5.1.2", "conventional-changelog-cli": "2.0.12", diff --git a/src/app/modules/data/chips/action-chip-list.component.ts b/src/app/modules/data/chips/action-chip-list.component.ts new file mode 100644 index 00000000..1903cd62 --- /dev/null +++ b/src/app/modules/data/chips/action-chip-list.component.ts @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +import {Component, Input} from '@angular/core'; +import {SCDateSeries, SCThings, SCThingType} from '@openstapps/core'; + +/** + * Shows a horizontal list of action chips + */ +@Component({ + selector: 'stapps-action-chip-list', + templateUrl: 'action-chip-list.html', + styleUrls: ['action-chip-list.scss'], +}) +export class ActionChipListComponent { + /** + * If chips are applicable + */ + applicable: Record boolean> = { + 'locate': () => this.item.hasOwnProperty('inPlace'), + 'event': () => this.item.type === SCThingType.AcademicEvent || + (this.item.type === SCThingType.DateSeries && (this.item as SCDateSeries).dates.length !== 0), + }; + + /** + * The item the action belongs to + */ + @Input() item: SCThings; +} diff --git a/src/app/modules/data/chips/action-chip-list.html b/src/app/modules/data/chips/action-chip-list.html new file mode 100644 index 00000000..5680b7fe --- /dev/null +++ b/src/app/modules/data/chips/action-chip-list.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/src/app/modules/data/chips/action-chip-list.scss b/src/app/modules/data/chips/action-chip-list.scss new file mode 100644 index 00000000..64dcc69e --- /dev/null +++ b/src/app/modules/data/chips/action-chip-list.scss @@ -0,0 +1,4 @@ +div { + display: flex; + flex-direction: row; +} diff --git a/src/app/modules/data/chips/add-event-popover.component.ts b/src/app/modules/data/chips/add-event-popover.component.ts new file mode 100644 index 00000000..716e6928 --- /dev/null +++ b/src/app/modules/data/chips/add-event-popover.component.ts @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2021 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +import {ChangeDetectorRef, Component, Input, OnInit} from '@angular/core'; +import {SCDateSeries} from '@openstapps/core'; +import {every, groupBy, some, sortBy, values} from 'lodash-es'; +import {capitalize, last} from 'lodash-es'; + +enum Selection { + ON = 2, + PARTIAL = 1, + OFF = 1, +} + +/** + * A tree + * + * The generic is to preserve type safety of how deep the tree goes. + */ +// tslint:disable-next-line:no-any +class TreeNode | SelectionValue> { + + /** + * Value of this node + */ + checked: boolean; + + /** + * If items are partially selected + */ + indeterminate: boolean; + + /** + * Parent of this node + */ + parent?: TreeNode>; + + constructor(readonly children: T[], readonly ref: ChangeDetectorRef) { + this.updateParents(); + this.accumulateApplyValues(); + } + + /** + * Accumulate values of children to set current value + */ + private accumulateApplyValues() { + const selections: number[] = + this.children.map(it => it instanceof TreeNode ? + (it.checked ? Selection.ON : (it.indeterminate ? Selection.PARTIAL : Selection.OFF)) : + (it as SelectionValue).selected ? Selection.ON : Selection.OFF); + + this.checked = every(selections, it => it === Selection.ON); + this.indeterminate = this.checked ? false : some(selections, it => it > Selection.OFF); + } + + /** + * Apply the value of this node to all child nodes + */ + private applyValueDownwards() { + for (const child of this.children) { + if (child instanceof TreeNode) { + child.checked = this.checked; + child.indeterminate = false; + // tslint:disable-next-line:no-any + (child as TreeNode).applyValueDownwards(); + } else { + (child as SelectionValue).selected = this.checked; + } + } + } + + /** + * Set all children's parent to this + */ + private updateParents() { + for (const child of this.children) { + if (child instanceof TreeNode) { + child.parent = this as TreeNode>; + } + } + } + + /** + * Update values to all parents upwards + */ + private updateValueUpwards() { + this.parent?.accumulateApplyValues(); + this.parent?.updateValueUpwards(); + } + + /** + * Click on this node + */ + click() { + this.checked = !this.checked; + this.indeterminate = false; + this.applyValueDownwards(); + this.updateValueUpwards(); + } + + /** + * Notify that a child's value has changed + */ + notifyChildChanged() { + this.accumulateApplyValues(); + this.updateValueUpwards(); + } +} + +interface SelectionValue { + /** + * Item that was selected + */ + item: SCDateSeries; + + /** + * Selection + */ + selected: boolean; +} + +/** + * Shows a horizontal list of action chips + */ +@Component({ + selector: 'stapps-add-event-popover-component', + templateUrl: 'add-event-popover.html', + styleUrls: ['add-event-popover.scss'], +}) +export class AddEventPopoverComponent implements OnInit { + /** + * Lodash alias + */ + capitalize: (item: string) => string = capitalize; + + /** + * The item the action belongs to + */ + @Input() items: SCDateSeries[]; + + /** + * Lodash alias + */ + last: (item: T[] | null | undefined) => T | undefined = last; + + /** + * Selection of the item + */ + selection: TreeNode>; + + constructor(readonly ref: ChangeDetectorRef) { + } + + /** + * Init + */ + ngOnInit() { + this.selection = + new TreeNode(values(groupBy(sortBy(this.items.map(item => ({ + selected: false, + item: item, + })), it => it.item.frequency), it => it.item.frequency)) + .map(item => new TreeNode(item, this.ref)), this.ref); + } +} diff --git a/src/app/modules/data/chips/add-event-popover.html b/src/app/modules/data/chips/add-event-popover.html new file mode 100644 index 00000000..9c689989 --- /dev/null +++ b/src/app/modules/data/chips/add-event-popover.html @@ -0,0 +1,40 @@ + + + + {{'data.chips.add_events.popover.ALL' | translate}} + + + + + + {{('frequency' | thingTranslate: frequency.children[0].item) | titlecase}} + + + + + + {{date.item.duration | amDuration: 'hours'}} + {{'data.chips.add_events.popover.AT' | translate}} + {{date.item.dates[0] | amDateFormat: 'HH:mm ddd'}} + {{'data.chips.add_events.popover.UNTIL' | translate}} + {{last(date.item.dates) | amDateFormat: 'll'}} + + + + {{date.item.duration | amDuration: 'hours'}} + {{'data.chips.add_events.popover.AT' | translate}} + {{last(date.item.dates) | amDateFormat: 'll, HH:mm'}} + + + + + + + + diff --git a/src/app/modules/data/chips/add-event-popover.scss b/src/app/modules/data/chips/add-event-popover.scss new file mode 100644 index 00000000..5f5b23ef --- /dev/null +++ b/src/app/modules/data/chips/add-event-popover.scss @@ -0,0 +1,7 @@ +::ng-deep ion-item-divider { + cursor: pointer; +} + +ion-card-content { + width: fit-content; +} diff --git a/src/app/modules/data/chips/data/add-event-action-chip.component.ts b/src/app/modules/data/chips/data/add-event-action-chip.component.ts new file mode 100644 index 00000000..ab602bce --- /dev/null +++ b/src/app/modules/data/chips/data/add-event-action-chip.component.ts @@ -0,0 +1,165 @@ +/* tslint:disable:prefer-function-over-method */ +/* + * Copyright (C) 2021 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +import {Component, Input, OnInit} from '@angular/core'; +import {PopoverController} from '@ionic/angular'; +import {SCDateSeries, SCThing, SCThingType} from '@openstapps/core'; +import {DataProvider} from '../../data.provider'; +import {AddEventPopoverComponent} from '../add-event-popover.component'; + +enum AddEventStates { + ADDED_ALL, + ADDED_SOME, + REMOVED_ALL, + UNAVAILABLE, +} + +/** + * Shows a horizontal list of action chips + */ +@Component({ + selector: 'stapps-add-event-action-chip', + templateUrl: 'add-event-action-chip.html', + styleUrls: ['add-event-action-chip.scss'], +}) +export class AddEventActionChipComponent implements OnInit { + /** + * Associated date series + */ + associatedDateSeries: Promise; + + /** + * Disabled + */ + disabled: boolean; + + /** + * Icon + */ + icon: string; + + /** + * Item + */ + @Input() item: SCThing; + + /** + * Label + */ + label: string; + + /** + * State + */ + state: AddEventStates; + + /** + * States + */ + states = { + [AddEventStates.ADDED_ALL]: { + icon: 'events-all', + label: 'data.chips.add_events.ADDED_ALL', + disabled: false, + }, + [AddEventStates.ADDED_SOME]: { + icon: 'events-partial', + label: 'data.chips.add_events.ADDED_SOME', + disabled: false, + }, + [AddEventStates.REMOVED_ALL]: { + icon: 'events', + label: 'data.chips.add_events.REMOVED_ALL', + disabled: false, + }, + [AddEventStates.UNAVAILABLE]: { + icon: 'close', + label: 'data.chips.add_events.UNAVAILABLE', + disabled: true, + }, + }; + + constructor(readonly popoverController: PopoverController, + readonly dataProvider: DataProvider) { + } + + /** + * Apply state + */ + applyState(state: AddEventStates) { + this.state = state; + const {label, icon, disabled} = this.states[state]; + this.label = label; + this.icon = icon; + this.disabled = disabled; + } + + /** + * Init + */ + ngOnInit() { + this.associatedDateSeries = this.item.type === SCThingType.DateSeries ? + Promise.resolve([this.item as SCDateSeries]) : + this.dataProvider.search({ + filter: { + arguments: { + filters: [ + { + arguments: { + field: 'type', + value: SCThingType.DateSeries, + }, + type: 'value', + }, + { + arguments: { + field: 'event.uid', + value: this.item.uid, + }, + type: 'value', + }, + ], + operation: 'and', + }, + type: 'boolean', + }, + }) + .then((it) => it.data as SCDateSeries[]); + this.associatedDateSeries.then((it) => this.applyState( + it.length < 1 ? AddEventStates.UNAVAILABLE : AddEventStates.REMOVED_ALL)); + } + + /** + * Action + */ + // @Override + async onClick(event: MouseEvent) { + const associatedDateSeries = await this.associatedDateSeries; + const popover = await this.popoverController.create({ + component: AddEventPopoverComponent, + translucent: true, + cssClass: 'add-event-popover', + componentProps: { + items: associatedDateSeries, + }, + event: event, + }); + await popover.present(); + // TODO: replace dummy implementation + await popover.onDidDismiss(); + this.applyState(this.state === AddEventStates.ADDED_ALL ? + AddEventStates.REMOVED_ALL : AddEventStates.ADDED_ALL); + } +} diff --git a/src/app/modules/data/chips/data/add-event-action-chip.html b/src/app/modules/data/chips/data/add-event-action-chip.html new file mode 100644 index 00000000..77f4ead0 --- /dev/null +++ b/src/app/modules/data/chips/data/add-event-action-chip.html @@ -0,0 +1,11 @@ +
+ + + {{label | translate}} + +
+ + + + + diff --git a/src/app/modules/data/chips/data/add-event-action-chip.scss b/src/app/modules/data/chips/data/add-event-action-chip.scss new file mode 100644 index 00000000..f032704e --- /dev/null +++ b/src/app/modules/data/chips/data/add-event-action-chip.scss @@ -0,0 +1,3 @@ +::ng-deep ion-skeleton-text { + width: 50px; +} diff --git a/src/app/modules/data/chips/data/locate-action-chip.component.ts b/src/app/modules/data/chips/data/locate-action-chip.component.ts new file mode 100644 index 00000000..41486a50 --- /dev/null +++ b/src/app/modules/data/chips/data/locate-action-chip.component.ts @@ -0,0 +1,39 @@ +/* tslint:disable:prefer-function-over-method */ +/* + * Copyright (C) 2021 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +import {Component, Input} from '@angular/core'; +import {SCThing} from '@openstapps/core'; + +/** + * Shows a horizontal list of action chips + */ +@Component({ + selector: 'stapps-locate-action-chip', + templateUrl: 'locate-action-chip.html', +}) +export class LocateActionChipComponent { + /** + * Item + */ + @Input() item: SCThing; + + /** + * Click + */ + onClick(/*event: MouseEvent*/) { + // TODO + } +} + diff --git a/src/app/modules/data/chips/data/locate-action-chip.html b/src/app/modules/data/chips/data/locate-action-chip.html new file mode 100644 index 00000000..f2abd377 --- /dev/null +++ b/src/app/modules/data/chips/data/locate-action-chip.html @@ -0,0 +1,7 @@ + + + {{'Locate' | translate}} + + + + diff --git a/src/app/modules/data/data.module.ts b/src/app/modules/data/data.module.ts index a329473d..9fdc5647 100644 --- a/src/app/modules/data/data.module.ts +++ b/src/app/modules/data/data.module.ts @@ -25,6 +25,10 @@ import {MomentModule} from 'ngx-moment'; import {ThingTranslateModule} from '../../translation/thing-translate.module'; import {MenuModule} from '../menu/menu.module'; import {StorageModule} from '../storage/storage.module'; +import {ActionChipListComponent} from './chips/action-chip-list.component'; +import {AddEventPopoverComponent} from './chips/add-event-popover.component'; +import {AddEventActionChipComponent} from './chips/data/add-event-action-chip.component'; +import {LocateActionChipComponent} from './chips/data/locate-action-chip.component'; import {DataFacetsProvider} from './data-facets.provider'; import {DataIconPipe} from './data-icon.pipe'; import {DataRoutingModule} from './data-routing.module'; @@ -77,6 +81,7 @@ import {VideoListItem} from './types/video/video-list-item.component'; */ @NgModule({ declarations: [ + AddEventPopoverComponent, OffersDetailComponent, OffersInListComponent, AddressDetailComponent, @@ -119,6 +124,9 @@ import {VideoListItem} from './types/video/video-list-item.component'; VideoDetailContentComponent, VideoListItem, DataIconPipe, + ActionChipListComponent, + AddEventActionChipComponent, + LocateActionChipComponent, ], entryComponents: [ DataListComponent, diff --git a/src/app/modules/data/detail/data-detail.scss b/src/app/modules/data/detail/data-detail.scss index 7a1ff7d1..8be59279 100644 --- a/src/app/modules/data/detail/data-detail.scss +++ b/src/app/modules/data/detail/data-detail.scss @@ -7,7 +7,8 @@ ::ng-deep { ion-slides.work-locations { ion-slide { - display: block; text-align: left; + display: block; + text-align: left; } } } diff --git a/src/app/modules/data/elements/skeleton-list-item.html b/src/app/modules/data/elements/skeleton-list-item.html index b2a3574f..80593d77 100644 --- a/src/app/modules/data/elements/skeleton-list-item.html +++ b/src/app/modules/data/elements/skeleton-list-item.html @@ -1,13 +1,19 @@ - + -

-

- +

+ +

+

+ +

+ + +
diff --git a/src/app/modules/data/list/data-list-item.html b/src/app/modules/data/list/data-list-item.html index 9d873f54..19ad4088 100644 --- a/src/app/modules/data/list/data-list-item.html +++ b/src/app/modules/data/list/data-list-item.html @@ -1,30 +1,36 @@ - - - + +
+ + - - - - - - - - - - - - - - - - -
-

- {{'name' | thingTranslate: item}} -

-

- -

+ +
+ + + + + + + + + + + + + + + +
+

+ {{'name' | thingTranslate: item}} +

+

+ +

+
+
diff --git a/src/app/modules/data/list/data-list-item.scss b/src/app/modules/data/list/data-list-item.scss index b09a90a8..b16f7766 100644 --- a/src/app/modules/data/list/data-list-item.scss +++ b/src/app/modules/data/list/data-list-item.scss @@ -1,3 +1,13 @@ +.item { + ion-label { + width: 100%; + + div { + display: flex; + flex-direction: column; + } + } +} ::ng-deep { ion-grid, ion-col { diff --git a/src/app/modules/data/list/data-list.component.ts b/src/app/modules/data/list/data-list.component.ts index f9bdddfa..fdf3242a 100644 --- a/src/app/modules/data/list/data-list.component.ts +++ b/src/app/modules/data/list/data-list.component.ts @@ -13,8 +13,19 @@ * this program. If not, see . */ import {CdkVirtualScrollViewport} from '@angular/cdk/scrolling'; -import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild} from '@angular/core'; +import { + Component, + EventEmitter, + HostListener, + Input, + OnChanges, + OnInit, + Output, + SimpleChanges, + ViewChild, +} from '@angular/core'; import {SCThings} from '@openstapps/core'; +import {ceil} from 'lodash-es'; import {BehaviorSubject, Observable, Subscription} from 'rxjs'; /** @@ -51,6 +62,10 @@ export class DataListComponent implements OnChanges, OnInit { * Indicates whether or not the list is to display SCThings of a single type */ @Input() singleType = false; + /** + * Items that display the skeleton list + */ + skeletonItems: number[]; /** * Array of all subscriptions to Observables */ @@ -58,9 +73,19 @@ export class DataListComponent implements OnChanges, OnInit { // tslint:disable-next-line: completed-docs @ViewChild(CdkVirtualScrollViewport) viewPort: CdkVirtualScrollViewport; + /** + * Calculate how many items would fill the screen + */ + @HostListener('window.resize', ['$event']) + calcSkeletonItems() { + const itemHeight = 122; + this.skeletonItems = new Array(ceil(window.innerHeight / itemHeight)); + } + /** * Uniquely identifies item at a certain list index */ + // tslint:disable-next-line:prefer-function-over-method identifyItem(_index: number, item: SCThings) { return item.uid; } @@ -73,18 +98,19 @@ export class DataListComponent implements OnChanges, OnInit { } // tslint:disable-next-line: completed-docs - ngOnInit(): void { - if (typeof this.resetToTop !== 'undefined') { - this.subscriptions.push(this.resetToTop.subscribe(() => { - this.viewPort.scrollToIndex(0); - })); + ngOnDestroy(): void { + for (const subscription of this.subscriptions) { + subscription.unsubscribe(); } } // tslint:disable-next-line: completed-docs - ngOnDestroy(): void { - for (const subscription of this.subscriptions) { - subscription.unsubscribe(); + ngOnInit(): void { + this.calcSkeletonItems(); + if (typeof this.resetToTop !== 'undefined') { + this.subscriptions.push(this.resetToTop.subscribe(() => { + this.viewPort.scrollToIndex(0); + })); } } diff --git a/src/app/modules/data/list/data-list.html b/src/app/modules/data/list/data-list.html index 5b76556c..c949bee9 100644 --- a/src/app/modules/data/list/data-list.html +++ b/src/app/modules/data/list/data-list.html @@ -13,5 +13,5 @@
- + diff --git a/src/app/translation/thing-translate.pipe.ts b/src/app/translation/thing-translate.pipe.ts index be411032..d7004f34 100644 --- a/src/app/translation/thing-translate.pipe.ts +++ b/src/app/translation/thing-translate.pipe.ts @@ -42,12 +42,14 @@ export class ThingTranslatePipe implements PipeTransform, OnDestroy { this.value = this.thingTranslate.get(thing, key); } - transform(query: unknown, thing: SCThings): unknown { + transform(query: P, thing: T): + P extends keyof T ? T[P] : P | unknown { if (typeof query !== 'string' || query.length <= 0) { - return query; + // tslint:disable-next-line:no-any + return query as any; } - if (!isThing(thing)){ + if (!isThing(thing)) { throw new SyntaxError(`Wrong parameter in ThingTranslatePipe. Expected a valid SCThing, received: ${thing}`); } @@ -69,7 +71,8 @@ export class ThingTranslatePipe implements PipeTransform, OnDestroy { }); } - return this.value; + // tslint:disable-next-line:no-any + return this.value as any; } /** @@ -111,13 +114,13 @@ export class ThingPropertyNameTranslatePipe implements PipeTransform, OnDestroy return query; } - if (!isThing(thingOrType) && typeof thingOrType !== 'string'){ + if (!isThing(thingOrType) && typeof thingOrType !== 'string') { throw new SyntaxError(`Wrong parameter in ThingTranslatePipe. Expected a valid SCThing or String, received: ${thingOrType}`); } // store the params, in case they change this.lastKey = query; - this.lastType= typeof thingOrType === 'string' ? thingOrType : thingOrType.type; + this.lastType = typeof thingOrType === 'string' ? thingOrType : thingOrType.type; this.updateValue(query, this.lastType); diff --git a/src/assets/custom-ion-icons/events-all.svg b/src/assets/custom-ion-icons/events-all.svg new file mode 100644 index 00000000..bc3e0cc1 --- /dev/null +++ b/src/assets/custom-ion-icons/events-all.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/custom-ion-icons/events-partial.svg b/src/assets/custom-ion-icons/events-partial.svg new file mode 100644 index 00000000..900079a9 --- /dev/null +++ b/src/assets/custom-ion-icons/events-partial.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/custom-ion-icons/events.svg b/src/assets/custom-ion-icons/events.svg new file mode 100644 index 00000000..5e29a42b --- /dev/null +++ b/src/assets/custom-ion-icons/events.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index 06ff3527..e368feee 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -19,6 +19,19 @@ "TITLE": "Angebote" } }, + "chips": { + "add_events": { + "ADDED_ALL": "Hinzugefügt", + "ADDED_SOME": "Manche Termine Hinzugefügt", + "REMOVED_ALL": "Termine Auswählen", + "UNAVAILABLE": "Keine Termine Verfügbar", + "popover": { + "ALL": "Alle Termine", + "AT": "um", + "UNTIL": "bis" + } + } + }, "types": { "dish": { "detail": { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index ed27001d..4f231a39 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -19,6 +19,19 @@ "TITLE": "offers" } }, + "chips": { + "add_events": { + "ADDED_ALL": "Added", + "ADDED_SOME": "Added Some Events", + "REMOVED_ALL": "Choose Events", + "UNAVAILABLE": "No Associated Events", + "popover": { + "ALL": "All Events", + "AT": "at", + "UNTIL": "until" + } + } + }, "types": { "dish": { "detail": { diff --git a/src/global.scss b/src/global.scss index f0fa50cb..7421879a 100644 --- a/src/global.scss +++ b/src/global.scss @@ -48,3 +48,7 @@ ion-item { font-size: x-large; } } + +.add-event-popover { + --width: fit-content; +}