diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 70761a2dd..000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - trailingComma: "es5", - tabWidth: 4, - printWidth: 120, - semi: true, - singleQuote: false, - useTabs: false, - bracketSpacing: true, - arrowParens: "avoid", - endOfLine: "auto", -}; diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..b00b6c8df --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,11 @@ +{ + "trailingComma": "es5", + "tabWidth": 2, + "printWidth": 120, + "semi": true, + "singleQuote": false, + "useTabs": false, + "bracketSpacing": true, + "arrowParens": "avoid", + "endOfLine": "auto" +} diff --git a/package-lock.json b/package-lock.json index 3bfa2f58b..bb16d5585 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,19 +86,10 @@ "typescript": "~4.6.4" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@adobe/css-tools": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz", - "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.0.tgz", + "integrity": "sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==", "dev": true }, "node_modules/@ampproject/remapping": { @@ -628,11 +619,11 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", - "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dependencies": { - "@babel/highlight": "^7.24.2", + "@babel/highlight": "^7.24.7", "picocolors": "^1.0.0" }, "engines": { @@ -640,9 +631,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.4.tgz", - "integrity": "sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.2.tgz", + "integrity": "sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==", "engines": { "node": ">=6.9.0" } @@ -723,25 +714,26 @@ } }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz", - "integrity": "sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz", + "integrity": "sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==", "dev": true, "dependencies": { - "@babel/types": "^7.22.15" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", - "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", + "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", "dependencies": { - "@babel/compat-data": "^7.23.5", - "@babel/helper-validator-option": "^7.23.5", - "browserslist": "^4.22.2", + "@babel/compat-data": "^7.25.2", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -758,19 +750,17 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.4.tgz", - "integrity": "sha512-lG75yeuUSVu0pIcbhiYMXBXANHrpUPaOfu7ryAzskCgKUHuAxRQI5ssrtmF0X9UXldPlvT0XM/A4F44OXRt6iQ==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-member-expression-to-functions": "^7.23.0", - "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/helper-replace-supers": "^7.24.1", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.0.tgz", + "integrity": "sha512-GYM6BxeQsETc9mnct+nIIpf63SAyzvyYN7UB/IlTyd+MBg06afFGp0mIeUqGyWgS2mxad6vqbMrHVlaL3m70sQ==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/traverse": "^7.25.0", "semver": "^6.3.1" }, "engines": { @@ -781,12 +771,12 @@ } }, "node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -802,12 +792,12 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz", - "integrity": "sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.2.tgz", + "integrity": "sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-annotate-as-pure": "^7.24.7", "regexpu-core": "^5.3.1", "semver": "^6.3.1" }, @@ -819,12 +809,12 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -856,82 +846,51 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name/node_modules/@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", - "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz", - "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz", + "integrity": "sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==", "dev": true, "dependencies": { - "@babel/types": "^7.23.0" + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.8" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.24.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", - "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", "dependencies": { - "@babel/types": "^7.24.0" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", - "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", + "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.20" + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.2" }, "engines": { "node": ">=6.9.0" @@ -941,35 +900,35 @@ } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", - "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz", + "integrity": "sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", - "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz", - "integrity": "sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.0.tgz", + "integrity": "sha512-NhavI2eWEIz/H9dbrG0TuOicDhNexze43i5z7lEqwYm0WEZVTwnPpA0EafUTP7+6/W79HWIP2cTe3Z5NiSTVpw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-wrap-function": "^7.22.20" + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-wrap-function": "^7.25.0", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -979,26 +938,26 @@ } }, "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz", - "integrity": "sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.0.tgz", + "integrity": "sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-member-expression-to-functions": "^7.23.0", - "@babel/helper-optimise-call-expression": "^7.22.5" + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -1008,123 +967,113 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", "dependencies": { - "@babel/types": "^7.22.5" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", - "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz", + "integrity": "sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", - "dependencies": { - "@babel/types": "^7.22.5" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", - "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", - "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz", - "integrity": "sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.0.tgz", + "integrity": "sha512-s6Q1ebqutSiZnEjaofc/UKDyC4SbzV5n5SrA2Gq8UawLycr3i04f1dX4OzoQVnexm6aOCh37SQNYlJ/8Ku+PMQ==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.22.5", - "@babel/template": "^7.22.15", - "@babel/types": "^7.22.19" + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function/node_modules/@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.4.tgz", - "integrity": "sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", + "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", "dependencies": { - "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.1", - "@babel/types": "^7.24.0" + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers/node_modules/@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", - "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -1134,9 +1083,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.4.tgz", - "integrity": "sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==", + "version": "7.25.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz", + "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==", + "dependencies": { + "@babel/types": "^7.25.2" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -1145,12 +1097,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.1.tgz", - "integrity": "sha512-y4HqEnkelJIOQGd+3g1bTeKsA5c6qM7eOn7VggGVbBc0y8MLSKHacwcIE2PplNlQSj0PqS9rrXL/nkPVK+kUNg==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.0.tgz", + "integrity": "sha512-lXwdNZtTmeVOOFtwM/WDe7yg1PL8sYhRk/XH0FzbR2HDQ0xC+EnQ/JHeoMYSavtU115tnUk0q9CDyq8si+LMAA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1160,14 +1112,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.1.tgz", - "integrity": "sha512-Hj791Ii4ci8HqnaKHAlLNs+zaLXb0EzSDhiAWp5VNlyvCNymYfacs64pxTxbH1znW/NcArSmwpmG9IKE/TUVVQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz", + "integrity": "sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/plugin-transform-optional-chaining": "^7.24.1" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1504,12 +1456,12 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.1.tgz", - "integrity": "sha512-IuwnI5XnuF189t91XbxmXeCDz3qs6iDRO7GJ++wcfgeXNs/8FmIlKcpDSXNVyuLQxlwvskmI3Ct73wUODkJBlQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", + "integrity": "sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1633,12 +1585,12 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.1.tgz", - "integrity": "sha512-ngT/3NkRhsaep9ck9uj2Xhv9+xB1zShY3tM3g6om4xxCELwCDN4g4Aq5dRn48+0hasAql7s2hdBOysCfNpr4fw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz", + "integrity": "sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1665,12 +1617,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.1.tgz", - "integrity": "sha512-TWWC18OShZutrv9C6mye1xwtam+uNi2bnTOCBUd5sZxyHOiWbU6ztSROofIMrK84uweEZC219POICK/sTYwfgg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz", + "integrity": "sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1680,12 +1632,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.4.tgz", - "integrity": "sha512-nIFUZIpGKDf9O9ttyRXpHFpKC+X3Y5mtshZONuEUYBomAKoM4y029Jr+uB1bHGPhNmK8YXHevDtKDOLmtRrp6g==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.0.tgz", + "integrity": "sha512-yBQjYoOjXlFv9nlXb3f1casSHOZkWr29NX+zChVanLg5Nc157CrbEX9D7hxxtTpuFy7Q0YzmmWfJxzvps4kXrQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1695,18 +1647,16 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.1.tgz", - "integrity": "sha512-ZTIe3W7UejJd3/3R4p7ScyyOoafetUShSf4kCqV0O7F/RiHxVj/wRaRnQlrGwflvcehNA8M42HkAiEDYZu2F1Q==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-replace-supers": "^7.24.1", - "@babel/helper-split-export-declaration": "^7.22.6", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.0.tgz", + "integrity": "sha512-xyi6qjr/fYU304fiRwFbekzkqVJZ6A7hOjWZd+89FVcBqPV3S9Wuozz82xdpLspckeaafntbzglaW4pqpzvtSw==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/traverse": "^7.25.0", "globals": "^11.1.0" }, "engines": { @@ -1717,25 +1667,25 @@ } }, "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.1.tgz", - "integrity": "sha512-5pJGVIUfJpOS+pAqBQd+QMaTD2vCL/HcePooON6pDpHgRp4gNRmzyHTPIkXntwKsq3ayUFVfJaIKPw2pOkOcTw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz", + "integrity": "sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/template": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/template": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1745,26 +1695,26 @@ } }, "node_modules/@babel/plugin-transform-computed-properties/node_modules/@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.1.tgz", - "integrity": "sha512-ow8jciWqNxR3RYbSNVuF4U2Jx130nwnBnhRw6N6h1bOejNkABmcI5X5oz29K4alWX7vf1C+o6gtKXikzRKkVdw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.8.tgz", + "integrity": "sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1774,13 +1724,13 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.1.tgz", - "integrity": "sha512-p7uUxgSoZwZ2lPNMzUkqCts3xlp8n+o05ikjy7gbtFJSt9gdU88jAmtfmOxHM14noQXBxfgzf2yRWECiNVhTCw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz", + "integrity": "sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1790,12 +1740,12 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.1.tgz", - "integrity": "sha512-msyzuUnvsjsaSaocV6L7ErfNsa5nDWL1XKNnDePLgmz+WdU4w/J8+AxBMrWfi9m4IxfL5sZQKUPQKDQeeAT6lA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz", + "integrity": "sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1805,13 +1755,13 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.1.tgz", - "integrity": "sha512-U1yX13dVBSwS23DEAqU+Z/PkwE9/m7QQy8Y9/+Tdb8UWYaGNDYwTLi19wqIAiROr8sXVum9A/rtiH5H0boUcTw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz", + "integrity": "sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.15", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1821,13 +1771,13 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.1.tgz", - "integrity": "sha512-OxBdcnF04bpdQdR3i4giHZNZQn7cm8RQKcSwA17wAAqEELo1ZOwp5FFgeptWUQXFyT9kwHo10aqqauYkRZPCAg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz", + "integrity": "sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1837,14 +1787,14 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.1.tgz", - "integrity": "sha512-BXmDZpPlh7jwicKArQASrj8n22/w6iymRnvHYYd2zO30DbE277JO20/7yXJT3QxDPtiQiOxQBbZH4TpivNXIxA==", + "version": "7.25.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.1.tgz", + "integrity": "sha512-TVVJVdW9RKMNgJJlLtHsKDTydjZAbwIsn6ySBPQaEAUU5+gVvlJt/9nRmqVbsV/IBanRjzWoaAQKLoamWVOUuA==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.1" }, "engines": { "node": ">=6.9.0" @@ -1854,12 +1804,12 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.1.tgz", - "integrity": "sha512-zn9pwz8U7nCqOYIiBaOxoQOtYmMODXTJnkxG4AtX8fPmnCRYWBOHD0qcpwS9e2VDSp1zNJYpdnFMIKb8jmwu6g==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.2.tgz", + "integrity": "sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1869,12 +1819,12 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.1.tgz", - "integrity": "sha512-4ojai0KysTWXzHseJKa1XPNXKRbuUrhkOPY4rEGeR+7ChlJVKxFa3H3Bz+7tWaGKgJAXUWKOGmltN+u9B3+CVg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz", + "integrity": "sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1884,13 +1834,13 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.1.tgz", - "integrity": "sha512-lAxNHi4HVtjnHd5Rxg3D5t99Xm6H7b04hUS7EHIXcUl2EV4yl1gWdqZrNzXnSrHveL9qMdbODlLF55mvgjAfaQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz", + "integrity": "sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1900,14 +1850,14 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.1.tgz", - "integrity": "sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz", + "integrity": "sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-simple-access": "^7.22.5" + "@babel/helper-module-transforms": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-simple-access": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1917,15 +1867,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.1.tgz", - "integrity": "sha512-mqQ3Zh9vFO1Tpmlt8QPnbwGHzNz3lpNEMxQb1kAemn/erstyqw1r9KeOlOfo3y6xAnFEcOv2tSyrXfmMk+/YZA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.0.tgz", + "integrity": "sha512-YPJfjQPDXxyQWg/0+jHKj1llnY5f/R6a0p/vP4lPymxLu7Lvl4k2WMitqi08yxwQcCVUUdG9LCUj4TNEgAp3Jw==", "dev": true, "dependencies": { - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-validator-identifier": "^7.22.20" + "@babel/helper-module-transforms": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -1935,13 +1885,13 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.1.tgz", - "integrity": "sha512-tuA3lpPj+5ITfcCluy6nWonSL7RvaG0AOTeAuvXqEKS34lnLzXpDb0dcP6K8jD0zWZFNDVly90AGFJPnm4fOYg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz", + "integrity": "sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1951,13 +1901,13 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", - "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz", + "integrity": "sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1967,12 +1917,12 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.1.tgz", - "integrity": "sha512-/rurytBM34hYy0HKZQyA0nHbQgQNFm4Q/BOc9Hflxi2X3twRof7NaE5W46j4kQitm7SvACVRXsa6N/tSZxvPug==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz", + "integrity": "sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1982,13 +1932,13 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.1.tgz", - "integrity": "sha512-oKJqR3TeI5hSLRxudMjFQ9re9fBVUU0GICqM3J1mi8MqlhVr6hC/ZN4ttAyMuQR6EZZIY6h/exe5swqGNNIkWQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz", + "integrity": "sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-replace-supers": "^7.24.1" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -1998,13 +1948,13 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.1.tgz", - "integrity": "sha512-n03wmDt+987qXwAgcBlnUUivrZBPZ8z1plL0YvgQalLm+ZE5BMhGm94jhxXtA1wzv1Cu2aaOv1BM9vbVttrzSg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.8.tgz", + "integrity": "sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "engines": { @@ -2015,12 +1965,12 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.1.tgz", - "integrity": "sha512-8Jl6V24g+Uw5OGPeWNKrKqXPDw2YDjLc53ojwfMcKwlEoETKU9rU0mHUtcg9JntWI/QYzGAXNWEcVHZ+fR+XXg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz", + "integrity": "sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2030,12 +1980,12 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.1.tgz", - "integrity": "sha512-LetvD7CrHmEx0G442gOomRr66d7q8HzzGGr4PMHGr+5YIm6++Yke+jxj246rpvsbyhJwCLxcTn6zW1P1BSenqA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz", + "integrity": "sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2045,12 +1995,12 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.1.tgz", - "integrity": "sha512-sJwZBCzIBE4t+5Q4IGLaaun5ExVMRY0lYwos/jNecjMrVCygCdph3IKv0tkP5Fc87e/1+bebAmEAGBfnRD+cnw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz", + "integrity": "sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0", + "@babel/helper-plugin-utils": "^7.24.7", "regenerator-transform": "^0.15.2" }, "engines": { @@ -2061,12 +2011,12 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.1.tgz", - "integrity": "sha512-JAclqStUfIwKN15HrsQADFgeZt+wexNQ0uLhuqvqAUFoqPMjEcFCYZBhq0LUdz6dZK/mD+rErhW71fbx8RYElg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz", + "integrity": "sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2105,12 +2055,12 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.1.tgz", - "integrity": "sha512-LyjVB1nsJ6gTTUKRjRWx9C1s9hE7dLfP/knKdrfeH9UPtAGjYGgxIbFfx7xyLIEWs7Xe1Gnf8EWiUqfjLhInZA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz", + "integrity": "sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2120,13 +2070,13 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.1.tgz", - "integrity": "sha512-KjmcIM+fxgY+KxPVbjelJC6hrH1CgtPmTvdXAfn3/a9CnWGSTY7nH4zm5+cjmWJybdcPSsD0++QssDsjcpe47g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz", + "integrity": "sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2136,12 +2086,12 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.1.tgz", - "integrity": "sha512-9v0f1bRXgPVcPrngOQvLXeGNNVLc8UjMVfebo9ka0WF3/7+aVUHmaJVT3sa0XCzEFioPfPHZiOcYG9qOsH63cw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz", + "integrity": "sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2151,12 +2101,12 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.1.tgz", - "integrity": "sha512-WRkhROsNzriarqECASCNu/nojeXCDTE/F2HmRgOzi7NGvyfYGq1NEjKBK3ckLfRgGc6/lPAqP0vDOSw3YtG34g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz", + "integrity": "sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2166,12 +2116,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.1.tgz", - "integrity": "sha512-CBfU4l/A+KruSUoW+vTQthwcAdwuqbpRNB8HQKlZABwHRhsdHZ9fezp4Sn18PeAlYxTNiLMlx4xUBV3AWfg1BA==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.8.tgz", + "integrity": "sha512-adNTUpDCVnmAE58VEqKlAA6ZBlNkMnWD0ZcW76lyNFN3MJniyGFZfNwERVk8Ap56MCnXztmDr19T4mPTztcuaw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -2181,12 +2131,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.1.tgz", - "integrity": "sha512-RlkVIcWT4TLI96zM660S877E7beKlQw7Ig+wqkKBiWfj0zH5Q4h50q6er4wzZKRNSYpfo6ILJ+hrJAGSX2qcNw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz", + "integrity": "sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2196,13 +2146,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.1.tgz", - "integrity": "sha512-2A/94wgZgxfTsiLaQ2E36XAOdcZmGAaEEgVmxQWwZXWkGhvoHbaqXcKnU8zny4ycpu3vNqg0L/PcCiYtHtA13g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz", + "integrity": "sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2357,18 +2307,15 @@ } }, "node_modules/@babel/traverse": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", - "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", - "dependencies": { - "@babel/code-frame": "^7.24.1", - "@babel/generator": "^7.24.1", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.24.1", - "@babel/types": "^7.24.0", + "version": "7.25.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.3.tgz", + "integrity": "sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ==", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.3", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.2", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -2377,11 +2324,11 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/generator": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.4.tgz", - "integrity": "sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", + "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", "dependencies": { - "@babel/types": "^7.24.0", + "@babel/types": "^7.25.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" @@ -2390,6 +2337,19 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/@babel/template": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/traverse/node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -2404,12 +2364,12 @@ } }, "node_modules/@babel/types": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", - "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", + "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -2885,6 +2845,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "deprecated": "Use @eslint/config-array instead", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.0", @@ -2921,6 +2882,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "deprecated": "Use @eslint/object-schema instead", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { @@ -3001,9 +2963,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", @@ -3274,9 +3236,9 @@ } }, "node_modules/@socket.io/component-emitter": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.1.tgz", - "integrity": "sha512-dzJtaDAAoXx4GCOJpbB2eG/Qj8VDpdwkLsWGzGm+0L7E8/434RyMbAHmk9ubXWVAb9nXmc44jUf8GKqVDiKezg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", "dev": true }, "node_modules/@tootallnate/once": { @@ -3342,9 +3304,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.56.8", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.8.tgz", - "integrity": "sha512-LdDdQVDzDXf3ijhhMnE27C5vc0QEknD8GiMR/Hi+fVbdZNfAfCy2j69m0LjUd2MAy0+kIgnOtd5ndTmDk/VWCA==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.0.tgz", + "integrity": "sha512-gi6WQJ7cHRgZxtkQEoyHMppPjq9Kxo5Tjn2prSKDSmZrCz8TZ3jSRCeTJm+WoM+oB0WG37bRqLzaaU3q7JypGg==", "dev": true, "dependencies": { "@types/estree": "*", @@ -3380,9 +3342,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.0.tgz", - "integrity": "sha512-bGyep3JqPCRry1wq+O5n7oiBgGWmeIJXPjXXCo8EK0u8duZGSYar7cGqd3ML2JUsLGeB7fmc06KYo9fLGWqPvQ==", + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", + "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", "dev": true, "dependencies": { "@types/node": "*", @@ -3404,9 +3366,9 @@ "dev": true }, "node_modules/@types/http-proxy": { - "version": "1.17.14", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.14.tgz", - "integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==", + "version": "1.17.15", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz", + "integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==", "dev": true, "dependencies": { "@types/node": "*" @@ -3444,9 +3406,9 @@ } }, "node_modules/@types/leaflet": { - "version": "1.9.8", - "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.8.tgz", - "integrity": "sha512-EXdsL4EhoUtGm2GC2ZYtXn+Fzc6pluVgagvo2VC1RHWToLGlTRwVYoDpqS/7QXa01rmDyBjJk3Catpf60VMkwg==", + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.12.tgz", + "integrity": "sha512-BK7XS+NyRI291HIo0HCfE18Lp8oA30H1gpi1tf0mF3TgiCEzanQjOqNZ4x126SXzzi2oNSZhZ5axJp1k0iM6jg==", "dev": true, "dependencies": { "@types/geojson": "*" @@ -3521,9 +3483,9 @@ "dev": true }, "node_modules/@types/qs": { - "version": "6.9.14", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", - "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==", + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", "dev": true }, "node_modules/@types/range-parser": { @@ -3584,9 +3546,9 @@ } }, "node_modules/@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", "dev": true, "dependencies": { "@types/node": "*" @@ -3831,12 +3793,12 @@ } }, "node_modules/adm-zip": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.12.tgz", - "integrity": "sha512-6TVU49mK6KZb4qG6xWaaM4C7sA/sgUMLy/JYMOzkcp3BvVLpW0fXDFQiIzAuxFCt/2+xD7fNIiPFAoLZPhVNLQ==", + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.15.tgz", + "integrity": "sha512-jYPWSeOA8EFoZnucrKCNihqBjoEGQSU4HKgHYQgKNEQ0pQF9a/DYuo/+fAxY76k4qe75LUlLWpAM1QWcBMTOKw==", "dev": true, "engines": { - "node": ">=6.0" + "node": ">=12.0" } }, "node_modules/agent-base": { @@ -4017,6 +3979,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { "delegates": "^1.0.0", @@ -4131,9 +4094,9 @@ "dev": true }, "node_modules/autoprefixer": { - "version": "10.4.19", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", - "integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==", + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", "dev": true, "funding": [ { @@ -4150,11 +4113,11 @@ } ], "dependencies": { - "browserslist": "^4.23.0", - "caniuse-lite": "^1.0.30001599", + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "postcss-value-parser": "^4.2.0" }, "bin": { @@ -4177,9 +4140,9 @@ } }, "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.1.tgz", + "integrity": "sha512-u5w79Rd7SU4JaIlA/zFqG+gOiuq25q5VLyZ8E+ijJeILuTxVzZgp2CaGw/UTw6pXYN9XMO9yiqj/nEHmhTG5CA==", "dev": true }, "node_modules/axobject-query": { @@ -4459,20 +4422,20 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" } }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "funding": [ { "type": "opencollective", @@ -4488,10 +4451,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -4675,9 +4638,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001608", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001608.tgz", - "integrity": "sha512-cjUJTQkk9fQlJR2s4HMuPMvTiRggl0rAVMtthQuyOlDWuqHXqN8azLq+pi8B2TjwKJ32diHjUqRIKeFX4z1FoA==", + "version": "1.0.30001651", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", + "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", "funding": [ { "type": "opencollective", @@ -4756,9 +4719,9 @@ } }, "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, "engines": { "node": ">=6.0" @@ -5175,12 +5138,12 @@ } }, "node_modules/core-js-compat": { - "version": "3.36.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.36.1.tgz", - "integrity": "sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA==", + "version": "3.38.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", + "integrity": "sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==", "dev": true, "dependencies": { - "browserslist": "^4.23.0" + "browserslist": "^4.23.3" }, "funding": { "type": "opencollective", @@ -5630,6 +5593,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -5679,6 +5643,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "dependencies": { "glob": "^7.1.3" @@ -5875,9 +5840,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.733", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.733.tgz", - "integrity": "sha512-gUI9nhI2iBGF0OaYYLKOaOtliFMl+Bt1rY7VmEjwxOxqoYLub/D9xmduPEhbw2imE6gYkJKhIE5it+KE2ulVxQ==" + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz", + "integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -5926,9 +5891,9 @@ } }, "node_modules/engine.io": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.4.tgz", - "integrity": "sha512-KdVSDKhVKyOi+r5uEabrDLZw2qXStVvCsEB/LN3mw4WFi6Gx50jTyuxYVCwAAC0U46FdnzP/ScKRBTXb/NiEOg==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", + "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", "dev": true, "dependencies": { "@types/cookie": "^0.4.1", @@ -5940,25 +5905,25 @@ "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", - "ws": "~8.11.0" + "ws": "~8.17.1" }, "engines": { "node": ">=10.2.0" } }, "node_modules/engine.io-parser": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz", - "integrity": "sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", "dev": true, "engines": { "node": ">=10.0.0" } }, "node_modules/enhanced-resolve": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", - "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -5982,10 +5947,16 @@ } }, "node_modules/ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==", - "dev": true + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.1.tgz", + "integrity": "sha512-QHuXVeZx9d+tIQAz/XztU0ZwZf2Agg9CcXcgE1rurqvdBeDBrpSwjl8/6XUqMg7tw2Y7uAdKb2sRv+bSEFqQ5A==", + "dev": true, + "dependencies": { + "punycode": "^1.4.1" + }, + "engines": { + "node": ">= 0.4" + } }, "node_modules/entities": { "version": "2.2.0", @@ -6767,9 +6738,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -7110,9 +7081,9 @@ "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -7316,9 +7287,9 @@ } }, "node_modules/fs-monkey": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz", - "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.6.tgz", + "integrity": "sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg==", "dev": true }, "node_modules/fs.realpath": { @@ -7357,6 +7328,7 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -7441,6 +7413,7 @@ "version": "8.0.3", "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7500,9 +7473,9 @@ } }, "node_modules/globby/node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "engines": { "node": ">= 4" @@ -7992,9 +7965,9 @@ "dev": true }, "node_modules/immutable": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.5.tgz", - "integrity": "sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", "dev": true }, "node_modules/import-fresh": { @@ -8050,6 +8023,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -8188,9 +8162,9 @@ } }, "node_modules/ipaddr.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", - "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", + "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", "dev": true, "engines": { "node": ">= 10" @@ -8214,11 +8188,14 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", + "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8547,6 +8524,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -8610,6 +8588,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "dependencies": { "glob": "^7.1.3" @@ -8692,6 +8671,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -8941,9 +8921,9 @@ "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" }, "node_modules/karma": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.3.tgz", - "integrity": "sha512-LuucC/RE92tJ8mlCwqEoRWXP38UMAqpnq98vktmS9SznSoUPPUJQbc91dHcxcunROvfQjdORVA/YFviH+Xci9Q==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz", + "integrity": "sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==", "dev": true, "dependencies": { "@colors/colors": "1.5.0", @@ -9086,6 +9066,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -9145,9 +9126,9 @@ } }, "node_modules/karma/node_modules/ua-parser-js": { - "version": "0.7.37", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.37.tgz", - "integrity": "sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA==", + "version": "0.7.38", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.38.tgz", + "integrity": "sha512-fYmIy7fKTSFAhG3fuPlubeGaMoAd6r0rSnfEsO5nEY55i26KSLt9EH7PLQiiqPUhNqYIJvSkTy1oArIcXAbPbA==", "dev": true, "funding": [ { @@ -9235,9 +9216,9 @@ } }, "node_modules/leaflet.fullscreen": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/leaflet.fullscreen/-/leaflet.fullscreen-3.0.1.tgz", - "integrity": "sha512-Lsg49e4AYSjHOhmy+VOm4+O6Urim2UvthydKJI3KzfwC3InYkfvJtv1mWuOb9K7qG4H2MtEut09Dz6noQyJARQ==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/leaflet.fullscreen/-/leaflet.fullscreen-3.0.2.tgz", + "integrity": "sha512-m27waFVmwdrLGXjZw2L8b7w/W28EY+u7IGzK2x8K99XaPuzKbjI+/H1j0OMawLcRPZyDRh+39XpyLsvDwHUEoA==" }, "node_modules/leaflet.markercluster": { "version": "1.5.3", @@ -9694,12 +9675,12 @@ "integrity": "sha512-awNbTOqCxK1DBGjalK3xqWIstBZgN6fxsMSiXLs9/spqWkF2pAhb2rrYCFSsr1/tT7PhcDGjZndG8SWYn0byYA==" }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -9865,9 +9846,9 @@ } }, "node_modules/minipass-json-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", - "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.2.tgz", + "integrity": "sha512-myxeeTm57lYs8pH2nxPzmEEg8DGIgW+9mv6D4JZD2pa81I/OBjeU7PtICXV6c9eRGTA5JMDsuIPUZRCyBMYNhg==", "dev": true, "dependencies": { "jsonparse": "^1.3.1", @@ -10164,9 +10145,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz", - "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", "dev": true, "optional": true, "bin": { @@ -10189,6 +10170,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -10218,9 +10200,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==" }, "node_modules/nopt": { "version": "6.0.0", @@ -10399,6 +10381,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { "are-we-there-yet": "^3.0.0", @@ -10441,10 +10424,13 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10517,17 +10503,17 @@ } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -10913,9 +10899,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -10995,9 +10981,9 @@ } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "dev": true, "funding": [ { @@ -11015,7 +11001,7 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "source-map-js": "^1.2.0" }, "engines": { @@ -11653,9 +11639,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", - "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dev": true, "dependencies": { "cssesc": "^3.0.0", @@ -11732,9 +11718,9 @@ } }, "node_modules/proj4": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/proj4/-/proj4-2.11.0.tgz", - "integrity": "sha512-SasuTkAx8HnWQHfIyhkdUNJorSJqINHAN3EyMWYiQRVorftz9DHz650YraFgczwgtHOxqnfuDxSNv3C8MUnHeg==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/proj4/-/proj4-2.12.0.tgz", + "integrity": "sha512-cQJxcVX7+fmAhOxoazKgk76GkGYQ5HcLod4rdy2MizhPvLdrZQJThxsHoz/TjjdxUvTm/rbozMgE0q9mdXKWIw==", "dependencies": { "mgrs": "1.0.0", "wkt-parser": "^1.3.3" @@ -11896,6 +11882,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -12090,18 +12077,16 @@ "dev": true }, "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true }, "node_modules/q": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", "integrity": "sha512-/CdEdaw49VZVmyIDGUQKDDT53c7qBkO6g5CefWz91Ae+l4+cRtcDYwMTXh6me4O8TMldeGHG3N2Bl84V78Ywbg==", + "deprecated": "You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.\n\n(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)", "dev": true, "engines": { "node": ">=0.6.0", @@ -12204,6 +12189,7 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.2.tgz", "integrity": "sha512-BSzugrt4kQ/Z0krro8zhTwV1Kd79ue25IhNN/VtHFy1mG/6Tluyi+msc0UpwaoQzxSHa28mntAjIZY6kEgfR9Q==", + "deprecated": "This package is no longer supported. Please use @npmcli/package-json instead.", "dev": true, "dependencies": { "glob": "^8.0.1", @@ -12533,15 +12519,16 @@ } }, "node_modules/rfdc": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", - "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "dev": true }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "dependencies": { "glob": "^7.1.3" @@ -12567,6 +12554,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -12771,9 +12759,9 @@ } }, "node_modules/sax": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", - "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", "dev": true }, "node_modules/schema-utils": { @@ -12860,6 +12848,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -12892,6 +12881,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "dependencies": { "glob": "^7.1.3" @@ -13315,13 +13305,13 @@ } }, "node_modules/socket.io-adapter": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.4.tgz", - "integrity": "sha512-wDNHGXGewWAjQPt3pyeYBtpWSq9cLE5UW1ZUPL/2eGK9jtse/FpXib7epSTsz0Q0m+6sg6Y4KtcFTlah1bdOVg==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", "dev": true, "dependencies": { "debug": "~4.3.4", - "ws": "~8.11.0" + "ws": "~8.17.1" } }, "node_modules/socket.io-parser": { @@ -13479,9 +13469,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", - "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", "dev": true }, "node_modules/spdy": { @@ -13698,6 +13688,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -13873,9 +13864,9 @@ } }, "node_modules/terser-webpack-plugin/node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -13934,9 +13925,9 @@ } }, "node_modules/terser-webpack-plugin/node_modules/terser": { - "version": "5.30.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.3.tgz", - "integrity": "sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -13952,9 +13943,9 @@ } }, "node_modules/terser/node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -13991,6 +13982,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -14078,9 +14070,9 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "dev": true, "dependencies": { "psl": "^1.1.33", @@ -14092,6 +14084,15 @@ "node": ">=6" } }, + "node_modules/tough-cookie/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/tough-cookie/node_modules/universalify": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", @@ -14133,9 +14134,9 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "node_modules/tslint": { "version": "6.1.3", @@ -14202,6 +14203,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -14342,9 +14344,9 @@ } }, "node_modules/ua-parser-js": { - "version": "1.0.37", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.37.tgz", - "integrity": "sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==", + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.38.tgz", + "integrity": "sha512-Aq5ppTOfvrCMgAPneW1HfWj66Xi7XL+/mIy996R1/CLS/rcyJQm6QZdsKrUeivDFQ+Oc9Wyuwor8Ze8peEoUoQ==", "funding": [ { "type": "opencollective", @@ -14440,9 +14442,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "funding": [ { "type": "opencollective", @@ -14458,8 +14460,8 @@ } ], "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -14477,6 +14479,15 @@ "punycode": "^2.1.0" } }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -14572,9 +14583,9 @@ } }, "node_modules/watchpack": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", - "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "dependencies": { "glob-to-regexp": "^0.4.1", @@ -14688,6 +14699,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -14726,6 +14738,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "dependencies": { "glob": "^7.1.3" @@ -14971,9 +14984,9 @@ } }, "node_modules/webpack/node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -15104,6 +15117,15 @@ "resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.3.3.tgz", "integrity": "sha512-ZnV3yH8/k58ZPACOXeiHaMuXIiaTk1t0hSUVisbO0t4RjA5wPpUytcxeyiN2h+LZRrmuHIh/1UlrR9e7DHDvTw==" }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -15156,16 +15178,16 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -15264,16 +15286,10 @@ } }, "dependencies": { - "@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true - }, "@adobe/css-tools": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz", - "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.0.tgz", + "integrity": "sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==", "dev": true }, "@ampproject/remapping": { @@ -15598,18 +15614,18 @@ } }, "@babel/code-frame": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", - "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "requires": { - "@babel/highlight": "^7.24.2", + "@babel/highlight": "^7.24.7", "picocolors": "^1.0.0" } }, "@babel/compat-data": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.4.tgz", - "integrity": "sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ==" + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.2.tgz", + "integrity": "sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==" }, "@babel/core": { "version": "7.18.10", @@ -15672,22 +15688,23 @@ } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz", - "integrity": "sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz", + "integrity": "sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==", "dev": true, "requires": { - "@babel/types": "^7.22.15" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/helper-compilation-targets": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", - "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", + "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", "requires": { - "@babel/compat-data": "^7.23.5", - "@babel/helper-validator-option": "^7.23.5", - "browserslist": "^4.22.2", + "@babel/compat-data": "^7.25.2", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -15700,29 +15717,27 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.4.tgz", - "integrity": "sha512-lG75yeuUSVu0pIcbhiYMXBXANHrpUPaOfu7ryAzskCgKUHuAxRQI5ssrtmF0X9UXldPlvT0XM/A4F44OXRt6iQ==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-member-expression-to-functions": "^7.23.0", - "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/helper-replace-supers": "^7.24.1", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.0.tgz", + "integrity": "sha512-GYM6BxeQsETc9mnct+nIIpf63SAyzvyYN7UB/IlTyd+MBg06afFGp0mIeUqGyWgS2mxad6vqbMrHVlaL3m70sQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/traverse": "^7.25.0", "semver": "^6.3.1" }, "dependencies": { "@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" } }, "semver": { @@ -15734,23 +15749,23 @@ } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz", - "integrity": "sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.2.tgz", + "integrity": "sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-annotate-as-pure": "^7.24.7", "regexpu-core": "^5.3.1", "semver": "^6.3.1" }, "dependencies": { "@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" } }, "semver": { @@ -15775,236 +15790,208 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==" - }, - "@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", - "requires": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, - "dependencies": { - "@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", - "requires": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" - } - } - } - }, - "@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz", - "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz", + "integrity": "sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==", "dev": true, "requires": { - "@babel/types": "^7.23.0" + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.8" } }, "@babel/helper-module-imports": { - "version": "7.24.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", - "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", "requires": { - "@babel/types": "^7.24.0" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/helper-module-transforms": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", - "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", + "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", "requires": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.20" + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.2" } }, "@babel/helper-optimise-call-expression": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", - "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz", + "integrity": "sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" } }, "@babel/helper-plugin-utils": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", - "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "dev": true }, "@babel/helper-remap-async-to-generator": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz", - "integrity": "sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.0.tgz", + "integrity": "sha512-NhavI2eWEIz/H9dbrG0TuOicDhNexze43i5z7lEqwYm0WEZVTwnPpA0EafUTP7+6/W79HWIP2cTe3Z5NiSTVpw==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-wrap-function": "^7.22.20" + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-wrap-function": "^7.25.0", + "@babel/traverse": "^7.25.0" }, "dependencies": { "@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" } } } }, "@babel/helper-replace-supers": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz", - "integrity": "sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.0.tgz", + "integrity": "sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-member-expression-to-functions": "^7.23.0", - "@babel/helper-optimise-call-expression": "^7.22.5" + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/traverse": "^7.25.0" } }, "@babel/helper-simple-access": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", "requires": { - "@babel/types": "^7.22.5" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", - "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz", + "integrity": "sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==", "dev": true, "requires": { - "@babel/types": "^7.22.5" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", - "requires": { - "@babel/types": "^7.22.5" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, "@babel/helper-string-parser": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", - "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==" + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==" }, "@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==" + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==" }, "@babel/helper-validator-option": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", - "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==" + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==" }, "@babel/helper-wrap-function": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz", - "integrity": "sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.0.tgz", + "integrity": "sha512-s6Q1ebqutSiZnEjaofc/UKDyC4SbzV5n5SrA2Gq8UawLycr3i04f1dX4OzoQVnexm6aOCh37SQNYlJ/8Ku+PMQ==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.22.5", - "@babel/template": "^7.22.15", - "@babel/types": "^7.22.19" + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.0", + "@babel/types": "^7.25.0" }, "dependencies": { "@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, "requires": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" } } } }, "@babel/helpers": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.4.tgz", - "integrity": "sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", + "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", "requires": { - "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.1", - "@babel/types": "^7.24.0" + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.0" }, "dependencies": { "@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "requires": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" } } } }, "@babel/highlight": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", - "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "requires": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" } }, "@babel/parser": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.4.tgz", - "integrity": "sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==" + "version": "7.25.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz", + "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==", + "requires": { + "@babel/types": "^7.25.2" + } }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.1.tgz", - "integrity": "sha512-y4HqEnkelJIOQGd+3g1bTeKsA5c6qM7eOn7VggGVbBc0y8MLSKHacwcIE2PplNlQSj0PqS9rrXL/nkPVK+kUNg==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.0.tgz", + "integrity": "sha512-lXwdNZtTmeVOOFtwM/WDe7yg1PL8sYhRk/XH0FzbR2HDQ0xC+EnQ/JHeoMYSavtU115tnUk0q9CDyq8si+LMAA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" } }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.1.tgz", - "integrity": "sha512-Hj791Ii4ci8HqnaKHAlLNs+zaLXb0EzSDhiAWp5VNlyvCNymYfacs64pxTxbH1znW/NcArSmwpmG9IKE/TUVVQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz", + "integrity": "sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/plugin-transform-optional-chaining": "^7.24.1" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7" } }, "@babel/plugin-proposal-async-generator-functions": { @@ -16212,12 +16199,12 @@ } }, "@babel/plugin-syntax-import-assertions": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.1.tgz", - "integrity": "sha512-IuwnI5XnuF189t91XbxmXeCDz3qs6iDRO7GJ++wcfgeXNs/8FmIlKcpDSXNVyuLQxlwvskmI3Ct73wUODkJBlQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", + "integrity": "sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-syntax-json-strings": { @@ -16302,12 +16289,12 @@ } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.1.tgz", - "integrity": "sha512-ngT/3NkRhsaep9ck9uj2Xhv9+xB1zShY3tM3g6om4xxCELwCDN4g4Aq5dRn48+0hasAql7s2hdBOysCfNpr4fw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz", + "integrity": "sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-async-to-generator": { @@ -16322,268 +16309,266 @@ } }, "@babel/plugin-transform-block-scoped-functions": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.1.tgz", - "integrity": "sha512-TWWC18OShZutrv9C6mye1xwtam+uNi2bnTOCBUd5sZxyHOiWbU6ztSROofIMrK84uweEZC219POICK/sTYwfgg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz", + "integrity": "sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-block-scoping": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.4.tgz", - "integrity": "sha512-nIFUZIpGKDf9O9ttyRXpHFpKC+X3Y5mtshZONuEUYBomAKoM4y029Jr+uB1bHGPhNmK8YXHevDtKDOLmtRrp6g==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.0.tgz", + "integrity": "sha512-yBQjYoOjXlFv9nlXb3f1casSHOZkWr29NX+zChVanLg5Nc157CrbEX9D7hxxtTpuFy7Q0YzmmWfJxzvps4kXrQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" } }, "@babel/plugin-transform-classes": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.1.tgz", - "integrity": "sha512-ZTIe3W7UejJd3/3R4p7ScyyOoafetUShSf4kCqV0O7F/RiHxVj/wRaRnQlrGwflvcehNA8M42HkAiEDYZu2F1Q==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-replace-supers": "^7.24.1", - "@babel/helper-split-export-declaration": "^7.22.6", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.0.tgz", + "integrity": "sha512-xyi6qjr/fYU304fiRwFbekzkqVJZ6A7hOjWZd+89FVcBqPV3S9Wuozz82xdpLspckeaafntbzglaW4pqpzvtSw==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/traverse": "^7.25.0", "globals": "^11.1.0" }, "dependencies": { "@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.7" } } } }, "@babel/plugin-transform-computed-properties": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.1.tgz", - "integrity": "sha512-5pJGVIUfJpOS+pAqBQd+QMaTD2vCL/HcePooON6pDpHgRp4gNRmzyHTPIkXntwKsq3ayUFVfJaIKPw2pOkOcTw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz", + "integrity": "sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/template": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/template": "^7.24.7" }, "dependencies": { "@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, "requires": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" } } } }, "@babel/plugin-transform-destructuring": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.1.tgz", - "integrity": "sha512-ow8jciWqNxR3RYbSNVuF4U2Jx130nwnBnhRw6N6h1bOejNkABmcI5X5oz29K4alWX7vf1C+o6gtKXikzRKkVdw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.8.tgz", + "integrity": "sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.1.tgz", - "integrity": "sha512-p7uUxgSoZwZ2lPNMzUkqCts3xlp8n+o05ikjy7gbtFJSt9gdU88jAmtfmOxHM14noQXBxfgzf2yRWECiNVhTCw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz", + "integrity": "sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-duplicate-keys": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.1.tgz", - "integrity": "sha512-msyzuUnvsjsaSaocV6L7ErfNsa5nDWL1XKNnDePLgmz+WdU4w/J8+AxBMrWfi9m4IxfL5sZQKUPQKDQeeAT6lA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz", + "integrity": "sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-exponentiation-operator": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.1.tgz", - "integrity": "sha512-U1yX13dVBSwS23DEAqU+Z/PkwE9/m7QQy8Y9/+Tdb8UWYaGNDYwTLi19wqIAiROr8sXVum9A/rtiH5H0boUcTw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz", + "integrity": "sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==", "dev": true, "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.15", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-for-of": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.1.tgz", - "integrity": "sha512-OxBdcnF04bpdQdR3i4giHZNZQn7cm8RQKcSwA17wAAqEELo1ZOwp5FFgeptWUQXFyT9kwHo10aqqauYkRZPCAg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz", + "integrity": "sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" } }, "@babel/plugin-transform-function-name": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.1.tgz", - "integrity": "sha512-BXmDZpPlh7jwicKArQASrj8n22/w6iymRnvHYYd2zO30DbE277JO20/7yXJT3QxDPtiQiOxQBbZH4TpivNXIxA==", + "version": "7.25.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.1.tgz", + "integrity": "sha512-TVVJVdW9RKMNgJJlLtHsKDTydjZAbwIsn6ySBPQaEAUU5+gVvlJt/9nRmqVbsV/IBanRjzWoaAQKLoamWVOUuA==", "dev": true, "requires": { - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.1" } }, "@babel/plugin-transform-literals": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.1.tgz", - "integrity": "sha512-zn9pwz8U7nCqOYIiBaOxoQOtYmMODXTJnkxG4AtX8fPmnCRYWBOHD0qcpwS9e2VDSp1zNJYpdnFMIKb8jmwu6g==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.2.tgz", + "integrity": "sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" } }, "@babel/plugin-transform-member-expression-literals": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.1.tgz", - "integrity": "sha512-4ojai0KysTWXzHseJKa1XPNXKRbuUrhkOPY4rEGeR+7ChlJVKxFa3H3Bz+7tWaGKgJAXUWKOGmltN+u9B3+CVg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz", + "integrity": "sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-modules-amd": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.1.tgz", - "integrity": "sha512-lAxNHi4HVtjnHd5Rxg3D5t99Xm6H7b04hUS7EHIXcUl2EV4yl1gWdqZrNzXnSrHveL9qMdbODlLF55mvgjAfaQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz", + "integrity": "sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.1.tgz", - "integrity": "sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz", + "integrity": "sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-simple-access": "^7.22.5" + "@babel/helper-module-transforms": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-simple-access": "^7.24.7" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.1.tgz", - "integrity": "sha512-mqQ3Zh9vFO1Tpmlt8QPnbwGHzNz3lpNEMxQb1kAemn/erstyqw1r9KeOlOfo3y6xAnFEcOv2tSyrXfmMk+/YZA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.0.tgz", + "integrity": "sha512-YPJfjQPDXxyQWg/0+jHKj1llnY5f/R6a0p/vP4lPymxLu7Lvl4k2WMitqi08yxwQcCVUUdG9LCUj4TNEgAp3Jw==", "dev": true, "requires": { - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-validator-identifier": "^7.22.20" + "@babel/helper-module-transforms": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.0" } }, "@babel/plugin-transform-modules-umd": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.1.tgz", - "integrity": "sha512-tuA3lpPj+5ITfcCluy6nWonSL7RvaG0AOTeAuvXqEKS34lnLzXpDb0dcP6K8jD0zWZFNDVly90AGFJPnm4fOYg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz", + "integrity": "sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", - "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz", + "integrity": "sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-new-target": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.1.tgz", - "integrity": "sha512-/rurytBM34hYy0HKZQyA0nHbQgQNFm4Q/BOc9Hflxi2X3twRof7NaE5W46j4kQitm7SvACVRXsa6N/tSZxvPug==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz", + "integrity": "sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-object-super": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.1.tgz", - "integrity": "sha512-oKJqR3TeI5hSLRxudMjFQ9re9fBVUU0GICqM3J1mi8MqlhVr6hC/ZN4ttAyMuQR6EZZIY6h/exe5swqGNNIkWQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz", + "integrity": "sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-replace-supers": "^7.24.1" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7" } }, "@babel/plugin-transform-optional-chaining": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.1.tgz", - "integrity": "sha512-n03wmDt+987qXwAgcBlnUUivrZBPZ8z1plL0YvgQalLm+ZE5BMhGm94jhxXtA1wzv1Cu2aaOv1BM9vbVttrzSg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.8.tgz", + "integrity": "sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", "@babel/plugin-syntax-optional-chaining": "^7.8.3" } }, "@babel/plugin-transform-parameters": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.1.tgz", - "integrity": "sha512-8Jl6V24g+Uw5OGPeWNKrKqXPDw2YDjLc53ojwfMcKwlEoETKU9rU0mHUtcg9JntWI/QYzGAXNWEcVHZ+fR+XXg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz", + "integrity": "sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-property-literals": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.1.tgz", - "integrity": "sha512-LetvD7CrHmEx0G442gOomRr66d7q8HzzGGr4PMHGr+5YIm6++Yke+jxj246rpvsbyhJwCLxcTn6zW1P1BSenqA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz", + "integrity": "sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-regenerator": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.1.tgz", - "integrity": "sha512-sJwZBCzIBE4t+5Q4IGLaaun5ExVMRY0lYwos/jNecjMrVCygCdph3IKv0tkP5Fc87e/1+bebAmEAGBfnRD+cnw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz", + "integrity": "sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0", + "@babel/helper-plugin-utils": "^7.24.7", "regenerator-transform": "^0.15.2" } }, "@babel/plugin-transform-reserved-words": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.1.tgz", - "integrity": "sha512-JAclqStUfIwKN15HrsQADFgeZt+wexNQ0uLhuqvqAUFoqPMjEcFCYZBhq0LUdz6dZK/mD+rErhW71fbx8RYElg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz", + "integrity": "sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-runtime": { @@ -16609,68 +16594,68 @@ } }, "@babel/plugin-transform-shorthand-properties": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.1.tgz", - "integrity": "sha512-LyjVB1nsJ6gTTUKRjRWx9C1s9hE7dLfP/knKdrfeH9UPtAGjYGgxIbFfx7xyLIEWs7Xe1Gnf8EWiUqfjLhInZA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz", + "integrity": "sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-spread": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.1.tgz", - "integrity": "sha512-KjmcIM+fxgY+KxPVbjelJC6hrH1CgtPmTvdXAfn3/a9CnWGSTY7nH4zm5+cjmWJybdcPSsD0++QssDsjcpe47g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz", + "integrity": "sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" } }, "@babel/plugin-transform-sticky-regex": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.1.tgz", - "integrity": "sha512-9v0f1bRXgPVcPrngOQvLXeGNNVLc8UjMVfebo9ka0WF3/7+aVUHmaJVT3sa0XCzEFioPfPHZiOcYG9qOsH63cw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz", + "integrity": "sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-template-literals": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.1.tgz", - "integrity": "sha512-WRkhROsNzriarqECASCNu/nojeXCDTE/F2HmRgOzi7NGvyfYGq1NEjKBK3ckLfRgGc6/lPAqP0vDOSw3YtG34g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz", + "integrity": "sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-typeof-symbol": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.1.tgz", - "integrity": "sha512-CBfU4l/A+KruSUoW+vTQthwcAdwuqbpRNB8HQKlZABwHRhsdHZ9fezp4Sn18PeAlYxTNiLMlx4xUBV3AWfg1BA==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.8.tgz", + "integrity": "sha512-adNTUpDCVnmAE58VEqKlAA6ZBlNkMnWD0ZcW76lyNFN3MJniyGFZfNwERVk8Ap56MCnXztmDr19T4mPTztcuaw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.8" } }, "@babel/plugin-transform-unicode-escapes": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.1.tgz", - "integrity": "sha512-RlkVIcWT4TLI96zM660S877E7beKlQw7Ig+wqkKBiWfj0zH5Q4h50q6er4wzZKRNSYpfo6ILJ+hrJAGSX2qcNw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz", + "integrity": "sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.1.tgz", - "integrity": "sha512-2A/94wgZgxfTsiLaQ2E36XAOdcZmGAaEEgVmxQWwZXWkGhvoHbaqXcKnU8zny4ycpu3vNqg0L/PcCiYtHtA13g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz", + "integrity": "sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.24.0" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, "@babel/preset-env": { @@ -16803,33 +16788,40 @@ } }, "@babel/traverse": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", - "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", - "requires": { - "@babel/code-frame": "^7.24.1", - "@babel/generator": "^7.24.1", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.24.1", - "@babel/types": "^7.24.0", + "version": "7.25.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.3.tgz", + "integrity": "sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ==", + "requires": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.3", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.2", "debug": "^4.3.1", "globals": "^11.1.0" }, "dependencies": { "@babel/generator": { - "version": "7.24.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.4.tgz", - "integrity": "sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", + "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", "requires": { - "@babel/types": "^7.24.0", + "@babel/types": "^7.25.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" } }, + "@babel/template": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "requires": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" + } + }, "@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -16843,12 +16835,12 @@ } }, "@babel/types": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", - "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", + "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", "requires": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" } }, @@ -17218,9 +17210,9 @@ } }, "@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" }, "@jridgewell/trace-mapping": { "version": "0.3.25", @@ -17413,9 +17405,9 @@ } }, "@socket.io/component-emitter": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.1.tgz", - "integrity": "sha512-dzJtaDAAoXx4GCOJpbB2eG/Qj8VDpdwkLsWGzGm+0L7E8/434RyMbAHmk9ubXWVAb9nXmc44jUf8GKqVDiKezg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", "dev": true }, "@tootallnate/once": { @@ -17478,9 +17470,9 @@ } }, "@types/eslint": { - "version": "8.56.8", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.8.tgz", - "integrity": "sha512-LdDdQVDzDXf3ijhhMnE27C5vc0QEknD8GiMR/Hi+fVbdZNfAfCy2j69m0LjUd2MAy0+kIgnOtd5ndTmDk/VWCA==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.0.tgz", + "integrity": "sha512-gi6WQJ7cHRgZxtkQEoyHMppPjq9Kxo5Tjn2prSKDSmZrCz8TZ3jSRCeTJm+WoM+oB0WG37bRqLzaaU3q7JypGg==", "dev": true, "requires": { "@types/estree": "*", @@ -17516,9 +17508,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.0.tgz", - "integrity": "sha512-bGyep3JqPCRry1wq+O5n7oiBgGWmeIJXPjXXCo8EK0u8duZGSYar7cGqd3ML2JUsLGeB7fmc06KYo9fLGWqPvQ==", + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", + "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", "dev": true, "requires": { "@types/node": "*", @@ -17540,9 +17532,9 @@ "dev": true }, "@types/http-proxy": { - "version": "1.17.14", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.14.tgz", - "integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==", + "version": "1.17.15", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz", + "integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==", "dev": true, "requires": { "@types/node": "*" @@ -17579,9 +17571,9 @@ } }, "@types/leaflet": { - "version": "1.9.8", - "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.8.tgz", - "integrity": "sha512-EXdsL4EhoUtGm2GC2ZYtXn+Fzc6pluVgagvo2VC1RHWToLGlTRwVYoDpqS/7QXa01rmDyBjJk3Catpf60VMkwg==", + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.12.tgz", + "integrity": "sha512-BK7XS+NyRI291HIo0HCfE18Lp8oA30H1gpi1tf0mF3TgiCEzanQjOqNZ4x126SXzzi2oNSZhZ5axJp1k0iM6jg==", "dev": true, "requires": { "@types/geojson": "*" @@ -17656,9 +17648,9 @@ "dev": true }, "@types/qs": { - "version": "6.9.14", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", - "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==", + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", "dev": true }, "@types/range-parser": { @@ -17719,9 +17711,9 @@ } }, "@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", "dev": true, "requires": { "@types/node": "*" @@ -17950,9 +17942,9 @@ } }, "adm-zip": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.12.tgz", - "integrity": "sha512-6TVU49mK6KZb4qG6xWaaM4C7sA/sgUMLy/JYMOzkcp3BvVLpW0fXDFQiIzAuxFCt/2+xD7fNIiPFAoLZPhVNLQ==", + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.15.tgz", + "integrity": "sha512-jYPWSeOA8EFoZnucrKCNihqBjoEGQSU4HKgHYQgKNEQ0pQF9a/DYuo/+fAxY76k4qe75LUlLWpAM1QWcBMTOKw==", "dev": true }, "agent-base": { @@ -18180,16 +18172,16 @@ "dev": true }, "autoprefixer": { - "version": "10.4.19", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", - "integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==", + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", "dev": true, "requires": { - "browserslist": "^4.23.0", - "caniuse-lite": "^1.0.30001599", + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "postcss-value-parser": "^4.2.0" } }, @@ -18200,9 +18192,9 @@ "dev": true }, "aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.1.tgz", + "integrity": "sha512-u5w79Rd7SU4JaIlA/zFqG+gOiuq25q5VLyZ8E+ijJeILuTxVzZgp2CaGw/UTw6pXYN9XMO9yiqj/nEHmhTG5CA==", "dev": true }, "axobject-query": { @@ -18421,22 +18413,22 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "requires": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" } }, "browserstack": { @@ -18574,9 +18566,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001608", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001608.tgz", - "integrity": "sha512-cjUJTQkk9fQlJR2s4HMuPMvTiRggl0rAVMtthQuyOlDWuqHXqN8azLq+pi8B2TjwKJ32diHjUqRIKeFX4z1FoA==" + "version": "1.0.30001651", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", + "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==" }, "caseless": { "version": "0.12.0", @@ -18627,9 +18619,9 @@ "dev": true }, "chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true }, "clean-stack": { @@ -18964,12 +18956,12 @@ } }, "core-js-compat": { - "version": "3.36.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.36.1.tgz", - "integrity": "sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA==", + "version": "3.38.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", + "integrity": "sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==", "dev": true, "requires": { - "browserslist": "^4.23.0" + "browserslist": "^4.23.3" } }, "core-util-is": { @@ -19482,9 +19474,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.733", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.733.tgz", - "integrity": "sha512-gUI9nhI2iBGF0OaYYLKOaOtliFMl+Bt1rY7VmEjwxOxqoYLub/D9xmduPEhbw2imE6gYkJKhIE5it+KE2ulVxQ==" + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz", + "integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==" }, "emoji-regex": { "version": "8.0.0", @@ -19526,9 +19518,9 @@ } }, "engine.io": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.4.tgz", - "integrity": "sha512-KdVSDKhVKyOi+r5uEabrDLZw2qXStVvCsEB/LN3mw4WFi6Gx50jTyuxYVCwAAC0U46FdnzP/ScKRBTXb/NiEOg==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", + "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", "dev": true, "requires": { "@types/cookie": "^0.4.1", @@ -19540,19 +19532,19 @@ "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", - "ws": "~8.11.0" + "ws": "~8.17.1" } }, "engine.io-parser": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz", - "integrity": "sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", "dev": true }, "enhanced-resolve": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", - "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -19570,10 +19562,13 @@ } }, "ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==", - "dev": true + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.1.tgz", + "integrity": "sha512-QHuXVeZx9d+tIQAz/XztU0ZwZf2Agg9CcXcgE1rurqvdBeDBrpSwjl8/6XUqMg7tw2Y7uAdKb2sRv+bSEFqQ5A==", + "dev": true, + "requires": { + "punycode": "^1.4.1" + } }, "entities": { "version": "2.2.0", @@ -20064,9 +20059,9 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -20347,9 +20342,9 @@ "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "requires": { "to-regex-range": "^5.0.1" } @@ -20495,9 +20490,9 @@ } }, "fs-monkey": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz", - "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.6.tgz", + "integrity": "sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg==", "dev": true }, "fs.realpath": { @@ -20627,9 +20622,9 @@ }, "dependencies": { "ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true } } @@ -21004,9 +20999,9 @@ "dev": true }, "immutable": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.5.tgz", - "integrity": "sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", "dev": true }, "import-fresh": { @@ -21159,9 +21154,9 @@ } }, "ipaddr.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", - "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", + "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", "dev": true }, "is-arrayish": { @@ -21179,11 +21174,11 @@ } }, "is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", + "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", "requires": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" } }, "is-docker": { @@ -21744,9 +21739,9 @@ "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" }, "karma": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.3.tgz", - "integrity": "sha512-LuucC/RE92tJ8mlCwqEoRWXP38UMAqpnq98vktmS9SznSoUPPUJQbc91dHcxcunROvfQjdORVA/YFviH+Xci9Q==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz", + "integrity": "sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==", "dev": true, "requires": { "@colors/colors": "1.5.0", @@ -21830,9 +21825,9 @@ "dev": true }, "ua-parser-js": { - "version": "0.7.37", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.37.tgz", - "integrity": "sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA==", + "version": "0.7.38", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.38.tgz", + "integrity": "sha512-fYmIy7fKTSFAhG3fuPlubeGaMoAd6r0rSnfEsO5nEY55i26KSLt9EH7PLQiiqPUhNqYIJvSkTy1oArIcXAbPbA==", "dev": true }, "yargs": { @@ -21972,9 +21967,9 @@ } }, "leaflet.fullscreen": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/leaflet.fullscreen/-/leaflet.fullscreen-3.0.1.tgz", - "integrity": "sha512-Lsg49e4AYSjHOhmy+VOm4+O6Urim2UvthydKJI3KzfwC3InYkfvJtv1mWuOb9K7qG4H2MtEut09Dz6noQyJARQ==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/leaflet.fullscreen/-/leaflet.fullscreen-3.0.2.tgz", + "integrity": "sha512-m27waFVmwdrLGXjZw2L8b7w/W28EY+u7IGzK2x8K99XaPuzKbjI+/H1j0OMawLcRPZyDRh+39XpyLsvDwHUEoA==" }, "leaflet.markercluster": { "version": "1.5.3", @@ -22320,12 +22315,12 @@ "integrity": "sha512-awNbTOqCxK1DBGjalK3xqWIstBZgN6fxsMSiXLs9/spqWkF2pAhb2rrYCFSsr1/tT7PhcDGjZndG8SWYn0byYA==" }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, "requires": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" } }, @@ -22446,9 +22441,9 @@ } }, "minipass-json-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", - "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.2.tgz", + "integrity": "sha512-myxeeTm57lYs8pH2nxPzmEEg8DGIgW+9mv6D4JZD2pa81I/OBjeU7PtICXV6c9eRGTA5JMDsuIPUZRCyBMYNhg==", "dev": true, "requires": { "jsonparse": "^1.3.1", @@ -22706,16 +22701,16 @@ } }, "node-gyp-build": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz", - "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", "dev": true, "optional": true }, "node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==" }, "nopt": { "version": "6.0.0", @@ -22884,9 +22879,9 @@ "dev": true }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true }, "obuf": { @@ -22939,17 +22934,17 @@ } }, "optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "requires": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" } }, "ora": { @@ -23255,9 +23250,9 @@ "dev": true }, "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, "picomatch": { "version": "2.3.1", @@ -23312,13 +23307,13 @@ "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==" }, "postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "dev": true, "requires": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "source-map-js": "^1.2.0" } }, @@ -23677,9 +23672,9 @@ } }, "postcss-selector-parser": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", - "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dev": true, "requires": { "cssesc": "^3.0.0", @@ -23729,9 +23724,9 @@ "dev": true }, "proj4": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/proj4/-/proj4-2.11.0.tgz", - "integrity": "sha512-SasuTkAx8HnWQHfIyhkdUNJorSJqINHAN3EyMWYiQRVorftz9DHz650YraFgczwgtHOxqnfuDxSNv3C8MUnHeg==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/proj4/-/proj4-2.12.0.tgz", + "integrity": "sha512-cQJxcVX7+fmAhOxoazKgk76GkGYQ5HcLod4rdy2MizhPvLdrZQJThxsHoz/TjjdxUvTm/rbozMgE0q9mdXKWIw==", "requires": { "mgrs": "1.0.0", "wkt-parser": "^1.3.3" @@ -24021,9 +24016,9 @@ "dev": true }, "punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", "dev": true }, "q": { @@ -24358,9 +24353,9 @@ "dev": true }, "rfdc": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", - "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "dev": true }, "rimraf": { @@ -24510,9 +24505,9 @@ } }, "sax": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", - "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", "dev": true }, "schema-utils": { @@ -24954,13 +24949,13 @@ } }, "socket.io-adapter": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.4.tgz", - "integrity": "sha512-wDNHGXGewWAjQPt3pyeYBtpWSq9cLE5UW1ZUPL/2eGK9jtse/FpXib7epSTsz0Q0m+6sg6Y4KtcFTlah1bdOVg==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", "dev": true, "requires": { "debug": "~4.3.4", - "ws": "~8.11.0" + "ws": "~8.17.1" } }, "socket.io-parser": { @@ -25089,9 +25084,9 @@ } }, "spdx-license-ids": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", - "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", "dev": true }, "spdy": { @@ -25361,9 +25356,9 @@ }, "dependencies": { "acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true } } @@ -25382,9 +25377,9 @@ }, "dependencies": { "acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true }, "ajv": { @@ -25424,9 +25419,9 @@ } }, "terser": { - "version": "5.30.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.3.tgz", - "integrity": "sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", @@ -25530,9 +25525,9 @@ "dev": true }, "tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "dev": true, "requires": { "psl": "^1.1.33", @@ -25541,6 +25536,12 @@ "url-parse": "^1.5.3" }, "dependencies": { + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + }, "universalify": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", @@ -25569,9 +25570,9 @@ } }, "tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "tslint": { "version": "6.1.3", @@ -25723,9 +25724,9 @@ "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==" }, "ua-parser-js": { - "version": "1.0.37", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.37.tgz", - "integrity": "sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==" + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.38.tgz", + "integrity": "sha512-Aq5ppTOfvrCMgAPneW1HfWj66Xi7XL+/mIy996R1/CLS/rcyJQm6QZdsKrUeivDFQ+Oc9Wyuwor8Ze8peEoUoQ==" }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", @@ -25786,12 +25787,12 @@ "dev": true }, "update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "requires": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" } }, "uri-js": { @@ -25801,6 +25802,14 @@ "dev": true, "requires": { "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + } } }, "url-parse": { @@ -25880,9 +25889,9 @@ "dev": true }, "watchpack": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", - "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "requires": { "glob-to-regexp": "^0.4.1", @@ -26065,9 +26074,9 @@ }, "dependencies": { "acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true }, "acorn-import-assertions": { @@ -26270,6 +26279,12 @@ "resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.3.3.tgz", "integrity": "sha512-ZnV3yH8/k58ZPACOXeiHaMuXIiaTk1t0hSUVisbO0t4RjA5wPpUytcxeyiN2h+LZRrmuHIh/1UlrR9e7DHDvTw==" }, + "word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -26309,9 +26324,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "requires": {} }, diff --git a/src/app/admin/admin-routing.module.ts b/src/app/admin/admin-routing.module.ts index 1e03251c0..b0694dbfe 100644 --- a/src/app/admin/admin-routing.module.ts +++ b/src/app/admin/admin-routing.module.ts @@ -1,78 +1,78 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { OrganisationDetailComponent } from './organisation/organisation-detail/organisation-detail.component'; -import { OrganisationEditComponent } from './organisation/organisation-edit/organisation-edit.component'; -import { OrganisationListComponent } from './organisation/organisation-list/organisation-list.component'; -import { OrganisationComponent } from './organisation/organisation.component'; -import { PermissionDetailComponent } from './permission/permission-detail/permission-detail.component'; -import { PermissionEditComponent } from './permission/permission-edit/permission-edit.component'; -import { PermissionListComponent } from './permission/permission-list/permission-list.component'; -import { PermissionComponent } from './permission/permission.component'; -import { UserDetailComponent } from './users/user-detail/user-detail.component'; -import { UserEditComponent } from './users/user-edit/user-edit.component'; -import { UserListComponent } from './users/user-list/user-list.component'; -import { UsersComponent } from './users/users.component'; -import { ApiKeyComponent } from './api-key/api-key.component'; -import { ApiKeyListComponent } from './api-key/api-key-list/api-key-list.component'; -import { ApiKeyEditComponent } from './api-key/api-key-edit/api-key-edit.component'; -import { AcceptUserComponent } from './users/accept-user/accept-user.component'; -import { UserTableTabComponent } from '@app/admin/users/user-list/user-table-tab/user-table-tab.component'; -import { AwaitingUsersTableTabComponent } from '@app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; +import { OrganisationDetailComponent } from "./organisation/organisation-detail/organisation-detail.component"; +import { OrganisationEditComponent } from "./organisation/organisation-edit/organisation-edit.component"; +import { OrganisationListComponent } from "./organisation/organisation-list/organisation-list.component"; +import { OrganisationComponent } from "./organisation/organisation.component"; +import { PermissionDetailComponent } from "./permission/permission-detail/permission-detail.component"; +import { PermissionEditComponent } from "./permission/permission-edit/permission-edit.component"; +import { PermissionListComponent } from "./permission/permission-list/permission-list.component"; +import { PermissionComponent } from "./permission/permission.component"; +import { UserDetailComponent } from "./users/user-detail/user-detail.component"; +import { UserEditComponent } from "./users/user-edit/user-edit.component"; +import { UserListComponent } from "./users/user-list/user-list.component"; +import { UsersComponent } from "./users/users.component"; +import { ApiKeyComponent } from "./api-key/api-key.component"; +import { ApiKeyListComponent } from "./api-key/api-key-list/api-key-list.component"; +import { ApiKeyEditComponent } from "./api-key/api-key-edit/api-key-edit.component"; +import { AcceptUserComponent } from "./users/accept-user/accept-user.component"; +import { UserTableTabComponent } from "@app/admin/users/user-list/user-table-tab/user-table-tab.component"; +import { AwaitingUsersTableTabComponent } from "@app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component"; const adminRoutes: Routes = [ { - path: 'organisations', + path: "organisations", component: OrganisationComponent, children: [ - { path: '', component: OrganisationListComponent }, - { path: 'new-organisation', component: OrganisationEditComponent }, - { path: ':org-id', component: OrganisationDetailComponent }, + { path: "", component: OrganisationListComponent }, + { path: "new-organisation", component: OrganisationEditComponent }, + { path: ":org-id", component: OrganisationDetailComponent }, { - path: ':org-id/edit-organisation', + path: ":org-id/edit-organisation", component: OrganisationEditComponent, }, ], }, { - path: 'users', + path: "users", component: UsersComponent, children: [ { - path: '', + path: "", component: UserListComponent, children: [ - { path: 'existing', component: UserTableTabComponent }, - { path: 'awaiting', component: AwaitingUsersTableTabComponent }, + { path: "existing", component: UserTableTabComponent }, + { path: "awaiting", component: AwaitingUsersTableTabComponent }, ], }, - { path: 'organization/:organization-id', component: UserListComponent }, - { path: 'new-user', component: UserEditComponent }, - { path: ':user-id', component: UserDetailComponent }, - { path: ':user-id/edit-user', component: UserEditComponent }, - { path: 'accept-user/:user-id/:org-id', component: AcceptUserComponent }, + { path: "organization/:organization-id", component: UserListComponent }, + { path: "new-user", component: UserEditComponent }, + { path: ":user-id", component: UserDetailComponent }, + { path: ":user-id/edit-user", component: UserEditComponent }, + { path: "accept-user/:user-id/:org-id", component: AcceptUserComponent }, ], }, { - path: 'permissions', + path: "permissions", component: PermissionComponent, children: [ - { path: '', component: PermissionListComponent }, - { path: 'new-permission', component: PermissionEditComponent }, - { path: ':permission-id', component: PermissionDetailComponent }, + { path: "", component: PermissionListComponent }, + { path: "new-permission", component: PermissionEditComponent }, + { path: ":permission-id", component: PermissionDetailComponent }, { - path: ':permission-id/edit-permission', + path: ":permission-id/edit-permission", component: PermissionEditComponent, }, ], }, { - path: 'api-key', + path: "api-key", component: ApiKeyComponent, children: [ - { path: '', component: ApiKeyListComponent }, - { path: 'new-api-key', component: ApiKeyEditComponent }, + { path: "", component: ApiKeyListComponent }, + { path: "new-api-key", component: ApiKeyEditComponent }, { - path: ':api-key-id/edit-api-key', + path: ":api-key-id/edit-api-key", component: ApiKeyEditComponent, }, ], diff --git a/src/app/admin/admin.component.html b/src/app/admin/admin.component.html index 90c6b6463..0680b43f9 100644 --- a/src/app/admin/admin.component.html +++ b/src/app/admin/admin.component.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/app/admin/admin.component.ts b/src/app/admin/admin.component.ts index d267ab24c..4403ea06e 100644 --- a/src/app/admin/admin.component.ts +++ b/src/app/admin/admin.component.ts @@ -1,15 +1,12 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-admin', - templateUrl: './admin.component.html', - styleUrls: ['./admin.component.scss'] + selector: "app-admin", + templateUrl: "./admin.component.html", + styleUrls: ["./admin.component.scss"], }) export class AdminComponent implements OnInit { + constructor() {} - constructor() { } - - ngOnInit(): void { - } - + ngOnInit(): void {} } diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index ace6a7bf1..9828a07ad 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -1,41 +1,41 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; -import { AdminRoutingModule } from './admin-routing.module'; -import { ApplicationsModule } from '@applications/applications.module'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; -import { FormModule } from '@shared/components/forms/form.module'; -import { NGMaterialModule } from '@shared/Modules/materiale.module'; -import { PipesModule } from '@shared/pipes/pipes.module'; -import { SharedModule } from '@shared/shared.module'; -import { PermissionDetailComponent } from './permission/permission-detail/permission-detail.component'; -import { PermissionEditComponent } from './permission/permission-edit/permission-edit.component'; -import { PermissionListComponent } from './permission/permission-list/permission-list.component'; -import { PermissionTabelComponent } from './permission/permission-list/permission-tabel/permission-tabel.component'; -import { PermissionComponent } from './permission/permission.component'; -import { OrganisationDetailComponent } from './organisation/organisation-detail/organisation-detail.component'; -import { OrganisationEditComponent } from './organisation/organisation-edit/organisation-edit.component'; -import { OrganisationListComponent } from './organisation/organisation-list/organisation-list.component'; -import { OrganisationTabelComponent } from './organisation/organisation-list/organisation-tabel/organisation-tabel.component'; -import { OrganisationComponent } from './organisation/organisation.component'; -import { UserDetailComponent } from './users/user-detail/user-detail.component'; -import { UserEditComponent } from './users/user-edit/user-edit.component'; -import { UserListComponent } from './users/user-list/user-list.component'; -import { UserTableComponent } from './users/user-list/user-table/user-table.component'; -import { UsersComponent } from './users/users.component'; -import { MatSelectModule } from '@angular/material/select'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatSelectSearchModule } from '@shared/components/mat-select-search/mat-select-search.module'; -import { ApiKeyComponent } from './api-key/api-key.component'; -import { ApiKeyListComponent } from './api-key/api-key-list/api-key-list.component'; -import { ApiKeyTableComponent } from './api-key/api-key-list/api-key-table/api-key-table.component'; -import { ApiKeyEditComponent } from './api-key/api-key-edit/api-key-edit.component'; -import { AwaitingUsersTableComponent } from './users/user-list/awaiting-users-table/awaiting-users-table.component'; -import { AcceptUserComponent } from './users/accept-user/accept-user.component'; -import { UserTableTabComponent } from './users/user-list/user-table-tab/user-table-tab.component'; -import { AwaitingUsersTableTabComponent } from './users/user-list/awaiting-user-tab/awaiting-users-table-tab.component'; +import { AdminRoutingModule } from "./admin-routing.module"; +import { ApplicationsModule } from "@applications/applications.module"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { RouterModule } from "@angular/router"; +import { TranslateModule } from "@ngx-translate/core"; +import { FormModule } from "@shared/components/forms/form.module"; +import { NGMaterialModule } from "@shared/Modules/materiale.module"; +import { PipesModule } from "@shared/pipes/pipes.module"; +import { SharedModule } from "@shared/shared.module"; +import { PermissionDetailComponent } from "./permission/permission-detail/permission-detail.component"; +import { PermissionEditComponent } from "./permission/permission-edit/permission-edit.component"; +import { PermissionListComponent } from "./permission/permission-list/permission-list.component"; +import { PermissionTabelComponent } from "./permission/permission-list/permission-tabel/permission-tabel.component"; +import { PermissionComponent } from "./permission/permission.component"; +import { OrganisationDetailComponent } from "./organisation/organisation-detail/organisation-detail.component"; +import { OrganisationEditComponent } from "./organisation/organisation-edit/organisation-edit.component"; +import { OrganisationListComponent } from "./organisation/organisation-list/organisation-list.component"; +import { OrganisationTabelComponent } from "./organisation/organisation-list/organisation-tabel/organisation-tabel.component"; +import { OrganisationComponent } from "./organisation/organisation.component"; +import { UserDetailComponent } from "./users/user-detail/user-detail.component"; +import { UserEditComponent } from "./users/user-edit/user-edit.component"; +import { UserListComponent } from "./users/user-list/user-list.component"; +import { UserTableComponent } from "./users/user-list/user-table/user-table.component"; +import { UsersComponent } from "./users/users.component"; +import { MatSelectModule } from "@angular/material/select"; +import { MatFormFieldModule } from "@angular/material/form-field"; +import { MatSelectSearchModule } from "@shared/components/mat-select-search/mat-select-search.module"; +import { ApiKeyComponent } from "./api-key/api-key.component"; +import { ApiKeyListComponent } from "./api-key/api-key-list/api-key-list.component"; +import { ApiKeyTableComponent } from "./api-key/api-key-list/api-key-table/api-key-table.component"; +import { ApiKeyEditComponent } from "./api-key/api-key-edit/api-key-edit.component"; +import { AwaitingUsersTableComponent } from "./users/user-list/awaiting-users-table/awaiting-users-table.component"; +import { AcceptUserComponent } from "./users/accept-user/accept-user.component"; +import { UserTableTabComponent } from "./users/user-list/user-table-tab/user-table-tab.component"; +import { AwaitingUsersTableTabComponent } from "./users/user-list/awaiting-user-tab/awaiting-users-table-tab.component"; @NgModule({ declarations: [ diff --git a/src/app/admin/api-key/api-key-edit/api-key-edit.component.html b/src/app/admin/api-key/api-key-edit/api-key-edit.component.html index 9a90bf142..782512131 100644 --- a/src/app/admin/api-key/api-key-edit/api-key-edit.component.html +++ b/src/app/admin/api-key/api-key-edit/api-key-edit.component.html @@ -11,9 +11,7 @@
- {{ "API-KEY.EDIT.NAME" | translate }}*
- {{ "QUESTION.PERMISSION.SELECT-PERMISSION" | translate }}* - + {{ permission.name }} @@ -57,10 +50,10 @@
diff --git a/src/app/admin/api-key/api-key-edit/api-key-edit.component.ts b/src/app/admin/api-key/api-key-edit/api-key-edit.component.ts index 9c441f75e..44b946160 100644 --- a/src/app/admin/api-key/api-key-edit/api-key-edit.component.ts +++ b/src/app/admin/api-key/api-key-edit/api-key-edit.component.ts @@ -1,29 +1,29 @@ -import { Location } from '@angular/common'; -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { PermissionResponse } from '@app/admin/permission/permission.model'; -import { PermissionService } from '@app/admin/permission/permission.service'; -import { TranslateService } from '@ngx-translate/core'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { BackButton } from '@shared/models/back-button.model'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { ApiKeyRequest } from '../api-key.model'; -import { ApiKeyService } from '../api-key.service'; +import { Location } from "@angular/common"; +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnInit } from "@angular/core"; +import { ActivatedRoute } from "@angular/router"; +import { PermissionResponse } from "@app/admin/permission/permission.model"; +import { PermissionService } from "@app/admin/permission/permission.service"; +import { TranslateService } from "@ngx-translate/core"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { BackButton } from "@shared/models/back-button.model"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { ApiKeyRequest } from "../api-key.model"; +import { ApiKeyService } from "../api-key.service"; @Component({ - selector: 'app-api-key-edit', - templateUrl: './api-key-edit.component.html', - styleUrls: ['./api-key-edit.component.scss'], + selector: "app-api-key-edit", + templateUrl: "./api-key-edit.component.html", + styleUrls: ["./api-key-edit.component.scss"], }) export class ApiKeyEditComponent implements OnInit { apiKeyRequest = new ApiKeyRequest(); public backButton: BackButton = { - label: '', - routerLink: ['admin', 'api-key'], + label: "", + routerLink: ["admin", "api-key"], }; - public title = ''; - public submitButton = ''; + public title = ""; + public submitButton = ""; public errorMessage: string; public errorMessages: string[]; public errorFields: string[]; @@ -44,16 +44,14 @@ export class ApiKeyEditComponent implements OnInit { ngOnInit(): void { this.getPermissions(); - this.translate.use('da'); - this.translate - .get(['NAV.API-KEY', 'FORM.EDIT-API-KEY', 'API-KEY.EDIT.SAVE']) - .subscribe((translations) => { - this.backButton.label = translations['NAV.API-KEY']; - this.title = translations['FORM.EDIT-API-KEY']; - this.submitButton = translations['API-KEY.EDIT.SAVE']; - }); + this.translate.use("da"); + this.translate.get(["NAV.API-KEY", "FORM.EDIT-API-KEY", "API-KEY.EDIT.SAVE"]).subscribe(translations => { + this.backButton.label = translations["NAV.API-KEY"]; + this.title = translations["FORM.EDIT-API-KEY"]; + this.submitButton = translations["API-KEY.EDIT.SAVE"]; + }); - this.id = +this.route.snapshot.paramMap.get('api-key-id'); + this.id = +this.route.snapshot.paramMap.get("api-key-id"); if (this.id > 0) { this.getApiKey(this.id); @@ -63,19 +61,10 @@ export class ApiKeyEditComponent implements OnInit { private getPermissions() { this.permissionService - .getPermissions( - undefined, - undefined, - undefined, - undefined, - undefined, - this.organizationId - ) + .getPermissions(undefined, undefined, undefined, undefined, undefined, this.organizationId) .subscribe( - (permissionsResponse) => { - this.permissions = permissionsResponse.data.filter( - (x) => x.organization?.id === this.organizationId - ); + permissionsResponse => { + this.permissions = permissionsResponse.data.filter(x => x.organization?.id === this.organizationId); }, (error: HttpErrorResponse) => { this.showError(error); @@ -84,10 +73,10 @@ export class ApiKeyEditComponent implements OnInit { } private getApiKey(id: number) { - this.apiKeyService.get(id).subscribe((key) => { + this.apiKeyService.get(id).subscribe(key => { this.apiKeyRequest.id = key.id; this.apiKeyRequest.name = key.name; - this.apiKeyRequest.permissionIds = key.permissions.map((pm) => pm.id); + this.apiKeyRequest.permissionIds = key.permissions.map(pm => pm.id); }); } @@ -98,21 +87,18 @@ export class ApiKeyEditComponent implements OnInit { private create(): void { this.apiKeyService.create(this.apiKeyRequest).subscribe( () => this.routeBack(), - (err) => this.showError(err) + err => this.showError(err) ); } private update(): void { this.apiKeyService.update(this.apiKeyRequest, this.id).subscribe( () => this.routeBack(), - (err) => this.showError(err) + err => this.showError(err) ); } - public compare( - matOptionValue: number, - ngModelObject: number - ): boolean { + public compare(matOptionValue: number, ngModelObject: number): boolean { return matOptionValue === ngModelObject; } diff --git a/src/app/admin/api-key/api-key-list/api-key-list.component.html b/src/app/admin/api-key/api-key-list/api-key-list.component.html index 4960433b4..369a84ba4 100644 --- a/src/app/admin/api-key/api-key-list/api-key-list.component.html +++ b/src/app/admin/api-key/api-key-list/api-key-list.component.html @@ -9,9 +9,7 @@
- +
diff --git a/src/app/admin/api-key/api-key-list/api-key-list.component.ts b/src/app/admin/api-key/api-key-list/api-key-list.component.ts index 9fdf53d36..7d3fcf935 100644 --- a/src/app/admin/api-key/api-key-list/api-key-list.component.ts +++ b/src/app/admin/api-key/api-key-list/api-key-list.component.ts @@ -1,14 +1,14 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Title } from '@angular/platform-browser'; -import { TranslateService } from '@ngx-translate/core'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { Component, Input, OnInit } from "@angular/core"; +import { Title } from "@angular/platform-browser"; +import { TranslateService } from "@ngx-translate/core"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-api-key-list', - templateUrl: './api-key-list.component.html', - styleUrls: ['./api-key-list.component.scss'], + selector: "app-api-key-list", + templateUrl: "./api-key-list.component.html", + styleUrls: ["./api-key-list.component.scss"], }) export class ApiKeyListComponent implements OnInit { @Input() organisationId: number; @@ -20,14 +20,17 @@ export class ApiKeyListComponent implements OnInit { private globalService: SharedVariableService, private meService: MeService ) { - translate.use('da'); + translate.use("da"); } ngOnInit(): void { - this.translate.get(['TITLE.API-KEY']).subscribe((translations) => { - this.titleService.setTitle(translations['TITLE.API-KEY']); + this.translate.get(["TITLE.API-KEY"]).subscribe(translations => { + this.titleService.setTitle(translations["TITLE.API-KEY"]); }); this.organisationId = this.globalService.getSelectedOrganisationId(); - this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.UserAdministrationWrite, this.organisationId); + this.canEdit = this.meService.hasAccessToTargetOrganization( + OrganizationAccessScope.UserAdministrationWrite, + this.organisationId + ); } } diff --git a/src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html b/src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html index 845210be2..bc9e9b5f6 100644 --- a/src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html +++ b/src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html @@ -2,18 +2,11 @@
- +
+ +
- {{ 'API-KEY.NAME' | translate }} + {{ "API-KEY.NAME" | translate }} {{ element.name }} @@ -23,7 +16,7 @@ - {{ 'API-KEY.PERMISSIONS' | translate }} + {{ "API-KEY.PERMISSIONS" | translate }} @@ -32,14 +25,14 @@
- {{ 'NoUsersAdded' | translate }} + {{ "NoUsersAdded" | translate }}
- {{ 'API-KEY.KEY' | translate }} + {{ "API-KEY.KEY" | translate }} {{ element.key }} @@ -60,21 +53,14 @@ aria-expanded="false" [attr.aria-label]="'APPLICATION-TABLE-ROW.SHOW-OPTIONS' | translate" > -
+ +
diff --git a/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.spec.ts b/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.spec.ts index d6ea50fca..854a13bb5 100644 --- a/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.spec.ts +++ b/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { OrganisationTabelComponent } from './organisation-tabel.component'; +import { OrganisationTabelComponent } from "./organisation-tabel.component"; -describe('OrganisationTabelComponent', () => { +describe("OrganisationTabelComponent", () => { let component: OrganisationTabelComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ OrganisationTabelComponent ] - }) - .compileComponents(); + declarations: [OrganisationTabelComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('OrganisationTabelComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.ts b/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.ts index 0d9143351..76bfac4fa 100644 --- a/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.ts +++ b/src/app/admin/organisation/organisation-list/organisation-tabel/organisation-tabel.component.ts @@ -1,105 +1,91 @@ -import { AfterViewInit, Component, Input, ViewChild } from '@angular/core'; -import { OrganisationService } from '@app/admin/organisation/organisation.service'; -import { - OrganisationGetManyResponse, - OrganisationResponse, -} from '../../organisation.model'; -import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; -import { MatSort } from '@angular/material/sort'; -import { merge, Observable, of as observableOf } from 'rxjs'; -import { MatPaginator, PageEvent } from '@angular/material/paginator'; -import { environment } from '@environments/environment'; -import { startWith, switchMap, map, catchError } from 'rxjs/operators'; -import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; +import { AfterViewInit, Component, Input, ViewChild } from "@angular/core"; +import { OrganisationService } from "@app/admin/organisation/organisation.service"; +import { OrganisationGetManyResponse, OrganisationResponse } from "../../organisation.model"; +import { DeleteDialogService } from "@shared/components/delete-dialog/delete-dialog.service"; +import { MatSort } from "@angular/material/sort"; +import { merge, Observable, of as observableOf } from "rxjs"; +import { MatPaginator, PageEvent } from "@angular/material/paginator"; +import { environment } from "@environments/environment"; +import { startWith, switchMap, map, catchError } from "rxjs/operators"; +import { DefaultPageSizeOptions } from "@shared/constants/page.constants"; @Component({ - selector: 'app-organisation-tabel', - templateUrl: './organisation-tabel.component.html', - styleUrls: ['./organisation-tabel.component.scss'], + selector: "app-organisation-tabel", + templateUrl: "./organisation-tabel.component.html", + styleUrls: ["./organisation-tabel.component.scss"], }) export class OrganisationTabelComponent implements AfterViewInit { - displayedColumns: string[] = ['name', 'applications', 'menu']; + displayedColumns: string[] = ["name", "applications", "menu"]; - data: OrganisationResponse[]; + data: OrganisationResponse[]; - @ViewChild(MatPaginator) paginator: MatPaginator; - @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; - @Input() organisationId?: number; - @Input() userId?: number; + @Input() organisationId?: number; + @Input() userId?: number; - resultsLength = 0; - public pageSize = environment.tablePageSize; - pageSizeOptions = DefaultPageSizeOptions; + resultsLength = 0; + public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; - isLoadingResults = true; + isLoadingResults = true; - constructor( - private organisationService: OrganisationService, - private deleteDialogService: DeleteDialogService - ) {} + constructor(private organisationService: OrganisationService, private deleteDialogService: DeleteDialogService) {} - ngAfterViewInit() { - // If the user changes the sort order, reset back to the first page. - this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); + ngAfterViewInit() { + // If the user changes the sort order, reset back to the first page. + this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); - merge(this.sort.sortChange, this.paginator.page) - .pipe( - startWith({}), - switchMap(() => { - this.isLoadingResults = true; - return this.getOrganisations( - this.sort.active, - this.sort.direction - ); - }), - map((data) => { - // Flip flag to show that loading has finished. - this.isLoadingResults = false; - this.resultsLength = data.count; + merge(this.sort.sortChange, this.paginator.page) + .pipe( + startWith({}), + switchMap(() => { + this.isLoadingResults = true; + return this.getOrganisations(this.sort.active, this.sort.direction); + }), + map(data => { + // Flip flag to show that loading has finished. + this.isLoadingResults = false; + this.resultsLength = data.count; - return data.data; - }), - catchError(() => { - this.isLoadingResults = false; - return observableOf([]); - }) - ) - .subscribe((data) => (this.data = data)); - } + return data.data; + }), + catchError(() => { + this.isLoadingResults = false; + return observableOf([]); + }) + ) + .subscribe(data => (this.data = data)); + } - getOrganisations( - orderByColumn: string, - orderByDirection: string - ): Observable { - return this.organisationService.getMultiple( - this.paginator.pageSize, - this.paginator.pageIndex * this.paginator.pageSize, - orderByColumn, - orderByDirection - ); - } + getOrganisations(orderByColumn: string, orderByDirection: string): Observable { + return this.organisationService.getMultiple( + this.paginator.pageSize, + this.paginator.pageIndex * this.paginator.pageSize, + orderByColumn, + orderByDirection + ); + } - clickDelete(element: any) { - this.deleteDialogService.showSimpleDialog().subscribe((response) => { - if (response) { - this.organisationService - .delete(element.id) - .subscribe((response) => { - if (response.ok) { - this.refresh(); - } - }); - } else { - console.log(response); - } + clickDelete(element: any) { + this.deleteDialogService.showSimpleDialog().subscribe(response => { + if (response) { + this.organisationService.delete(element.id).subscribe(response => { + if (response.ok) { + this.refresh(); + } }); - } + } else { + console.log(response); + } + }); + } - private refresh() { - const pageEvent = new PageEvent(); - pageEvent.pageIndex = this.paginator.pageIndex; - pageEvent.pageSize = this.paginator.pageSize; - this.paginator.page.emit(pageEvent); - } + private refresh() { + const pageEvent = new PageEvent(); + pageEvent.pageIndex = this.paginator.pageIndex; + pageEvent.pageSize = this.paginator.pageSize; + this.paginator.page.emit(pageEvent); + } } diff --git a/src/app/admin/organisation/organisation.component.html b/src/app/admin/organisation/organisation.component.html index 90c6b6463..0680b43f9 100644 --- a/src/app/admin/organisation/organisation.component.html +++ b/src/app/admin/organisation/organisation.component.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/app/admin/organisation/organisation.component.ts b/src/app/admin/organisation/organisation.component.ts index b512d4d8d..cfc3cb0ad 100644 --- a/src/app/admin/organisation/organisation.component.ts +++ b/src/app/admin/organisation/organisation.component.ts @@ -1,14 +1,14 @@ -import { Component, OnInit } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { Component, OnInit } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; @Component({ - selector: 'app-organisation', - templateUrl: './organisation.component.html', - styleUrls: ['./organisation.component.scss'], + selector: "app-organisation", + templateUrl: "./organisation.component.html", + styleUrls: ["./organisation.component.scss"], }) export class OrganisationComponent implements OnInit { constructor(public translate: TranslateService) { - translate.use('da'); + translate.use("da"); } ngOnInit(): void {} diff --git a/src/app/admin/organisation/organisation.model.ts b/src/app/admin/organisation/organisation.model.ts index fdf05791f..e5a6a6d47 100644 --- a/src/app/admin/organisation/organisation.model.ts +++ b/src/app/admin/organisation/organisation.model.ts @@ -1,6 +1,6 @@ -import { Application } from '@applications/application.model'; -import { PayloadDecoder } from '../../payload-decoder/payload-decoder.model'; -import { PermissionResponse } from '../permission/permission.model'; +import { Application } from "@applications/application.model"; +import { PayloadDecoder } from "../../payload-decoder/payload-decoder.model"; +import { PermissionResponse } from "../permission/permission.model"; export class Organisation { id?: number; diff --git a/src/app/admin/organisation/organisation.service.ts b/src/app/admin/organisation/organisation.service.ts index c350f2f03..756907b2a 100644 --- a/src/app/admin/organisation/organisation.service.ts +++ b/src/app/admin/organisation/organisation.service.ts @@ -1,28 +1,25 @@ -import { Injectable } from '@angular/core'; -import { RestService } from '../../shared/services/rest.service'; -import { Observable } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { RestService } from "../../shared/services/rest.service"; +import { Observable } from "rxjs"; import { Organisation, OrganisationResponse, OrganisationGetManyResponse, OrganisationGetMinimalResponse, -} from './organisation.model'; -import { map, shareReplay } from 'rxjs/operators'; -import { UserMinimalService } from '../users/user-minimal.service'; -import { UpdateUserOrgsDto } from '../users/user.model'; +} from "./organisation.model"; +import { map, shareReplay } from "rxjs/operators"; +import { UserMinimalService } from "../users/user-minimal.service"; +import { UpdateUserOrgsDto } from "../users/user.model"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class OrganisationService { - URL = 'organization'; - URLMINIMAL = 'organization/minimal'; - URLMINIMAL_NEWKOMBIT = 'kombitCreation/minimal'; + URL = "organization"; + URLMINIMAL = "organization/minimal"; + URLMINIMAL_NEWKOMBIT = "kombitCreation/minimal"; - constructor( - private restService: RestService, - private userMinimalService: UserMinimalService - ) {} + constructor(private restService: RestService, private userMinimalService: UserMinimalService) {} post(body: Organisation): Observable { return this.restService.post(this.URL, body); @@ -30,19 +27,15 @@ export class OrganisationService { put(body: Organisation, id: number): Observable { return this.restService.put(this.URL, body, id, { - observe: 'response', + observe: "response", }); } getOne(id: number): Observable { return this.restService.get(this.URL, {}, id).pipe( map((response: OrganisationResponse) => { - response.createdByName = this.userMinimalService.getUserNameFrom( - response.createdBy - ); - response.updatedByName = this.userMinimalService.getUserNameFrom( - response.updatedBy - ); + response.createdByName = this.userMinimalService.getUserNameFrom(response.createdBy); + response.updatedByName = this.userMinimalService.getUserNameFrom(response.updatedBy); return response; }) ); diff --git a/src/app/admin/permission/permission-detail/permission-detail.component.html b/src/app/admin/permission/permission-detail/permission-detail.component.html index 5bd2decaa..a9ec99e1c 100644 --- a/src/app/admin/permission/permission-detail/permission-detail.component.html +++ b/src/app/admin/permission/permission-detail/permission-detail.component.html @@ -1,41 +1,54 @@
- - -
-
-
-
-

{{'PERMISSION.DETAIL.HEADLINE' | translate}}

- -

{{'PERMISSION.DETAIL.TYPE' | translate}}{{permission.type | translatePermissions}}

-

{{'PERMISSION.DETAIL.ORG' | translate}} - {{permission.organization?.name}} -

- -
-
+ + +
+
+
+
+

{{ "PERMISSION.DETAIL.HEADLINE" | translate }}

+ +

+ {{ "PERMISSION.DETAIL.TYPE" | translate }}{{ permission.type | translatePermissions }} +

+

+ {{ "PERMISSION.DETAIL.ORG" | translate }} + {{ permission.organization?.name }} +

-
-
-
-

- {{ 'PERMISSION.DETAIL.USERS' | translate }} -

- -
-
+
+
+
+
+
+

+ {{ "PERMISSION.DETAIL.USERS" | translate }} +

+
-
-
-
-

- {{ 'PERMISSION.DETAIL.APPLICATIONS' | translate }} -

+
+
+
+
+
+

+ {{ "PERMISSION.DETAIL.APPLICATIONS" | translate }} +

- -
-
+
+
+
diff --git a/src/app/admin/permission/permission-detail/permission-detail.component.spec.ts b/src/app/admin/permission/permission-detail/permission-detail.component.spec.ts index 52317fac0..6483a65cf 100644 --- a/src/app/admin/permission/permission-detail/permission-detail.component.spec.ts +++ b/src/app/admin/permission/permission-detail/permission-detail.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { PermissionDetailComponent } from './permission-detail.component'; +import { PermissionDetailComponent } from "./permission-detail.component"; -describe('PermissionDetailComponent', () => { +describe("PermissionDetailComponent", () => { let component: PermissionDetailComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ PermissionDetailComponent ] - }) - .compileComponents(); + declarations: [PermissionDetailComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('PermissionDetailComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/permission/permission-detail/permission-detail.component.ts b/src/app/admin/permission/permission-detail/permission-detail.component.ts index ef2bde9a3..ab1fc2364 100644 --- a/src/app/admin/permission/permission-detail/permission-detail.component.ts +++ b/src/app/admin/permission/permission-detail/permission-detail.component.ts @@ -1,24 +1,23 @@ -import { Component, OnChanges, OnInit, SimpleChanges } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { PermissionService } from '@app/admin/permission/permission.service'; -import { Subscription } from 'rxjs'; -import { PermissionResponse, PermissionType } from '../permission.model'; -import { BackButton } from '@shared/models/back-button.model'; -import { QuickActionButton } from '@shared/models/quick-action-button.model'; -import { UserResponse } from '@app/admin/users/user.model'; -import { DropdownButton } from '@shared/models/dropdown-button.model'; -import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; -import { environment } from '@environments/environment'; -import { Title } from '@angular/platform-browser'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; - +import { Component, OnChanges, OnInit, SimpleChanges } from "@angular/core"; +import { ActivatedRoute, Router } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { PermissionService } from "@app/admin/permission/permission.service"; +import { Subscription } from "rxjs"; +import { PermissionResponse, PermissionType } from "../permission.model"; +import { BackButton } from "@shared/models/back-button.model"; +import { QuickActionButton } from "@shared/models/quick-action-button.model"; +import { UserResponse } from "@app/admin/users/user.model"; +import { DropdownButton } from "@shared/models/dropdown-button.model"; +import { DeleteDialogService } from "@shared/components/delete-dialog/delete-dialog.service"; +import { environment } from "@environments/environment"; +import { Title } from "@angular/platform-browser"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-permission-detail', - templateUrl: './permission-detail.component.html', - styleUrls: ['./permission-detail.component.scss'] + selector: "app-permission-detail", + templateUrl: "./permission-detail.component.html", + styleUrls: ["./permission-detail.component.scss"], }) export class PermissionDetailComponent implements OnInit, OnChanges { isLoadingResults = true; @@ -28,17 +27,17 @@ export class PermissionDetailComponent implements OnInit, OnChanges { permission: PermissionResponse; permissions: PermissionResponse[]; public backButton: BackButton = { - label: '', - routerLink: '/admin/permissions', + label: "", + routerLink: "/admin/permissions", }; public buttons: QuickActionButton[] = [ { - label: 'PERMISSIONS.DELETE', - type: 'delete', + label: "PERMISSIONS.DELETE", + type: "delete", }, { - label: 'PERMISSIONS.EDIT', - type: 'edit', + label: "PERMISSIONS.EDIT", + type: "edit", }, ]; id: number; @@ -56,24 +55,25 @@ export class PermissionDetailComponent implements OnInit, OnChanges { private titleService: Title, private deleteDialogService: DeleteDialogService, private meService: MeService - ) { } + ) {} ngOnInit(): void { - this.translate.use('da'); - this.id = +this.route.snapshot.paramMap.get('permission-id'); + this.translate.use("da"); + this.id = +this.route.snapshot.paramMap.get("permission-id"); if (this.id > 0) { this.getPermission(this.id); this.dropdownButton = { - label: '', - editRouterLink: 'edit-permission', + label: "", + editRouterLink: "edit-permission", isErasable: true, }; } - this.translate.get(['NAV.PERMISSIONS', 'PERMISSION.DETAIL.DROPDOWN', 'TITLE.PERMISSION']) + this.translate + .get(["NAV.PERMISSIONS", "PERMISSION.DETAIL.DROPDOWN", "TITLE.PERMISSION"]) .subscribe(translations => { - this.backButton.label = translations['NAV.PERMISSIONS']; - this.dropdownButton.label = translations['PERMISSION.DETAIL.DROPDOWN']; - this.titleService.setTitle(translations['TITLE.PERMISSION']); + this.backButton.label = translations["NAV.PERMISSIONS"]; + this.dropdownButton.label = translations["PERMISSION.DETAIL.DROPDOWN"]; + this.titleService.setTitle(translations["TITLE.PERMISSION"]); }); this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.UserAdministrationWrite); } @@ -83,27 +83,25 @@ export class PermissionDetailComponent implements OnInit, OnChanges { } private getPermission(id: number) { - this.subscription = this.permissionService - .getPermission(id) - .subscribe((response) => { - this.permission = response; - this.users = response.users; - this.showApplicationTable = this.meService.hasPermissions( - response, - PermissionType.Read, - PermissionType.OrganizationApplicationAdmin, - PermissionType.GlobalAdmin - ); - this.isLoadingResults = false; - }); + this.subscription = this.permissionService.getPermission(id).subscribe(response => { + this.permission = response; + this.users = response.users; + this.showApplicationTable = this.meService.hasPermissions( + response, + PermissionType.Read, + PermissionType.OrganizationApplicationAdmin, + PermissionType.GlobalAdmin + ); + this.isLoadingResults = false; + }); } onDeletePermission() { - this.deleteDialogService.showSimpleDialog().subscribe((response) => { + this.deleteDialogService.showSimpleDialog().subscribe(response => { if (response) { - this.permissionService.deletePermission(this.id).subscribe((response) => { + this.permissionService.deletePermission(this.id).subscribe(response => { if (response.ok && response.body.affected > 0) { - this.router.navigate(['admin/permissions']); + this.router.navigate(["admin/permissions"]); } }); } @@ -111,6 +109,6 @@ export class PermissionDetailComponent implements OnInit, OnChanges { } onEditPermission() { - this.router.navigate(['edit-permission'], { relativeTo: this.route }); + this.router.navigate(["edit-permission"], { relativeTo: this.route }); } } diff --git a/src/app/admin/permission/permission-edit/permission-edit.component.html b/src/app/admin/permission/permission-edit/permission-edit.component.html index 7ab628f45..7a1112b71 100644 --- a/src/app/admin/permission/permission-edit/permission-edit.component.html +++ b/src/app/admin/permission/permission-edit/permission-edit.component.html @@ -1,103 +1,147 @@
-
-
    -
  • - {{error | translate}} -
  • -
-
- -
-
- * - -
-
+
+
    +
  • + {{ error | translate }} +
  • +
+
+
- * - - - {{'PERMISSION-TYPE.' + level.type | translate}} - - + * +
+
-
- - - - - - {{getTextForUser(user)}} - - - -
+
+ * + + + {{ "PERMISSION-TYPE." + level.type | translate }} + + +
-
-
- * - -
-
+
+ + + + + + {{ getTextForUser(user) }} + + + +
-
- - -
- - - - {{app.name}} - - -
-
+
+
+ * +
+
-
-
- -
- - {{'PERMISSION.EDIT.ADD-APPLICATION-ON-CREATE' | translate}} -
-
-
+
+ + +
+ + + + {{ app.name }} + + +
+
+
-
- - +
+
+ +
+ + {{ "PERMISSION.EDIT.ADD-APPLICATION-ON-CREATE" | translate }} +
+
+ +
+ + +
diff --git a/src/app/admin/permission/permission-edit/permission-edit.component.scss b/src/app/admin/permission/permission-edit/permission-edit.component.scss index d3f5a12fa..e69de29bb 100644 --- a/src/app/admin/permission/permission-edit/permission-edit.component.scss +++ b/src/app/admin/permission/permission-edit/permission-edit.component.scss @@ -1 +0,0 @@ - diff --git a/src/app/admin/permission/permission-edit/permission-edit.component.spec.ts b/src/app/admin/permission/permission-edit/permission-edit.component.spec.ts index 3955610df..579dcdab6 100644 --- a/src/app/admin/permission/permission-edit/permission-edit.component.spec.ts +++ b/src/app/admin/permission/permission-edit/permission-edit.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { PermissionEditComponent } from './permission-edit.component'; +import { PermissionEditComponent } from "./permission-edit.component"; -describe('PermissionEditComponent', () => { +describe("PermissionEditComponent", () => { let component: PermissionEditComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ PermissionEditComponent ] - }) - .compileComponents(); + declarations: [PermissionEditComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('PermissionEditComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/permission/permission-edit/permission-edit.component.ts b/src/app/admin/permission/permission-edit/permission-edit.component.ts index ed0d4a864..fb2174386 100644 --- a/src/app/admin/permission/permission-edit/permission-edit.component.ts +++ b/src/app/admin/permission/permission-edit/permission-edit.component.ts @@ -1,31 +1,27 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { HttpErrorResponse } from '@angular/common/http'; -import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { ReplaySubject, Subject, Subscription } from 'rxjs'; -import { Location } from '@angular/common'; -import { PermissionService } from '../permission.service'; -import { - PermissionRequest, - PermissionType, - PermissionTypes, -} from '../permission.model'; -import { OrganisationResponse } from '../../organisation/organisation.model'; -import { OrganisationService } from '../../organisation/organisation.service'; -import { UserService } from '../../users/user.service'; -import { UserResponse } from '../../users/user.model'; -import { ApplicationService } from '@applications/application.service'; -import { Application } from '@applications/application.model'; -import { BackButton } from '@shared/models/back-button.model'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { takeUntil } from 'rxjs/operators'; -import { MeService } from '@shared/services/me.service'; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { HttpErrorResponse } from "@angular/common/http"; +import { UntypedFormControl, UntypedFormGroup } from "@angular/forms"; +import { ActivatedRoute } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { ReplaySubject, Subject, Subscription } from "rxjs"; +import { Location } from "@angular/common"; +import { PermissionService } from "../permission.service"; +import { PermissionRequest, PermissionType, PermissionTypes } from "../permission.model"; +import { OrganisationResponse } from "../../organisation/organisation.model"; +import { OrganisationService } from "../../organisation/organisation.service"; +import { UserService } from "../../users/user.service"; +import { UserResponse } from "../../users/user.model"; +import { ApplicationService } from "@applications/application.service"; +import { Application } from "@applications/application.model"; +import { BackButton } from "@shared/models/back-button.model"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { takeUntil } from "rxjs/operators"; +import { MeService } from "@shared/services/me.service"; @Component({ - selector: 'app-permission-edit', - templateUrl: './permission-edit.component.html', - styleUrls: ['./permission-edit.component.scss'], + selector: "app-permission-edit", + templateUrl: "./permission-edit.component.html", + styleUrls: ["./permission-edit.component.scss"], }) export class PermissionEditComponent implements OnInit, OnDestroy { permission = new PermissionRequest(); @@ -39,11 +35,11 @@ export class PermissionEditComponent implements OnInit, OnDestroy { public formFailedSubmit = false; public form: UntypedFormGroup; public backButton: BackButton = { - label: '', - routerLink: ['admin', 'permissions'], + label: "", + routerLink: ["admin", "permissions"], }; - public title = ''; - public submitButton = ''; + public title = ""; + public submitButton = ""; public isEditMode = false; id: number; subscription: Subscription; @@ -59,15 +55,11 @@ export class PermissionEditComponent implements OnInit, OnDestroy { public userMultiCtrl: UntypedFormControl = new UntypedFormControl(); public userMultiFilterCtrl: UntypedFormControl = new UntypedFormControl(); - public filteredUsersMulti: ReplaySubject = new ReplaySubject< - UserResponse[] - >(1); + public filteredUsersMulti: ReplaySubject = new ReplaySubject(1); public applicationMultiCtrl: UntypedFormControl = new UntypedFormControl(); public applicationMultiFilterCtrl: UntypedFormControl = new UntypedFormControl(); - public filteredApplicationsMulti: ReplaySubject< - Application[] - > = new ReplaySubject(1); + public filteredApplicationsMulti: ReplaySubject = new ReplaySubject(1); public permissionLevelsCtrl: UntypedFormControl = new UntypedFormControl(); @@ -89,15 +81,13 @@ export class PermissionEditComponent implements OnInit, OnDestroy { ngOnInit(): void { this.getOrganizations(); this.getUsers(); - this.translate.use('da'); - this.translate - .get(['NAV.PERMISSIONS', 'FORM.EDIT-PERMISSION', 'PERMISSION.SAVE']) - .subscribe((translations) => { - this.backButton.label = translations['NAV.PERMISSIONS']; - this.title = translations['FORM.EDIT-PERMISSION']; - this.submitButton = translations['PERMISSION.SAVE']; - }); - this.id = +this.route.snapshot.paramMap.get('permission-id'); + this.translate.use("da"); + this.translate.get(["NAV.PERMISSIONS", "FORM.EDIT-PERMISSION", "PERMISSION.SAVE"]).subscribe(translations => { + this.backButton.label = translations["NAV.PERMISSIONS"]; + this.title = translations["FORM.EDIT-PERMISSION"]; + this.submitButton = translations["PERMISSION.SAVE"]; + }); + this.id = +this.route.snapshot.paramMap.get("permission-id"); if (this.id > 0) { this.getPermission(this.id); this.isEditMode = true; @@ -105,17 +95,13 @@ export class PermissionEditComponent implements OnInit, OnDestroy { this.setBackButton(); } - this.userMultiFilterCtrl.valueChanges - .pipe(takeUntil(this._onDestroy)) - .subscribe(() => { - this.filterUsersMulti(); - }); + this.userMultiFilterCtrl.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(() => { + this.filterUsersMulti(); + }); - this.applicationMultiFilterCtrl.valueChanges - .pipe(takeUntil(this._onDestroy)) - .subscribe(() => { - this.filterApplicationsMulti(); - }); + this.applicationMultiFilterCtrl.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(() => { + this.filterApplicationsMulti(); + }); } private filterApplicationsMulti() { @@ -131,11 +117,7 @@ export class PermissionEditComponent implements OnInit, OnDestroy { search = search.toLowerCase(); } // filter the banks - this.filteredApplicationsMulti.next( - this.applications.filter( - (app) => app.name.toLowerCase().indexOf(search) > -1 - ) - ); + this.filteredApplicationsMulti.next(this.applications.filter(app => app.name.toLowerCase().indexOf(search) > -1)); } private filterUsersMulti() { @@ -150,10 +132,9 @@ export class PermissionEditComponent implements OnInit, OnDestroy { } else { search = search.toLowerCase(); } - const filtered = this.users.filter((user) => { + const filtered = this.users.filter(user => { return ( - user.name.toLocaleLowerCase().indexOf(search) > -1 || - user?.email?.toLocaleLowerCase()?.indexOf(search) > -1 + user.name.toLocaleLowerCase().indexOf(search) > -1 || user?.email?.toLocaleLowerCase()?.indexOf(search) > -1 ); }); // filter the banks @@ -165,34 +146,30 @@ export class PermissionEditComponent implements OnInit, OnDestroy { } private setBackButton() { - this.backButton.routerLink = ['admin', 'permissions']; + this.backButton.routerLink = ["admin", "permissions"]; } private getOrganizations() { - this.organisationSubscription = this.organisationService - .getMultiple(1000, 0, 'name', 'asc') - .subscribe( - (orgs) => { - this.organisations = orgs.data; - }, - (error: HttpErrorResponse) => { - this.showError(error); - } - ); + this.organisationSubscription = this.organisationService.getMultiple(1000, 0, "name", "asc").subscribe( + orgs => { + this.organisations = orgs.data; + }, + (error: HttpErrorResponse) => { + this.showError(error); + } + ); } private getUsers() { - this.userSubscription = this.userService - .getMultiple(1000, 0, 'name', 'asc') - .subscribe( - (users) => { - this.users = users.data; - this.filteredUsersMulti.next(this.users.slice()); - }, - (error: HttpErrorResponse) => { - this.showError(error); - } - ); + this.userSubscription = this.userService.getMultiple(1000, 0, "name", "asc").subscribe( + users => { + this.users = users.data; + this.filteredUsersMulti.next(this.users.slice()); + }, + (error: HttpErrorResponse) => { + this.showError(error); + } + ); } public compare(o1: any, o2: any): boolean { @@ -208,35 +185,27 @@ export class PermissionEditComponent implements OnInit, OnDestroy { } private getApplications(organizationId: number) { - this.applicationSubscription = this.applicationService - .getApplicationsByOrganizationId(organizationId) - .subscribe( - (res) => { - this.applications = res.data.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); - this.filteredApplicationsMulti.next(this.applications.slice()); - }, - (error: HttpErrorResponse) => { - this.showError(error); - } - ); + this.applicationSubscription = this.applicationService.getApplicationsByOrganizationId(organizationId).subscribe( + res => { + this.applications = res.data.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); + this.filteredApplicationsMulti.next(this.applications.slice()); + }, + (error: HttpErrorResponse) => { + this.showError(error); + } + ); } private getPermission(id: number) { this.subscription = this.permissionService.getPermission(id).subscribe( - (response) => { + response => { this.permission.name = response.name; this.permission.levels = response.type; this.permissionLevelsCtrl.setValue(this.permission.levels); - this.permission.userIds = response.users.map((x) => x.id); + this.permission.userIds = response.users.map(x => x.id); this.userMultiCtrl.setValue(this.permission.userIds); - this.permission.automaticallyAddNewApplications = - response.automaticallyAddNewApplications; - this.isNotGlobalAdmin = this.meService.hasNotTargetPermissions( - response, - PermissionType.GlobalAdmin - ); + this.permission.automaticallyAddNewApplications = response.automaticallyAddNewApplications; + this.isNotGlobalAdmin = this.meService.hasNotTargetPermissions(response, PermissionType.GlobalAdmin); if (this.isNotGlobalAdmin) { this.permission.organizationId = response?.organization?.id; @@ -245,17 +214,9 @@ export class PermissionEditComponent implements OnInit, OnDestroy { this.allowedLevels = [{ type: PermissionType.GlobalAdmin }]; } - if ( - this.meService.hasPermissions( - response, - PermissionType.Read, - PermissionType.OrganizationApplicationAdmin - ) - ) { + if (this.meService.hasPermissions(response, PermissionType.Read, PermissionType.OrganizationApplicationAdmin)) { this.getApplications(this.permission.organizationId); - this.permission.applicationIds = response.applications.map( - (x) => x.id - ); + this.permission.applicationIds = response.applications.map(x => x.id); this.applicationMultiCtrl.setValue(this.permission.applicationIds); } }, @@ -267,7 +228,7 @@ export class PermissionEditComponent implements OnInit, OnDestroy { private create(): void { this.permissionService.createPermission(this.permission).subscribe( - (_response) => { + _response => { this.routeBack(); }, (error: HttpErrorResponse) => { @@ -281,7 +242,7 @@ export class PermissionEditComponent implements OnInit, OnDestroy { () => { this.routeBack(); }, - (error) => { + error => { this.showError(error); } ); diff --git a/src/app/admin/permission/permission-list/permission-list.component.html b/src/app/admin/permission/permission-list/permission-list.component.html index 684ba789d..ac02f2c7f 100644 --- a/src/app/admin/permission/permission-list/permission-list.component.html +++ b/src/app/admin/permission/permission-list/permission-list.component.html @@ -1,12 +1,16 @@ - +
-
-
-
- - -
-
+
+
+
+ +
+
diff --git a/src/app/admin/permission/permission-list/permission-list.component.spec.ts b/src/app/admin/permission/permission-list/permission-list.component.spec.ts index 2656a4bf0..3f1999071 100644 --- a/src/app/admin/permission/permission-list/permission-list.component.spec.ts +++ b/src/app/admin/permission/permission-list/permission-list.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { PermissionListComponent } from './permission-list.component'; +import { PermissionListComponent } from "./permission-list.component"; -describe('PermissionListComponent', () => { +describe("PermissionListComponent", () => { let component: PermissionListComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ PermissionListComponent ] - }) - .compileComponents(); + declarations: [PermissionListComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('PermissionListComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/permission/permission-list/permission-list.component.ts b/src/app/admin/permission/permission-list/permission-list.component.ts index 07ba2bb4a..3a408bf0b 100644 --- a/src/app/admin/permission/permission-list/permission-list.component.ts +++ b/src/app/admin/permission/permission-list/permission-list.component.ts @@ -1,18 +1,18 @@ -import { Component, OnInit, OnChanges, SimpleChanges } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { PermissionResponse } from '../permission.model'; -import { Subscription } from 'rxjs'; -import { PermissionService } from '../permission.service'; -import { Sort } from '@shared/models/sort.model'; -import { environment } from '@environments/environment'; -import { Title } from '@angular/platform-browser'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { Component, OnInit, OnChanges, SimpleChanges } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; +import { PermissionResponse } from "../permission.model"; +import { Subscription } from "rxjs"; +import { PermissionService } from "../permission.service"; +import { Sort } from "@shared/models/sort.model"; +import { environment } from "@environments/environment"; +import { Title } from "@angular/platform-browser"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-permission-list', - templateUrl: './permission-list.component.html', - styleUrls: ['./permission-list.component.scss'], + selector: "app-permission-list", + templateUrl: "./permission-list.component.html", + styleUrls: ["./permission-list.component.scss"], }) export class PermissionListComponent implements OnInit, OnChanges { isLoadingResults = true; @@ -29,7 +29,7 @@ export class PermissionListComponent implements OnInit, OnChanges { private permissionService: PermissionService, private meService: MeService ) { - translate.use('da'); + translate.use("da"); } ngOnChanges(): void { this.getPermissions(); @@ -37,24 +37,21 @@ export class PermissionListComponent implements OnInit, OnChanges { ngOnInit(): void { this.getPermissions(); - this.translate.get(['TITLE.PERMISSION']) - .subscribe(translations => { - this.titleService.setTitle(translations['TITLE.PERMISSION']); + this.translate.get(["TITLE.PERMISSION"]).subscribe(translations => { + this.titleService.setTitle(translations["TITLE.PERMISSION"]); }); this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.UserAdministrationWrite); } getPermissions() { - this.permissionSubscription = this.permissionService - .getPermissions() - .subscribe((response) => { - this.permissions = response.data; - this.isLoadingResults = false; - }); + this.permissionSubscription = this.permissionService.getPermissions().subscribe(response => { + this.permissions = response.data; + this.isLoadingResults = false; + }); } deletePermission(id: number) { - this.permissionService.deletePermission(id).subscribe((response) => { + this.permissionService.deletePermission(id).subscribe(response => { if (response.ok && response.body.affected > 0) { this.getPermissions(); } diff --git a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.html b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.html index 51892babf..79b25ef6a 100644 --- a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.html +++ b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.html @@ -1,86 +1,99 @@
-
- -
- +
+ +
+
+ + + + + - - - - - + + + + + - - - - + + - - + + + + + - - - - + + - - Ingen brugere er tilføjet - - - - - - - - - - - - - - - - - -
+ {{ "PERMISSION.NAME" | translate }} + + + {{ element.name }} + + + {{ element.name }} + + - {{ 'PERMISSION.NAME' | translate }} - - - {{element.name}} - - - {{element.name}} - - + {{ "PERMISSION.ORGANISATION" | translate }} + + {{ element?.organization?.name ? element.organization.name : ("PERMISSION.NO_ORGANISATION" | translate) }} + - {{ 'PERMISSION.ORGANISATION' | translate }} - {{element?.organization?.name ? element.organization.name : ("PERMISSION.NO_ORGANISATION" | translate)}} + + + + {{ "PERMISSION.NUMBER_OF_MEMBERS" | translate }} + +
+ {{ element.users.length }} +
+ Ingen brugere er tilføjet +
+ {{ "PERMISSION.TYPE" | translate }} + + {{ element.type | translatePermissions }} + - {{ 'PERMISSION.NUMBER_OF_MEMBERS' | translate }} -
- {{element.users.length}} + + +
+ + - {{ 'PERMISSION.TYPE' | translate }} - {{ element.type | translatePermissions }} - - -
- - + + + + +
diff --git a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.spec.ts b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.spec.ts index 6ab6fdee4..660507da2 100644 --- a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.spec.ts +++ b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { PermissionTabelComponent } from './permission-tabel.component'; +import { PermissionTabelComponent } from "./permission-tabel.component"; -describe('PermissionTabelComponent', () => { +describe("PermissionTabelComponent", () => { let component: PermissionTabelComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ PermissionTabelComponent ] - }) - .compileComponents(); + declarations: [PermissionTabelComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('PermissionTabelComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.ts b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.ts index 9a0cbd2c7..a9bc5761a 100644 --- a/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.ts +++ b/src/app/admin/permission/permission-list/permission-tabel/permission-tabel.component.ts @@ -1,129 +1,116 @@ -import { Component, ViewChild, AfterViewInit, Input } from '@angular/core'; -import { MatPaginator, PageEvent } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; -import { Router } from '@angular/router'; -import { environment } from '@environments/environment'; -import { TranslateService } from '@ngx-translate/core'; -import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; -import { MeService } from '@shared/services/me.service'; -import { merge, Observable, of as observableOf } from 'rxjs'; -import { startWith, switchMap, map, catchError } from 'rxjs/operators'; -import { - PermissionGetManyResponse, - PermissionResponse, - PermissionType, -} from '../../permission.model'; -import { PermissionService } from '../../permission.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; +import { Component, ViewChild, AfterViewInit, Input } from "@angular/core"; +import { MatPaginator, PageEvent } from "@angular/material/paginator"; +import { MatSort } from "@angular/material/sort"; +import { Router } from "@angular/router"; +import { environment } from "@environments/environment"; +import { TranslateService } from "@ngx-translate/core"; +import { DeleteDialogService } from "@shared/components/delete-dialog/delete-dialog.service"; +import { MeService } from "@shared/services/me.service"; +import { merge, Observable, of as observableOf } from "rxjs"; +import { startWith, switchMap, map, catchError } from "rxjs/operators"; +import { PermissionGetManyResponse, PermissionResponse, PermissionType } from "../../permission.model"; +import { PermissionService } from "../../permission.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { DefaultPageSizeOptions } from "@shared/constants/page.constants"; @Component({ - selector: 'app-permission-tabel', - templateUrl: './permission-tabel.component.html', - styleUrls: ['./permission-tabel.component.scss'], + selector: "app-permission-tabel", + templateUrl: "./permission-tabel.component.html", + styleUrls: ["./permission-tabel.component.scss"], }) export class PermissionTabelComponent implements AfterViewInit { - displayedColumns: string[] = [ - 'name', - 'organisations', - 'members', - 'type', - 'menu', - ]; - data: PermissionResponse[]; + displayedColumns: string[] = ["name", "organisations", "members", "type", "menu"]; + data: PermissionResponse[]; - @ViewChild(MatPaginator) paginator: MatPaginator; - @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; - @Input() organisationId?: number; - @Input() userId?: number; + @Input() organisationId?: number; + @Input() userId?: number; - resultsLength = 0; - public pageSize = environment.tablePageSize; - pageSizeOptions = DefaultPageSizeOptions; + resultsLength = 0; + public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; - isLoadingResults = true; + isLoadingResults = true; - constructor( - public translate: TranslateService, - private router: Router, - private permissionService: PermissionService, - private deleteDialogService: DeleteDialogService, - private meService: MeService, - ) { - translate.use('da'); - } + constructor( + public translate: TranslateService, + private router: Router, + private permissionService: PermissionService, + private deleteDialogService: DeleteDialogService, + private meService: MeService + ) { + translate.use("da"); + } - ngAfterViewInit() { - // If the user changes the sort order, reset back to the first page. - this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); + ngAfterViewInit() { + // If the user changes the sort order, reset back to the first page. + this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); - merge(this.sort.sortChange, this.paginator.page) - .pipe( - startWith({}), - switchMap(() => { - this.isLoadingResults = true; - return this.getPermissions( - this.sort.active, - this.sort.direction - ); - }), - map((data) => { - // Flip flag to show that loading has finished. - this.isLoadingResults = false; - this.resultsLength = data.count; + merge(this.sort.sortChange, this.paginator.page) + .pipe( + startWith({}), + switchMap(() => { + this.isLoadingResults = true; + return this.getPermissions(this.sort.active, this.sort.direction); + }), + map(data => { + // Flip flag to show that loading has finished. + this.isLoadingResults = false; + this.resultsLength = data.count; - return data.data; - }), - catchError(() => { - this.isLoadingResults = false; - return observableOf([]); - }) - ) - .subscribe((data) => (this.data = data)); - } + return data.data; + }), + catchError(() => { + this.isLoadingResults = false; + return observableOf([]); + }) + ) + .subscribe(data => (this.data = data)); + } - getPermissions( - orderByColumn: string, - orderByDirection: string - ): Observable { - return this.permissionService.getPermissions( - this.paginator.pageSize, - this.paginator.pageIndex * this.paginator.pageSize, - orderByColumn, - orderByDirection, - this.userId, - this.organisationId - ); - } + getPermissions(orderByColumn: string, orderByDirection: string): Observable { + return this.permissionService.getPermissions( + this.paginator.pageSize, + this.paginator.pageIndex * this.paginator.pageSize, + orderByColumn, + orderByDirection, + this.userId, + this.organisationId + ); + } - routeToPermissions(element: any) { - this.router.navigate(['admin/permissions', element.id]); - } + routeToPermissions(element: any) { + this.router.navigate(["admin/permissions", element.id]); + } - deletePermission(id: number) { - this.deleteDialogService.showSimpleDialog().subscribe((response) => { - if (response) { - this.permissionService.deletePermission(id).subscribe((response) => { - if (response.ok && response.body.affected > 0) { - this.refresh(); - } - }); - } + deletePermission(id: number) { + this.deleteDialogService.showSimpleDialog().subscribe(response => { + if (response) { + this.permissionService.deletePermission(id).subscribe(response => { + if (response.ok && response.body.affected > 0) { + this.refresh(); + } }); - } + } + }); + } - canAccess(element: PermissionResponse) { - if (this.meService.hasPermissions(element, PermissionType.GlobalAdmin)) { - return this.meService.hasGlobalAdmin(); - } - return this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.UserAdministrationWrite, element.organization.id); + canAccess(element: PermissionResponse) { + if (this.meService.hasPermissions(element, PermissionType.GlobalAdmin)) { + return this.meService.hasGlobalAdmin(); } + return this.meService.hasAccessToTargetOrganization( + OrganizationAccessScope.UserAdministrationWrite, + element.organization.id + ); + } - private refresh() { - const pageEvent = new PageEvent(); - pageEvent.pageIndex = this.paginator.pageIndex; - pageEvent.pageSize = this.paginator.pageSize; - this.paginator.page.emit(pageEvent); - } + private refresh() { + const pageEvent = new PageEvent(); + pageEvent.pageIndex = this.paginator.pageIndex; + pageEvent.pageSize = this.paginator.pageSize; + this.paginator.page.emit(pageEvent); + } } diff --git a/src/app/admin/permission/permission.component.html b/src/app/admin/permission/permission.component.html index 90c6b6463..0680b43f9 100644 --- a/src/app/admin/permission/permission.component.html +++ b/src/app/admin/permission/permission.component.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/app/admin/permission/permission.component.spec.ts b/src/app/admin/permission/permission.component.spec.ts index 46525adf9..1d512dea9 100644 --- a/src/app/admin/permission/permission.component.spec.ts +++ b/src/app/admin/permission/permission.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { PermissionComponent } from './permission.component'; +import { PermissionComponent } from "./permission.component"; -describe('PermissionComponent', () => { +describe("PermissionComponent", () => { let component: PermissionComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ PermissionComponent ] - }) - .compileComponents(); + declarations: [PermissionComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('PermissionComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/permission/permission.component.ts b/src/app/admin/permission/permission.component.ts index d8ddb28a8..97c9d2af3 100644 --- a/src/app/admin/permission/permission.component.ts +++ b/src/app/admin/permission/permission.component.ts @@ -1,17 +1,14 @@ -import { Component, OnInit } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { Component, OnInit } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; @Component({ - selector: 'app-permission', - templateUrl: './permission.component.html', - styleUrls: ['./permission.component.scss'] + selector: "app-permission", + templateUrl: "./permission.component.html", + styleUrls: ["./permission.component.scss"], }) export class PermissionComponent implements OnInit { - constructor(public translate: TranslateService) { - translate.use('da'); - } - ngOnInit(): void { + translate.use("da"); } - + ngOnInit(): void {} } diff --git a/src/app/admin/permission/permission.model.ts b/src/app/admin/permission/permission.model.ts index f8777dfe5..4d85096dc 100644 --- a/src/app/admin/permission/permission.model.ts +++ b/src/app/admin/permission/permission.model.ts @@ -1,6 +1,6 @@ -import { OrganisationResponse } from '../organisation/organisation.model'; -import { UserResponse } from '../users/user.model'; -import { Application } from '../../applications/application.model'; +import { OrganisationResponse } from "../organisation/organisation.model"; +import { UserResponse } from "../users/user.model"; +import { Application } from "../../applications/application.model"; export class PermissionRequest { levels: PermissionTypes[]; @@ -44,9 +44,9 @@ export interface PermissionTypes { } export enum PermissionType { - GlobalAdmin = 'GlobalAdmin', - OrganizationUserAdmin = 'OrganizationUserAdmin', - OrganizationGatewayAdmin = 'OrganizationGatewayAdmin', - OrganizationApplicationAdmin = 'OrganizationApplicationAdmin', - Read = 'Read', + GlobalAdmin = "GlobalAdmin", + OrganizationUserAdmin = "OrganizationUserAdmin", + OrganizationGatewayAdmin = "OrganizationGatewayAdmin", + OrganizationApplicationAdmin = "OrganizationApplicationAdmin", + Read = "Read", } diff --git a/src/app/admin/permission/permission.service.ts b/src/app/admin/permission/permission.service.ts index d2ce1d8b1..83bc20403 100644 --- a/src/app/admin/permission/permission.service.ts +++ b/src/app/admin/permission/permission.service.ts @@ -1,62 +1,45 @@ -import { Injectable } from '@angular/core'; -import { RestService } from '../../shared/services/rest.service'; -import { Observable } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { RestService } from "../../shared/services/rest.service"; +import { Observable } from "rxjs"; import { PermissionGetManyResponse, PermissionResponse, PermissionRequest, PermissionRequestAcceptUser, -} from './permission.model'; -import { map } from 'rxjs/operators'; -import { UserMinimalService } from '../users/user-minimal.service'; +} from "./permission.model"; +import { map } from "rxjs/operators"; +import { UserMinimalService } from "../users/user-minimal.service"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class PermissionService { - endpoint = 'permission'; - constructor( - private restService: RestService, - private userMinimalService: UserMinimalService - ) {} + endpoint = "permission"; + constructor(private restService: RestService, private userMinimalService: UserMinimalService) {} createPermission(body: PermissionRequest): Observable { return this.restService.post(this.endpoint, body, { - observe: 'response', + observe: "response", }); } - createPermissionAcceptUser( - body: PermissionRequestAcceptUser - ): Observable { - return this.restService.put( - this.endpoint + '/acceptUser', - body, - undefined, - { - observe: 'response', - } - ); + createPermissionAcceptUser(body: PermissionRequestAcceptUser): Observable { + return this.restService.put(this.endpoint + "/acceptUser", body, undefined, { + observe: "response", + }); } - updatePermission( - body: PermissionRequest, - id: number - ): Observable { + updatePermission(body: PermissionRequest, id: number): Observable { return this.restService.put(this.endpoint, body, id, { - observe: 'response', + observe: "response", }); } getPermission(id: number): Observable { return this.restService.get(this.endpoint, {}, id).pipe( map((response: PermissionResponse) => { - response.createdByName = this.userMinimalService.getUserNameFrom( - response.createdBy - ); - response.updatedByName = this.userMinimalService.getUserNameFrom( - response.updatedBy - ); + response.createdByName = this.userMinimalService.getUserNameFrom(response.createdBy); + response.updatedByName = this.userMinimalService.getUserNameFrom(response.updatedBy); return response; }) ); diff --git a/src/app/admin/users/accept-user/accept-user.component.html b/src/app/admin/users/accept-user/accept-user.component.html index 45aafb4a8..5a5801726 100644 --- a/src/app/admin/users/accept-user/accept-user.component.html +++ b/src/app/admin/users/accept-user/accept-user.component.html @@ -14,23 +14,32 @@

- {{ 'USERS.ACCEPT-USER.QUESTION-ACCEPT' | translate }} + {{ "USERS.ACCEPT-USER.QUESTION-ACCEPT" | translate }} {{ user.name }} - {{ 'USERS.ACCEPT-USER.IN-ORGANIZATION' | translate }} - {{ organizationName}} + {{ "USERS.ACCEPT-USER.IN-ORGANIZATION" | translate }} + {{ organizationName }}

- * - + * + {{ permission.name }} @@ -38,10 +47,10 @@

diff --git a/src/app/admin/users/accept-user/accept-user.component.ts b/src/app/admin/users/accept-user/accept-user.component.ts index 4d5f424fb..b713ac64a 100644 --- a/src/app/admin/users/accept-user/accept-user.component.ts +++ b/src/app/admin/users/accept-user/accept-user.component.ts @@ -1,25 +1,25 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnInit, OnDestroy } from "@angular/core"; +import { ActivatedRoute, Router } from "@angular/router"; import { PermissionRequestAcceptUser, PermissionType, PermissionTypes, PermissionResponse, -} from '@app/admin/permission/permission.model'; -import { TranslateService } from '@ngx-translate/core'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { Subscription } from 'rxjs'; -import { UserResponse } from '../user.model'; -import { UserService } from '../user.service'; -import { Location } from '@angular/common'; -import { PermissionService } from '@app/admin/permission/permission.service'; -import { UntypedFormControl } from '@angular/forms'; +} from "@app/admin/permission/permission.model"; +import { TranslateService } from "@ngx-translate/core"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { Subscription } from "rxjs"; +import { UserResponse } from "../user.model"; +import { UserService } from "../user.service"; +import { Location } from "@angular/common"; +import { PermissionService } from "@app/admin/permission/permission.service"; +import { UntypedFormControl } from "@angular/forms"; @Component({ - selector: 'app-accept-user', - templateUrl: './accept-user.component.html', - styleUrls: ['./accept-user.component.scss'], + selector: "app-accept-user", + templateUrl: "./accept-user.component.html", + styleUrls: ["./accept-user.component.scss"], }) export class AcceptUserComponent implements OnInit, OnDestroy { public backButtonTitle: string; @@ -53,47 +53,34 @@ export class AcceptUserComponent implements OnInit, OnDestroy { ) {} ngOnInit(): void { - this.userId = +this.route.snapshot.paramMap.get('user-id'); - this.organizationId = +this.route.snapshot.paramMap.get('org-id'); + this.userId = +this.route.snapshot.paramMap.get("user-id"); + this.organizationId = +this.route.snapshot.paramMap.get("org-id"); if (this.userId) { this.getUser(this.userId); } - this.translate - .get(['GEN.BACK', 'USERS.ACCEPT-USER.ACCEPT']) - .subscribe((translations) => { - this.backButtonTitle = translations['GEN.BACK']; - this.title = translations['USERS.ACCEPT-USER.ACCEPT']; - }); + this.translate.get(["GEN.BACK", "USERS.ACCEPT-USER.ACCEPT"]).subscribe(translations => { + this.backButtonTitle = translations["GEN.BACK"]; + this.title = translations["USERS.ACCEPT-USER.ACCEPT"]; + }); this.permission.userId = this.userId; this.permission.organizationId = this.organizationId; this.getPermissionsForOrg(this.organizationId); } private getUser(id: number) { - this.subscription = this.userService - .getOne(id, false) - .subscribe((response) => { - this.user = response; - }); + this.subscription = this.userService.getOne(id, false).subscribe(response => { + this.user = response; + }); } private getPermissionsForOrg(orgId: number) { this.permissionsForOrgSubscription = this.permissionService - .getPermissions( - undefined, - undefined, - undefined, - undefined, - undefined, - orgId - ) + .getPermissions(undefined, undefined, undefined, undefined, undefined, orgId) .subscribe( - (permissionsResponse) => { - this.permissions = permissionsResponse.data.filter( - (x) => x.organization?.id === this.organizationId - ); + permissionsResponse => { + this.permissions = permissionsResponse.data.filter(x => x.organization?.id === this.organizationId); this.permissionsCtrl.setValue(this.permissions); this.organizationName = permissionsResponse.data[0]?.organization?.name; }, @@ -114,17 +101,15 @@ export class AcceptUserComponent implements OnInit, OnDestroy { } onSubmit(): void { - this.permissionService - .createPermissionAcceptUser(this.permission) - .subscribe( - () => { - this.routeBack(); - }, - (error: HttpErrorResponse) => { - console.log(error); - this.showError(error); - } - ); + this.permissionService.createPermissionAcceptUser(this.permission).subscribe( + () => { + this.routeBack(); + }, + (error: HttpErrorResponse) => { + console.log(error); + this.showError(error); + } + ); } ngOnDestroy() { diff --git a/src/app/admin/users/new-kombit-user-page/new-user.component.html b/src/app/admin/users/new-kombit-user-page/new-user.component.html index 9ad02297b..0b95f4c5c 100644 --- a/src/app/admin/users/new-kombit-user-page/new-user.component.html +++ b/src/app/admin/users/new-kombit-user-page/new-user.component.html @@ -5,7 +5,7 @@

- {{ 'NEW_USER.FIRST_LOGIN' | translate }} + {{ "NEW_USER.FIRST_LOGIN" | translate }}

@@ -14,14 +14,12 @@

{{ error | translate }}
  • - {{errorMessage | translate}} -
  • + {{ errorMessage | translate }} +

    - {{ "USERS.EMAIL" | translate }}* name="email" [(ngModel)]="createNewKombitUserFromFrontend.email" [ngClass]="{ - 'is-invalid': - formFailedSubmit && errorFields.includes('email'), + 'is-invalid': formFailedSubmit && errorFields.includes('email'), 'is-valid': formFailedSubmit && !errorFields.includes('email') }" />
    - * + * panelClass="overflow-x-hidden" aria-required="true" > - + - {{ org.name }} - + {{ org.name }} +
    diff --git a/src/app/admin/users/new-kombit-user-page/new-user.component.ts b/src/app/admin/users/new-kombit-user-page/new-user.component.ts index 46aea1244..ecdc5b510 100644 --- a/src/app/admin/users/new-kombit-user-page/new-user.component.ts +++ b/src/app/admin/users/new-kombit-user-page/new-user.component.ts @@ -1,24 +1,21 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; -import { Router } from '@angular/router'; -import { Organisation } from '@app/admin/organisation/organisation.model'; -import { OrganisationService } from '@app/admin/organisation/organisation.service'; -import { - CreateNewKombitUserDto, - CreateNewKombitUserFromFrontend, -} from '@app/admin/users/user.model'; -import { UserService } from '@app/admin/users/user.service'; -import { TranslateService } from '@ngx-translate/core'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { ReplaySubject, Subject, Subscription } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnInit } from "@angular/core"; +import { UntypedFormControl } from "@angular/forms"; +import { Router } from "@angular/router"; +import { Organisation } from "@app/admin/organisation/organisation.model"; +import { OrganisationService } from "@app/admin/organisation/organisation.service"; +import { CreateNewKombitUserDto, CreateNewKombitUserFromFrontend } from "@app/admin/users/user.model"; +import { UserService } from "@app/admin/users/user.service"; +import { TranslateService } from "@ngx-translate/core"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { ReplaySubject, Subject, Subscription } from "rxjs"; +import { takeUntil } from "rxjs/operators"; @Component({ - selector: 'app-new-user', - templateUrl: './new-user.component.html', - styleUrls: ['./new-user.component.scss'], + selector: "app-new-user", + templateUrl: "./new-user.component.html", + styleUrls: ["./new-user.component.scss"], }) export class NewUserComponent implements OnInit { public organisationSubscription: Subscription; @@ -29,9 +26,7 @@ export class NewUserComponent implements OnInit { public errorMessages: unknown; public createNewKombitUserFromFrontend: CreateNewKombitUserFromFrontend = new CreateNewKombitUserFromFrontend(); public organisationsFilterCtrl: UntypedFormControl = new UntypedFormControl(); - public filteredOrganisations: ReplaySubject< - Organisation[] - > = new ReplaySubject(1); + public filteredOrganisations: ReplaySubject = new ReplaySubject(1); public errorMessage: string; private onDestroy = new Subject(); @@ -46,23 +41,15 @@ export class NewUserComponent implements OnInit { ngOnInit(): void { if (history.state.fromKombit) { - this.translate.get([ - 'NEW_USER.FIRST_LOGIN', - 'USERS.EMAIL', - 'NAV.ORGANISATIONS', - 'NAV.BACK', - 'USERS.SAVE', - ]); + this.translate.get(["NEW_USER.FIRST_LOGIN", "USERS.EMAIL", "NAV.ORGANISATIONS", "NAV.BACK", "USERS.SAVE"]); this.getOrganisations(); - this.organisationsFilterCtrl.valueChanges - .pipe(takeUntil(this.onDestroy)) - .subscribe(() => { - this.filterOrganisations(); - }); + this.organisationsFilterCtrl.valueChanges.pipe(takeUntil(this.onDestroy)).subscribe(() => { + this.filterOrganisations(); + }); } else { - this.router.navigate(['/not-found']); + this.router.navigate(["/not-found"]); } } @@ -80,7 +67,7 @@ export class NewUserComponent implements OnInit { search = search.toLowerCase(); } - const filtered = this.organisations.filter((org) => { + const filtered = this.organisations.filter(org => { return org.name.toLocaleLowerCase().indexOf(search) > -1; }); @@ -90,13 +77,11 @@ export class NewUserComponent implements OnInit { onSubmit(): void { this.resetErrors(); - const createNewKombitUserDTO = this.mapToDto( - this.createNewKombitUserFromFrontend - ); + const createNewKombitUserDTO = this.mapToDto(this.createNewKombitUserFromFrontend); this.userService.updateNewKombit(createNewKombitUserDTO).subscribe( () => { - this.router.navigate(['/applications']); + this.router.navigate(["/applications"]); }, (error: HttpErrorResponse) => { this.handleError(error); @@ -105,24 +90,19 @@ export class NewUserComponent implements OnInit { ); } - private mapToDto( - frontendModel: CreateNewKombitUserFromFrontend - ): CreateNewKombitUserDto { + private mapToDto(frontendModel: CreateNewKombitUserFromFrontend): CreateNewKombitUserDto { const createNewKombitUserDTO = new CreateNewKombitUserDto(); createNewKombitUserDTO.email = frontendModel.email; createNewKombitUserDTO.requestedOrganizationIds = []; - frontendModel.requestedOrganizations.forEach((organization) => { + frontendModel.requestedOrganizations.forEach(organization => { createNewKombitUserDTO.requestedOrganizationIds.push(organization.id); }); return createNewKombitUserDTO; } - public compare( - o1: Organisation | undefined, - o2: Organisation | undefined - ): boolean { + public compare(o1: Organisation | undefined, o2: Organisation | undefined): boolean { return o1?.id === o2?.id; } @@ -131,12 +111,10 @@ export class NewUserComponent implements OnInit { if (!this.organisations) { this.filteredOrganisations.next(this.organisations.slice()); } else { - this.organisationSubscription = this.organisationService - .getMinimalNoPerm() - .subscribe((orgs) => { - this.organisations = orgs.data; - this.filteredOrganisations.next(this.organisations.slice()); - }); + this.organisationSubscription = this.organisationService.getMinimalNoPerm().subscribe(orgs => { + this.organisations = orgs.data; + this.filteredOrganisations.next(this.organisations.slice()); + }); } } @@ -147,7 +125,7 @@ export class NewUserComponent implements OnInit { } handleError(error: HttpErrorResponse) { - if (typeof error.error?.error === 'string' && typeof error.error?.message === 'string') { + if (typeof error.error?.error === "string" && typeof error.error?.message === "string") { this.errorMessage = error.error?.message; } else { const errors = this.errorMessageService.handleErrorMessageWithFields(error); diff --git a/src/app/admin/users/user-detail/user-detail.component.html b/src/app/admin/users/user-detail/user-detail.component.html index 89edbc39e..ac523950a 100644 --- a/src/app/admin/users/user-detail/user-detail.component.html +++ b/src/app/admin/users/user-detail/user-detail.component.html @@ -1,37 +1,54 @@
    - -
    -
    -
    -
    -

    {{ 'USERS.DETAIL.HEADLINE' | translate }}

    -

    {{ 'USERS.DETAIL.EMAIL' | translate }}{{user.email}}

    - -

    - {{ 'USERS.DETAIL.STATUS' | translate }}{{user.active | activeDeactive}}

    -

    - {{ 'USERS.DETAIL.LAST-LOGIN' | translate }}{{user?.lastLogin | dkTime}}

    - -

    {{ 'USERS.DETAIL.LAST-LOGIN' | translate }}{{ 'USERS.DETAIL.NO-LOGIN' | translate }} -

    -
    -

    {{ 'USERS.DETAIL.GLOBALADMIN' | translate }} - {{((user.permissions | isGlobalAdmin) ? 'USERS.GLOBAL_ADMIN.TRUE' : 'USERS.GLOBAL_ADMIN.FALSE') | translate}} -

    -
    -
    + +
    +
    +
    +
    +

    {{ "USERS.DETAIL.HEADLINE" | translate }}

    +

    + {{ "USERS.DETAIL.EMAIL" | translate }}{{ user.email }} +

    + +

    + {{ "USERS.DETAIL.STATUS" | translate }}{{ user.active | activeDeactive }} +

    +

    + {{ "USERS.DETAIL.LAST-LOGIN" | translate }}{{ user?.lastLogin | dkTime }}

    + +

    + {{ "USERS.DETAIL.LAST-LOGIN" | translate }}{{ "USERS.DETAIL.NO-LOGIN" | translate }} +

    +
    +

    + {{ "USERS.DETAIL.GLOBALADMIN" | translate }} + {{ + ((user.permissions | isGlobalAdmin) ? "USERS.GLOBAL_ADMIN.TRUE" : "USERS.GLOBAL_ADMIN.FALSE") | translate + }} +

    -
    -
    -
    -

    - {{ 'USERS.DETAIL.PERMISSIONS' | translate }} -

    - - -
    -
    +
    +
    +
    +
    +
    +

    + {{ "USERS.DETAIL.PERMISSIONS" | translate }} +

    +
    +
    +
    diff --git a/src/app/admin/users/user-detail/user-detail.component.spec.ts b/src/app/admin/users/user-detail/user-detail.component.spec.ts index 700be6e28..396d06d6b 100644 --- a/src/app/admin/users/user-detail/user-detail.component.spec.ts +++ b/src/app/admin/users/user-detail/user-detail.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { UserDetailComponent } from './user-detail.component'; +import { UserDetailComponent } from "./user-detail.component"; -describe('UserDetailComponent', () => { +describe("UserDetailComponent", () => { let component: UserDetailComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ UserDetailComponent ] - }) - .compileComponents(); + declarations: [UserDetailComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('UserDetailComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/users/user-detail/user-detail.component.ts b/src/app/admin/users/user-detail/user-detail.component.ts index 46063d7c0..91ff95840 100644 --- a/src/app/admin/users/user-detail/user-detail.component.ts +++ b/src/app/admin/users/user-detail/user-detail.component.ts @@ -1,22 +1,22 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { Subscription } from 'rxjs'; -import { UserResponse } from '../user.model'; -import { UserService } from '../user.service'; -import { BackButton } from '@shared/models/back-button.model'; -import { QuickActionButton } from '@shared/models/quick-action-button.model'; -import { Application } from '@applications/application.model'; -import { OrganisationResponse } from '@app/admin/organisation/organisation.model'; -import { DropdownButton } from '@shared/models/dropdown-button.model'; -import { environment } from '@environments/environment'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { ActivatedRoute, Router } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { Subscription } from "rxjs"; +import { UserResponse } from "../user.model"; +import { UserService } from "../user.service"; +import { BackButton } from "@shared/models/back-button.model"; +import { QuickActionButton } from "@shared/models/quick-action-button.model"; +import { Application } from "@applications/application.model"; +import { OrganisationResponse } from "@app/admin/organisation/organisation.model"; +import { DropdownButton } from "@shared/models/dropdown-button.model"; +import { environment } from "@environments/environment"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-user-detail', - templateUrl: './user-detail.component.html', - styleUrls: ['./user-detail.component.scss'], + selector: "app-user-detail", + templateUrl: "./user-detail.component.html", + styleUrls: ["./user-detail.component.scss"], }) export class UserDetailComponent implements OnInit, OnDestroy { isLoadingResults = true; @@ -29,17 +29,17 @@ export class UserDetailComponent implements OnInit, OnDestroy { organisation: OrganisationResponse; user: UserResponse; public backButton: BackButton = { - label: '', + label: "", routerLink: undefined, }; public buttons: QuickActionButton[] = [ { - label: 'USERS.DELETE', - type: 'delete', + label: "USERS.DELETE", + type: "delete", }, { - label: 'USERS.EDIT', - type: 'edit', + label: "USERS.EDIT", + type: "edit", }, ]; dropdownButton: DropdownButton; @@ -56,38 +56,32 @@ export class UserDetailComponent implements OnInit, OnDestroy { ) {} ngOnInit(): void { - this.translate.use('da'); - this.id = +this.route.snapshot.paramMap.get('user-id'); + this.translate.use("da"); + this.id = +this.route.snapshot.paramMap.get("user-id"); if (this.id > 0) { this.getUser(this.id); this.dropdownButton = { - label: '', - editRouterLink: 'edit-user', + label: "", + editRouterLink: "edit-user", isErasable: false, }; } - this.translate - .get(['NAV.USERS', 'USERS.DETAIL.DROPDOWN']) - .subscribe((translations) => { - this.backButton.label = translations['NAV.USERS']; - this.dropdownButton.label = translations['USERS.DETAIL.DROPDOWN']; - }); - this.canEdit = this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.UserAdministrationWrite - ); + this.translate.get(["NAV.USERS", "USERS.DETAIL.DROPDOWN"]).subscribe(translations => { + this.backButton.label = translations["NAV.USERS"]; + this.dropdownButton.label = translations["USERS.DETAIL.DROPDOWN"]; + }); + this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.UserAdministrationWrite); } private getUser(id: number) { - this.subscription = this.userService - .getOne(id, true) - .subscribe((response) => { - this.user = response; - this.isLoadingResults = false; - }); + this.subscription = this.userService.getOne(id, true).subscribe(response => { + this.user = response; + this.isLoadingResults = false; + }); } onEditUser() { - this.router.navigate(['edit-user'], { relativeTo: this.route }); + this.router.navigate(["edit-user"], { relativeTo: this.route }); } ngOnDestroy() { diff --git a/src/app/admin/users/user-edit/user-edit.component.html b/src/app/admin/users/user-edit/user-edit.component.html index a7add0d85..0ee115bae 100644 --- a/src/app/admin/users/user-edit/user-edit.component.html +++ b/src/app/admin/users/user-edit/user-edit.component.html @@ -1,56 +1,98 @@ - +
    -
    -
      -
    • - {{error | translate}} -
    • -
    • - {{errorMessage | translate}} -
    • -
    -
    +
    +
      +
    • + {{ error | translate }} +
    • +
    • + {{ errorMessage | translate }} +
    • +
    +
    -
    -
    - * - -
    +
    +
    + * +
    -
    -
    - * - -
    +
    +
    +
    + * +
    +
    -
    -
    - * - -
    -
    -
    - - {{'USERS.FORM.ACTIVE' | translate}} -
    -
    - - {{'USERS.FORM.GLOBAL-ADMIN' | translate}} +
    +
    + * +
    -
    -
    - - -
    +
    +
    + + {{ "USERS.FORM.ACTIVE" | translate }} +
    +
    + + {{ "USERS.FORM.GLOBAL-ADMIN" | translate }} +
    +
    +
    + +
    +
    diff --git a/src/app/admin/users/user-edit/user-edit.component.spec.ts b/src/app/admin/users/user-edit/user-edit.component.spec.ts index 69e3971d8..6d3008f06 100644 --- a/src/app/admin/users/user-edit/user-edit.component.spec.ts +++ b/src/app/admin/users/user-edit/user-edit.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { UserEditComponent } from './user-edit.component'; +import { UserEditComponent } from "./user-edit.component"; -describe('UserEditComponent', () => { +describe("UserEditComponent", () => { let component: UserEditComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ UserEditComponent ] - }) - .compileComponents(); + declarations: [UserEditComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('UserEditComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/users/user-edit/user-edit.component.ts b/src/app/admin/users/user-edit/user-edit.component.ts index b8e5b61bd..608d7d739 100644 --- a/src/app/admin/users/user-edit/user-edit.component.ts +++ b/src/app/admin/users/user-edit/user-edit.component.ts @@ -1,22 +1,22 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; -import { UserRequest } from '../user.model'; -import { TranslateService } from '@ngx-translate/core'; -import { UserService } from '../user.service'; -import { Subscription } from 'rxjs'; -import { Location } from '@angular/common'; -import { PermissionType } from '@app/admin/permission/permission.model'; -import { AuthService, CurrentUserInfoResponse } from '@auth/auth.service'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnInit } from "@angular/core"; +import { UntypedFormGroup } from "@angular/forms"; +import { ActivatedRoute } from "@angular/router"; +import { UserRequest } from "../user.model"; +import { TranslateService } from "@ngx-translate/core"; +import { UserService } from "../user.service"; +import { Subscription } from "rxjs"; +import { Location } from "@angular/common"; +import { PermissionType } from "@app/admin/permission/permission.model"; +import { AuthService, CurrentUserInfoResponse } from "@auth/auth.service"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-user-edit', - templateUrl: './user-edit.component.html', - styleUrls: ['./user-edit.component.scss'], + selector: "app-user-edit", + templateUrl: "./user-edit.component.html", + styleUrls: ["./user-edit.component.scss"], }) export class UserEditComponent implements OnInit { user = new UserRequest(); @@ -25,9 +25,9 @@ export class UserEditComponent implements OnInit { public errorFields: string[]; public formFailedSubmit = false; public form: UntypedFormGroup; - public backButtonTitle = ''; - public title = ''; - public submitButton = ''; + public backButtonTitle = ""; + public title = ""; + public submitButton = ""; id: number; subscription: Subscription; isGlobalAdmin = false; @@ -45,15 +45,13 @@ export class UserEditComponent implements OnInit { ) {} ngOnInit(): void { - this.translate.use('da'); - this.translate - .get(['NAV.USERS', 'FORM.EDIT-USERS', 'USERS.SAVE']) - .subscribe((translations) => { - this.backButtonTitle = translations['NAV.USERS']; - this.title = translations['FORM.EDIT-USERS']; - this.submitButton = translations['USERS.SAVE']; - }); - this.id = +this.route.snapshot.paramMap.get('user-id'); + this.translate.use("da"); + this.translate.get(["NAV.USERS", "FORM.EDIT-USERS", "USERS.SAVE"]).subscribe(translations => { + this.backButtonTitle = translations["NAV.USERS"]; + this.title = translations["FORM.EDIT-USERS"]; + this.submitButton = translations["USERS.SAVE"]; + }); + this.id = +this.route.snapshot.paramMap.get("user-id"); if (this.id > 0) { this.getUser(this.id); } else { @@ -65,12 +63,12 @@ export class UserEditComponent implements OnInit { } private getUser(id: number) { - this.subscription = this.userService.getOne(id).subscribe((response) => { + this.subscription = this.userService.getOne(id).subscribe(response => { this.user.name = response.name; this.user.email = response.email; this.user.id = response.id; this.user.active = response.active; - this.user.globalAdmin = response.permissions.some((response) => + this.user.globalAdmin = response.permissions.some(response => this.meService.hasPermissions(response, PermissionType.GlobalAdmin) ); this.isKombit = response.nameId != null; @@ -84,7 +82,7 @@ export class UserEditComponent implements OnInit { private create(): void { this.userService.post(this.user).subscribe( - (response) => { + response => { console.log(response); this.routeBack(); }, @@ -96,10 +94,10 @@ export class UserEditComponent implements OnInit { private update(): void { this.userService.put(this.user, this.id).subscribe( - (response) => { + response => { this.routeBack(); }, - (error) => { + error => { this.showError(error); } ); @@ -117,19 +115,15 @@ export class UserEditComponent implements OnInit { this.errorFields = []; this.errorMessages = []; - if (typeof error.error?.message === 'string') { + if (typeof error.error?.message === "string") { this.errorMessage = error.error.message; - if ( - error.error.message === 'MESSAGE.PASSWORD-DOES-NOT-MEET-REQUIREMENTS' - ) { - this.errorFields.push('password'); + if (error.error.message === "MESSAGE.PASSWORD-DOES-NOT-MEET-REQUIREMENTS") { + this.errorFields.push("password"); } } else if (error.error?.message?.length > 0) { - error.error.message.forEach((err) => { + error.error.message.forEach(err => { this.errorFields.push(err.property); - this.errorMessages = this.errorMessages.concat( - Object.values(err.constraints) - ); + this.errorMessages = this.errorMessages.concat(Object.values(err.constraints)); }); } else { this.errorMessage = error.message; diff --git a/src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.html b/src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.html index 6201b134e..adf9b7ed3 100644 --- a/src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.html +++ b/src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.html @@ -1,7 +1,4 @@
    - +
    diff --git a/src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.ts b/src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.ts index 199f85dd3..4298becd8 100644 --- a/src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.ts +++ b/src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.ts @@ -1,10 +1,10 @@ -import { Component, OnInit } from '@angular/core'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; +import { Component, OnInit } from "@angular/core"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; @Component({ - selector: 'app-awaiting-user-tab', - templateUrl: './awaiting-users-table-tab.component.html', - styleUrls: ['./awaiting-users-table-tab.component.scss'], + selector: "app-awaiting-user-tab", + templateUrl: "./awaiting-users-table-tab.component.html", + styleUrls: ["./awaiting-users-table-tab.component.scss"], }) export class AwaitingUsersTableTabComponent implements OnInit { organizationId: number; diff --git a/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html b/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html index 88817e562..f973f334c 100644 --- a/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html +++ b/src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html @@ -5,23 +5,11 @@
    {{ errorMessage | translate }}
    - +
    - + +
    - {{ 'USERS.NAME' | translate }} + + {{ "USERS.NAME" | translate }}

    {{ element.name }}

    @@ -31,7 +19,7 @@
    - {{ 'USERS.EMAIL' | translate }} + {{ "USERS.EMAIL" | translate }}

    {{ element.email }}

    @@ -52,24 +40,17 @@ aria-expanded="false" [attr.aria-label]="'APPLICATION-TABLE-ROW.SHOW-OPTIONS' | translate" > -
    + +
    diff --git a/src/app/admin/users/user-list/user-table/user-table.component.ts b/src/app/admin/users/user-list/user-table/user-table.component.ts index 547f8c6cd..823337ecf 100644 --- a/src/app/admin/users/user-list/user-table/user-table.component.ts +++ b/src/app/admin/users/user-list/user-table/user-table.component.ts @@ -1,29 +1,22 @@ -import { AfterViewInit, Component, Input, ViewChild } from '@angular/core'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; -import { TranslateService } from '@ngx-translate/core'; -import { catchError, map, startWith, switchMap } from 'rxjs/operators'; -import { UserGetManyResponse, UserResponse } from '../../user.model'; -import { UserService } from '../../user.service'; -import { merge, Observable, of as observableOf } from 'rxjs'; -import { environment } from '@environments/environment'; -import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; -import { MeService } from '@shared/services/me.service'; +import { AfterViewInit, Component, Input, ViewChild } from "@angular/core"; +import { MatPaginator } from "@angular/material/paginator"; +import { MatSort } from "@angular/material/sort"; +import { TranslateService } from "@ngx-translate/core"; +import { catchError, map, startWith, switchMap } from "rxjs/operators"; +import { UserGetManyResponse, UserResponse } from "../../user.model"; +import { UserService } from "../../user.service"; +import { merge, Observable, of as observableOf } from "rxjs"; +import { environment } from "@environments/environment"; +import { DefaultPageSizeOptions } from "@shared/constants/page.constants"; +import { MeService } from "@shared/services/me.service"; @Component({ - selector: 'app-user-table', - templateUrl: './user-table.component.html', - styleUrls: ['./user-table.component.scss'], + selector: "app-user-table", + templateUrl: "./user-table.component.html", + styleUrls: ["./user-table.component.scss"], }) export class UserTableComponent implements AfterViewInit { - displayedColumns: string[] = [ - 'name', - 'email', - 'global', - 'status', - 'lastLogin', - 'menu', - ]; + displayedColumns: string[] = ["name", "email", "global", "status", "lastLogin", "menu"]; data: UserResponse[]; public pageSize = environment.tablePageSize; @@ -43,18 +36,11 @@ export class UserTableComponent implements AfterViewInit { @Input() canSort = true; isGlobalAdmin: boolean; - constructor( - public translate: TranslateService, - private userService: UserService, - private meService: MeService - ) { + constructor(public translate: TranslateService, private userService: UserService, private meService: MeService) { this.isGlobalAdmin = this.meService.hasGlobalAdmin(); } - getUsers( - orderByColumn: string, - orderByDirection: string - ): Observable { + getUsers(orderByColumn: string, orderByDirection: string): Observable { if (this.organizationId !== null && this.organizationId !== undefined) { if (this.isGlobalAdmin) { return this.userService.getMultiple( @@ -94,7 +80,7 @@ export class UserTableComponent implements AfterViewInit { this.isLoadingResults = true; return this.getUsers(this.sort.active, this.sort.direction); }), - map((data) => { + map(data => { // Flip flag to show that loading has finished. this.isLoadingResults = false; this.resultsLength = data.count; @@ -106,6 +92,6 @@ export class UserTableComponent implements AfterViewInit { return observableOf([]); }) ) - .subscribe((data) => (this.data = data)); + .subscribe(data => (this.data = data)); } } diff --git a/src/app/admin/users/user-minimal.model.ts b/src/app/admin/users/user-minimal.model.ts index 2920de722..17a81aab4 100644 --- a/src/app/admin/users/user-minimal.model.ts +++ b/src/app/admin/users/user-minimal.model.ts @@ -1,8 +1,8 @@ export interface UserMinimalResponse { - users: UserMinimal[]; + users: UserMinimal[]; } export interface UserMinimal { - id: number; - name: string; -} \ No newline at end of file + id: number; + name: string; +} diff --git a/src/app/admin/users/user-minimal.service.ts b/src/app/admin/users/user-minimal.service.ts index 8aa36f43d..1ba2b7059 100644 --- a/src/app/admin/users/user-minimal.service.ts +++ b/src/app/admin/users/user-minimal.service.ts @@ -1,59 +1,50 @@ -import { Injectable } from '@angular/core'; -import { RestService } from '@shared/services/rest.service'; -import { Observable } from 'rxjs'; -import { UserMinimal, UserMinimalResponse } from './user-minimal.model'; +import { Injectable } from "@angular/core"; +import { RestService } from "@shared/services/rest.service"; +import { Observable } from "rxjs"; +import { UserMinimal, UserMinimalResponse } from "./user-minimal.model"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class UserMinimalService { - - URL = 'user/minimal'; - URL_NEW_KOMBIT = "kombitCreation/minimalUsers" - private userMinimalList: UserMinimal[]; - - constructor( - private restService: RestService) { } - - getUserMinimalRest(): Observable { - return this.restService.get(this.URL); - } - - getUserMinimalRestNewKombit(): Observable { - return this.restService.get(this.URL_NEW_KOMBIT); - } - - setUserMinimalList() { - return this.getUserMinimalRestNewKombit().subscribe( - (response: UserMinimalResponse) => { - localStorage.setItem( - 'userMinimalList', - JSON.stringify(response.users) - ); - this.userMinimalList = response.users; - } - ); - } - - private getUserMinimalList(): UserMinimal[] { - if (this.userMinimalList) { - return this.userMinimalList; - } - return new Object(JSON.parse(localStorage.getItem('userMinimalList'))) as UserMinimal[]; + URL = "user/minimal"; + URL_NEW_KOMBIT = "kombitCreation/minimalUsers"; + private userMinimalList: UserMinimal[]; + + constructor(private restService: RestService) {} + + getUserMinimalRest(): Observable { + return this.restService.get(this.URL); + } + + getUserMinimalRestNewKombit(): Observable { + return this.restService.get(this.URL_NEW_KOMBIT); + } + + setUserMinimalList() { + return this.getUserMinimalRestNewKombit().subscribe((response: UserMinimalResponse) => { + localStorage.setItem("userMinimalList", JSON.stringify(response.users)); + this.userMinimalList = response.users; + }); + } + + private getUserMinimalList(): UserMinimal[] { + if (this.userMinimalList) { + return this.userMinimalList; } + return new Object(JSON.parse(localStorage.getItem("userMinimalList"))) as UserMinimal[]; + } - getUserNameFrom(id: number): string { - const username = this.getUserMinimalList().find( - user => user.id === id - )?.name; - return username; - } + getUserNameFrom(id: number): string { + const username = this.getUserMinimalList().find(user => user.id === id)?.name; + return username; + } - setHasSeenWelcomeScreen(): void { - localStorage.setItem('hasSeenWelcomeScreen', true.toString()); - } + setHasSeenWelcomeScreen(): void { + localStorage.setItem("hasSeenWelcomeScreen", true.toString()); + } - getHasSeenWelcomeScreen(): boolean { - return !!localStorage.getItem('hasSeenWelcomeScreen'); - } + getHasSeenWelcomeScreen(): boolean { + return !!localStorage.getItem("hasSeenWelcomeScreen"); + } } diff --git a/src/app/admin/users/user-page/user-page.component.html b/src/app/admin/users/user-page/user-page.component.html index ff1785a06..009749d9f 100644 --- a/src/app/admin/users/user-page/user-page.component.html +++ b/src/app/admin/users/user-page/user-page.component.html @@ -5,22 +5,22 @@

    - {{ 'USER_PAGE.AWAITING_CONFIRMATION' | translate }} + {{ "USER_PAGE.AWAITING_CONFIRMATION" | translate }}

    - {{ 'USER_PAGE.APPLY_ORGANISATIONS' | translate }} + {{ "USER_PAGE.APPLY_ORGANISATIONS" | translate }}

    -

    {{ 'USER_PAGE.APPLIED_ORGANISATIONS' | translate }}

    +

    {{ "USER_PAGE.APPLIED_ORGANISATIONS" | translate }}

    {{ org.name }}

    - {{ 'USER_PAGE.NO_APPLIED_ORGS' | translate }} + {{ "USER_PAGE.NO_APPLIED_ORGS" | translate }}

    - {{ 'USER_PAGE.QUESTION_APPLY_ORGANISATIONS' | translate }} + {{ "USER_PAGE.QUESTION_APPLY_ORGANISATIONS" | translate }}
    @@ -33,30 +33,26 @@
    - - + + - {{ org.name }} - + {{ + org.name + }} +
    diff --git a/src/app/admin/users/user-page/user-page.component.ts b/src/app/admin/users/user-page/user-page.component.ts index 5772e9029..35fdd97bc 100644 --- a/src/app/admin/users/user-page/user-page.component.ts +++ b/src/app/admin/users/user-page/user-page.component.ts @@ -1,25 +1,21 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; -import { Organisation } from '@app/admin/organisation/organisation.model'; -import { OrganisationService } from '@app/admin/organisation/organisation.service'; -import { - UpdateUserOrgFromFrontend, - UpdateUserOrgsDto, - UserResponse, -} from '@app/admin/users/user.model'; -import { UserService } from '@app/admin/users/user.service'; -import { CurrentUserInfoResponse } from '@auth/auth.service'; -import { TranslateService } from '@ngx-translate/core'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { ReplaySubject, Subject, Subscription } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnInit } from "@angular/core"; +import { UntypedFormControl } from "@angular/forms"; +import { Organisation } from "@app/admin/organisation/organisation.model"; +import { OrganisationService } from "@app/admin/organisation/organisation.service"; +import { UpdateUserOrgFromFrontend, UpdateUserOrgsDto, UserResponse } from "@app/admin/users/user.model"; +import { UserService } from "@app/admin/users/user.service"; +import { CurrentUserInfoResponse } from "@auth/auth.service"; +import { TranslateService } from "@ngx-translate/core"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { ReplaySubject, Subject, Subscription } from "rxjs"; +import { takeUntil } from "rxjs/operators"; @Component({ - selector: 'app-user-page', - templateUrl: './user-page.component.html', - styleUrls: ['./user-page.component.scss'], + selector: "app-user-page", + templateUrl: "./user-page.component.html", + styleUrls: ["./user-page.component.scss"], }) export class UserPageComponent implements OnInit { public updateUserOrgs: UpdateUserOrgsDto = new UpdateUserOrgsDto(); @@ -38,9 +34,7 @@ export class UserPageComponent implements OnInit { public userInfo: CurrentUserInfoResponse; public pressed = false; public organisationsFilterCtrl: UntypedFormControl = new UntypedFormControl(); - public filteredOrganisations: ReplaySubject< - Organisation[] - > = new ReplaySubject(1); + public filteredOrganisations: ReplaySubject = new ReplaySubject(1); private onDestroy = new Subject(); constructor( @@ -49,47 +43,41 @@ export class UserPageComponent implements OnInit { private organizationService: OrganisationService, private sharedService: SharedVariableService, private errorMessageService: ErrorMessageService, - private sharedVariableService: SharedVariableService, + private sharedVariableService: SharedVariableService ) {} ngOnInit(): void { this.userInfo = this.sharedService.getUserInfo(); const hasSomePermission = this.sharedVariableService.getHasAnyPermission(); - this.userService - .getOneSimple(this.userInfo.user.id) - .subscribe((response: UserResponse) => { - // When used as user-page, check for users organizations so it's only possible to apply not already joined organizations - this.requestedUserOrganizations = response.requestedOrganizations; - if (this.userInfo.organizations.length > 0) { - this.compareRequestedAndAlreadyJoinedOrganizations( - this.requestedUserOrganizations, - this.userInfo.organizations - ); - } - - if (this.requestedUserOrganizations.length === 0) { - this.checkForNoUserOrganizations = true; - } + this.userService.getOneSimple(this.userInfo.user.id).subscribe((response: UserResponse) => { + // When used as user-page, check for users organizations so it's only possible to apply not already joined organizations + this.requestedUserOrganizations = response.requestedOrganizations; + if (this.userInfo.organizations.length > 0) { + this.compareRequestedAndAlreadyJoinedOrganizations( + this.requestedUserOrganizations, + this.userInfo.organizations + ); + } - this.awaitingConfirmation = response.awaitingConfirmation; - if (!this.awaitingConfirmation && hasSomePermission) { - this.translate - .get('GEN.BACK') - .subscribe((translation) => (this.backButtonTitle = translation)); - } - this.translate.get('USER_PAGE.USER_PAGE').subscribe((translation) => { - this.title = translation; - }); + if (this.requestedUserOrganizations.length === 0) { + this.checkForNoUserOrganizations = true; + } - this.getOrganisations(); + this.awaitingConfirmation = response.awaitingConfirmation; + if (!this.awaitingConfirmation && hasSomePermission) { + this.translate.get("GEN.BACK").subscribe(translation => (this.backButtonTitle = translation)); + } + this.translate.get("USER_PAGE.USER_PAGE").subscribe(translation => { + this.title = translation; }); - this.organisationsFilterCtrl.valueChanges - .pipe(takeUntil(this.onDestroy)) - .subscribe(() => { - this.filterOrganisations(); - }); + this.getOrganisations(); + }); + + this.organisationsFilterCtrl.valueChanges.pipe(takeUntil(this.onDestroy)).subscribe(() => { + this.filterOrganisations(); + }); } private filterOrganisations() { if (!this.requestOrganizationsList) { @@ -103,7 +91,7 @@ export class UserPageComponent implements OnInit { } else { search = search.toLowerCase(); } - const filtered = this.requestOrganizationsList.filter((org) => { + const filtered = this.requestOrganizationsList.filter(org => { return org.name.toLocaleLowerCase().indexOf(search) > -1; }); this.filteredOrganisations.next(filtered); @@ -113,31 +101,26 @@ export class UserPageComponent implements OnInit { requestedOrganizations: Organisation[], alreadyJoinedOrganizations: Organisation[] ) { - alreadyJoinedOrganizations.forEach((actOrg) => { - if (!requestedOrganizations.find((org) => org.id === actOrg.id)) { + alreadyJoinedOrganizations.forEach(actOrg => { + if (!requestedOrganizations.find(org => org.id === actOrg.id)) { this.requestedUserOrganizations.push(actOrg); } }); } - public compare( - o1: Organisation | undefined, - o2: Organisation | undefined - ): boolean { + public compare(o1: Organisation | undefined, o2: Organisation | undefined): boolean { return o1?.id === o2?.id; } public getOrganisations() { - this.organisationSubscription = this.organizationService - .getMinimalNoPerm() - .subscribe((orgs) => { - this.requestOrganizationsList = orgs.data; - this.requestOrganizationsList = this.filterChosenOrganizations( - this.requestedUserOrganizations, - this.requestOrganizationsList - ); - this.filteredOrganisations.next(this.requestOrganizationsList.slice()); - }); + this.organisationSubscription = this.organizationService.getMinimalNoPerm().subscribe(orgs => { + this.requestOrganizationsList = orgs.data; + this.requestOrganizationsList = this.filterChosenOrganizations( + this.requestedUserOrganizations, + this.requestOrganizationsList + ); + this.filteredOrganisations.next(this.requestOrganizationsList.slice()); + }); } public filterChosenOrganizations( @@ -146,8 +129,8 @@ export class UserPageComponent implements OnInit { ): Organisation[] { const filteredChosenOrganizations: Organisation[] = []; - allOrganizations.forEach((allOrg) => { - if (!requestedUserOrganizations.find((org) => org.id === allOrg.id)) { + allOrganizations.forEach(allOrg => { + if (!requestedUserOrganizations.find(org => org.id === allOrg.id)) { filteredChosenOrganizations.push(allOrg); } }); @@ -163,7 +146,7 @@ export class UserPageComponent implements OnInit { public mapToDto(body: UpdateUserOrgFromFrontend) { this.updateUserOrgs.requestedOrganizationIds = []; if (body.requestedOrganizations) { - body.requestedOrganizations.forEach((organization) => { + body.requestedOrganizations.forEach(organization => { this.updateUserOrgs.requestedOrganizationIds.push(organization.id); }); } else { diff --git a/src/app/admin/users/user.model.ts b/src/app/admin/users/user.model.ts index 01bbebdce..95c39eaac 100644 --- a/src/app/admin/users/user.model.ts +++ b/src/app/admin/users/user.model.ts @@ -1,8 +1,5 @@ -import { - Organisation, - OrganisationResponse, -} from '../organisation/organisation.model'; -import { PermissionResponse } from '../permission/permission.model'; +import { Organisation, OrganisationResponse } from "../organisation/organisation.model"; +import { PermissionResponse } from "../permission/permission.model"; export class UserRequest { id: number; @@ -33,8 +30,7 @@ export interface UserResponse { requestedOrganizations: OrganisationResponse[]; } -export interface UserResponsePerRequestedOrganization - extends Omit { +export interface UserResponsePerRequestedOrganization extends Omit { requestedOrganization: OrganisationResponse; } diff --git a/src/app/admin/users/user.service.ts b/src/app/admin/users/user.service.ts index 45c75b71c..804e78480 100644 --- a/src/app/admin/users/user.service.ts +++ b/src/app/admin/users/user.service.ts @@ -1,9 +1,9 @@ -import { Injectable } from '@angular/core'; -import { RestService } from '@shared/services/rest.service'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { Organisation } from '../organisation/organisation.model'; -import { UserMinimalService } from './user-minimal.service'; +import { Injectable } from "@angular/core"; +import { RestService } from "@shared/services/rest.service"; +import { Observable } from "rxjs"; +import { map } from "rxjs/operators"; +import { Organisation } from "../organisation/organisation.model"; +import { UserMinimalService } from "./user-minimal.service"; import { UserResponse, UserRequest, @@ -11,19 +11,16 @@ import { CreateNewKombitUserDto, UpdateUserOrgsDto, RejectUserDto, -} from './user.model'; +} from "./user.model"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class UserService { - URL = 'user'; - URL_NEW_KOMBIT = 'kombitCreation'; + URL = "user"; + URL_NEW_KOMBIT = "kombitCreation"; - constructor( - private restService: RestService, - private userMinimalService: UserMinimalService - ) {} + constructor(private restService: RestService, private userMinimalService: UserMinimalService) {} post(body: UserRequest): Observable { return this.restService.post(this.URL, body); @@ -31,24 +28,18 @@ export class UserService { put(body: UserRequest, id: number): Observable { return this.restService.put(this.URL, body, id, { - observe: 'response', + observe: "response", }); } getOne(id: number, extendedInfo = false): Observable { - return this.restService - .get(this.URL, { extendedInfo }, id) - .pipe( - map((response: UserResponse) => { - response.createdByName = this.userMinimalService.getUserNameFrom( - response.createdBy - ); - response.updatedByName = this.userMinimalService.getUserNameFrom( - response.updatedBy - ); - return response; - }) - ); + return this.restService.get(this.URL, { extendedInfo }, id).pipe( + map((response: UserResponse) => { + response.createdByName = this.userMinimalService.getUserNameFrom(response.createdBy); + response.updatedByName = this.userMinimalService.getUserNameFrom(response.updatedBy); + return response; + }) + ); } getMultiple( @@ -57,7 +48,7 @@ export class UserService { orderByColumn?: string, orderByDirection?: string, permissionId?: number - ): Observable { + ): Observable { if (permissionId != null) { return this.restService.get(`permission/${permissionId}/users`, { limit, @@ -79,14 +70,14 @@ export class UserService { orderByColumn?: string, orderByDirection?: string, organizationId?: number - ): Observable { + ): Observable { return this.restService.get(this.URL + `/organizationUsers/${organizationId}`, { limit, offset, orderOn: orderByColumn, sort: orderByDirection, }); - } + } hideWelcome(id: number): Observable { return this.restService.put(`${this.URL}/${id}/hide-welcome`, null, null); @@ -98,15 +89,12 @@ export class UserService { orderByColumn?: string, orderByDirection?: string ): Observable { - return this.restService.get( - this.URL + '/awaitingUsers', - { - limit, - offset, - orderOn: orderByColumn, - sort: orderByDirection, - }, - ); + return this.restService.get(this.URL + "/awaitingUsers", { + limit, + offset, + orderOn: orderByColumn, + sort: orderByDirection, + }); } getAwaitingUsersForOrganization( @@ -116,15 +104,12 @@ export class UserService { orderByColumn?: string, orderByDirection?: string ): Observable { - return this.restService.get( - `${this.URL}/awaitingUsers/${organizationId}`, - { - limit, - offset, - orderOn: orderByColumn, - sort: orderByDirection, - }, - ); + return this.restService.get(`${this.URL}/awaitingUsers/${organizationId}`, { + limit, + offset, + orderOn: orderByColumn, + sort: orderByDirection, + }); } getOneSimple(id: number): Observable { @@ -136,30 +121,20 @@ export class UserService { } updateNewKombit(body: CreateNewKombitUserDto): Observable { - return this.restService.put( - this.URL_NEW_KOMBIT + '/createNewKombitUser', - body, - undefined, - { - observe: 'response', - } - ); + return this.restService.put(this.URL_NEW_KOMBIT + "/createNewKombitUser", body, undefined, { + observe: "response", + }); } updateUserOrgs(body: UpdateUserOrgsDto): Observable { - return this.restService.put( - this.URL_NEW_KOMBIT + '/updateUserOrgs', - body, - undefined, - { - observe: 'response', - } - ); + return this.restService.put(this.URL_NEW_KOMBIT + "/updateUserOrgs", body, undefined, { + observe: "response", + }); } rejectUser(body: RejectUserDto): Observable { - return this.restService.put(this.URL + '/rejectUser', body, undefined, { - observe: 'response', + return this.restService.put(this.URL + "/rejectUser", body, undefined, { + observe: "response", }); } } diff --git a/src/app/admin/users/users.component.html b/src/app/admin/users/users.component.html index 90c6b6463..0680b43f9 100644 --- a/src/app/admin/users/users.component.html +++ b/src/app/admin/users/users.component.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/app/admin/users/users.component.ts b/src/app/admin/users/users.component.ts index 8d6353400..2a0d9074f 100644 --- a/src/app/admin/users/users.component.ts +++ b/src/app/admin/users/users.component.ts @@ -1,14 +1,11 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-users', - templateUrl: './users.component.html' + selector: "app-users", + templateUrl: "./users.component.html", }) export class UsersComponent implements OnInit { + constructor() {} - constructor() { } - - ngOnInit(): void { - } - + ngOnInit(): void {} } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 711a17344..a4dfdc69e 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,32 +1,60 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule, PreloadAllModules } from '@angular/router'; -import { AuthComponent } from './auth/auth.component'; -import { ErrorPageComponent } from './error-page/error-page.component'; -import { SearchComponent } from './search/search.component'; -import { AuthGuardService as AuthGuard } from './auth/auth-guard.service'; -import { NewUserComponent } from './admin/users/new-kombit-user-page/new-user.component'; -import { UserPageComponent } from './admin/users/user-page/user-page.component'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule, PreloadAllModules } from "@angular/router"; +import { AuthComponent } from "./auth/auth.component"; +import { ErrorPageComponent } from "./error-page/error-page.component"; +import { SearchComponent } from "./search/search.component"; +import { AuthGuardService as AuthGuard } from "./auth/auth-guard.service"; +import { NewUserComponent } from "./admin/users/new-kombit-user-page/new-user.component"; +import { UserPageComponent } from "./admin/users/user-page/user-page.component"; const routes: Routes = [ - { path: 'admin', loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule), canActivate: [AuthGuard] }, - { path: 'auth', component: AuthComponent }, - { path: 'applications', loadChildren: () => import('./applications/applications.module').then(m => m.ApplicationsModule), canActivate: [AuthGuard] }, - { path: 'gateways', loadChildren: () => import('./gateway/gateway.module').then(m => m.GatewayModule), canActivate: [AuthGuard] }, - { path: 'profiles', loadChildren: () => import('./profiles/profiles.module').then(m => m.ProfilesModule), canActivate: [AuthGuard] }, - { path: 'payload-decoder', loadChildren: () => import('./payload-decoder/payload-decoder.module').then(m => m.PayloadDecoderModule), canActivate: [AuthGuard] }, - { path: 'sigfox', loadChildren: () => import('./sigfox/sigfox.module').then(m => m.SigfoxModule), canActivate: [AuthGuard] }, - { path: 'device-model', loadChildren: () => import('./device-model/device-model.module').then(m => m.DeviceModelModule), canActivate: [AuthGuard] }, - { path: 'search', component: SearchComponent, canActivate: [AuthGuard] }, - { path: 'not-found', component: ErrorPageComponent, data: { message: 'not-found', code: 404 } }, - { path: 'not-authorized', component: ErrorPageComponent }, - { path: 'new-user', component: NewUserComponent, canActivate: [AuthGuard]}, - { path: 'user-page', component: UserPageComponent, canActivate: [AuthGuard]}, - { path: '', redirectTo: '/applications', pathMatch: 'full' }, - { path: '**', redirectTo: '/not-found', pathMatch: 'full' } + { + path: "admin", + loadChildren: () => import("./admin/admin.module").then(m => m.AdminModule), + canActivate: [AuthGuard], + }, + { path: "auth", component: AuthComponent }, + { + path: "applications", + loadChildren: () => import("./applications/applications.module").then(m => m.ApplicationsModule), + canActivate: [AuthGuard], + }, + { + path: "gateways", + loadChildren: () => import("./gateway/gateway.module").then(m => m.GatewayModule), + canActivate: [AuthGuard], + }, + { + path: "profiles", + loadChildren: () => import("./profiles/profiles.module").then(m => m.ProfilesModule), + canActivate: [AuthGuard], + }, + { + path: "payload-decoder", + loadChildren: () => import("./payload-decoder/payload-decoder.module").then(m => m.PayloadDecoderModule), + canActivate: [AuthGuard], + }, + { + path: "sigfox", + loadChildren: () => import("./sigfox/sigfox.module").then(m => m.SigfoxModule), + canActivate: [AuthGuard], + }, + { + path: "device-model", + loadChildren: () => import("./device-model/device-model.module").then(m => m.DeviceModelModule), + canActivate: [AuthGuard], + }, + { path: "search", component: SearchComponent, canActivate: [AuthGuard] }, + { path: "not-found", component: ErrorPageComponent, data: { message: "not-found", code: 404 } }, + { path: "not-authorized", component: ErrorPageComponent }, + { path: "new-user", component: NewUserComponent, canActivate: [AuthGuard] }, + { path: "user-page", component: UserPageComponent, canActivate: [AuthGuard] }, + { path: "", redirectTo: "/applications", pathMatch: "full" }, + { path: "**", redirectTo: "/not-found", pathMatch: "full" }, ]; @NgModule({ - imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules, relativeLinkResolution: 'legacy' })], - exports: [RouterModule], + imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules, relativeLinkResolution: "legacy" })], + exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/src/app/app.component.html b/src/app/app.component.html index da2046f7b..c5fe39292 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -5,4 +5,4 @@
    -
    \ No newline at end of file +
    diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 8cd6829b6..d562a219c 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -1,8 +1,8 @@ -@import 'src/assets/scss/setup/breakpoints'; -@import 'src/assets/scss/setup/variables'; +@import "src/assets/scss/setup/breakpoints"; +@import "src/assets/scss/setup/variables"; #content { - @media(min-width: $screen-md-min) { + @media (min-width: $screen-md-min) { padding-left: $navWidth; } } diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 89507e7a1..0446f418b 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,33 +1,31 @@ -import { TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AppComponent } from './app.component'; +import { TestBed, waitForAsync } from "@angular/core/testing"; +import { RouterTestingModule } from "@angular/router/testing"; +import { AppComponent } from "./app.component"; -describe('AppComponent', () => { - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule], - declarations: [AppComponent], - }).compileComponents(); - })); +describe("AppComponent", () => { + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [RouterTestingModule], + declarations: [AppComponent], + }).compileComponents(); + })); - it('should create the app', () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); + it("should create the app", () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); - it(`should have as title 'OS2IoT-frontend'`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app.title).toEqual('OS2IoT-frontend'); - }); + it(`should have as title 'OS2IoT-frontend'`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app.title).toEqual("OS2IoT-frontend"); + }); - it('should render title', () => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.nativeElement; - expect(compiled.querySelector('.content span').textContent).toContain( - 'OS2IoT-frontend app is running!' - ); - }); + it("should render title", () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.nativeElement; + expect(compiled.querySelector(".content span").textContent).toContain("OS2IoT-frontend app is running!"); + }); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1d1f82702..e00da019e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,20 +1,18 @@ -import { Component } from '@angular/core'; -import { LoggedInService } from '@shared/services/loggedin.service'; +import { Component } from "@angular/core"; +import { LoggedInService } from "@shared/services/loggedin.service"; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'], + selector: "app-root", + templateUrl: "./app.component.html", + styleUrls: ["./app.component.scss"], }) export class AppComponent { - title = 'OS2IoT-frontend'; - isLoggedIn = true; + title = "OS2IoT-frontend"; + isLoggedIn = true; - constructor(private loggedInService: LoggedInService) { - loggedInService.changeEmitted?.subscribe( - (change) => { - this.isLoggedIn = change; - } - ); - } + constructor(private loggedInService: LoggedInService) { + loggedInService.changeEmitted?.subscribe(change => { + this.isLoggedIn = change; + }); + } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 85f83919b..0647bca93 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,56 +1,47 @@ -import { BrowserModule, Title } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; -import { TranslateHttpLoader } from '@ngx-translate/http-loader'; -import { - HttpClient, - HttpClientModule, - HTTP_INTERCEPTORS, -} from '@angular/common/http'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { NavbarModule } from './navbar/navbar.module'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ProfilesModule } from './profiles/profiles.module'; -import { AuthJwtInterceptor } from '@shared/helpers/auth-jwt.interceptor'; -import { AuthModule } from './auth/auth.module'; -import { GatewayModule } from './gateway/gateway.module'; -import { SharedVariableModule } from '@shared/shared-variable/shared-variable.module'; -import { SAVER, getSaver } from '@shared/providers/saver.provider'; -import { ErrorPageComponent } from './error-page/error-page.component'; -import { SearchModule } from './search/search.module'; -import { JwtModule } from '@auth0/angular-jwt'; -import { MonacoEditorModule } from 'ngx-monaco-editor-v2'; -import { MatInputModule } from '@angular/material/input'; -import { MatPaginatorIntl } from '@angular/material/paginator'; -import { MatPaginatorIntlDa } from '@shared/helpers/mat-paginator-intl-da'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { NewUserComponent } from './admin/users/new-kombit-user-page/new-user.component'; -import { WelcomeDialogModule } from '@shared/components/welcome-dialog/welcome-dialog.module'; -import { NGMaterialModule } from '@shared/Modules/materiale.module'; -import { MatSelectSearchModule } from '@shared/components/mat-select-search/mat-select-search.module'; -import { UserPageComponent } from './admin/users/user-page/user-page.component'; -import { SharedModule } from '@shared/shared.module'; -import { PipesModule } from '@shared/pipes/pipes.module'; -import { CookieService } from 'ngx-cookie-service'; +import { BrowserModule, Title } from "@angular/platform-browser"; +import { NgModule } from "@angular/core"; +import { TranslateModule, TranslateLoader } from "@ngx-translate/core"; +import { TranslateHttpLoader } from "@ngx-translate/http-loader"; +import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http"; +import { AppRoutingModule } from "./app-routing.module"; +import { AppComponent } from "./app.component"; +import { NavbarModule } from "./navbar/navbar.module"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { ProfilesModule } from "./profiles/profiles.module"; +import { AuthJwtInterceptor } from "@shared/helpers/auth-jwt.interceptor"; +import { AuthModule } from "./auth/auth.module"; +import { GatewayModule } from "./gateway/gateway.module"; +import { SharedVariableModule } from "@shared/shared-variable/shared-variable.module"; +import { SAVER, getSaver } from "@shared/providers/saver.provider"; +import { ErrorPageComponent } from "./error-page/error-page.component"; +import { SearchModule } from "./search/search.module"; +import { JwtModule } from "@auth0/angular-jwt"; +import { MonacoEditorModule } from "ngx-monaco-editor-v2"; +import { MatInputModule } from "@angular/material/input"; +import { MatPaginatorIntl } from "@angular/material/paginator"; +import { MatPaginatorIntlDa } from "@shared/helpers/mat-paginator-intl-da"; +import { MatTooltipModule } from "@angular/material/tooltip"; +import { NewUserComponent } from "./admin/users/new-kombit-user-page/new-user.component"; +import { WelcomeDialogModule } from "@shared/components/welcome-dialog/welcome-dialog.module"; +import { NGMaterialModule } from "@shared/Modules/materiale.module"; +import { MatSelectSearchModule } from "@shared/components/mat-select-search/mat-select-search.module"; +import { UserPageComponent } from "./admin/users/user-page/user-page.component"; +import { SharedModule } from "@shared/shared.module"; +import { PipesModule } from "@shared/pipes/pipes.module"; +import { CookieService } from "ngx-cookie-service"; export function HttpLoaderFactory(http: HttpClient) { - return new TranslateHttpLoader(http, './assets/i18n/', '.json'); + return new TranslateHttpLoader(http, "./assets/i18n/", ".json"); } export function tokenGetter() { - return localStorage.getItem('id_token'); + return localStorage.getItem("id_token"); } @NgModule({ - declarations: [ - AppComponent, - ErrorPageComponent, - NewUserComponent, - UserPageComponent, - ], + declarations: [AppComponent, ErrorPageComponent, NewUserComponent, UserPageComponent], imports: [ SharedVariableModule.forRoot(), AuthModule, @@ -61,7 +52,7 @@ export function tokenGetter() { NavbarModule, ProfilesModule, TranslateModule.forRoot({ - defaultLanguage: 'da', + defaultLanguage: "da", loader: { provide: TranslateLoader, useFactory: HttpLoaderFactory, @@ -99,7 +90,7 @@ export function tokenGetter() { { provide: HTTP_INTERCEPTORS, useClass: AuthJwtInterceptor, multi: true }, { provide: SAVER, useFactory: getSaver }, { provide: MatPaginatorIntl, useClass: MatPaginatorIntlDa }, - { provide: CookieService } + { provide: CookieService }, ], }) export class AppModule {} diff --git a/src/app/applications/application-detail/application-detail.component.html b/src/app/applications/application-detail/application-detail.component.html index 63061ad01..60be95bd2 100644 --- a/src/app/applications/application-detail/application-detail.component.html +++ b/src/app/applications/application-detail/application-detail.component.html @@ -1,81 +1,81 @@
    - - -
    -
    -
    -
    -
    - {{ errorMessage | translate }} -
    -

    {{ "APPLICATION.DETAILS" | translate }}

    - -

    - {{ "APPLICATION.DESCRIPTION" | translate }} -

    -

    {{application.description}}

    - -
    + + +
    +
    +
    +
    +
    + {{ errorMessage | translate }} +
    +

    {{ "APPLICATION.DETAILS" | translate }}

    + +

    + {{ "APPLICATION.DESCRIPTION" | translate }} +

    +

    {{application.description}}

    + +
    +
    +
    +
    +
    + +
    +
    +
    + IoTDeviceMarker +

      IoT-Enhed

    +
    +
    + InactiveGatewayMarker +

      Inaktiv gateway

    -
    -
    -
    - -
    -
    -
    - IoTDeviceMarker -

      IoT-Enhed

    -
    -
    - InactiveGatewayMarker -

      Inaktiv gateway

    -
    -
    - ActiveGatewayMarker -

      Aktiv gateway

    -
    -
    -
    +
    + ActiveGatewayMarker +

      Aktiv gateway

    +
    - - +
    + + +
    diff --git a/src/app/applications/application-detail/application-detail.component.scss b/src/app/applications/application-detail/application-detail.component.scss index ff72dad87..d2439da20 100644 --- a/src/app/applications/application-detail/application-detail.component.scss +++ b/src/app/applications/application-detail/application-detail.component.scss @@ -2,21 +2,21 @@ @import "src/assets/scss/setup/variables"; .application-component { - .bottom-separator { - min-height: 60px; - border-bottom: $grey-separator solid 1px; + .bottom-separator { + min-height: 60px; + border-bottom: $grey-separator solid 1px; - @include media-breakpoint-up(md) { - min-height: 150px; - } + @include media-breakpoint-up(md) { + min-height: 150px; } + } } .marker { - height: 25px; - width: 20px; + height: 25px; + width: 20px; } .markerDescriptionDiv { - margin-top: 10px; + margin-top: 10px; } diff --git a/src/app/applications/application-detail/application-detail.component.spec.ts b/src/app/applications/application-detail/application-detail.component.spec.ts index df827095c..862af2f32 100644 --- a/src/app/applications/application-detail/application-detail.component.spec.ts +++ b/src/app/applications/application-detail/application-detail.component.spec.ts @@ -1,16 +1,14 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ApplicationDetailComponent } from './application-detail.component'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ApplicationDetailComponent } from "./application-detail.component"; - -describe('ApplicationComponent', () => { +describe("ApplicationComponent", () => { let component: ApplicationDetailComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ApplicationDetailComponent] - }) - .compileComponents(); + declarations: [ApplicationDetailComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +17,7 @@ describe('ApplicationComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/application-detail/application-detail.component.ts b/src/app/applications/application-detail/application-detail.component.ts index ff9ea829f..ba55cbfe0 100644 --- a/src/app/applications/application-detail/application-detail.component.ts +++ b/src/app/applications/application-detail/application-detail.component.ts @@ -19,201 +19,201 @@ import { ChirpstackGatewayService } from "@shared/services/chirpstack-gateway.se import { Gateway, GatewayResponseMany } from "@app/gateway/gateway.model"; @Component({ - selector: "app-application", - templateUrl: "./application-detail.component.html", - styleUrls: ["./application-detail.component.scss"], + selector: "app-application", + templateUrl: "./application-detail.component.html", + styleUrls: ["./application-detail.component.scss"], }) export class ApplicationDetailComponent implements OnInit, OnDestroy, AfterViewInit { - @Output() deleteApplication = new EventEmitter(); - public navTabs: any[] = [ - { - label: "APPLICATION.IOT-DEVICES", - link: "./iot-devices", - index: 0, - }, - { - label: "APPLICATION.MULTICAST-GROUPS", - link: "./multicast-groups", - index: 1, - }, - { - label: "APPLICATION.DATATARGET-SHOW", - link: "./data-targets", - index: 2, - }, - ]; - public applicationsSubscription: Subscription; - public application: Application; - public backButton: BackButton = { label: "", routerLink: "/applications" }; - public id: number; - public dropdownButton: DropdownButton; - public errorMessage: string; - public canEdit = false; - public devices: IotDevicesApplicationMapResponse[]; - public coordinateList = []; - private deviceSubscription: Subscription; - private gatewaysSubscription: Subscription; - public gateways: Gateway[]; - public redMarker = "/assets/images/red-marker.png"; - public greenMarker = "/assets/images/green-marker.png"; - public greyMarker = "/assets/images/grey-marker.png"; + @Output() deleteApplication = new EventEmitter(); + public navTabs: any[] = [ + { + label: "APPLICATION.IOT-DEVICES", + link: "./iot-devices", + index: 0, + }, + { + label: "APPLICATION.MULTICAST-GROUPS", + link: "./multicast-groups", + index: 1, + }, + { + label: "APPLICATION.DATATARGET-SHOW", + link: "./data-targets", + index: 2, + }, + ]; + public applicationsSubscription: Subscription; + public application: Application; + public backButton: BackButton = { label: "", routerLink: "/applications" }; + public id: number; + public dropdownButton: DropdownButton; + public errorMessage: string; + public canEdit = false; + public devices: IotDevicesApplicationMapResponse[]; + public coordinateList = []; + private deviceSubscription: Subscription; + private gatewaysSubscription: Subscription; + public gateways: Gateway[]; + public redMarker = "/assets/images/red-marker.png"; + public greenMarker = "/assets/images/green-marker.png"; + public greyMarker = "/assets/images/grey-marker.png"; - constructor( - private applicationService: ApplicationService, - private route: ActivatedRoute, - public translate: TranslateService, - public router: Router, - private meService: MeService, - private titleService: Title, - private deleteDialogService: DeleteDialogService, - private restService: RestService, - private sharedVariableService: SharedVariableService, - private chirpstackGatewayService: ChirpstackGatewayService - ) {} + constructor( + private applicationService: ApplicationService, + private route: ActivatedRoute, + public translate: TranslateService, + public router: Router, + private meService: MeService, + private titleService: Title, + private deleteDialogService: DeleteDialogService, + private restService: RestService, + private sharedVariableService: SharedVariableService, + private chirpstackGatewayService: ChirpstackGatewayService + ) {} - ngOnInit(): void { - this.id = +this.route.snapshot.paramMap.get("id"); - if (this.id) { - this.bindApplication(this.id); - this.dropdownButton = { - label: "", - editRouterLink: "../edit-application/" + this.id, - isErasable: true, - }; - } - - this.translate - .get(["NAV.APPLICATIONS", "APPLICATION-TABLE-ROW.SHOW-OPTIONS", "TITLE.APPLICATION"]) - .subscribe(translations => { - this.backButton.label = translations["NAV.APPLICATIONS"]; - this.dropdownButton.label = translations["APPLICATION-TABLE-ROW.SHOW-OPTIONS"]; - this.titleService.setTitle(translations["TITLE.APPLICATION"]); - }); - this.canEdit = this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.ApplicationWrite, - undefined, - this.id - ); - this.applicationService.canEdit = this.canEdit; - this.applicationService.id = this.id; - if (this.router.url.split("/").length <= 3) { - this.router.navigateByUrl(`/applications/${this.id}/iot-devices`, { - replaceUrl: true, - }); - } + ngOnInit(): void { + this.id = +this.route.snapshot.paramMap.get("id"); + if (this.id) { + this.bindApplication(this.id); + this.dropdownButton = { + label: "", + editRouterLink: "../edit-application/" + this.id, + isErasable: true, + }; } - ngAfterViewInit() { - this.deviceSubscription = this.getDevices().subscribe(devices => { - this.devices = devices; - this.mapDevicesToCoordinateList(); - this.getGateways(); - }); + this.translate + .get(["NAV.APPLICATIONS", "APPLICATION-TABLE-ROW.SHOW-OPTIONS", "TITLE.APPLICATION"]) + .subscribe(translations => { + this.backButton.label = translations["NAV.APPLICATIONS"]; + this.dropdownButton.label = translations["APPLICATION-TABLE-ROW.SHOW-OPTIONS"]; + this.titleService.setTitle(translations["TITLE.APPLICATION"]); + }); + this.canEdit = this.meService.hasAccessToTargetOrganization( + OrganizationAccessScope.ApplicationWrite, + undefined, + this.id + ); + this.applicationService.canEdit = this.canEdit; + this.applicationService.id = this.id; + if (this.router.url.split("/").length <= 3) { + this.router.navigateByUrl(`/applications/${this.id}/iot-devices`, { + replaceUrl: true, + }); } + } - private getGateways(): void { - this.gatewaysSubscription = this.chirpstackGatewayService - .getMultiple({ - limit: null, - offset: null, - sort: null, - }) - .subscribe((gateways: GatewayResponseMany) => { - this.gateways = gateways.resultList; - this.mapGatewaysToCoordinateList(); - }); - } + ngAfterViewInit() { + this.deviceSubscription = this.getDevices().subscribe(devices => { + this.devices = devices; + this.mapDevicesToCoordinateList(); + this.getGateways(); + }); + } - private mapDevicesToCoordinateList() { - const tempCoordinateList = []; - this.devices.map(dev => { - if (!dev.location) { - return; - } - tempCoordinateList.push({ - longitude: dev.location.coordinates[0], - latitude: dev.location.coordinates[1], - draggable: false, - editEnabled: false, - useGeolocation: false, - markerInfo: { - name: dev.name, - active: false, - id: dev.id, - isDevice: true, - internalOrganizationId: this.sharedVariableService.getSelectedOrganisationId(), - networkTechnology: dev.type, - lastActive: dev.latestSentMessage, - }, - }); - }); + private getGateways(): void { + this.gatewaysSubscription = this.chirpstackGatewayService + .getMultiple({ + limit: null, + offset: null, + sort: null, + }) + .subscribe((gateways: GatewayResponseMany) => { + this.gateways = gateways.resultList; + this.mapGatewaysToCoordinateList(); + }); + } - this.coordinateList = tempCoordinateList; - } + private mapDevicesToCoordinateList() { + const tempCoordinateList = []; + this.devices.map(dev => { + if (!dev.location) { + return; + } + tempCoordinateList.push({ + longitude: dev.location.coordinates[0], + latitude: dev.location.coordinates[1], + draggable: false, + editEnabled: false, + useGeolocation: false, + markerInfo: { + name: dev.name, + active: false, + id: dev.id, + isDevice: true, + internalOrganizationId: this.sharedVariableService.getSelectedOrganisationId(), + networkTechnology: dev.type, + lastActive: dev.latestSentMessage, + }, + }); + }); - private mapGatewaysToCoordinateList() { - const tempcoordinateList = []; - this.gateways.map(gateway => - tempcoordinateList.push({ - longitude: gateway.location.longitude, - latitude: gateway.location.latitude, - draggable: false, - editEnabled: false, - useGeolocation: false, - markerInfo: { - name: gateway.name, - active: this.getGatewayStatus(gateway), - id: gateway.gatewayId, - internalOrganizationId: gateway.organizationId, - internalOrganizationName: gateway.organizationName, - }, - }) - ); - this.coordinateList.push.apply(this.coordinateList, tempcoordinateList); - } + this.coordinateList = tempCoordinateList; + } - private getGatewayStatus(gateway: Gateway): boolean { - return this.chirpstackGatewayService.isGatewayActive(gateway); - } + private mapGatewaysToCoordinateList() { + const tempcoordinateList = []; + this.gateways.map(gateway => + tempcoordinateList.push({ + longitude: gateway.location.longitude, + latitude: gateway.location.latitude, + draggable: false, + editEnabled: false, + useGeolocation: false, + markerInfo: { + name: gateway.name, + active: this.getGatewayStatus(gateway), + id: gateway.gatewayId, + internalOrganizationId: gateway.organizationId, + internalOrganizationName: gateway.organizationName, + }, + }) + ); + this.coordinateList.push.apply(this.coordinateList, tempcoordinateList); + } - onDeleteApplication() { - this.deleteDialogService.showApplicationDialog(this.application).subscribe(response => { - if (response) { - this.applicationService.deleteApplication(this.application.id).subscribe(response => { - if (response.ok && response.body.affected > 0) { - console.log("delete application with id:" + this.application.id.toString()); - this.router.navigate(["applications"]); - } else { - this.errorMessage = response?.error?.message; - } - }); - } else { - console.log(response); - } - }); - } + private getGatewayStatus(gateway: Gateway): boolean { + return this.chirpstackGatewayService.isGatewayActive(gateway); + } - bindApplication(id: number): void { - this.applicationsSubscription = this.applicationService.getApplication(id).subscribe(application => { - this.application = application; + onDeleteApplication() { + this.deleteDialogService.showApplicationDialog(this.application).subscribe(response => { + if (response) { + this.applicationService.deleteApplication(this.application.id).subscribe(response => { + if (response.ok && response.body.affected > 0) { + console.log("delete application with id:" + this.application.id.toString()); + this.router.navigate(["applications"]); + } else { + this.errorMessage = response?.error?.message; + } }); - } + } else { + console.log(response); + } + }); + } - getDevices(): Observable { - return this.restService.get(`application/${this.id}/iot-devices-map`).pipe( - map((data: IotDevicesApplicationMapResponse[]) => { - // For some reason, the backend is not capable to sort MQTT_EXTERNAL_BROKER and MQTT_INTERNAL_BROKER. - // Therefore we do it manually in the frontend. - return data; - }) - ); - } + bindApplication(id: number): void { + this.applicationsSubscription = this.applicationService.getApplication(id).subscribe(application => { + this.application = application; + }); + } + + getDevices(): Observable { + return this.restService.get(`application/${this.id}/iot-devices-map`).pipe( + map((data: IotDevicesApplicationMapResponse[]) => { + // For some reason, the backend is not capable to sort MQTT_EXTERNAL_BROKER and MQTT_INTERNAL_BROKER. + // Therefore we do it manually in the frontend. + return data; + }) + ); + } - ngOnDestroy() { - this.gatewaysSubscription.unsubscribe(); - this.deviceSubscription?.unsubscribe(); - if (this.applicationsSubscription) { - this.applicationsSubscription.unsubscribe(); - } + ngOnDestroy() { + this.gatewaysSubscription.unsubscribe(); + this.deviceSubscription?.unsubscribe(); + if (this.applicationsSubscription) { + this.applicationsSubscription.unsubscribe(); } + } } diff --git a/src/app/applications/application-edit/application-edit.component.spec.ts b/src/app/applications/application-edit/application-edit.component.spec.ts index 4e690e3a4..6c683a73f 100644 --- a/src/app/applications/application-edit/application-edit.component.spec.ts +++ b/src/app/applications/application-edit/application-edit.component.spec.ts @@ -1,16 +1,14 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ApplicationEditComponent } from './application-edit.component'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ApplicationEditComponent } from "./application-edit.component"; - -describe('EditApplicationComponent', () => { +describe("EditApplicationComponent", () => { let component: ApplicationEditComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ApplicationEditComponent] - }) - .compileComponents(); + declarations: [ApplicationEditComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +17,7 @@ describe('EditApplicationComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/application-edit/application-edit.component.ts b/src/app/applications/application-edit/application-edit.component.ts index b90e98a13..7a35fa048 100644 --- a/src/app/applications/application-edit/application-edit.component.ts +++ b/src/app/applications/application-edit/application-edit.component.ts @@ -1,42 +1,40 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { BackButton } from '@shared/models/back-button.model'; +import { Component, OnInit } from "@angular/core"; +import { ActivatedRoute } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { BackButton } from "@shared/models/back-button.model"; @Component({ - selector: 'app-application-edit', - templateUrl: './application-edit.component.html', - styleUrls: ['./application-edit.component.scss'] + selector: "app-application-edit", + templateUrl: "./application-edit.component.html", + styleUrls: ["./application-edit.component.scss"], }) export class ApplicationEditComponent implements OnInit { - public backButton: BackButton = { label: '', routerLink: 'applications' }; + public backButton: BackButton = { label: "", routerLink: "applications" }; public multiPage = false; - public title = ''; - public sectionTitle = ''; - public submitButton = ''; + public title = ""; + public sectionTitle = ""; + public submitButton = ""; private applicaitonId: string; - constructor( - public translate: TranslateService, - private route: ActivatedRoute - ) { - translate.use('da'); + constructor(public translate: TranslateService, private route: ActivatedRoute) { + translate.use("da"); } ngOnInit(): void { - this.translate.get(['NAV.APPLICATIONS', 'FORM.EDIT-NEW-APPLICATION', 'APPLICATION.SAVE']) + this.translate + .get(["NAV.APPLICATIONS", "FORM.EDIT-NEW-APPLICATION", "APPLICATION.SAVE"]) .subscribe(translations => { - this.backButton.label = translations['NAV.APPLICATIONS']; - this.title = translations['FORM.EDIT-NEW-APPLICATION']; - this.submitButton = translations['APPLICATION.SAVE']; + this.backButton.label = translations["NAV.APPLICATIONS"]; + this.title = translations["FORM.EDIT-NEW-APPLICATION"]; + this.submitButton = translations["APPLICATION.SAVE"]; }); - this.applicaitonId = this.route.snapshot.paramMap.get('id'); + this.applicaitonId = this.route.snapshot.paramMap.get("id"); if (this.applicaitonId) { this.setBackButton(this.applicaitonId); } } private setBackButton(applicationId: string) { - this.backButton.routerLink = ['applications', applicationId] + this.backButton.routerLink = ["applications", applicationId]; } } diff --git a/src/app/applications/application.model.ts b/src/app/applications/application.model.ts index 6ebbf7d73..c5732e919 100644 --- a/src/app/applications/application.model.ts +++ b/src/app/applications/application.model.ts @@ -1,12 +1,12 @@ -import { ControlledPropertyTypes } from '@app/device-model/Enums/controlled-propperty.enum'; -import { ApplicationDeviceTypeUnion } from '@shared/enums/device-type'; -import { ControlledProperty } from '@shared/models/controlled-property.model'; -import { Organisation } from '../admin/organisation/organisation.model'; -import { ApplicationStatus } from './enums/status.enum'; -import { IotDevice } from './iot-devices/iot-device.model'; -import { ApplicationDeviceType } from './models/application-device-type.model'; -import { PermissionResponse } from '@app/admin/permission/permission.model'; -import { Datatarget } from '@applications/datatarget/datatarget.model'; +import { ControlledPropertyTypes } from "@app/device-model/Enums/controlled-propperty.enum"; +import { ApplicationDeviceTypeUnion } from "@shared/enums/device-type"; +import { ControlledProperty } from "@shared/models/controlled-property.model"; +import { Organisation } from "../admin/organisation/organisation.model"; +import { ApplicationStatus } from "./enums/status.enum"; +import { IotDevice } from "./iot-devices/iot-device.model"; +import { ApplicationDeviceType } from "./models/application-device-type.model"; +import { PermissionResponse } from "@app/admin/permission/permission.model"; +import { Datatarget } from "@applications/datatarget/datatarget.model"; export class Application { public id: number; diff --git a/src/app/applications/application.service.ts b/src/app/applications/application.service.ts index f44c172a7..a3d048eef 100644 --- a/src/app/applications/application.service.ts +++ b/src/app/applications/application.service.ts @@ -1,9 +1,9 @@ -import { Injectable } from '@angular/core'; -import { Application, ApplicationData } from '@applications/application.model'; -import { RestService } from '../shared/services/rest.service'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { UserMinimalService } from '@app/admin/users/user-minimal.service'; +import { Injectable } from "@angular/core"; +import { Application, ApplicationData } from "@applications/application.model"; +import { RestService } from "../shared/services/rest.service"; +import { Observable } from "rxjs"; +import { map } from "rxjs/operators"; +import { UserMinimalService } from "@app/admin/users/user-minimal.service"; interface GetApplicationParameters { limit: number; @@ -15,35 +15,28 @@ interface GetApplicationParameters { } @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class ApplicationService { public id: number; public canEdit = false; - constructor( - private restService: RestService, - private userMinimalService: UserMinimalService - ) {} + constructor(private restService: RestService, private userMinimalService: UserMinimalService) {} createApplication(body: any): Observable { - return this.restService.post('application', body, { observe: 'response' }); + return this.restService.post("application", body, { observe: "response" }); } updateApplication(body: any, id: number): Observable { - return this.restService.put('application', body, id, { - observe: 'response', + return this.restService.put("application", body, id, { + observe: "response", }); } getApplication(id: number): Observable { - return this.restService.get('application', {}, id).pipe( + return this.restService.get("application", {}, id).pipe( map((response: Application) => { - response.createdByName = this.userMinimalService.getUserNameFrom( - response.createdBy - ); - response.updatedByName = this.userMinimalService.getUserNameFrom( - response.updatedBy - ); + response.createdByName = this.userMinimalService.getUserNameFrom(response.createdBy); + response.updatedByName = this.userMinimalService.getUserNameFrom(response.updatedBy); return response; }) ); @@ -65,27 +58,22 @@ export class ApplicationService { }; if (permissionId) { body.permissionId = permissionId; - return this.restService.get( - `permission/${permissionId}/applications`, - body - ); + return this.restService.get(`permission/${permissionId}/applications`, body); } else if (organizationId) { body.organizationId = organizationId; - return this.restService.get('application', body); + return this.restService.get("application", body); } - return this.restService.get('application', body); + return this.restService.get("application", body); } - getApplicationsByOrganizationId( - organizationId: number - ): Observable { + getApplicationsByOrganizationId(organizationId: number): Observable { const body = { organizationId, }; - return this.restService.get('application', body); + return this.restService.get("application", body); } deleteApplication(id: number) { - return this.restService.delete('application', id); + return this.restService.delete("application", id); } } diff --git a/src/app/applications/applications-list/applications-list.component.html b/src/app/applications/applications-list/applications-list.component.html index 22e98f433..4fc5997cd 100644 --- a/src/app/applications/applications-list/applications-list.component.html +++ b/src/app/applications/applications-list/applications-list.component.html @@ -1,19 +1,23 @@
    -
    -
    +
    +
    -

    {{'WELCOME-DIALOG.WELCOME' | translate}}

    -

    {{'WELCOME-DIALOG.NO-ACCESS' | translate}}

    +

    {{ "WELCOME-DIALOG.WELCOME" | translate }}

    +

    {{ "WELCOME-DIALOG.NO-ACCESS" | translate }}

    - +
    @@ -27,5 +31,5 @@

    {{'WELCOME-DIALOG.NO-ACCESS' | translate}}

    - +
    diff --git a/src/app/applications/applications-list/applications-list.component.spec.ts b/src/app/applications/applications-list/applications-list.component.spec.ts index af4f40e6c..57e07a35c 100644 --- a/src/app/applications/applications-list/applications-list.component.spec.ts +++ b/src/app/applications/applications-list/applications-list.component.spec.ts @@ -1,17 +1,14 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ApplicationsListComponent } from './applications-list.component'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ApplicationsListComponent } from "./applications-list.component"; - - -describe('ListApplicationsComponent', () => { +describe("ListApplicationsComponent", () => { let component: ApplicationsListComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ApplicationsListComponent] - }) - .compileComponents(); + declarations: [ApplicationsListComponent], + }).compileComponents(); })); beforeEach(() => { @@ -20,7 +17,7 @@ describe('ListApplicationsComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/applications-list/applications-list.component.ts b/src/app/applications/applications-list/applications-list.component.ts index 6ab622a82..66eccd7f8 100644 --- a/src/app/applications/applications-list/applications-list.component.ts +++ b/src/app/applications/applications-list/applications-list.component.ts @@ -1,26 +1,26 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { Title } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; -import { UserMinimalService } from '@app/admin/users/user-minimal.service'; -import { NavbarComponent } from '@app/navbar/navbar.component'; -import { Application } from '@applications/application.model'; -import { AuthService } from '@auth/auth.service'; -import { environment } from '@environments/environment'; -import { TranslateService } from '@ngx-translate/core'; -import { WelcomeDialogComponent } from '@shared/components/welcome-dialog/welcome-dialog.component'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { MeService } from '@shared/services/me.service'; -import { WelcomeDialogModel } from '@shared/models/dialog.model'; - -const welcomeDialogId = 'welcome-dialog'; +import { Component, Input, OnInit } from "@angular/core"; +import { MatDialog } from "@angular/material/dialog"; +import { Title } from "@angular/platform-browser"; +import { ActivatedRoute, Router } from "@angular/router"; +import { UserMinimalService } from "@app/admin/users/user-minimal.service"; +import { NavbarComponent } from "@app/navbar/navbar.component"; +import { Application } from "@applications/application.model"; +import { AuthService } from "@auth/auth.service"; +import { environment } from "@environments/environment"; +import { TranslateService } from "@ngx-translate/core"; +import { WelcomeDialogComponent } from "@shared/components/welcome-dialog/welcome-dialog.component"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { MeService } from "@shared/services/me.service"; +import { WelcomeDialogModel } from "@shared/models/dialog.model"; + +const welcomeDialogId = "welcome-dialog"; @Component({ providers: [NavbarComponent], - selector: 'app-applications-list', - templateUrl: './applications-list.component.html', - styleUrls: ['./applications-list.component.scss'], + selector: "app-applications-list", + templateUrl: "./applications-list.component.html", + styleUrls: ["./applications-list.component.scss"], }) export class ApplicationsListComponent implements OnInit { isLoadingResults = true; @@ -49,72 +49,66 @@ export class ApplicationsListComponent implements OnInit { private dialog: MatDialog, private userMinimalService: UserMinimalService ) { - translate.use('da'); + translate.use("da"); } ngOnInit(): void { - this.translate.get(['TITLE.APPLICATION']).subscribe((translations) => { - this.titleService.setTitle(translations['TITLE.APPLICATION']); + this.translate.get(["TITLE.APPLICATION"]).subscribe(translations => { + this.titleService.setTitle(translations["TITLE.APPLICATION"]); }); this.organizationId = this.globalService.getSelectedOrganisationId(); - this.canEdit = this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.ApplicationWrite - ); + this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.ApplicationWrite); // Authenticate user this.verifyUserAndInit(); } verifyUserAndInit() { - this.route.queryParams.subscribe(async (params) => { + this.route.queryParams.subscribe(async params => { await this.translate .get([ - 'WELCOME-DIALOG.NO-JOB-ACCESS', - 'TITLE.FRONTPAGE', - 'WELCOME-DIALOG.KOMBIT-LOGIN-ERROR', - 'WELCOME-DIALOG.USER-INACTIVE', + "WELCOME-DIALOG.NO-JOB-ACCESS", + "TITLE.FRONTPAGE", + "WELCOME-DIALOG.KOMBIT-LOGIN-ERROR", + "WELCOME-DIALOG.USER-INACTIVE", ]) .toPromise() - .then((translations) => { - this.unauthorizedMessage = - translations['WELCOME-DIALOG.NO-JOB-ACCESS']; - this.kombitError = translations['WELCOME-DIALOG.KOMBIT-LOGIN-ERROR']; - this.noAccess = translations['WELCOME-DIALOG.USER-INACTIVE']; - this.titleService.setTitle(translations['TITLE.FRONTPAGE']); + .then(translations => { + this.unauthorizedMessage = translations["WELCOME-DIALOG.NO-JOB-ACCESS"]; + this.kombitError = translations["WELCOME-DIALOG.KOMBIT-LOGIN-ERROR"]; + this.noAccess = translations["WELCOME-DIALOG.USER-INACTIVE"]; + this.titleService.setTitle(translations["TITLE.FRONTPAGE"]); }); // this is used when a user is returned from Kombit login - const jwt = params['jwt']; + const jwt = params["jwt"]; if (jwt) { this.authService.setSession(jwt); const userInfo = await this.sharedVariableService.setUserInfo(); if (!userInfo.user.email) { - this.router.navigate(['/new-user'], { + this.router.navigate(["/new-user"], { state: { fromKombit: true }, }); return; } else { // Clear the URL from the parameter - this.router.navigate(['/applications'], { replaceUrl: true }); + this.router.navigate(["/applications"], { replaceUrl: true }); return; } } else { - const error = params['error']; + const error = params["error"]; if (error) { - if ( - error === 'MESSAGE.KOMBIT-LOGIN-FAILED' || - error === 'MESSAGE.API-KEY-AUTH-FAILED' - ) { - this.router.navigate(['/not-authorized'], { + if (error === "MESSAGE.KOMBIT-LOGIN-FAILED" || error === "MESSAGE.API-KEY-AUTH-FAILED") { + this.router.navigate(["/not-authorized"], { state: { message: this.kombitError, code: 401 }, }); - } else if (error === 'MESSAGE.USER-INACTIVE') { - this.router.navigate(['/not-authorized'], { + } else if (error === "MESSAGE.USER-INACTIVE") { + this.router.navigate(["/not-authorized"], { state: { message: this.noAccess, code: 401 }, }); } else { - this.router.navigate(['/not-authorized'], { + this.router.navigate(["/not-authorized"], { state: { message: this.unauthorizedMessage, code: 401 }, }); } @@ -131,10 +125,7 @@ export class ApplicationsListComponent implements OnInit { if ( !this.hasSomePermission || - (!this.isGlobalAdmin && - !hasSeenWelcomeScreen && - userInfo?.user?.showWelcomeScreen && - !isOpen) + (!this.isGlobalAdmin && !hasSeenWelcomeScreen && userInfo?.user?.showWelcomeScreen && !isOpen) ) { this.userMinimalService.setHasSeenWelcomeScreen(); @@ -142,8 +133,8 @@ export class ApplicationsListComponent implements OnInit { id: welcomeDialogId, disableClose: true, closeOnNavigation: true, - panelClass: 'welcome-screen', - maxWidth: '60vw', + panelClass: "welcome-screen", + maxWidth: "60vw", data: { hasSomePermission: this.hasSomePermission, } as WelcomeDialogModel, @@ -152,7 +143,7 @@ export class ApplicationsListComponent implements OnInit { if (!this.hasSomePermission) { // In case a previous .navigate() was fired, ensure this is called after setTimeout(() => { - this.router.navigate(['/user-page'], { replaceUrl: true }); + this.router.navigate(["/user-page"], { replaceUrl: true }); }); } } diff --git a/src/app/applications/applications-list/applications-table/applications-table.component.html b/src/app/applications/applications-list/applications-table/applications-table.component.html index 72449d4c0..7b4ec785c 100644 --- a/src/app/applications/applications-list/applications-table/applications-table.component.html +++ b/src/app/applications/applications-list/applications-table/applications-table.component.html @@ -10,127 +10,135 @@
    - {{errorMessage | translate}} + {{ errorMessage | translate }}
    - - +
    + {{ "APPLICATION-TABLE.IOT-DEVICES" | translate }} + @@ -138,17 +146,25 @@ - +
    - {{ 'APPLICATION-TABLE.NAME' | translate }} + {{ "APPLICATION-TABLE.NAME" | translate }} - {{element.name}} + {{ + element.name + }} - {{'APPLICATION-TABLE.OWNER' | translate}} + {{ "APPLICATION-TABLE.OWNER" | translate }} - {{application.owner ?? '-'}} + {{ application.owner ?? "-" }} - {{'APPLICATION-TABLE.CONTACT-PERSON' | translate}} + {{ "APPLICATION-TABLE.CONTACT-PERSON" | translate }} - {{application.contactPerson ?? '-'}} + {{ application.contactPerson ?? "-" }} - {{ 'APPLICATION-TABLE.IOT-DEVICES' | translate }} - {{element?.iotDevices?.length ?? 0}} + {{ element?.iotDevices?.length ?? 0 }} - {{ 'APPLICATION-TABLE.DATA-TARGETS' | translate}} + {{ "APPLICATION-TABLE.DATA-TARGETS" | translate }} - {{application?.dataTargets?.length ?? 0}} + {{ application?.dataTargets?.length ?? 0 }} - {{ 'APPLICATION-TABLE.OPEN-DATA-DK' | translate }} + {{ "APPLICATION-TABLE.OPEN-DATA-DK" | translate }} - {{isOpenDataDK(application.dataTargets) | yesNo}} + {{ isOpenDataDK(application.dataTargets) | yesNo }} - {{'APPLICATION-TABLE.STATUS' | translate}} + {{ "APPLICATION-TABLE.STATUS" | translate }} - {{application.status ? ('APPLICATION.STATUS.' + application.status | translate) : '-'}} + {{ application.status ? ("APPLICATION.STATUS." + application.status | translate) : "-" }} - {{'APPLICATION-TABLE.PERSONAL-DATA' | translate}} + {{ "APPLICATION-TABLE.PERSONAL-DATA" | translate }} - {{!application.personalData ? '-' : ''}} + {{ !application.personalData ? "-" : "" }} - {{'APPLICATION-TABLE.START-DATE' | translate}} + {{ "APPLICATION-TABLE.START-DATE" | translate }} - {{(application.startDate | dateOnly) ?? '-'}} + {{ (application.startDate | dateOnly) ?? "-" }} - {{'APPLICATION-TABLE.END-DATE' | translate}} + {{ "APPLICATION-TABLE.END-DATE" | translate }} - {{(application.endDate | dateOnly) ?? '-'}} + {{ (application.endDate | dateOnly) ?? "-" }} - {{'APPLICATION-TABLE.CATEGORY' | translate}} + {{ "APPLICATION-TABLE.CATEGORY" | translate }} - {{application.category ?? '-'}} + {{ application.category ?? "-" }} - {{'APPLICATION-TABLE.CONTROLLED-PROPERTIES' | translate}} + {{ "APPLICATION-TABLE.CONTROLLED-PROPERTIES" | translate }} - {{mapControlledProperties(application.controlledProperties) ?? '-'}} + {{ mapControlledProperties(application.controlledProperties) ?? "-" }} - {{'APPLICATION-TABLE.DEVICE-TYPES' | translate}} + {{ "APPLICATION-TABLE.DEVICE-TYPES" | translate }} - {{mapDeviceTypes(application.deviceTypes) ?? '-'}} + {{ mapDeviceTypes(application.deviceTypes) ?? "-" }} @@ -156,11 +172,15 @@
    - +
    diff --git a/src/app/applications/applications-list/applications-table/applications-table.component.spec.ts b/src/app/applications/applications-list/applications-table/applications-table.component.spec.ts index f6e107433..799525ae2 100644 --- a/src/app/applications/applications-list/applications-table/applications-table.component.spec.ts +++ b/src/app/applications/applications-list/applications-table/applications-table.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { ApplicationsTableComponent } from './applications-table.component'; +import { ApplicationsTableComponent } from "./applications-table.component"; -describe('ApplicationTableOtherComponent', () => { +describe("ApplicationTableOtherComponent", () => { let component: ApplicationsTableComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ ApplicationsTableComponent ] - }) - .compileComponents(); + declarations: [ApplicationsTableComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('ApplicationTableOtherComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/applications-list/applications-table/applications-table.component.ts b/src/app/applications/applications-list/applications-table/applications-table.component.ts index c0ce9eb1d..cd74766f0 100644 --- a/src/app/applications/applications-list/applications-table/applications-table.component.ts +++ b/src/app/applications/applications-list/applications-table/applications-table.component.ts @@ -1,11 +1,11 @@ import { - AfterViewInit, - ChangeDetectorRef, - Component, - Input, - OnInit, - ViewChild, - ViewEncapsulation, + AfterViewInit, + ChangeDetectorRef, + Component, + Input, + OnInit, + ViewChild, + ViewEncapsulation, } from "@angular/core"; import { MatPaginator } from "@angular/material/paginator"; import { MatSort } from "@angular/material/sort"; @@ -26,249 +26,247 @@ import { faFlag } from "@fortawesome/free-solid-svg-icons"; import { TableColumn } from "@shared/types/table.type"; const columnDefinitions: TableColumn[] = [ - { - id: "name", - display: "APPLICATION-TABLE.NAME", - default: true, - toggleable: false, - }, - { - id: "owner", - display: "APPLICATION-TABLE.OWNER", - default: true, - toggleable: true, - }, - { - id: "contactPerson", - display: "APPLICATION-TABLE.CONTACT-PERSON", - default: false, - toggleable: true, - }, - { - id: "devices", - display: "APPLICATION-TABLE.IOT-DEVICES", - default: true, - toggleable: true, - }, - { - id: "dataTargets", - display: "APPLICATION-TABLE.DATA-TARGETS", - default: true, - toggleable: true, - }, - { - id: "openDataDkEnabled", - display: "APPLICATION-TABLE.OPEN-DATA-DK", - default: false, - toggleable: true, - }, - { - id: "status", - display: "APPLICATION-TABLE.STATUS", - default: true, - toggleable: true, - }, - { - id: "personalData", - display: "APPLICATION-TABLE.PERSONAL-DATA", - default: true, - toggleable: true, - }, - { - id: "startDate", - display: "APPLICATION-TABLE.START-DATE", - default: false, - toggleable: true, - }, - { - id: "endDate", - display: "APPLICATION-TABLE.END-DATE", - default: false, - toggleable: true, - }, - { - id: "category", - display: "APPLICATION-TABLE.CATEGORY", - default: false, - toggleable: true, - }, - { - id: "controlledProperties", - display: "APPLICATION-TABLE.CONTROLLED-PROPERTIES", - default: false, - toggleable: true, - }, - { - id: "deviceTypes", - display: "APPLICATION-TABLE.DEVICE-TYPES", - default: false, - toggleable: true, - }, - { - id: "menu", - display: "", - default: true, - toggleable: false, - }, + { + id: "name", + display: "APPLICATION-TABLE.NAME", + default: true, + toggleable: false, + }, + { + id: "owner", + display: "APPLICATION-TABLE.OWNER", + default: true, + toggleable: true, + }, + { + id: "contactPerson", + display: "APPLICATION-TABLE.CONTACT-PERSON", + default: false, + toggleable: true, + }, + { + id: "devices", + display: "APPLICATION-TABLE.IOT-DEVICES", + default: true, + toggleable: true, + }, + { + id: "dataTargets", + display: "APPLICATION-TABLE.DATA-TARGETS", + default: true, + toggleable: true, + }, + { + id: "openDataDkEnabled", + display: "APPLICATION-TABLE.OPEN-DATA-DK", + default: false, + toggleable: true, + }, + { + id: "status", + display: "APPLICATION-TABLE.STATUS", + default: true, + toggleable: true, + }, + { + id: "personalData", + display: "APPLICATION-TABLE.PERSONAL-DATA", + default: true, + toggleable: true, + }, + { + id: "startDate", + display: "APPLICATION-TABLE.START-DATE", + default: false, + toggleable: true, + }, + { + id: "endDate", + display: "APPLICATION-TABLE.END-DATE", + default: false, + toggleable: true, + }, + { + id: "category", + display: "APPLICATION-TABLE.CATEGORY", + default: false, + toggleable: true, + }, + { + id: "controlledProperties", + display: "APPLICATION-TABLE.CONTROLLED-PROPERTIES", + default: false, + toggleable: true, + }, + { + id: "deviceTypes", + display: "APPLICATION-TABLE.DEVICE-TYPES", + default: false, + toggleable: true, + }, + { + id: "menu", + display: "", + default: true, + toggleable: false, + }, ]; @Component({ - selector: "app-applications-table", - styleUrls: ["./applications-table.component.scss"], - templateUrl: "./applications-table.component.html", - encapsulation: ViewEncapsulation.None, + selector: "app-applications-table", + styleUrls: ["./applications-table.component.scss"], + templateUrl: "./applications-table.component.html", + encapsulation: ViewEncapsulation.None, }) export class ApplicationsTableComponent implements AfterViewInit, OnInit { - @Input() organizationId: number; - @Input() permissionId: number; + @Input() organizationId: number; + @Input() permissionId: number; - faFlagIcon = faFlag; + faFlagIcon = faFlag; - displayedColumns: string[] = []; + displayedColumns: string[] = []; - data: Application[] = []; + data: Application[] = []; - public pageSize = environment.tablePageSize; - pageSizeOptions = DefaultPageSizeOptions; - resultsLength = 0; - isLoadingResults = true; - public errorMessage: string; + public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; + resultsLength = 0; + isLoadingResults = true; + public errorMessage: string; - applicationSavedColumns = "applicationSavedColumns"; + applicationSavedColumns = "applicationSavedColumns"; - @ViewChild(MatPaginator) paginator: MatPaginator; - @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; - constructor( - public translate: TranslateService, - private applicationService: ApplicationService, - private router: Router, - private deleteDialogService: DeleteDialogService, - private cdRef: ChangeDetectorRef - ) {} + constructor( + public translate: TranslateService, + private applicationService: ApplicationService, + private router: Router, + private deleteDialogService: DeleteDialogService, + private cdRef: ChangeDetectorRef + ) {} - ngOnInit() { - // Detect changes done by child column selector - this.cdRef.detectChanges(); - this.translate.use("da"); - } + ngOnInit() { + // Detect changes done by child column selector + this.cdRef.detectChanges(); + this.translate.use("da"); + } - ngAfterViewInit() { - // If the user changes the sort order, reset back to the first page. - this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); + ngAfterViewInit() { + // If the user changes the sort order, reset back to the first page. + this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); - merge(this.sort.sortChange, this.paginator.page) - .pipe( - startWith({}), - switchMap(() => { - this.isLoadingResults = true; - return this.getApplications(this.sort.active, this.sort.direction); - }), - map(data => { - // Flip flag to show that loading has finished. - this.isLoadingResults = false; - this.resultsLength = data.count; + merge(this.sort.sortChange, this.paginator.page) + .pipe( + startWith({}), + switchMap(() => { + this.isLoadingResults = true; + return this.getApplications(this.sort.active, this.sort.direction); + }), + map(data => { + // Flip flag to show that loading has finished. + this.isLoadingResults = false; + this.resultsLength = data.count; - return data.data; - }), - catchError(() => { - this.isLoadingResults = false; - return observableOf([]); - }) - ) - .subscribe(data => (this.data = data)); - } + return data.data; + }), + catchError(() => { + this.isLoadingResults = false; + return observableOf([]); + }) + ) + .subscribe(data => (this.data = data)); + } - getApplications(orderByColumn: string, orderByDirection: string): Observable { - return this.applicationService - .getApplications( - this.paginator.pageSize, - this.paginator.pageIndex * this.paginator.pageSize, - orderByDirection, - orderByColumn, - this.organizationId, - this.permissionId - ) - .pipe( - map((data: ApplicationData) => { - // Status is getting translated in frontend, and therefore sorting is not working since the backend doesn't know the translation - // Therefore we do it manually in the frontend. - if (orderByColumn !== "status") { - return data; - } else { - data.data.sort((a: Application, b: Application) => { - const valueA = a[orderByColumn]; - const valueB = b[orderByColumn]; + getApplications(orderByColumn: string, orderByDirection: string): Observable { + return this.applicationService + .getApplications( + this.paginator.pageSize, + this.paginator.pageIndex * this.paginator.pageSize, + orderByDirection, + orderByColumn, + this.organizationId, + this.permissionId + ) + .pipe( + map((data: ApplicationData) => { + // Status is getting translated in frontend, and therefore sorting is not working since the backend doesn't know the translation + // Therefore we do it manually in the frontend. + if (orderByColumn !== "status") { + return data; + } else { + data.data.sort((a: Application, b: Application) => { + const valueA = a[orderByColumn]; + const valueB = b[orderByColumn]; - if (valueA === "NONE" && valueB !== "NONE") { - return orderByDirection === "asc" ? 1 : -1; - } - if (valueA !== "NONE" && valueB === "NONE") { - return orderByDirection === "asc" ? -1 : 1; - } - const translatedA = this.translate.instant("APPLICATION.STATUS." + valueA); - const translatedB = this.translate.instant("APPLICATION.STATUS." + valueB); + if (valueA === "NONE" && valueB !== "NONE") { + return orderByDirection === "asc" ? 1 : -1; + } + if (valueA !== "NONE" && valueB === "NONE") { + return orderByDirection === "asc" ? -1 : 1; + } + const translatedA = this.translate.instant("APPLICATION.STATUS." + valueA); + const translatedB = this.translate.instant("APPLICATION.STATUS." + valueB); - return translatedA.localeCompare(translatedB) * (orderByDirection === "asc" ? 1 : -1); - }); + return translatedA.localeCompare(translatedB) * (orderByDirection === "asc" ? 1 : -1); + }); - return data; - } - }) - ); - } + return data; + } + }) + ); + } - deleteApplication(id: number) { - const applicationToDelete = this.data?.find(app => app.id === id); + deleteApplication(id: number) { + const applicationToDelete = this.data?.find(app => app.id === id); - this.deleteDialogService.showApplicationDialog(applicationToDelete).subscribe(response => { - if (response) { - this.applicationService.deleteApplication(id).subscribe(response => { - if (response.ok && response.body.affected > 0) { - this.paginator.page.emit({ - pageIndex: this.paginator.pageIndex, - pageSize: this.paginator.pageSize, - length: this.resultsLength, - }); - } else { - this.errorMessage = response?.error?.message; - } - }); - } + this.deleteDialogService.showApplicationDialog(applicationToDelete).subscribe(response => { + if (response) { + this.applicationService.deleteApplication(id).subscribe(response => { + if (response.ok && response.body.affected > 0) { + this.paginator.page.emit({ + pageIndex: this.paginator.pageIndex, + pageSize: this.paginator.pageSize, + length: this.resultsLength, + }); + } else { + this.errorMessage = response?.error?.message; + } }); - } + } + }); + } - navigateToEditPage(applicationId: string) { - this.router.navigate(["applications", "edit-application", applicationId]); - } + navigateToEditPage(applicationId: string) { + this.router.navigate(["applications", "edit-application", applicationId]); + } - mapControlledProperties(value: ControlledProperty[]) { - if (!value.length) return "-"; + mapControlledProperties(value: ControlledProperty[]) { + if (!value.length) return "-"; - return value.map(p => p.type).join(", "); - } + return value.map(p => p.type).join(", "); + } - mapDeviceTypes(value: ApplicationDeviceType[]) { - const deviceTypeTranslationPrefix = "IOT-DEVICE-TYPES."; - const deviceTypeTranslationKeys = ApplicationDeviceTypeEntries.map( - x => `${deviceTypeTranslationPrefix}${x.key}` - ); + mapDeviceTypes(value: ApplicationDeviceType[]) { + const deviceTypeTranslationPrefix = "IOT-DEVICE-TYPES."; + const deviceTypeTranslationKeys = ApplicationDeviceTypeEntries.map(x => `${deviceTypeTranslationPrefix}${x.key}`); - const result = []; + const result = []; - this.translate - .get([...deviceTypeTranslationKeys, deviceTypeTranslationPrefix + "OTHER"]) - .subscribe(translations => { - value.forEach(p => result.push(translations[deviceTypeTranslationPrefix + p.type])); - }); - return result.length ? result.join(", ") : "-"; - } + this.translate + .get([...deviceTypeTranslationKeys, deviceTypeTranslationPrefix + "OTHER"]) + .subscribe(translations => { + value.forEach(p => result.push(translations[deviceTypeTranslationPrefix + p.type])); + }); + return result.length ? result.join(", ") : "-"; + } - isOpenDataDK(dataTargets: Datatarget[]): boolean { - const result = dataTargets.find(t => t.type === "OPENDATADK"); + isOpenDataDK(dataTargets: Datatarget[]): boolean { + const result = dataTargets.find(t => t.type === "OPENDATADK"); - return !!result; - } + return !!result; + } - protected readonly columnDefinitions = columnDefinitions; + protected readonly columnDefinitions = columnDefinitions; } diff --git a/src/app/applications/applications-routing.module.ts b/src/app/applications/applications-routing.module.ts index 3500e7d2e..5542be8df 100644 --- a/src/app/applications/applications-routing.module.ts +++ b/src/app/applications/applications-routing.module.ts @@ -1,86 +1,86 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { ApplicationDetailComponent } from './application-detail/application-detail.component'; -import { ApplicationEditComponent } from './application-edit/application-edit.component'; -import { ApplicationsListComponent } from './applications-list/applications-list.component'; -import { ApplicationsComponent } from './applications.component'; -import { IoTDeviceDetailComponent } from './iot-devices/iot-device-detail/iot-device-detail.component'; -import { IotDeviceEditComponent } from './iot-devices/iot-device-edit/iot-device-edit.component'; -import { DatatargetEditComponent } from './datatarget/datatarget-edit/datatarget-edit.component'; -import { DatatargetDetailComponent } from './datatarget/datatarget-detail/datatarget-detail.component'; -import { BulkImportComponent } from './bulk-import/bulk-import.component'; -import { MulticastEditComponent } from './multicast/multicast-edit/multicast-edit.component'; -import { MulticastDetailComponent } from './multicast/multicast-detail/multicast-detail.component'; -import { DatatargetNewComponent } from './datatarget/datatarget-new/datatarget-new.component'; -import { IotDevicesTabComponent } from '@applications/iot-devices/iot-devices-tab/iot-devices-tab.component'; -import { MulticastTabComponent } from '@applications/multicast/multicast-tab/multicast-tab.component'; -import { DatatargetTabComponent } from '@applications/datatarget/datatarget-tab/datatarget-tab.component'; -import { IotDeviceDetailsTabComponent } from '@applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component'; -import { IotDeviceHistoryTabComponent } from '@applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component'; -import { IotDeviceDataPacketsTabComponent } from '@applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component'; -import { IotDeviceDownlinkTabComponent } from '@applications/iot-devices/iot-device-detail/iot-device-downlink-tab/iot-device-downlink-tab.component'; +import { NgModule } from "@angular/core"; +import { RouterModule, Routes } from "@angular/router"; +import { ApplicationDetailComponent } from "./application-detail/application-detail.component"; +import { ApplicationEditComponent } from "./application-edit/application-edit.component"; +import { ApplicationsListComponent } from "./applications-list/applications-list.component"; +import { ApplicationsComponent } from "./applications.component"; +import { IoTDeviceDetailComponent } from "./iot-devices/iot-device-detail/iot-device-detail.component"; +import { IotDeviceEditComponent } from "./iot-devices/iot-device-edit/iot-device-edit.component"; +import { DatatargetEditComponent } from "./datatarget/datatarget-edit/datatarget-edit.component"; +import { DatatargetDetailComponent } from "./datatarget/datatarget-detail/datatarget-detail.component"; +import { BulkImportComponent } from "./bulk-import/bulk-import.component"; +import { MulticastEditComponent } from "./multicast/multicast-edit/multicast-edit.component"; +import { MulticastDetailComponent } from "./multicast/multicast-detail/multicast-detail.component"; +import { DatatargetNewComponent } from "./datatarget/datatarget-new/datatarget-new.component"; +import { IotDevicesTabComponent } from "@applications/iot-devices/iot-devices-tab/iot-devices-tab.component"; +import { MulticastTabComponent } from "@applications/multicast/multicast-tab/multicast-tab.component"; +import { DatatargetTabComponent } from "@applications/datatarget/datatarget-tab/datatarget-tab.component"; +import { IotDeviceDetailsTabComponent } from "@applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component"; +import { IotDeviceHistoryTabComponent } from "@applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component"; +import { IotDeviceDataPacketsTabComponent } from "@applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component"; +import { IotDeviceDownlinkTabComponent } from "@applications/iot-devices/iot-device-detail/iot-device-downlink-tab/iot-device-downlink-tab.component"; const applicationRoutes: Routes = [ { - path: '', + path: "", component: ApplicationsComponent, children: [ - { path: '', component: ApplicationsListComponent }, - { path: 'new-application', component: ApplicationEditComponent }, - { path: 'edit-application/:id', component: ApplicationEditComponent }, + { path: "", component: ApplicationsListComponent }, + { path: "new-application", component: ApplicationEditComponent }, + { path: "edit-application/:id", component: ApplicationEditComponent }, { - path: ':id', + path: ":id", children: [ { - path: '', + path: "", component: ApplicationDetailComponent, children: [ - { path: 'iot-devices', component: IotDevicesTabComponent }, - { path: 'multicast-groups', component: MulticastTabComponent }, - { path: 'data-targets', component: DatatargetTabComponent }, + { path: "iot-devices", component: IotDevicesTabComponent }, + { path: "multicast-groups", component: MulticastTabComponent }, + { path: "data-targets", component: DatatargetTabComponent }, ], }, - { path: 'new-iot-device', component: IotDeviceEditComponent }, + { path: "new-iot-device", component: IotDeviceEditComponent }, { - path: 'iot-device-edit/:deviceId', + path: "iot-device-edit/:deviceId", component: IotDeviceEditComponent, }, { - path: 'iot-device/:deviceId', + path: "iot-device/:deviceId", component: IoTDeviceDetailComponent, children: [ - { path: 'details', component: IotDeviceDetailsTabComponent }, - { path: 'history', component: IotDeviceHistoryTabComponent }, + { path: "details", component: IotDeviceDetailsTabComponent }, + { path: "history", component: IotDeviceHistoryTabComponent }, { - path: 'data-packets', + path: "data-packets", component: IotDeviceDataPacketsTabComponent, }, { - path: 'downlink', + path: "downlink", component: IotDeviceDownlinkTabComponent, }, ], }, - { path: 'datatarget-new', component: DatatargetNewComponent }, - { path: 'datatarget-edit', component: DatatargetEditComponent }, + { path: "datatarget-new", component: DatatargetNewComponent }, + { path: "datatarget-edit", component: DatatargetEditComponent }, { - path: 'datatarget-edit/:datatargetId', + path: "datatarget-edit/:datatargetId", component: DatatargetEditComponent, }, { - path: 'datatarget/:datatargetId', + path: "datatarget/:datatargetId", component: DatatargetDetailComponent, }, - { path: 'multicast-edit', component: MulticastEditComponent }, + { path: "multicast-edit", component: MulticastEditComponent }, { - path: 'multicast-edit/:multicastId', + path: "multicast-edit/:multicastId", component: MulticastEditComponent, }, { - path: 'multicast/:multicastId', + path: "multicast/:multicastId", component: MulticastDetailComponent, }, - { path: 'bulk-import', component: BulkImportComponent }, + { path: "bulk-import", component: BulkImportComponent }, ], }, ], diff --git a/src/app/applications/applications.component.spec.ts b/src/app/applications/applications.component.spec.ts index e8cbcb290..86893c8a0 100644 --- a/src/app/applications/applications.component.spec.ts +++ b/src/app/applications/applications.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { ApplicationsComponent } from './applications.component'; +import { ApplicationsComponent } from "./applications.component"; -describe('ApplicationsComponent', () => { +describe("ApplicationsComponent", () => { let component: ApplicationsComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ApplicationsComponent] - }) - .compileComponents(); + declarations: [ApplicationsComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('ApplicationsComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/applications.component.ts b/src/app/applications/applications.component.ts index 51cae9f3f..202cc7488 100644 --- a/src/app/applications/applications.component.ts +++ b/src/app/applications/applications.component.ts @@ -1,14 +1,11 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-applications', - templateUrl: './applications.component.html', + selector: "app-applications", + templateUrl: "./applications.component.html", }) export class ApplicationsComponent implements OnInit { + constructor() {} - constructor() { } - - ngOnInit(): void { - } - + ngOnInit(): void {} } diff --git a/src/app/applications/applications.module.ts b/src/app/applications/applications.module.ts index f7c9c34c0..f3bd3dc67 100644 --- a/src/app/applications/applications.module.ts +++ b/src/app/applications/applications.module.ts @@ -1,24 +1,24 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; -import { ApplicationsComponent } from './applications.component'; -import { FormModule } from '@shared/components/forms/form.module'; -import { ApplicationDetailComponent } from './application-detail/application-detail.component'; -import { ApplicationEditComponent } from './application-edit/application-edit.component'; -import { ApplicationsListComponent } from './applications-list/applications-list.component'; -import { ApplicaitonsRoutingModule } from './applications-routing.module'; -import { DatatargetModule } from './datatarget/datatarget.module'; -import { IotDevicesModule } from './iot-devices/iot-devices.module'; -import { SharedModule } from '@shared/shared.module'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { DirectivesModule } from '@shared/directives/directives.module'; -import { NGMaterialModule } from '@shared/Modules/materiale.module'; -import { BulkImportComponent } from './bulk-import/bulk-import.component'; -import { PipesModule } from '@shared/pipes/pipes.module'; -import { ApplicationsTableComponent } from './applications-list/applications-table/applications-table.component'; -import { MulticastModule } from './multicast/multicast.module'; -import { ReactiveFormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule } from "@angular/router"; +import { TranslateModule } from "@ngx-translate/core"; +import { ApplicationsComponent } from "./applications.component"; +import { FormModule } from "@shared/components/forms/form.module"; +import { ApplicationDetailComponent } from "./application-detail/application-detail.component"; +import { ApplicationEditComponent } from "./application-edit/application-edit.component"; +import { ApplicationsListComponent } from "./applications-list/applications-list.component"; +import { ApplicaitonsRoutingModule } from "./applications-routing.module"; +import { DatatargetModule } from "./datatarget/datatarget.module"; +import { IotDevicesModule } from "./iot-devices/iot-devices.module"; +import { SharedModule } from "@shared/shared.module"; +import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"; +import { DirectivesModule } from "@shared/directives/directives.module"; +import { NGMaterialModule } from "@shared/Modules/materiale.module"; +import { BulkImportComponent } from "./bulk-import/bulk-import.component"; +import { PipesModule } from "@shared/pipes/pipes.module"; +import { ApplicationsTableComponent } from "./applications-list/applications-table/applications-table.component"; +import { MulticastModule } from "./multicast/multicast.module"; +import { ReactiveFormsModule } from "@angular/forms"; @NgModule({ declarations: [ @@ -29,11 +29,7 @@ import { ReactiveFormsModule } from '@angular/forms'; ApplicationsTableComponent, BulkImportComponent, ], - exports: [ - ApplicaitonsRoutingModule, - ApplicationsComponent, - ApplicationsTableComponent, - ], + exports: [ApplicaitonsRoutingModule, ApplicationsComponent, ApplicationsTableComponent], imports: [ CommonModule, RouterModule, diff --git a/src/app/applications/bulk-import/bulk-import.component.html b/src/app/applications/bulk-import/bulk-import.component.html index 129225a5e..c5e60c2c5 100644 --- a/src/app/applications/bulk-import/bulk-import.component.html +++ b/src/app/applications/bulk-import/bulk-import.component.html @@ -1,91 +1,107 @@
    -
    - - -
    -
    -
      - {{'APPLICATION.BULK.FILEFORMATERRORMESSAGE' | translate}} -
    -
    -
    - - - +
    + + +
    +
    +
      + {{ + "APPLICATION.BULK.FILEFORMATERRORMESSAGE" | translate + }} +
    +
    +
    + +
    -
    - -
    - -
    -
    -

    {{ file }}

    - -
    - -
    -
    - +
    +
    +
    -
    - +
    +

    {{ file }}

    +
    -
    - + +
    + +
    +
    + +
    +
    +
    + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - -
    {{ "APPLICATION.BULK.NAME" | translate }}{{ element.device?.name }} {{ 'APPLICATION.BULK.NAME' | translate }} {{element.device?.name}} {{ "APPLICATION.BULK.TYPE" | translate }}{{ "IOT-DEVICE-TYPES." + element.device?.type | translate }} {{ 'APPLICATION.BULK.TYPE' | translate }} {{"IOT-DEVICE-TYPES." + element.device?.type | translate}} {{ "APPLICATION.BULK.IMPORTSTATUS" | translate }}{{ element.importStatus }} {{ 'APPLICATION.BULK.IMPORTSTATUS' | translate }} {{element.importStatus}} {{ "APPLICATION.BULK.ERROR" | translate }} +
      +
    • + {{ error | translate }} +
    • +
    +
    {{ 'APPLICATION.BULK.ERROR' | translate }} -
      -
    • - {{error | translate}} -
    • -
    -
    -
    + + + +
    - {{ 'DATATARGET-TABLE.NAME' | translate }} + {{ "DATATARGET-TABLE.NAME" | translate }} - {{element.name}} + {{ + element.name + }} - {{ 'DATATARGET-TABLE.TYPE' | translate }} + {{ "DATATARGET-TABLE.TYPE" | translate }} + - - {{'DATATARGET.' + element.type + '.TYPE' | translate}} + {{ "DATATARGET." + element.type + ".TYPE" | translate }} + @@ -29,16 +30,23 @@ @@ -46,8 +54,13 @@ - + - +
    diff --git a/src/app/applications/datatarget/datatarget-table/datatarget-table.component.spec.ts b/src/app/applications/datatarget/datatarget-table/datatarget-table.component.spec.ts index fd15355d7..958347760 100644 --- a/src/app/applications/datatarget/datatarget-table/datatarget-table.component.spec.ts +++ b/src/app/applications/datatarget/datatarget-table/datatarget-table.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { DatatargetTableComponent } from './datatarget-table.component'; +import { DatatargetTableComponent } from "./datatarget-table.component"; -describe('DatatargetTabelComponent', () => { +describe("DatatargetTabelComponent", () => { let component: DatatargetTableComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ DatatargetTableComponent ] - }) - .compileComponents(); + declarations: [DatatargetTableComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('DatatargetTabelComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/datatarget-table/datatarget-table.component.ts b/src/app/applications/datatarget/datatarget-table/datatarget-table.component.ts index 91e083357..c340bdaab 100644 --- a/src/app/applications/datatarget/datatarget-table/datatarget-table.component.ts +++ b/src/app/applications/datatarget/datatarget-table/datatarget-table.component.ts @@ -1,112 +1,109 @@ -import { Component, OnInit, Input, OnDestroy, ViewChild, AfterViewInit } from '@angular/core'; -import { Subscription } from 'rxjs'; -import { TranslateService } from '@ngx-translate/core'; -import { ActivatedRoute } from '@angular/router'; -import { Datatarget, DatatargetData } from '../datatarget.model'; -import { DatatargetService } from '../datatarget.service'; -import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; -import { MatTableDataSource } from '@angular/material/table'; -import { environment } from '@environments/environment'; -import { tableSorter } from '@shared/helpers/table-sorting.helper'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; +import { Component, OnInit, Input, OnDestroy, ViewChild, AfterViewInit } from "@angular/core"; +import { Subscription } from "rxjs"; +import { TranslateService } from "@ngx-translate/core"; +import { ActivatedRoute } from "@angular/router"; +import { Datatarget, DatatargetData } from "../datatarget.model"; +import { DatatargetService } from "../datatarget.service"; +import { DeleteDialogService } from "@shared/components/delete-dialog/delete-dialog.service"; +import { MatPaginator } from "@angular/material/paginator"; +import { MatSort } from "@angular/material/sort"; +import { MatTableDataSource } from "@angular/material/table"; +import { environment } from "@environments/environment"; +import { tableSorter } from "@shared/helpers/table-sorting.helper"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { DefaultPageSizeOptions } from "@shared/constants/page.constants"; @Component({ - selector: 'app-datatarget-table', - templateUrl: './datatarget-table.component.html', - styleUrls: ['./datatarget-table.component.scss'] + selector: "app-datatarget-table", + templateUrl: "./datatarget-table.component.html", + styleUrls: ["./datatarget-table.component.scss"], }) export class DatatargetTableComponent implements OnInit, AfterViewInit, OnDestroy { - @ViewChild(MatPaginator) paginator: MatPaginator; - @ViewChild(MatSort) sort: MatSort; - displayedColumns: string[] = ['name', 'type', 'menu']; - dataSource = new MatTableDataSource(); - datatargets: Datatarget[]; - resultsLength = 0; - public canEdit = false; - @Input() isLoadingResults = true; - public pageSize = environment.tablePageSize; - pageSizeOptions = DefaultPageSizeOptions; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + displayedColumns: string[] = ["name", "type", "menu"]; + dataSource = new MatTableDataSource(); + datatargets: Datatarget[]; + resultsLength = 0; + public canEdit = false; + @Input() isLoadingResults = true; + public pageSize = environment.tablePageSize; + pageSizeOptions = DefaultPageSizeOptions; - @Input() pageLimit: number; - public pageOffset = 0; - public pageTotal: number; - public applicationId: number; + @Input() pageLimit: number; + public pageOffset = 0; + public pageTotal: number; + public applicationId: number; - private datatargetSubscription: Subscription; - private deleteDialogSubscription: Subscription; + private datatargetSubscription: Subscription; + private deleteDialogSubscription: Subscription; - constructor( - private route: ActivatedRoute, - private deleteDialogService: DeleteDialogService, - private datatargetService: DatatargetService, - private meService: MeService, - public translate: TranslateService) { - translate.use('da'); - } - - ngOnInit(): void { - this.applicationId = +Number(this.route.parent.snapshot.paramMap.get('id')); - this.getDatatarget(); - this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.ApplicationWrite, undefined, this.applicationId); - } + constructor( + private route: ActivatedRoute, + private deleteDialogService: DeleteDialogService, + private datatargetService: DatatargetService, + private meService: MeService, + public translate: TranslateService + ) { + translate.use("da"); + } - ngAfterViewInit() { - this.dataSource.paginator = this.paginator; - this.dataSource.sort = this.sort; - } + ngOnInit(): void { + this.applicationId = +Number(this.route.parent.snapshot.paramMap.get("id")); + this.getDatatarget(); + this.canEdit = this.meService.hasAccessToTargetOrganization( + OrganizationAccessScope.ApplicationWrite, + undefined, + this.applicationId + ); + } - getDatatarget(): void { - const appId: number = this.applicationId; - if (appId) { - this.datatargetSubscription = this.datatargetService - .getByApplicationId( - this.pageLimit, - this.pageOffset * this.pageLimit, - appId - ) - .subscribe((datatargets: DatatargetData) => { - this.datatargets = datatargets.data; - this.dataSource = new MatTableDataSource(this.datatargets); - this.dataSource.paginator = this.paginator; - this.dataSource.sort = this.sort; - this.dataSource.sortingDataAccessor = tableSorter; - this.isLoadingResults = false; - if (this.pageLimit) { - this.pageTotal = Math.ceil(datatargets.count / this.pageLimit); - } - }); - } + ngAfterViewInit() { + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + } + getDatatarget(): void { + const appId: number = this.applicationId; + if (appId) { + this.datatargetSubscription = this.datatargetService + .getByApplicationId(this.pageLimit, this.pageOffset * this.pageLimit, appId) + .subscribe((datatargets: DatatargetData) => { + this.datatargets = datatargets.data; + this.dataSource = new MatTableDataSource(this.datatargets); + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + this.dataSource.sortingDataAccessor = tableSorter; + this.isLoadingResults = false; + if (this.pageLimit) { + this.pageTotal = Math.ceil(datatargets.count / this.pageLimit); + } + }); } + } - deleteDatatarget(element: any) { - this.deleteDialogSubscription = this.deleteDialogService.showSimpleDialog().subscribe( - (response) => { - if (response) { - this.datatargetService.delete(element.id).subscribe((response) => { - if (response.ok && response.body.affected > 0) { - this.getDatatarget(); - } - }); - } else { - console.log(response); - } - } - ); - } + deleteDatatarget(element: any) { + this.deleteDialogSubscription = this.deleteDialogService.showSimpleDialog().subscribe(response => { + if (response) { + this.datatargetService.delete(element.id).subscribe(response => { + if (response.ok && response.body.affected > 0) { + this.getDatatarget(); + } + }); + } else { + console.log(response); + } + }); + } - ngOnDestroy() { - // prevent memory leak by unsubscribing - if (this.datatargetSubscription) { - this.datatargetSubscription.unsubscribe(); - } - if (this.deleteDialogSubscription) { - this.deleteDialogSubscription.unsubscribe(); - } + ngOnDestroy() { + // prevent memory leak by unsubscribing + if (this.datatargetSubscription) { + this.datatargetSubscription.unsubscribe(); } - + if (this.deleteDialogSubscription) { + this.deleteDialogSubscription.unsubscribe(); + } + } } diff --git a/src/app/applications/datatarget/datatarget-types.service.spec.ts b/src/app/applications/datatarget/datatarget-types.service.spec.ts index 1f4241271..50f349f16 100644 --- a/src/app/applications/datatarget/datatarget-types.service.spec.ts +++ b/src/app/applications/datatarget/datatarget-types.service.spec.ts @@ -1,16 +1,16 @@ /* tslint:disable:no-unused-variable */ -import { TestBed, inject, waitForAsync } from '@angular/core/testing'; -import { DatatargetTypesService } from './datatarget-types.service'; +import { TestBed, inject, waitForAsync } from "@angular/core/testing"; +import { DatatargetTypesService } from "./datatarget-types.service"; -describe('Service: DatatargetTypesService', () => { +describe("Service: DatatargetTypesService", () => { beforeEach(() => { TestBed.configureTestingModule({ - providers: [DatatargetTypesService] + providers: [DatatargetTypesService], }); }); - it('should ...', inject([DatatargetTypesService], (service: DatatargetTypesService) => { + it("should ...", inject([DatatargetTypesService], (service: DatatargetTypesService) => { expect(service).toBeTruthy(); })); }); diff --git a/src/app/applications/datatarget/datatarget-types.service.ts b/src/app/applications/datatarget/datatarget-types.service.ts index a1ef01684..de53fe079 100644 --- a/src/app/applications/datatarget/datatarget-types.service.ts +++ b/src/app/applications/datatarget/datatarget-types.service.ts @@ -1,18 +1,18 @@ -import { Injectable, Type } from '@angular/core'; -import { DataTargetType } from '@shared/enums/datatarget-type'; -import { DatatargetDetail } from './datatarget-detail/datatarget-detail'; -import { DatatargetEdit } from './datatarget-edit/datatarget-edit'; -import { DatatargetTypeDescriptor } from './datatarget.model'; -import { FiwareDetailComponent } from './fiware/fiware-detail/fiware-detail.component'; -import { FiwareEditComponent } from './fiware/fiware-edit/fiware-edit.component'; -import { HttppushDetailComponent } from './httppush/httppush-detail/httppush-detail.component'; -import { HttppushEditComponent } from './httppush/httppush-edit/httppush-edit.component'; -import { MqttDetailComponent } from './mqtt-detail/mqtt-detail.component'; -import { MqttEditComponent } from './mqtt-edit/mqtt-edit.component'; -import { OpendatadkEditComponent } from './opendatadk/opendatadk-edit/opendatadk-edit.component'; +import { Injectable, Type } from "@angular/core"; +import { DataTargetType } from "@shared/enums/datatarget-type"; +import { DatatargetDetail } from "./datatarget-detail/datatarget-detail"; +import { DatatargetEdit } from "./datatarget-edit/datatarget-edit"; +import { DatatargetTypeDescriptor } from "./datatarget.model"; +import { FiwareDetailComponent } from "./fiware/fiware-detail/fiware-detail.component"; +import { FiwareEditComponent } from "./fiware/fiware-edit/fiware-edit.component"; +import { HttppushDetailComponent } from "./httppush/httppush-detail/httppush-detail.component"; +import { HttppushEditComponent } from "./httppush/httppush-edit/httppush-edit.component"; +import { MqttDetailComponent } from "./mqtt-detail/mqtt-detail.component"; +import { MqttEditComponent } from "./mqtt-edit/mqtt-edit.component"; +import { OpendatadkEditComponent } from "./opendatadk/opendatadk-edit/opendatadk-edit.component"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class DatatargetTypesService { constructor() {} @@ -20,36 +20,36 @@ export class DatatargetTypesService { getAvailableDataTargetTypes(): DatatargetTypeDescriptor[] { return [ { - name: 'DATATARGET.HTTP_PUSH.NAME', + name: "DATATARGET.HTTP_PUSH.NAME", type: DataTargetType.HTTPPUSH, icon: null, - description: 'DATATARGET.HTTP_PUSH.DESCRIPTION', - readMoreUrl: '', - provider: 'OS2', + description: "DATATARGET.HTTP_PUSH.DESCRIPTION", + readMoreUrl: "", + provider: "OS2", }, { - name: 'DATATARGET.OPENDATA-DK.NAME', + name: "DATATARGET.OPENDATA-DK.NAME", type: DataTargetType.OPENDATADK, - icon: '/assets/images/logo_opendatadk.svg', - description: 'DATATARGET.OPENDATA-DK.DESCRIPTION', - readMoreUrl: 'https://www.opendata.dk/', - provider: 'OS2', + icon: "/assets/images/logo_opendatadk.svg", + description: "DATATARGET.OPENDATA-DK.DESCRIPTION", + readMoreUrl: "https://www.opendata.dk/", + provider: "OS2", }, { - name: 'DATATARGET.FIWARE.NAME', + name: "DATATARGET.FIWARE.NAME", type: DataTargetType.FIWARE, - icon: '/assets/images/logo_FIWARE.png', - description: 'DATATARGET.FIWARE.DESCRIPTION', - readMoreUrl: 'https://www.kmd.dk', - provider: 'KMD A/S', + icon: "/assets/images/logo_FIWARE.png", + description: "DATATARGET.FIWARE.DESCRIPTION", + readMoreUrl: "https://www.kmd.dk", + provider: "KMD A/S", }, { - name: 'DATATARGET.MQTT.NAME', + name: "DATATARGET.MQTT.NAME", type: DataTargetType.MQTT, - icon: '/assets/images/logo_mqtt.png', - description: 'DATATARGET.MQTT.DESCRIPTION', - readMoreUrl: 'https://mqtt.org/', - provider: 'OS2', + icon: "/assets/images/logo_mqtt.png", + description: "DATATARGET.MQTT.DESCRIPTION", + readMoreUrl: "https://mqtt.org/", + provider: "OS2", }, ]; } diff --git a/src/app/applications/datatarget/datatarget.model.ts b/src/app/applications/datatarget/datatarget.model.ts index f66c885ad..298169b35 100644 --- a/src/app/applications/datatarget/datatarget.model.ts +++ b/src/app/applications/datatarget/datatarget.model.ts @@ -1,53 +1,53 @@ -import { DataTargetType } from '@shared/enums/datatarget-type'; -import { OpenDataDkDataset as OpenDataDkDataset } from './opendatadk/opendatadk-dataset.model'; +import { DataTargetType } from "@shared/enums/datatarget-type"; +import { OpenDataDkDataset as OpenDataDkDataset } from "./opendatadk/opendatadk-dataset.model"; export class Datatarget { - id: number; - name: string; - applicationId: number; - type: DataTargetType = DataTargetType.HTTPPUSH; - url: string; - tenant: string; - context: string; - // default 30 sec - timeout = 30000; - authorizationHeader: string; - tokenEndpoint: string; - clientId: string; - clientSecret: string; - setToOpendataDk = false; - openDataDkDataset: OpenDataDkDataset = new OpenDataDkDataset(); - mqttPort?: number; - mqttTopic?: string; - mqttQos?: string; - mqttUsername?: string; - mqttPassword?: string; - createdAt: string; - updatedAt: string; - createdBy: number; - updatedBy: number; - createdByName: string; - updatedByName: string; + id: number; + name: string; + applicationId: number; + type: DataTargetType = DataTargetType.HTTPPUSH; + url: string; + tenant: string; + context: string; + // default 30 sec + timeout = 30000; + authorizationHeader: string; + tokenEndpoint: string; + clientId: string; + clientSecret: string; + setToOpendataDk = false; + openDataDkDataset: OpenDataDkDataset = new OpenDataDkDataset(); + mqttPort?: number; + mqttTopic?: string; + mqttQos?: string; + mqttUsername?: string; + mqttPassword?: string; + createdAt: string; + updatedAt: string; + createdBy: number; + updatedBy: number; + createdByName: string; + updatedByName: string; } export class DatatargetData { - data: Datatarget[]; - ok?: boolean; - count?: number; + data: Datatarget[]; + ok?: boolean; + count?: number; } export class DatatargetTypeDescriptor { - name: string; - type: DataTargetType; - icon: string; - description: string; - readMoreUrl: string; - provider: string; + name: string; + type: DataTargetType; + icon: string; + description: string; + readMoreUrl: string; + provider: string; } export class OddkMailInfo { - organizationId?: number; - organizationOddkAlias: string; - comment?: string; - sharingUrl?: string -} \ No newline at end of file + organizationId?: number; + organizationOddkAlias: string; + comment?: string; + sharingUrl?: string; +} diff --git a/src/app/applications/datatarget/datatarget.module.ts b/src/app/applications/datatarget/datatarget.module.ts index 2a8518acc..ea0361994 100644 --- a/src/app/applications/datatarget/datatarget.module.ts +++ b/src/app/applications/datatarget/datatarget.module.ts @@ -1,31 +1,31 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { DatatargetTableComponent } from './datatarget-table/datatarget-table.component'; -import { DatatargetEditComponent } from './datatarget-edit/datatarget-edit.component'; -import { DatatargetDetailComponent } from './datatarget-detail/datatarget-detail.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterModule } from '@angular/router'; -import { NGMaterialModule } from '@shared/Modules/materiale.module'; -import { FormModule } from '@shared/components/forms/form.module'; -import { OpendatadkComponent } from './opendatadk/opendatadk.component'; -import { OpendatadkEditComponent } from './opendatadk/opendatadk-edit/opendatadk-edit.component'; -import { OpendatadkDetailComponent } from './opendatadk/opendatadk-detail/opendatadk-detail.component'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { SharedModule } from '@shared/shared.module'; -import { PipesModule } from '@shared/pipes/pipes.module'; -import { DatatargetNewComponent } from './datatarget-new/datatarget-new.component'; -import { FiwareEditComponent } from './fiware/fiware-edit/fiware-edit.component'; -import { FiwareDetailComponent } from './fiware/fiware-detail/fiware-detail.component'; -import { HttppushDetailComponent } from './httppush/httppush-detail/httppush-detail.component'; -import { HttppushEditComponent } from './httppush/httppush-edit/httppush-edit.component'; -import { DatatargetDetailTypeSelectorDirective } from './datatarget-detail/datatarget-detail-type-selector.directive'; -import { DatatargetEditTypeSelectorDirective } from './datatarget-edit/datatarget-edit-type-selector.directive'; -import { MqttEditComponent } from './mqtt-edit/mqtt-edit.component'; -import { MqttDetailComponent } from './mqtt-detail/mqtt-detail.component'; -import { DatatargetTabComponent } from './datatarget-tab/datatarget-tab.component'; -import { OpenDataDkMailDialogComponent } from './opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog'; -import { OpenDataDkWarningDialogComponent } from './opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { DatatargetTableComponent } from "./datatarget-table/datatarget-table.component"; +import { DatatargetEditComponent } from "./datatarget-edit/datatarget-edit.component"; +import { DatatargetDetailComponent } from "./datatarget-detail/datatarget-detail.component"; +import { TranslateModule } from "@ngx-translate/core"; +import { RouterModule } from "@angular/router"; +import { NGMaterialModule } from "@shared/Modules/materiale.module"; +import { FormModule } from "@shared/components/forms/form.module"; +import { OpendatadkComponent } from "./opendatadk/opendatadk.component"; +import { OpendatadkEditComponent } from "./opendatadk/opendatadk-edit/opendatadk-edit.component"; +import { OpendatadkDetailComponent } from "./opendatadk/opendatadk-detail/opendatadk-detail.component"; +import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { SharedModule } from "@shared/shared.module"; +import { PipesModule } from "@shared/pipes/pipes.module"; +import { DatatargetNewComponent } from "./datatarget-new/datatarget-new.component"; +import { FiwareEditComponent } from "./fiware/fiware-edit/fiware-edit.component"; +import { FiwareDetailComponent } from "./fiware/fiware-detail/fiware-detail.component"; +import { HttppushDetailComponent } from "./httppush/httppush-detail/httppush-detail.component"; +import { HttppushEditComponent } from "./httppush/httppush-edit/httppush-edit.component"; +import { DatatargetDetailTypeSelectorDirective } from "./datatarget-detail/datatarget-detail-type-selector.directive"; +import { DatatargetEditTypeSelectorDirective } from "./datatarget-edit/datatarget-edit-type-selector.directive"; +import { MqttEditComponent } from "./mqtt-edit/mqtt-edit.component"; +import { MqttDetailComponent } from "./mqtt-detail/mqtt-detail.component"; +import { DatatargetTabComponent } from "./datatarget-tab/datatarget-tab.component"; +import { OpenDataDkMailDialogComponent } from "./opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog"; +import { OpenDataDkWarningDialogComponent } from "./opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog"; @NgModule({ declarations: [ diff --git a/src/app/applications/datatarget/datatarget.service.spec.ts b/src/app/applications/datatarget/datatarget.service.spec.ts index c2f0c3aa8..2de235f0b 100644 --- a/src/app/applications/datatarget/datatarget.service.spec.ts +++ b/src/app/applications/datatarget/datatarget.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { DatatargetService } from './datatarget.service'; +import { DatatargetService } from "./datatarget.service"; -describe('DatatargetService', () => { +describe("DatatargetService", () => { let service: DatatargetService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('DatatargetService', () => { service = TestBed.inject(DatatargetService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/datatarget.service.ts b/src/app/applications/datatarget/datatarget.service.ts index 1efcb30eb..29dd04ce4 100644 --- a/src/app/applications/datatarget/datatarget.service.ts +++ b/src/app/applications/datatarget/datatarget.service.ts @@ -1,43 +1,39 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { DatatargetResponse } from '@applications/datatarget/datatarget-response.model'; -import { RestService } from '@shared/services/rest.service'; -import { DatatargetData, Datatarget, OddkMailInfo } from './datatarget.model'; -import { map } from 'rxjs/operators'; -import { OpenDataDkDataset } from './opendatadk/opendatadk-dataset.model'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { UserMinimalService } from '@app/admin/users/user-minimal.service'; +import { Injectable } from "@angular/core"; +import { Observable } from "rxjs"; +import { DatatargetResponse } from "@applications/datatarget/datatarget-response.model"; +import { RestService } from "@shared/services/rest.service"; +import { DatatargetData, Datatarget, OddkMailInfo } from "./datatarget.model"; +import { map } from "rxjs/operators"; +import { OpenDataDkDataset } from "./opendatadk/opendatadk-dataset.model"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { UserMinimalService } from "@app/admin/users/user-minimal.service"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class DatatargetService { - - private dataTargetURL = 'data-target'; + private dataTargetURL = "data-target"; constructor( private restService: RestService, private sharedVariableService: SharedVariableService, - private userMinimalService: UserMinimalService) { } + private userMinimalService: UserMinimalService + ) {} get(id: number): Observable { return this.restService.get(this.dataTargetURL, null, id).pipe( - map( - (response: DatatargetResponse) => { - const datatarget = this.mapToDatatarget(response); - return datatarget; - } - ) + map((response: DatatargetResponse) => { + const datatarget = this.mapToDatatarget(response); + return datatarget; + }) ); } - getByApplicationId( - limit: number, offset: number, applicationId: number - ): Observable { + getByApplicationId(limit: number, offset: number, applicationId: number): Observable { const body = { limit, offset, - applicationId + applicationId, // sort: sort, // orderOn: orderOn, // todo tilføj når iot-314 er tilføjet @@ -47,25 +43,21 @@ export class DatatargetService { update(datatarget: Datatarget): Observable { this.trimModel(datatarget); - return this.restService.put(this.dataTargetURL, datatarget, datatarget.id, { observe: 'response' }).pipe( - map( - (response: DatatargetResponse) => { - const datatarget = this.mapToDatatarget(response); - return datatarget; - } - ) + return this.restService.put(this.dataTargetURL, datatarget, datatarget.id, { observe: "response" }).pipe( + map((response: DatatargetResponse) => { + const datatarget = this.mapToDatatarget(response); + return datatarget; + }) ); } create(datatarget: Datatarget): Observable { this.trimModel(datatarget); return this.restService.post(this.dataTargetURL, datatarget).pipe( - map( - (response: DatatargetResponse) => { - const datatarget = this.mapToDatatarget(response); - return datatarget; - } - ) + map((response: DatatargetResponse) => { + const datatarget = this.mapToDatatarget(response); + return datatarget; + }) ); } @@ -94,7 +86,9 @@ export class DatatargetService { clientSecret: dataTargetResponse.clientSecret, applicationId: dataTargetResponse.application.id, setToOpendataDk: dataTargetResponse?.openDataDkDataset ? true : false, - openDataDkDataset: dataTargetResponse?.openDataDkDataset ? dataTargetResponse.openDataDkDataset : new OpenDataDkDataset(), + openDataDkDataset: dataTargetResponse?.openDataDkDataset + ? dataTargetResponse.openDataDkDataset + : new OpenDataDkDataset(), mqttPort: dataTargetResponse.mqttPort, mqttTopic: dataTargetResponse.mqttTopic, mqttQos: dataTargetResponse.mqttQos, @@ -107,23 +101,26 @@ export class DatatargetService { createdByName: this.userMinimalService.getUserNameFrom(dataTargetResponse.createdBy), updatedByName: this.userMinimalService.getUserNameFrom(dataTargetResponse.updatedBy), }; - model.openDataDkDataset.keywordsInput = dataTargetResponse.openDataDkDataset?.keywords?.join(', '); + model.openDataDkDataset.keywordsInput = dataTargetResponse.openDataDkDataset?.keywords?.join(", "); model.openDataDkDataset.url = this.getOpendataSharingApiUrl(); return model; } getOpendataSharingApiUrl(): string { - return this.restService.createResourceUrl('open-data-dk-sharing', this.sharedVariableService.getSelectedOrganisationId()); + return this.restService.createResourceUrl( + "open-data-dk-sharing", + this.sharedVariableService.getSelectedOrganisationId() + ); } getOpenDataDkRegistered(organizationId: number): Observable { - return this.restService.get(this.dataTargetURL + '/getOpenDataDkRegistered', undefined, organizationId); + return this.restService.get(this.dataTargetURL + "/getOpenDataDkRegistered", undefined, organizationId); } updateOpenDataDkRegistered(organizationId: number): Observable { - return this.restService.put(this.dataTargetURL + '/updateOpenDataDkRegistered', undefined, organizationId); + return this.restService.put(this.dataTargetURL + "/updateOpenDataDkRegistered", undefined, organizationId); } sendOpenDataDkMail(mailDto: OddkMailInfo): Observable { mailDto.sharingUrl = this.getOpendataSharingApiUrl(); - return this.restService.post(this.dataTargetURL + '/sendOpenDataDkMail', mailDto); + return this.restService.post(this.dataTargetURL + "/sendOpenDataDkMail", mailDto); } } diff --git a/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.html b/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.html index f878370cd..b3984e37e 100644 --- a/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.html +++ b/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.html @@ -1,84 +1,126 @@
    - -
    -
    -
    -
    -

    {{ 'DATATARGET.DETAILS' | translate }}

    - - -

    Context Broker{{datatarget.url}}

    -

    {{ 'DATATARGET.TIMEOUT' | translate }}{{datatarget.timeout}}

    -

    {{ 'DATATARGET.TYPE' | translate }}{{'DATATARGET.' + datatarget.type + '.TYPE' | translate}}

    - - -

    {{ 'DATATARGET.TENANT' | translate }}

    -
    {{datatarget.tenant}}
    - -

    {{ 'DATATARGET.NO-TENANT' | translate }}

    -
    + +
    +
    +
    +
    +

    {{ "DATATARGET.DETAILS" | translate }}

    + + +

    Context Broker{{ datatarget.url }}

    +

    + {{ "DATATARGET.TIMEOUT" | translate }}{{ datatarget.timeout }} +

    +

    + {{ "DATATARGET.TYPE" | translate }}{{ "DATATARGET." + datatarget.type + ".TYPE" | translate }} +

    + -

    {{ 'DATATARGET.CONTEXT' | translate }}

    -
    {{datatarget.context}}
    - -

    {{ 'DATATARGET.NO-CONTEXT' | translate }}

    -
    +

    + {{ "DATATARGET.TENANT" | translate }} +

    + +
    {{ datatarget.tenant }}
    +
    + +

    {{ "DATATARGET.NO-TENANT" | translate }}

    +
    -

    {{ 'DATATARGET.AUTHORIZATIONHEADER' | translate }}

    -
    {{datatarget.authorizationHeader}}
    - -

    {{ 'DATATARGET.NO-AUTHORIZATIONHEADER' | translate }}

    -
    +

    + {{ "DATATARGET.CONTEXT" | translate }} +

    + +
    {{ datatarget.context }}
    +
    + +

    {{ "DATATARGET.NO-CONTEXT" | translate }}

    +
    -

    {{ 'DATATARGET.TOKENENDPOINT' | translate }}

    -
    {{datatarget.tokenEndpoint}}
    - -

    {{ 'DATATARGET.NO-TOKENENDPOINT' | translate }}

    -
    +

    + {{ "DATATARGET.AUTHORIZATIONHEADER" | translate }} +

    + +
    {{ datatarget.authorizationHeader }}
    +
    + +

    {{ "DATATARGET.NO-AUTHORIZATIONHEADER" | translate }}

    +
    -

    {{ 'DATATARGET.CLIENTID' | translate }}

    -
    {{datatarget.clientId}}
    - -

    {{ 'DATATARGET.NO-CLIENTID' | translate }}

    -
    +

    + {{ "DATATARGET.TOKENENDPOINT" | translate }} +

    + +
    {{ datatarget.tokenEndpoint }}
    +
    + +

    {{ "DATATARGET.NO-TOKENENDPOINT" | translate }}

    +
    -

    {{ 'DATATARGET.CLIENTSECRET' | translate }}

    -
    {{''.padStart(20, '*')}}
    - -

    {{ 'DATATARGET.NO-CLIENTSECRET' | translate }}

    -
    +

    + {{ "DATATARGET.CLIENTID" | translate }} +

    + +
    {{ datatarget.clientId }}
    +
    + +

    {{ "DATATARGET.NO-CLIENTID" | translate }}

    +
    -
    +

    + {{ "DATATARGET.CLIENTSECRET" | translate }} +

    + +
    {{ "".padStart(20, "*") }}
    +
    + +

    {{ "DATATARGET.NO-CLIENTSECRET" | translate }}

    +
    - +
    -
    +
    -

    {{ 'DATATARGET.RELATIONS' | translate }}

    +

    {{ "DATATARGET.RELATIONS" | translate }}

    -

    {{'DATATARGET.NO-RELATIONS' | translate}}

    +

    {{ "DATATARGET.NO-RELATIONS" | translate }}

    -

    {{'DATATARGET.PAYLOADEDECODER' | translate}} - {{relation.payloadDecoder.name}} +

    + {{ "DATATARGET.PAYLOADEDECODER" | translate }} + {{ + relation.payloadDecoder.name + }} - {{ 'DATATARGET.NO-PAYLOADDECODER' | translate}} + {{ "DATATARGET.NO-PAYLOADDECODER" | translate }}

    -

    {{'DATATARGET.IOTDEVICE' | translate}} +

    + {{ "DATATARGET.IOTDEVICE" | translate }} - , {{device.name}} + , + {{ + device.name + }}

    @@ -92,3 +134,4 @@

    {{ 'DATATARGET.RELATIONS' | translate }}

    +
    diff --git a/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.spec.ts b/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.spec.ts index f048cadbf..eaeb015bb 100644 --- a/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.spec.ts +++ b/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.spec.ts @@ -1,19 +1,18 @@ /* tslint:disable:no-unused-variable */ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { By } from "@angular/platform-browser"; +import { DebugElement } from "@angular/core"; -import { FiwareDetailComponent } from './fiware-detail.component'; +import { FiwareDetailComponent } from "./fiware-detail.component"; -describe('FiwareDetailComponent', () => { +describe("FiwareDetailComponent", () => { let component: FiwareDetailComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ FiwareDetailComponent ] - }) - .compileComponents(); + declarations: [FiwareDetailComponent], + }).compileComponents(); })); beforeEach(() => { @@ -22,7 +21,7 @@ describe('FiwareDetailComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.ts b/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.ts index 97bc7c6a3..e4e18d6d4 100644 --- a/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.ts +++ b/src/app/applications/datatarget/fiware/fiware-detail/fiware-detail.component.ts @@ -1,30 +1,29 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { Subscription } from 'rxjs'; -import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { PayloadDeviceDatatargetGetByDataTarget } from '@app/payload-decoder/payload-device-data.model'; -import { PayloadDeviceDatatargetService } from '@app/payload-decoder/payload-device-datatarget.service'; -import { BackButton } from '@shared/models/back-button.model'; -import { DatatargetService } from '../../datatarget.service'; -import { Location } from '@angular/common'; -import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; -import { Datatarget } from '../../datatarget.model'; -import { DropdownButton } from '@shared/models/dropdown-button.model'; -import { faArrowsAltH } from '@fortawesome/free-solid-svg-icons'; -import { DatatargetDetail } from '@applications/datatarget/datatarget-detail/datatarget-detail'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { Subscription } from "rxjs"; +import { ActivatedRoute } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { PayloadDeviceDatatargetGetByDataTarget } from "@app/payload-decoder/payload-device-data.model"; +import { PayloadDeviceDatatargetService } from "@app/payload-decoder/payload-device-datatarget.service"; +import { BackButton } from "@shared/models/back-button.model"; +import { DatatargetService } from "../../datatarget.service"; +import { Location } from "@angular/common"; +import { DeleteDialogService } from "@shared/components/delete-dialog/delete-dialog.service"; +import { Datatarget } from "../../datatarget.model"; +import { DropdownButton } from "@shared/models/dropdown-button.model"; +import { faArrowsAltH } from "@fortawesome/free-solid-svg-icons"; +import { DatatargetDetail } from "@applications/datatarget/datatarget-detail/datatarget-detail"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-fiware-detail', - templateUrl: './fiware-detail.component.html', - styleUrls: ['./fiware-detail.component.scss'], + selector: "app-fiware-detail", + templateUrl: "./fiware-detail.component.html", + styleUrls: ["./fiware-detail.component.scss"], }) -export class FiwareDetailComponent - implements DatatargetDetail, OnInit, OnDestroy { +export class FiwareDetailComponent implements DatatargetDetail, OnInit, OnDestroy { public datatargetSubscription: Subscription; public datatarget: Datatarget; - public backButton: BackButton = { label: '', routerLink: undefined }; + public backButton: BackButton = { label: "", routerLink: undefined }; public dataTargetRelations: PayloadDeviceDatatargetGetByDataTarget[]; private deleteDialogSubscription: Subscription; public dropdownButton: DropdownButton; @@ -42,24 +41,22 @@ export class FiwareDetailComponent ) {} ngOnInit(): void { - const id: number = +this.route.snapshot.paramMap.get('datatargetId'); - const appId: number = +this.route.snapshot.paramMap.get('id'); + const id: number = +this.route.snapshot.paramMap.get("datatargetId"); + const appId: number = +this.route.snapshot.paramMap.get("id"); if (id) { this.getDatatarget(id); this.getDatatargetRelations(id); this.dropdownButton = { - label: '', - editRouterLink: '../../datatarget-edit/' + id, + label: "", + editRouterLink: "../../datatarget-edit/" + id, isErasable: true, }; } - this.translate - .get(['NAV.MY-DATATARGET', 'DATATARGET.SHOW-OPTIONS']) - .subscribe((translations) => { - this.backButton.label = translations['NAV.MY-DATATARGET']; - this.dropdownButton.label = translations['DATATARGET.SHOW-OPTIONS']; - }); + this.translate.get(["NAV.MY-DATATARGET", "DATATARGET.SHOW-OPTIONS"]).subscribe(translations => { + this.backButton.label = translations["NAV.MY-DATATARGET"]; + this.dropdownButton.label = translations["DATATARGET.SHOW-OPTIONS"]; + }); this.canEdit = this.meService.hasAccessToTargetOrganization( OrganizationAccessScope.ApplicationWrite, undefined, @@ -73,26 +70,20 @@ export class FiwareDetailComponent }); } onDeleteDatatarget() { - this.deleteDialogSubscription = this.deleteDialogService - .showSimpleDialog() - .subscribe((response) => { - if (response) { - this.datatargetService - .delete(this.datatarget.id) - .subscribe((response) => {}); - this.location.back(); - } else { - console.log(response); - } - }); + this.deleteDialogSubscription = this.deleteDialogService.showSimpleDialog().subscribe(response => { + if (response) { + this.datatargetService.delete(this.datatarget.id).subscribe(response => {}); + this.location.back(); + } else { + console.log(response); + } + }); } getDatatargetRelations(id: number) { - this.datatargetRelationServicer - .getByDataTarget(id) - .subscribe((response) => { - this.dataTargetRelations = response.data; - }); + this.datatargetRelationServicer.getByDataTarget(id).subscribe(response => { + this.dataTargetRelations = response.data; + }); } ngOnDestroy(): void { diff --git a/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.html b/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.html index ecc013dc9..6a83bc732 100644 --- a/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.html +++ b/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.html @@ -1,74 +1,114 @@ - - +
    -
    • - {{error | translate}} + {{ error | translate }}
    - * - {{ "QUESTION.GIVE-DATATARGET-NAME" | translate }}* + + [ngClass]="{ + 'is-invalid': formFailedSubmit && errorFields.includes('name'), + 'is-valid': formFailedSubmit && !errorFields.includes('name') + }" + />
    - * - + * +
    - + - + matTooltipHideDelay="2000" + > +
    - + - + matTooltipHideDelay="2000" + > +
    - * - {{ "QUESTION.GIVE-DATATARGET-TIMEOUT" | translate }}* + + [ngClass]="{ + 'is-invalid': formFailedSubmit && errorFields.includes('timeout'), + 'is-valid': formFailedSubmit && !errorFields.includes('timeout') + }" + />
    - - + +
    - - + +
    - - + +
    - - + +
    -
    {{'QUESTION.DATATARGET.RELATIONS' | translate}}
    +
    {{ "QUESTION.DATATARGET.RELATIONS" | translate }}
    - {{'QUESTION.ADD-RELATIONS' | translate}} + {{ "QUESTION.ADD-RELATIONS" | translate }} - + @@ -185,8 +254,12 @@
    {{'QUESTION.DATATARGET.RELATIONS' | translate}}
    - - + +
    diff --git a/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.scss b/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.scss index bb96f6577..276abe9d1 100644 --- a/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.scss +++ b/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.scss @@ -1,4 +1,4 @@ .form-info-icon { - margin-left: 5px; - cursor: pointer; -} \ No newline at end of file + margin-left: 5px; + cursor: pointer; +} diff --git a/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.spec.ts b/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.spec.ts index f445a61e6..eb4faa06c 100644 --- a/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.spec.ts +++ b/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.spec.ts @@ -1,19 +1,18 @@ /* tslint:disable:no-unused-variable */ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { By } from "@angular/platform-browser"; +import { DebugElement } from "@angular/core"; -import { FiwareEditComponent } from './fiware-edit.component'; +import { FiwareEditComponent } from "./fiware-edit.component"; -describe('FiwareEditComponent', () => { +describe("FiwareEditComponent", () => { let component: FiwareEditComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ FiwareEditComponent ] - }) - .compileComponents(); + declarations: [FiwareEditComponent], + }).compileComponents(); })); beforeEach(() => { @@ -22,7 +21,7 @@ describe('FiwareEditComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.ts b/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.ts index 32fb4fb4d..8985d326c 100644 --- a/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.ts +++ b/src/app/applications/datatarget/fiware/fiware-edit/fiware-edit.component.ts @@ -1,42 +1,42 @@ -import { Component, OnInit, Input, OnDestroy } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Datatarget } from '../../datatarget.model'; -import { Subscription } from 'rxjs'; -import { Application } from '@applications/application.model'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { faTimesCircle } from '@fortawesome/free-solid-svg-icons'; +import { Component, OnInit, Input, OnDestroy } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; +import { ActivatedRoute, Router } from "@angular/router"; +import { Datatarget } from "../../datatarget.model"; +import { Subscription } from "rxjs"; +import { Application } from "@applications/application.model"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { faTimesCircle } from "@fortawesome/free-solid-svg-icons"; import { PayloadDeviceDatatarget, PayloadDeviceDatatargetGetByDataTargetResponse, -} from '@payload-decoder/payload-device-data.model'; -import { DatatargetService } from '../../datatarget.service'; -import { ApplicationService } from '@applications/application.service'; -import { PayloadDecoderService } from '@payload-decoder/payload-decoder.service'; -import { PayloadDeviceDatatargetService } from '@payload-decoder/payload-device-datatarget.service'; -import { SnackService } from '@shared/services/snack.service'; -import { MatDialog } from '@angular/material/dialog'; -import { HttpErrorResponse } from '@angular/common/http'; -import { PayloadDecoderMappedResponse } from '@payload-decoder/payload-decoder.model'; -import { DeleteDialogComponent } from '@shared/components/delete-dialog/delete-dialog.component'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { ScrollToTopService } from '@shared/services/scroll-to-top.service'; -import { DataTargetType } from '@shared/enums/datatarget-type'; -import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; -import { DatatargetEdit } from '@applications/datatarget/datatarget-edit/datatarget-edit'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +} from "@payload-decoder/payload-device-data.model"; +import { DatatargetService } from "../../datatarget.service"; +import { ApplicationService } from "@applications/application.service"; +import { PayloadDecoderService } from "@payload-decoder/payload-decoder.service"; +import { PayloadDeviceDatatargetService } from "@payload-decoder/payload-device-datatarget.service"; +import { SnackService } from "@shared/services/snack.service"; +import { MatDialog } from "@angular/material/dialog"; +import { HttpErrorResponse } from "@angular/common/http"; +import { PayloadDecoderMappedResponse } from "@payload-decoder/payload-decoder.model"; +import { DeleteDialogComponent } from "@shared/components/delete-dialog/delete-dialog.component"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { ScrollToTopService } from "@shared/services/scroll-to-top.service"; +import { DataTargetType } from "@shared/enums/datatarget-type"; +import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons"; +import { DatatargetEdit } from "@applications/datatarget/datatarget-edit/datatarget-edit"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-fiware-edit', - templateUrl: './fiware-edit.component.html', - styleUrls: ['./fiware-edit.component.scss'], + selector: "app-fiware-edit", + templateUrl: "./fiware-edit.component.html", + styleUrls: ["./fiware-edit.component.scss"], }) export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { public multiPage = false; - public title = ''; - public sectionTitle = ''; - public backButtonTitle = ''; + public title = ""; + public sectionTitle = ""; + public backButtonTitle = ""; @Input() submitButton: string; public datatarget: Datatarget = new Datatarget(); faTimesCircle = faTimesCircle; @@ -72,30 +72,25 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { private scrollToTopService: ScrollToTopService, private meService: MeService ) { - translate.use('da'); + translate.use("da"); } ngOnInit() { this.translate - .get([ - 'FORM.CREATE-NEW-DATATARGET', - 'FORM.EDIT-DATATARGET', - 'DATATARGET.SAVE', - 'NAV.DATATARGET', - ]) - .subscribe((translations) => { - const datatargetid = +this.route.snapshot.paramMap.get('datatargetId'); + .get(["FORM.CREATE-NEW-DATATARGET", "FORM.EDIT-DATATARGET", "DATATARGET.SAVE", "NAV.DATATARGET"]) + .subscribe(translations => { + const datatargetid = +this.route.snapshot.paramMap.get("datatargetId"); if (datatargetid !== 0) { - this.title = translations['FORM.EDIT-DATATARGET']; + this.title = translations["FORM.EDIT-DATATARGET"]; } else { - this.title = translations['FORM.CREATE-NEW-DATATARGET']; + this.title = translations["FORM.CREATE-NEW-DATATARGET"]; } - this.submitButton = translations['DATATARGET.SAVE']; - this.backButtonTitle = translations['NAV.DATATARGET']; + this.submitButton = translations["DATATARGET.SAVE"]; + this.backButtonTitle = translations["NAV.DATATARGET"]; }); - this.datatargetid = +this.route.snapshot.paramMap.get('datatargetId'); - this.applicationId = +this.route.snapshot.paramMap.get('id'); + this.datatargetid = +this.route.snapshot.paramMap.get("datatargetId"); + this.applicationId = +this.route.snapshot.paramMap.get("id"); this.datatarget.type = DataTargetType.FIWARE; @@ -107,9 +102,7 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { this.getDevices(); } this.getPayloadDecoders(); - this.canEdit = this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.ApplicationWrite - ); + this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.ApplicationWrite); } addRow() { @@ -129,11 +122,9 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { } else if (this.payloadDeviceDatatarget[index]?.id === null) { this.payloadDeviceDatatarget.splice(index, 1); } else { - this.payloadDeviceDataTargetService - .delete(this.payloadDeviceDatatarget[index].id) - .subscribe((response) => { - this.payloadDeviceDatatarget.splice(index, 1); - }); + this.payloadDeviceDataTargetService.delete(this.payloadDeviceDatatarget[index].id).subscribe(response => { + this.payloadDeviceDatatarget.splice(index, 1); + }); } } @@ -142,11 +133,11 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { data: { showAccept: true, showCancel: true, - message: 'Er du sikker på at du vil slette?', + message: "Er du sikker på at du vil slette?", }, }); - dialog.afterClosed().subscribe((result) => { + dialog.afterClosed().subscribe(result => { if (result === true) { this.deleteRow(index); } @@ -169,11 +160,7 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { updateDatatarget() { this.resetErrors(); - this.counter = - 1 + - (this.payloadDeviceDatatarget?.length - ? this.payloadDeviceDatatarget?.length - : 0); + this.counter = 1 + (this.payloadDeviceDatatarget?.length ? this.payloadDeviceDatatarget?.length : 0); this.datatargetService.update(this.datatarget).subscribe( (response: Datatarget) => { this.datatarget = response; @@ -187,18 +174,18 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { } addPayloadDeviceDatatarget() { - this.payloadDeviceDatatarget.map((pdd) => { + this.payloadDeviceDatatarget.map(pdd => { if (pdd.payloadDecoderId === 0) { pdd.payloadDecoderId = null; } }); - this.payloadDeviceDatatarget.forEach((relation) => { + this.payloadDeviceDatatarget.forEach(relation => { if (relation.id) { this.payloadDeviceDataTargetService.put(relation).subscribe( - (response) => { + response => { this.countToRedirect(); }, - (error) => { + error => { this.handleError(error); } ); @@ -207,7 +194,7 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { (res: any) => { this.countToRedirect(); }, - (error) => { + error => { this.handleError(error); } ); @@ -257,16 +244,12 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { this.applicationSubscription = this.applicationService .getApplication(this.applicationId) .subscribe((application: Application) => { - this.devices = application.iotDevices.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); + this.devices = application.iotDevices.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); }); } public selectAllDevices(index: number) { - this.payloadDeviceDatatarget[index].iotDeviceIds = this.devices.map( - (device) => device.id - ); + this.payloadDeviceDatatarget[index].iotDeviceIds = this.devices.map(device => device.id); } public deSelectAllDevices(index: number) { @@ -275,11 +258,9 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { getPayloadDecoders() { this.payloadDecoderSubscription = this.payloadDecoderService - .getMultiple(1000, 0, 'id', 'ASC') + .getMultiple(1000, 0, "id", "ASC") .subscribe((response: PayloadDecoderMappedResponse) => { - this.payloadDecoders = response.data.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); + this.payloadDecoders = response.data.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); }); } @@ -291,7 +272,7 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { } routeToDatatargets(): void { - this.router.navigate(['applications', this.applicationId.toString()]); + this.router.navigate(["applications", this.applicationId.toString()]); } onCoordinateKey(event: any) { @@ -301,11 +282,9 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { } getDatatarget(id: number) { - this.datatargetSubscription = this.datatargetService - .get(id) - .subscribe((response: Datatarget) => { - this.datatarget = response; - }); + this.datatargetSubscription = this.datatargetService.get(id).subscribe((response: Datatarget) => { + this.datatarget = response; + }); } showSavedSnack() { @@ -333,18 +312,13 @@ export class FiwareEditComponent implements DatatargetEdit, OnInit, OnDestroy { } } - private mapToDatatargetDevicePayload( - dto: PayloadDeviceDatatargetGetByDataTargetResponse - ) { + private mapToDatatargetDevicePayload(dto: PayloadDeviceDatatargetGetByDataTargetResponse) { this.payloadDeviceDatatarget = []; - dto.data.forEach((element) => { + dto.data.forEach(element => { this.payloadDeviceDatatarget.push({ id: element.id, - iotDeviceIds: element.iotDevices.map((x) => x.id), - payloadDecoderId: - element.payloadDecoder?.id === undefined - ? 0 - : element.payloadDecoder?.id, + iotDeviceIds: element.iotDevices.map(x => x.id), + payloadDecoderId: element.payloadDecoder?.id === undefined ? 0 : element.payloadDecoder?.id, dataTargetId: element.dataTarget.id, }); }); diff --git a/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.html b/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.html index 72d69c573..e298c88ee 100644 --- a/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.html +++ b/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.html @@ -1,37 +1,58 @@
    - +
    -

    {{ 'DATATARGET.DETAILS' | translate }}

    +

    {{ "DATATARGET.DETAILS" | translate }}

    -

    {{ 'DATATARGET.URL' | translate }}{{datatarget.url}}

    -

    {{ 'DATATARGET.TIMEOUT' | translate }}{{datatarget.timeout}}

    +

    + {{ "DATATARGET.URL" | translate }}{{ datatarget.url }} +

    +

    + {{ "DATATARGET.TIMEOUT" | translate }}{{ datatarget.timeout }} +

    -

    {{ 'DATATARGET.TYPE' | translate }}{{'DATATARGET.' + datatarget.type + '.TYPE' | translate}}

    +

    + {{ "DATATARGET.TYPE" | translate }}{{ "DATATARGET." + datatarget.type + ".TYPE" | translate }} +

    -

    {{ 'DATATARGET.AUTHORIZATIONHEADER' | translate }}

    -
    {{datatarget.authorizationHeader}}
    +

    + {{ "DATATARGET.AUTHORIZATIONHEADER" | translate }} +

    + +
    {{
    +                datatarget.authorizationHeader
    +              }}
    +
    -

    {{ 'DATATARGET.NO-AUTHORIZATIONHEADER' | translate }}

    +

    {{ "DATATARGET.NO-AUTHORIZATIONHEADER" | translate }}

    -
    -

    {{ 'DATATARGET.OPENDATA-DK.TYPE' | translate }}

    -
    +

    {{ "DATATARGET.OPENDATA-DK.TYPE" | translate }}

    +
    -

    {{ 'DATATARGET.NO-OPENDATA-DK' | translate }}

    +

    {{ "DATATARGET.NO-OPENDATA-DK" | translate }}

    @@ -39,30 +60,37 @@

    {{ 'DATATARGET.OPENDATA-DK.TYPE' | translate }}

    -
    +
    -

    {{ 'DATATARGET.RELATIONS' | translate }}

    +

    {{ "DATATARGET.RELATIONS" | translate }}

    -

    {{'DATATARGET.NO-RELATIONS' | translate}}

    +

    {{ "DATATARGET.NO-RELATIONS" | translate }}

    -

    {{'DATATARGET.PAYLOADEDECODER' | translate}} - {{relation.payloadDecoder.name}} +

    + {{ "DATATARGET.PAYLOADEDECODER" | translate }} + {{ + relation.payloadDecoder.name + }} - {{ 'DATATARGET.NO-PAYLOADDECODER' | translate}} + {{ "DATATARGET.NO-PAYLOADDECODER" | translate }}

    -

    {{'DATATARGET.IOTDEVICE' | translate}} +

    + {{ "DATATARGET.IOTDEVICE" | translate }} - , {{device.name}} + , + {{ + device.name + }}

    diff --git a/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.scss b/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.scss index e5e49dffe..5be2c506a 100644 --- a/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.scss +++ b/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.scss @@ -1,3 +1,3 @@ pre { - word-wrap: break-word; - } \ No newline at end of file + word-wrap: break-word; +} diff --git a/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.spec.ts b/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.spec.ts index d7830e526..0b1e7b922 100644 --- a/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.spec.ts +++ b/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.spec.ts @@ -1,19 +1,18 @@ /* tslint:disable:no-unused-variable */ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { By } from "@angular/platform-browser"; +import { DebugElement } from "@angular/core"; -import { HttppushDetailComponent } from './httppush-detail.component'; +import { HttppushDetailComponent } from "./httppush-detail.component"; -describe('HttppushDetailComponent', () => { +describe("HttppushDetailComponent", () => { let component: HttppushDetailComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ HttppushDetailComponent ] - }) - .compileComponents(); + declarations: [HttppushDetailComponent], + }).compileComponents(); })); beforeEach(() => { @@ -22,7 +21,7 @@ describe('HttppushDetailComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.ts b/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.ts index 47878a841..7c2f9f146 100644 --- a/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.ts +++ b/src/app/applications/datatarget/httppush/httppush-detail/httppush-detail.component.ts @@ -1,33 +1,32 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { Subscription } from 'rxjs'; -import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { PayloadDeviceDatatargetGetByDataTarget } from '@app/payload-decoder/payload-device-data.model'; -import { PayloadDeviceDatatargetService } from '@app/payload-decoder/payload-device-datatarget.service'; -import { BackButton } from '@shared/models/back-button.model'; -import { DatatargetService } from '../../datatarget.service'; -import { Location } from '@angular/common'; -import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; -import { Datatarget } from '../../datatarget.model'; -import { DropdownButton } from '@shared/models/dropdown-button.model'; -import { faArrowsAltH } from '@fortawesome/free-solid-svg-icons'; -import { DatatargetDetail } from '@applications/datatarget/datatarget-detail/datatarget-detail'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { DataTargetType } from '@shared/enums/datatarget-type'; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { Subscription } from "rxjs"; +import { ActivatedRoute } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { PayloadDeviceDatatargetGetByDataTarget } from "@app/payload-decoder/payload-device-data.model"; +import { PayloadDeviceDatatargetService } from "@app/payload-decoder/payload-device-datatarget.service"; +import { BackButton } from "@shared/models/back-button.model"; +import { DatatargetService } from "../../datatarget.service"; +import { Location } from "@angular/common"; +import { DeleteDialogService } from "@shared/components/delete-dialog/delete-dialog.service"; +import { Datatarget } from "../../datatarget.model"; +import { DropdownButton } from "@shared/models/dropdown-button.model"; +import { faArrowsAltH } from "@fortawesome/free-solid-svg-icons"; +import { DatatargetDetail } from "@applications/datatarget/datatarget-detail/datatarget-detail"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { DataTargetType } from "@shared/enums/datatarget-type"; @Component({ - selector: 'app-httppush-detail', - templateUrl: './httppush-detail.component.html', - styleUrls: ['./httppush-detail.component.scss'], + selector: "app-httppush-detail", + templateUrl: "./httppush-detail.component.html", + styleUrls: ["./httppush-detail.component.scss"], }) -export class HttppushDetailComponent - implements DatatargetDetail, OnInit, OnDestroy { +export class HttppushDetailComponent implements DatatargetDetail, OnInit, OnDestroy { dataTargetType = DataTargetType; public datatargetSubscription: Subscription; public datatarget: Datatarget; - public backButton: BackButton = { label: '', routerLink: undefined }; + public backButton: BackButton = { label: "", routerLink: undefined }; public dataTargetRelations: PayloadDeviceDatatargetGetByDataTarget[]; private deleteDialogSubscription: Subscription; public dropdownButton: DropdownButton; @@ -45,23 +44,21 @@ export class HttppushDetailComponent ) {} ngOnInit(): void { - const id: number = +this.route.snapshot.paramMap.get('datatargetId'); - const appId: number = +this.route.snapshot.paramMap.get('id'); + const id: number = +this.route.snapshot.paramMap.get("datatargetId"); + const appId: number = +this.route.snapshot.paramMap.get("id"); if (id) { this.getDatatarget(id); this.getDatatargetRelations(id); this.dropdownButton = { - label: '', - editRouterLink: '../../datatarget-edit/' + id, + label: "", + editRouterLink: "../../datatarget-edit/" + id, isErasable: true, }; } - this.translate - .get(['NAV.MY-DATATARGET', 'DATATARGET.SHOW-OPTIONS']) - .subscribe((translations) => { - this.backButton.label = translations['NAV.MY-DATATARGET']; - this.dropdownButton.label = translations['DATATARGET.SHOW-OPTIONS']; - }); + this.translate.get(["NAV.MY-DATATARGET", "DATATARGET.SHOW-OPTIONS"]).subscribe(translations => { + this.backButton.label = translations["NAV.MY-DATATARGET"]; + this.dropdownButton.label = translations["DATATARGET.SHOW-OPTIONS"]; + }); this.canEdit = this.meService.hasAccessToTargetOrganization( OrganizationAccessScope.ApplicationWrite, undefined, @@ -76,26 +73,20 @@ export class HttppushDetailComponent } onDeleteDatatarget() { - this.deleteDialogSubscription = this.deleteDialogService - .showSimpleDialog() - .subscribe((response) => { - if (response) { - this.datatargetService - .delete(this.datatarget.id) - .subscribe((response) => {}); - this.location.back(); - } else { - console.log(response); - } - }); + this.deleteDialogSubscription = this.deleteDialogService.showSimpleDialog().subscribe(response => { + if (response) { + this.datatargetService.delete(this.datatarget.id).subscribe(response => {}); + this.location.back(); + } else { + console.log(response); + } + }); } getDatatargetRelations(id: number) { - this.datatargetRelationServicer - .getByDataTarget(id) - .subscribe((response) => { - this.dataTargetRelations = response.data; - }); + this.datatargetRelationServicer.getByDataTarget(id).subscribe(response => { + this.dataTargetRelations = response.data; + }); } ngOnDestroy(): void { diff --git a/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.html b/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.html index 96bbe9365..6a6e0d285 100644 --- a/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.html +++ b/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.html @@ -1,132 +1,152 @@ - - +
    -
    -
      -
    • - {{error | translate}} -
    • -
    -
    -
    -
    - * - -
    +
    +
      +
    • + {{ error | translate }} +
    • +
    +
    +
    +
    + * +
    +
    -
    -
    - * - -
    +
    +
    + * + +
    +
    +
    +
    + * + +
    +
    +
    +
    + +
    -
    -
    - * - -
    -
    -
    -
    - - -
    -
    +
    -
    -
    {{'QUESTION.DATATARGET.RELATIONS' | translate}}
    -
    -
    - {{'QUESTION.DATATARGET.SELECT-DEVICES' | translate}} - - - - - {{device.name}} + {{ device.name }}
    @@ -156,15 +227,13 @@
    {{'QUESTION.DATATARGET.RELATIONS' | translate}}
    - {{'QUESTION.DATATARGET.SELECT-PAYLOADDECODER' | translate}} - + {{ "QUESTION.DATATARGET.SELECT-PAYLOADDECODER" | translate }} + - {{'QUESTION.DATATARGET.NO-PAYLOAD-DECODER-SELECTED' | translate}} + {{ "QUESTION.DATATARGET.NO-PAYLOAD-DECODER-SELECTED" | translate }} - {{payloadDecoder.name}} + {{ payloadDecoder.name }} @@ -173,8 +242,8 @@
    {{'QUESTION.DATATARGET.RELATIONS' | translate}}
    - -

    {{'DATATARGET.DELETE' | translate}}

    + +

    {{ "DATATARGET.DELETE" | translate }}

    - - - - - - - -
    -
    - - {{'QUESTION.DATATARGET.SELECT-DEVICES' | translate}} - - - - - - {{device.name}} - - -
    -
    -
    - - {{'QUESTION.DATATARGET.SELECT-PAYLOADDECODER' | translate}} - - - {{'QUESTION.DATATARGET.NO-PAYLOAD-DECODER-SELECTED' | translate}} - - - {{payloadDecoder.name}} - - - -
    -
    - -
    - -

    {{'DATATARGET.DELETE' | translate}}

    -
    -
    -
    -
    -
    -
    - - -
    - +
    +
    {{ "QUESTION.DATATARGET.RELATIONS" | translate }}
    +
    +
    + {{ "QUESTION.ADD-RELATIONS" | translate }} + + + + + + + + + +
    +
    + + {{ "QUESTION.DATATARGET.SELECT-DEVICES" | translate }} + + + + + + {{ device.name }} + + +
    +
    +
    + + {{ "QUESTION.DATATARGET.SELECT-PAYLOADDECODER" | translate }} + + + {{ "QUESTION.DATATARGET.NO-PAYLOAD-DECODER-SELECTED" | translate }} + + + {{ payloadDecoder.name }} + + + +
    +
    + +
    + +

    {{ "DATATARGET.DELETE" | translate }}

    +
    +
    +
    +
    +
    +
    + + +
    + diff --git a/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.spec.ts b/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.spec.ts index 21980cfd2..e2d0a0205 100644 --- a/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.spec.ts +++ b/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.spec.ts @@ -1,19 +1,18 @@ /* tslint:disable:no-unused-variable */ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { By } from "@angular/platform-browser"; +import { DebugElement } from "@angular/core"; -import { HttppushEditComponent } from './httppush-edit.component'; +import { HttppushEditComponent } from "./httppush-edit.component"; -describe('HttppushEditComponent', () => { +describe("HttppushEditComponent", () => { let component: HttppushEditComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ HttppushEditComponent ] - }) - .compileComponents(); + declarations: [HttppushEditComponent], + }).compileComponents(); })); beforeEach(() => { @@ -22,7 +21,7 @@ describe('HttppushEditComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.ts b/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.ts index 1c27409b6..df0d12c33 100644 --- a/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.ts +++ b/src/app/applications/datatarget/httppush/httppush-edit/httppush-edit.component.ts @@ -1,41 +1,40 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Datatarget } from '../../datatarget.model'; -import { Subscription } from 'rxjs'; -import { Application } from '@applications/application.model'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { faTimesCircle } from '@fortawesome/free-solid-svg-icons'; +import { Component, OnInit, OnDestroy } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; +import { ActivatedRoute, Router } from "@angular/router"; +import { Datatarget } from "../../datatarget.model"; +import { Subscription } from "rxjs"; +import { Application } from "@applications/application.model"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { faTimesCircle } from "@fortawesome/free-solid-svg-icons"; import { PayloadDeviceDatatarget, PayloadDeviceDatatargetGetByDataTargetResponse, -} from '@payload-decoder/payload-device-data.model'; -import { DatatargetService } from '../../datatarget.service'; -import { ApplicationService } from '@applications/application.service'; -import { PayloadDecoderService } from '@payload-decoder/payload-decoder.service'; -import { PayloadDeviceDatatargetService } from '@payload-decoder/payload-device-datatarget.service'; -import { SnackService } from '@shared/services/snack.service'; -import { MatDialog } from '@angular/material/dialog'; -import { HttpErrorResponse } from '@angular/common/http'; -import { PayloadDecoderMappedResponse } from '@payload-decoder/payload-decoder.model'; -import { DeleteDialogComponent } from '@shared/components/delete-dialog/delete-dialog.component'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { ScrollToTopService } from '@shared/services/scroll-to-top.service'; -import { DatatargetEdit } from '@applications/datatarget/datatarget-edit/datatarget-edit'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +} from "@payload-decoder/payload-device-data.model"; +import { DatatargetService } from "../../datatarget.service"; +import { ApplicationService } from "@applications/application.service"; +import { PayloadDecoderService } from "@payload-decoder/payload-decoder.service"; +import { PayloadDeviceDatatargetService } from "@payload-decoder/payload-device-datatarget.service"; +import { SnackService } from "@shared/services/snack.service"; +import { MatDialog } from "@angular/material/dialog"; +import { HttpErrorResponse } from "@angular/common/http"; +import { PayloadDecoderMappedResponse } from "@payload-decoder/payload-decoder.model"; +import { DeleteDialogComponent } from "@shared/components/delete-dialog/delete-dialog.component"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { ScrollToTopService } from "@shared/services/scroll-to-top.service"; +import { DatatargetEdit } from "@applications/datatarget/datatarget-edit/datatarget-edit"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-httppush-edit', - templateUrl: './httppush-edit.component.html', - styleUrls: ['./httppush-edit.component.scss'], + selector: "app-httppush-edit", + templateUrl: "./httppush-edit.component.html", + styleUrls: ["./httppush-edit.component.scss"], }) -export class HttppushEditComponent - implements DatatargetEdit, OnInit, OnDestroy { +export class HttppushEditComponent implements DatatargetEdit, OnInit, OnDestroy { public multiPage = false; - public title = ''; - public sectionTitle = ''; - public backButtonTitle = ''; + public title = ""; + public sectionTitle = ""; + public backButtonTitle = ""; public submitButton: string; public datatarget: Datatarget = new Datatarget(); faTimesCircle = faTimesCircle; @@ -71,30 +70,25 @@ export class HttppushEditComponent private scrollToTopService: ScrollToTopService, private meService: MeService ) { - translate.use('da'); + translate.use("da"); } ngOnInit() { this.translate - .get([ - 'FORM.CREATE-NEW-DATATARGET', - 'FORM.EDIT-DATATARGET', - 'DATATARGET.SAVE', - 'NAV.DATATARGET', - ]) - .subscribe((translations) => { - const datatargetid = +this.route.snapshot.paramMap.get('datatargetId'); + .get(["FORM.CREATE-NEW-DATATARGET", "FORM.EDIT-DATATARGET", "DATATARGET.SAVE", "NAV.DATATARGET"]) + .subscribe(translations => { + const datatargetid = +this.route.snapshot.paramMap.get("datatargetId"); if (datatargetid !== 0) { - this.title = translations['FORM.EDIT-DATATARGET']; + this.title = translations["FORM.EDIT-DATATARGET"]; } else { - this.title = translations['FORM.CREATE-NEW-DATATARGET']; + this.title = translations["FORM.CREATE-NEW-DATATARGET"]; } - this.submitButton = translations['DATATARGET.SAVE']; - this.backButtonTitle = translations['NAV.DATATARGET']; + this.submitButton = translations["DATATARGET.SAVE"]; + this.backButtonTitle = translations["NAV.DATATARGET"]; }); - this.datatargetid = +this.route.snapshot.paramMap.get('datatargetId'); - this.applicationId = +this.route.snapshot.paramMap.get('id'); + this.datatargetid = +this.route.snapshot.paramMap.get("datatargetId"); + this.applicationId = +this.route.snapshot.paramMap.get("id"); if (this.datatargetid !== 0) { this.getDatatarget(this.datatargetid); this.getPayloadDeviceDatatarget(this.datatargetid); @@ -127,11 +121,9 @@ export class HttppushEditComponent } else if (this.payloadDeviceDatatarget[index]?.id === null) { this.payloadDeviceDatatarget.splice(index, 1); } else { - this.payloadDeviceDataTargetService - .delete(this.payloadDeviceDatatarget[index].id) - .subscribe((response) => { - this.payloadDeviceDatatarget.splice(index, 1); - }); + this.payloadDeviceDataTargetService.delete(this.payloadDeviceDatatarget[index].id).subscribe(response => { + this.payloadDeviceDatatarget.splice(index, 1); + }); } } @@ -140,11 +132,11 @@ export class HttppushEditComponent data: { showAccept: true, showCancel: true, - message: 'Er du sikker på at du vil slette?', + message: "Er du sikker på at du vil slette?", }, }); - dialog.afterClosed().subscribe((result) => { + dialog.afterClosed().subscribe(result => { if (result === true) { this.deleteRow(index); } @@ -182,18 +174,18 @@ export class HttppushEditComponent } addPayloadDeviceDatatarget() { - this.payloadDeviceDatatarget.map((pdd) => { + this.payloadDeviceDatatarget.map(pdd => { if (pdd.payloadDecoderId === 0) { pdd.payloadDecoderId = null; } }); - this.payloadDeviceDatatarget.forEach((relation) => { + this.payloadDeviceDatatarget.forEach(relation => { if (relation.id) { this.payloadDeviceDataTargetService.put(relation).subscribe( - (response) => { + response => { this.countToRedirect(); }, - (error) => { + error => { this.handleError(error); } ); @@ -202,7 +194,7 @@ export class HttppushEditComponent (res: any) => { this.countToRedirect(); }, - (error) => { + error => { this.handleError(error); } ); @@ -211,14 +203,10 @@ export class HttppushEditComponent } private validatePayloadDeviceDatatarget = () => { - const isError = this.payloadDeviceDatatarget?.some( - (relation) => (relation.iotDeviceIds?.length ?? 0) < 1 - ); + const isError = this.payloadDeviceDatatarget?.some(relation => (relation.iotDeviceIds?.length ?? 0) < 1); if (isError) { - this.errorFields = ['devices']; - this.errorMessages = [ - 'Must attach at least one IoT-device for each element in list of devices / decoders', - ]; + this.errorFields = ["devices"]; + this.errorMessages = ["Must attach at least one IoT-device for each element in list of devices / decoders"]; this.scrollToTopService.scrollToTop(); } return !isError; @@ -267,16 +255,12 @@ export class HttppushEditComponent this.applicationSubscription = this.applicationService .getApplication(this.applicationId) .subscribe((application: Application) => { - this.devices = application.iotDevices.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); + this.devices = application.iotDevices.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); }); } public selectAllDevices(index: number) { - this.payloadDeviceDatatarget[index].iotDeviceIds = this.devices.map( - (device) => device.id - ); + this.payloadDeviceDatatarget[index].iotDeviceIds = this.devices.map(device => device.id); } public deSelectAllDevices(index: number) { @@ -285,11 +269,9 @@ export class HttppushEditComponent getPayloadDecoders() { this.payloadDecoderSubscription = this.payloadDecoderService - .getMultiple(1000, 0, 'id', 'ASC') + .getMultiple(1000, 0, "id", "ASC") .subscribe((response: PayloadDecoderMappedResponse) => { - this.payloadDecoders = response.data.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); + this.payloadDecoders = response.data.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); }); } @@ -300,12 +282,11 @@ export class HttppushEditComponent this.scrollToTopService.scrollToTop(); } - routeToDatatargets = () => this.router.navigate(['applications', this.applicationId, 'data-targets']); + routeToDatatargets = () => this.router.navigate(["applications", this.applicationId, "data-targets"]); routeToCreatedDatatarget = () => - this.router.navigate( - ['applications', this.applicationId, 'datatarget', this.datatarget.id], - { replaceUrl: true } - ); + this.router.navigate(["applications", this.applicationId, "datatarget", this.datatarget.id], { + replaceUrl: true, + }); onCoordinateKey(event: any) { if (event.target.value.length > event.target.maxLength) { @@ -314,11 +295,9 @@ export class HttppushEditComponent } getDatatarget(id: number) { - this.datatargetSubscription = this.datatargetService - .get(id) - .subscribe((response: Datatarget) => { - this.datatarget = response; - }); + this.datatargetSubscription = this.datatargetService.get(id).subscribe((response: Datatarget) => { + this.datatarget = response; + }); } showSavedSnack() { @@ -340,18 +319,13 @@ export class HttppushEditComponent } } - private mapToDatatargetDevicePayload( - dto: PayloadDeviceDatatargetGetByDataTargetResponse - ) { + private mapToDatatargetDevicePayload(dto: PayloadDeviceDatatargetGetByDataTargetResponse) { this.payloadDeviceDatatarget = []; - dto.data.forEach((element) => { + dto.data.forEach(element => { this.payloadDeviceDatatarget.push({ id: element.id, - iotDeviceIds: element.iotDevices.map((x) => x.id), - payloadDecoderId: - element.payloadDecoder?.id === undefined - ? 0 - : element.payloadDecoder?.id, + iotDeviceIds: element.iotDevices.map(x => x.id), + payloadDecoderId: element.payloadDecoder?.id === undefined ? 0 : element.payloadDecoder?.id, dataTargetId: element.dataTarget.id, }); }); diff --git a/src/app/applications/datatarget/mqtt-detail/mqtt-detail.component.html b/src/app/applications/datatarget/mqtt-detail/mqtt-detail.component.html index e8b225e27..1d9b39237 100644 --- a/src/app/applications/datatarget/mqtt-detail/mqtt-detail.component.html +++ b/src/app/applications/datatarget/mqtt-detail/mqtt-detail.component.html @@ -1,55 +1,90 @@
    - +
    -

    {{ 'DATATARGET.DETAILS' | translate }}

    +

    {{ "DATATARGET.DETAILS" | translate }}

    -

    {{ 'DATATARGET.MQTT.BROKER-URL' | translate }}{{datatarget.url}}

    -

    {{ 'DATATARGET.TIMEOUT' | translate }}{{datatarget.timeout}}

    -

    {{ 'DATATARGET.TYPE' | translate }}{{'DATATARGET.' + datatarget.type + ".TYPE" | - translate}}

    +

    + {{ "DATATARGET.MQTT.BROKER-URL" | translate }}{{ datatarget.url }} +

    +

    + {{ "DATATARGET.TIMEOUT" | translate }}{{ datatarget.timeout }} +

    +

    + {{ "DATATARGET.TYPE" | translate }}{{ "DATATARGET." + datatarget.type + ".TYPE" | translate }} +

    -

    {{ 'DATATARGET.MQTT.PORT' | translate }}{{datatarget.mqttPort}}

    -

    {{ 'DATATARGET.MQTT.TOPIC' | translate }}{{datatarget.mqttTopic}}

    -

    {{ 'DATATARGET.MQTT.QOS' | translate }}{{datatarget.mqttQos}}

    -

    {{ 'DATATARGET.MQTT.USERNAME' | translate }}{{datatarget.mqttUsername}}

    -

    {{ 'DATATARGET.MQTT.PASSWORD' | translate }}{{datatarget.mqttPassword}}

    +

    + {{ "DATATARGET.MQTT.PORT" | translate }}{{ datatarget.mqttPort }} +

    +

    + {{ "DATATARGET.MQTT.TOPIC" | translate }}{{ datatarget.mqttTopic }} +

    +

    + {{ "DATATARGET.MQTT.QOS" | translate }}{{ datatarget.mqttQos }} +

    +

    + {{ "DATATARGET.MQTT.USERNAME" | translate }}{{ datatarget.mqttUsername }} +

    +

    + {{ "DATATARGET.MQTT.PASSWORD" | translate }}{{ datatarget.mqttPassword }} +

    -
    +
    -

    {{ 'DATATARGET.RELATIONS' | translate }}

    +

    {{ "DATATARGET.RELATIONS" | translate }}

    -

    {{'DATATARGET.NO-RELATIONS' | translate}}

    +

    {{ "DATATARGET.NO-RELATIONS" | translate }}

    -

    {{'DATATARGET.PAYLOADEDECODER' | translate}} - {{relation.payloadDecoder.name}} +

    + {{ "DATATARGET.PAYLOADEDECODER" | translate }} + {{ + relation.payloadDecoder.name + }} - {{ 'DATATARGET.NO-PAYLOADDECODER' | translate}} + {{ "DATATARGET.NO-PAYLOADDECODER" | translate }}

    -

    {{'DATATARGET.IOTDEVICE' | translate}} +

    + {{ "DATATARGET.IOTDEVICE" | translate }} - , {{device.name}} + , + {{ + device.name + }}

    @@ -63,3 +98,4 @@

    {{ 'DATATARGET.RELATIONS' | translate }}

    +
    diff --git a/src/app/applications/datatarget/mqtt-detail/mqtt-detail.component.ts b/src/app/applications/datatarget/mqtt-detail/mqtt-detail.component.ts index 564d38dec..4edc99322 100644 --- a/src/app/applications/datatarget/mqtt-detail/mqtt-detail.component.ts +++ b/src/app/applications/datatarget/mqtt-detail/mqtt-detail.component.ts @@ -1,31 +1,30 @@ -import { Location } from '@angular/common'; -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { DatatargetDetail } from '@applications/datatarget/datatarget-detail/datatarget-detail'; -import { faArrowsAltH } from '@fortawesome/free-solid-svg-icons'; -import { TranslateService } from '@ngx-translate/core'; -import { PayloadDeviceDatatargetGetByDataTarget } from '@payload-decoder/payload-device-data.model'; -import { PayloadDeviceDatatargetService } from '@payload-decoder/payload-device-datatarget.service'; -import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; -import { BackButton } from '@shared/models/back-button.model'; -import { DropdownButton } from '@shared/models/dropdown-button.model'; -import { Subscription } from 'rxjs'; -import { Datatarget } from '../datatarget.model'; -import { DatatargetService } from '../datatarget.service'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { Location } from "@angular/common"; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { ActivatedRoute } from "@angular/router"; +import { DatatargetDetail } from "@applications/datatarget/datatarget-detail/datatarget-detail"; +import { faArrowsAltH } from "@fortawesome/free-solid-svg-icons"; +import { TranslateService } from "@ngx-translate/core"; +import { PayloadDeviceDatatargetGetByDataTarget } from "@payload-decoder/payload-device-data.model"; +import { PayloadDeviceDatatargetService } from "@payload-decoder/payload-device-datatarget.service"; +import { DeleteDialogService } from "@shared/components/delete-dialog/delete-dialog.service"; +import { BackButton } from "@shared/models/back-button.model"; +import { DropdownButton } from "@shared/models/dropdown-button.model"; +import { Subscription } from "rxjs"; +import { Datatarget } from "../datatarget.model"; +import { DatatargetService } from "../datatarget.service"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-mqtt-detail', - templateUrl: './mqtt-detail.component.html', - styleUrls: ['./mqtt-detail.component.scss'], + selector: "app-mqtt-detail", + templateUrl: "./mqtt-detail.component.html", + styleUrls: ["./mqtt-detail.component.scss"], }) // TODO: Most of the code is duplicated from other datatarget edit components. // Same applies to the html file. One solution is extending a base datatarget-edit component -export class MqttDetailComponent - implements DatatargetDetail, OnInit, OnDestroy { +export class MqttDetailComponent implements DatatargetDetail, OnInit, OnDestroy { public datatarget: Datatarget; - public backButton: BackButton = { label: '', routerLink: undefined }; + public backButton: BackButton = { label: "", routerLink: undefined }; public dataTargetRelations: PayloadDeviceDatatargetGetByDataTarget[]; private deleteDialogSubscription: Subscription; public dropdownButton: DropdownButton; @@ -43,24 +42,22 @@ export class MqttDetailComponent ) {} ngOnInit(): void { - const id: number = +this.route.snapshot.paramMap.get('datatargetId'); - const appId: number = +this.route.snapshot.paramMap.get('id'); + const id: number = +this.route.snapshot.paramMap.get("datatargetId"); + const appId: number = +this.route.snapshot.paramMap.get("id"); if (id) { this.getDatatarget(id); this.getDatatargetRelations(id); this.dropdownButton = { - label: '', - editRouterLink: '../../datatarget-edit/' + id, + label: "", + editRouterLink: "../../datatarget-edit/" + id, isErasable: true, }; } - this.translate - .get(['NAV.MY-DATATARGET', 'DATATARGET.SHOW-OPTIONS']) - .subscribe((translations) => { - this.backButton.label = translations['NAV.MY-DATATARGET']; - this.dropdownButton.label = translations['DATATARGET.SHOW-OPTIONS']; - }); + this.translate.get(["NAV.MY-DATATARGET", "DATATARGET.SHOW-OPTIONS"]).subscribe(translations => { + this.backButton.label = translations["NAV.MY-DATATARGET"]; + this.dropdownButton.label = translations["DATATARGET.SHOW-OPTIONS"]; + }); this.canEdit = this.meService.hasAccessToTargetOrganization( OrganizationAccessScope.ApplicationWrite, undefined, @@ -75,18 +72,16 @@ export class MqttDetailComponent } onDeleteDatatarget() { - this.deleteDialogSubscription = this.deleteDialogService - .showSimpleDialog() - .subscribe((response) => { - if (response) { - this.datatargetService.delete(this.datatarget.id).subscribe(() => {}); - this.location.back(); - } - }); + this.deleteDialogSubscription = this.deleteDialogService.showSimpleDialog().subscribe(response => { + if (response) { + this.datatargetService.delete(this.datatarget.id).subscribe(() => {}); + this.location.back(); + } + }); } getDatatargetRelations(id: number) { - this.datatargetRelationService.getByDataTarget(id).subscribe((response) => { + this.datatargetRelationService.getByDataTarget(id).subscribe(response => { this.dataTargetRelations = response.data; }); } diff --git a/src/app/applications/datatarget/mqtt-edit/mqtt-edit.component.html b/src/app/applications/datatarget/mqtt-edit/mqtt-edit.component.html index acd45b98c..bd67eaf10 100644 --- a/src/app/applications/datatarget/mqtt-edit/mqtt-edit.component.html +++ b/src/app/applications/datatarget/mqtt-edit/mqtt-edit.component.html @@ -1,63 +1,114 @@ - +
    • - {{error | translate}} + {{ error | translate }}
    - * - + * +
    - * - + * +
    - * - + * +
    - * - - + * + +
    - * + * - +
    - * - + * +
    - * - + * +
    - * - + * +
    -
    {{'QUESTION.DATATARGET.RELATIONS' | translate}}
    +
    {{ "QUESTION.DATATARGET.RELATIONS" | translate }}
    - {{'QUESTION.ADD-RELATIONS' | translate}} + {{ "QUESTION.ADD-RELATIONS" | translate }} - - - - + + - + + +
    -
    - - {{'QUESTION.DATATARGET.SELECT-DEVICES' | translate}} - - - - - - {{device.name}} - - -
    -
    -
    - - {{'QUESTION.DATATARGET.SELECT-PAYLOADDECODER' | translate}} - - - {{'QUESTION.DATATARGET.NO-PAYLOAD-DECODER-SELECTED' | translate}} - - - {{payloadDecoder.name}} - - - -
    -
    - -
    - -

    {{'DATATARGET.DELETE' | translate}}

    +
    +
    + + {{ "QUESTION.DATATARGET.SELECT-DEVICES" | translate }} + + + + + + {{ device.name }} + + +
    +
    +
    + + {{ "QUESTION.DATATARGET.SELECT-PAYLOADDECODER" | translate }} + + + {{ "QUESTION.DATATARGET.NO-PAYLOAD-DECODER-SELECTED" | translate }} + + + {{ payloadDecoder.name }} + + +
    - -
    + +
    + +

    {{ "DATATARGET.DELETE" | translate }}

    +
    +
    +
    - - + +
    diff --git a/src/app/applications/datatarget/mqtt-edit/mqtt-edit.component.ts b/src/app/applications/datatarget/mqtt-edit/mqtt-edit.component.ts index 512ab6e10..7b85d9c8a 100644 --- a/src/app/applications/datatarget/mqtt-edit/mqtt-edit.component.ts +++ b/src/app/applications/datatarget/mqtt-edit/mqtt-edit.component.ts @@ -1,38 +1,32 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Application } from '@applications/application.model'; -import { ApplicationService } from '@applications/application.service'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { - faQuestionCircle, - faTimesCircle, -} from '@fortawesome/free-solid-svg-icons'; -import { - PayloadDecoder, - PayloadDecoderMappedResponse, -} from '@payload-decoder/payload-decoder.model'; -import { PayloadDecoderService } from '@payload-decoder/payload-decoder.service'; +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { MatDialog } from "@angular/material/dialog"; +import { ActivatedRoute, Router } from "@angular/router"; +import { Application } from "@applications/application.model"; +import { ApplicationService } from "@applications/application.service"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { faQuestionCircle, faTimesCircle } from "@fortawesome/free-solid-svg-icons"; +import { PayloadDecoder, PayloadDecoderMappedResponse } from "@payload-decoder/payload-decoder.model"; +import { PayloadDecoderService } from "@payload-decoder/payload-decoder.service"; import { PayloadDeviceDatatarget, PayloadDeviceDatatargetGetByDataTargetResponse, -} from '@payload-decoder/payload-device-data.model'; -import { PayloadDeviceDatatargetService } from '@payload-decoder/payload-device-datatarget.service'; -import { DeleteDialogComponent } from '@shared/components/delete-dialog/delete-dialog.component'; -import { DataTargetType } from '@shared/enums/datatarget-type'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { ScrollToTopService } from '@shared/services/scroll-to-top.service'; -import { SnackService } from '@shared/services/snack.service'; -import { Subscription } from 'rxjs'; -import { DatatargetEdit } from '../datatarget-edit/datatarget-edit'; -import { Datatarget } from '../datatarget.model'; -import { DatatargetService } from '../datatarget.service'; +} from "@payload-decoder/payload-device-data.model"; +import { PayloadDeviceDatatargetService } from "@payload-decoder/payload-device-datatarget.service"; +import { DeleteDialogComponent } from "@shared/components/delete-dialog/delete-dialog.component"; +import { DataTargetType } from "@shared/enums/datatarget-type"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { ScrollToTopService } from "@shared/services/scroll-to-top.service"; +import { SnackService } from "@shared/services/snack.service"; +import { Subscription } from "rxjs"; +import { DatatargetEdit } from "../datatarget-edit/datatarget-edit"; +import { Datatarget } from "../datatarget.model"; +import { DatatargetService } from "../datatarget.service"; @Component({ - selector: 'app-mqtt-edit', - templateUrl: './mqtt-edit.component.html', - styleUrls: ['./mqtt-edit.component.scss'], + selector: "app-mqtt-edit", + templateUrl: "./mqtt-edit.component.html", + styleUrls: ["./mqtt-edit.component.scss"], }) // TODO: Most of the code is duplicated from other datatarget edit components. // Same applies to the html file. One solution is extending a base datatarget-edit component @@ -68,8 +62,8 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { ) {} ngOnInit(): void { - this.datatargetId = +this.route.snapshot.paramMap.get('datatargetId'); - this.applicationId = +this.route.snapshot.paramMap.get('id'); + this.datatargetId = +this.route.snapshot.paramMap.get("datatargetId"); + this.applicationId = +this.route.snapshot.paramMap.get("id"); this.datatarget.type = DataTargetType.MQTT; if (this.datatargetId !== 0) { @@ -84,11 +78,9 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { private getPayloadDecoders() { this.payloadDecoderSubscription = this.payloadDecoderService - .getMultiple(1000, 0, 'id', 'ASC') + .getMultiple(1000, 0, "id", "ASC") .subscribe((response: PayloadDecoderMappedResponse) => { - this.payloadDecoders = response.data.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); + this.payloadDecoders = response.data.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); }); } @@ -100,24 +92,20 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { } routeToDatatargets(): void { - this.router.navigate(['applications', this.applicationId.toString()]); + this.router.navigate(["applications", this.applicationId.toString()]); } getDatatarget(id: number) { - this.datatargetSubscription = this.datatargetService - .get(id) - .subscribe((response: Datatarget) => { - this.datatarget = response; - }); + this.datatargetSubscription = this.datatargetService.get(id).subscribe((response: Datatarget) => { + this.datatarget = response; + }); } getDevices(): void { this.applicationSubscription = this.applicationService .getApplication(this.applicationId) .subscribe((application: Application) => { - this.devices = application.iotDevices.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); + this.devices = application.iotDevices.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); }); } @@ -129,27 +117,20 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { }); } - private mapToDatatargetDevicePayload( - dto: PayloadDeviceDatatargetGetByDataTargetResponse - ) { + private mapToDatatargetDevicePayload(dto: PayloadDeviceDatatargetGetByDataTargetResponse) { this.payloadDeviceDatatarget = []; - dto.data.forEach((element) => { + dto.data.forEach(element => { this.payloadDeviceDatatarget.push({ id: element.id, - iotDeviceIds: element.iotDevices.map((x) => x.id), - payloadDecoderId: - element.payloadDecoder?.id === undefined - ? 0 - : element.payloadDecoder?.id, + iotDeviceIds: element.iotDevices.map(x => x.id), + payloadDecoderId: element.payloadDecoder?.id === undefined ? 0 : element.payloadDecoder?.id, dataTargetId: element.dataTarget.id, }); }); } public selectAllDevices(index: number) { - this.payloadDeviceDatatarget[index].iotDeviceIds = this.devices.map( - (device) => device.id - ); + this.payloadDeviceDatatarget[index].iotDeviceIds = this.devices.map(device => device.id); } public deselectAllDevices(index: number) { @@ -173,11 +154,9 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { } else if (this.payloadDeviceDatatarget[index]?.id === null) { this.payloadDeviceDatatarget.splice(index, 1); } else { - this.payloadDeviceDatatargetService - .delete(this.payloadDeviceDatatarget[index].id) - .subscribe(() => { - this.payloadDeviceDatatarget.splice(index, 1); - }); + this.payloadDeviceDatatargetService.delete(this.payloadDeviceDatatarget[index].id).subscribe(() => { + this.payloadDeviceDatatarget.splice(index, 1); + }); } } @@ -186,11 +165,11 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { data: { showAccept: true, showCancel: true, - message: 'Er du sikker på at du vil slette?', + message: "Er du sikker på at du vil slette?", }, }); - dialog.afterClosed().subscribe((result) => { + dialog.afterClosed().subscribe(result => { if (result === true) { this.deleteRow(index); } @@ -245,12 +224,12 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { } private addPayloadDeviceDatatarget() { - this.payloadDeviceDatatarget.map((pdd) => { + this.payloadDeviceDatatarget.map(pdd => { if (pdd.payloadDecoderId === 0) { pdd.payloadDecoderId = null; } }); - this.payloadDeviceDatatarget.forEach((relation) => { + this.payloadDeviceDatatarget.forEach(relation => { this.activeApiCalls += 1; if (relation.id) { @@ -258,7 +237,7 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { () => { this.countToRedirect(); }, - (error) => { + error => { this.handleError(error); } ); @@ -267,7 +246,7 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { () => { this.countToRedirect(); }, - (error) => { + error => { this.handleError(error); } ); diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-dataset.model.ts b/src/app/applications/datatarget/opendatadk/opendatadk-dataset.model.ts index 031f23095..88f2e83c2 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-dataset.model.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk-dataset.model.ts @@ -1,13 +1,13 @@ export class OpenDataDkDataset { - id?: number; - name: string; //reqired - max 120 - resourceTitle: string; - description: string; - keywords: string[]; - keywordsInput: string; - license = 'https://creativecommons.org/publicdomain/zero/1.0/'; - authorName: string; //required - authorEmail: string; //reqired - url: string; // autogenerated with orgid as input - acceptTerms = false; + id?: number; + name: string; //reqired - max 120 + resourceTitle: string; + description: string; + keywords: string[]; + keywordsInput: string; + license = "https://creativecommons.org/publicdomain/zero/1.0/"; + authorName: string; //required + authorEmail: string; //reqired + url: string; // autogenerated with orgid as input + acceptTerms = false; } diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.html b/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.html index cfe1e7049..cd25f5ad6 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.html +++ b/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.html @@ -1,34 +1,34 @@

    - {{ 'OPENDATADK.DETAILS.NAME' | translate }} - {{openDataDkDataset.name}} + {{ "OPENDATADK.DETAILS.NAME" | translate }} + {{ openDataDkDataset.name }}

    - {{ 'OPENDATADK.DETAILS.RESOURCETITLE' | translate }} - {{openDataDkDataset.resourceTitle ? openDataDkDataset.resourceTitle : ('OPENDATADK.DETAILS.NA' | translate)}} + {{ "OPENDATADK.DETAILS.RESOURCETITLE" | translate }} + {{ openDataDkDataset.resourceTitle ? openDataDkDataset.resourceTitle : ("OPENDATADK.DETAILS.NA" | translate) }}

    - {{ 'OPENDATADK.DETAILS.DESCRIPTION' | translate }} - {{openDataDkDataset.description ? openDataDkDataset.description : ('OPENDATADK.DETAILS.NA' | translate) }} + {{ "OPENDATADK.DETAILS.DESCRIPTION" | translate }} + {{ openDataDkDataset.description ? openDataDkDataset.description : ("OPENDATADK.DETAILS.NA" | translate) }}

    - {{ 'OPENDATADK.DETAILS.KEYWORDS' | translate }} - {{openDataDkDataset.keywords ? openDataDkDataset.keywords : ('OPENDATADK.DETAILS.NA' | translate) }} + {{ "OPENDATADK.DETAILS.KEYWORDS" | translate }} + {{ openDataDkDataset.keywords ? openDataDkDataset.keywords : ("OPENDATADK.DETAILS.NA" | translate) }}

    - {{ 'OPENDATADK.DETAILS.AUTHORNAME' | translate }} - {{openDataDkDataset.authorName}} + {{ "OPENDATADK.DETAILS.AUTHORNAME" | translate }} + {{ openDataDkDataset.authorName }}

    - {{ 'OPENDATADK.DETAILS.AUTHOREMAIL' | translate }} - {{openDataDkDataset.authorEmail}} + {{ "OPENDATADK.DETAILS.AUTHOREMAIL" | translate }} + {{ openDataDkDataset.authorEmail }}

    - {{ 'OPENDATADK.DETAILS.URL' | translate }} - {{openDataDkDataset.url}} -

    \ No newline at end of file + {{ "OPENDATADK.DETAILS.URL" | translate }} + {{ openDataDkDataset.url }} +

    diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.spec.ts b/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.spec.ts index 5bec3c301..c63115d0a 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.spec.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { OpendatadkDetailComponent } from './opendatadk-detail.component'; +import { OpendatadkDetailComponent } from "./opendatadk-detail.component"; -describe('OpendatadkDetailComponent', () => { +describe("OpendatadkDetailComponent", () => { let component: OpendatadkDetailComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ OpendatadkDetailComponent ] - }) - .compileComponents(); + declarations: [OpendatadkDetailComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('OpendatadkDetailComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.ts b/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.ts index ca8bf7b5b..6719912b9 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk-detail/opendatadk-detail.component.ts @@ -1,18 +1,15 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { OpenDataDkDataset } from '../opendatadk-dataset.model'; +import { Component, Input, OnInit } from "@angular/core"; +import { OpenDataDkDataset } from "../opendatadk-dataset.model"; @Component({ - selector: 'app-opendatadk-detail', - templateUrl: './opendatadk-detail.component.html', - styleUrls: ['./opendatadk-detail.component.scss'] + selector: "app-opendatadk-detail", + templateUrl: "./opendatadk-detail.component.html", + styleUrls: ["./opendatadk-detail.component.scss"], }) export class OpendatadkDetailComponent implements OnInit { - @Input() openDataDkDataset: OpenDataDkDataset; - constructor() { } - - ngOnInit(): void { - } + constructor() {} + ngOnInit(): void {} } diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.html b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.html index baaae5602..d1f119d28 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.html +++ b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.html @@ -1,30 +1,29 @@ - +
    -

    {{'GUIDE' | translate}}

    +

    {{ "GUIDE" | translate }}

    - {{ 'OPENDATADK.INTRO.GUIDE_HEADER' | translate }} + {{ "OPENDATADK.INTRO.GUIDE_HEADER" | translate }}

    - {{ 'OPENDATADK.INTRO.GUIDE1' | translate }} -

    - {{ 'OPENDATADK.INTRO.GUIDE2' | translate }} -

    - {{ 'OPENDATADK.INTRO.GUIDE3' | translate }} -

    - {{ 'OPENDATADK.INTRO.GUIDE4' | translate }} - {{ 'OPENDATADK.INTRO.GUIDE5' | translate }} -

    + {{ "OPENDATADK.INTRO.GUIDE1" | translate }} +

    + {{ "OPENDATADK.INTRO.GUIDE2" | translate }} +

    + {{ "OPENDATADK.INTRO.GUIDE3" | translate }} +

    + {{ "OPENDATADK.INTRO.GUIDE4" | translate }} + {{ + "OPENDATADK.INTRO.GUIDE5" | translate + }} +

    @@ -32,30 +31,35 @@

    {{'GUIDE' | translate}}

    - {{ 'OPENDATADK.INTRO.PROCEDURE_HEADER' | translate }} + {{ "OPENDATADK.INTRO.PROCEDURE_HEADER" | translate }}

      -
    1. - {{ 'OPENDATADK.INTRO.PROCEDURE1' | translate }} - https://www.opendata.dk/ -

    2. -
    3. {{ 'OPENDATADK.INTRO.PROCEDURE2' | translate }}

    4. -
    5. {{ 'OPENDATADK.INTRO.PROCEDURE3' | translate }}

    6. -
    7. - {{ 'OPENDATADK.INTRO.PROCEDURE4' | translate }} - {{ 'OPENDATADK.INTRO.PROCEDURE4_LINK' | translate }} -

    8. +
    9. +

      + {{ "OPENDATADK.INTRO.PROCEDURE1" | translate }} + https://www.opendata.dk/ +

      +
    10. +
    11. +

      {{ "OPENDATADK.INTRO.PROCEDURE2" | translate }}

      +
    12. +
    13. +

      {{ "OPENDATADK.INTRO.PROCEDURE3" | translate }}

      +
    14. +
    15. +

      + {{ "OPENDATADK.INTRO.PROCEDURE4" | translate }} + {{ "OPENDATADK.INTRO.PROCEDURE4_LINK" | translate }} +

      +
    -
    -

    {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | translate}}

    + +

    {{ (datatargetId ? "FORM.EDIT-DATATARGET" : "FORM.CREATE-NEW-DATATARGET") | translate }}

      @@ -66,16 +70,15 @@

      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t
      - + + matTooltipHideDelay="2000" + > {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t
      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t [matTooltip]="'OPENDATADK.QUESTION.GIVE-OPENDATADK-NAME-INFO' | translate" matTooltipPosition="above" matTooltipShowDelay="600" - matTooltipHideDelay="2000"> + matTooltipHideDelay="2000" + > {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t required [(ngModel)]="datatarget.openDataDkDataset.name" [ngClass]="{ - 'is-invalid': - formFailedSubmit && errorFields.includes('openDataDkDataset.name'), - 'is-valid': - formFailedSubmit && !errorFields.includes('openDataDkDataset.name') + 'is-invalid': formFailedSubmit && errorFields.includes('openDataDkDataset.name'), + 'is-valid': formFailedSubmit && !errorFields.includes('openDataDkDataset.name') }" />
      @@ -131,7 +133,7 @@

      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t
      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t [matTooltip]="'OPENDATADK.QUESTION.GIVE-OPENDATADK-RESOURCETITLE-INFO' | translate" matTooltipPosition="above" matTooltipShowDelay="600" - matTooltipHideDelay="2000"> + matTooltipHideDelay="2000" + > {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t required [(ngModel)]="datatarget.openDataDkDataset.resourceTitle" [ngClass]="{ - 'is-invalid': - formFailedSubmit && - errorFields.includes('openDataDkDataset.resourceTitle'), - 'is-valid': - formFailedSubmit && - !errorFields.includes('openDataDkDataset.resourceTitle') - }" /> + 'is-invalid': formFailedSubmit && errorFields.includes('openDataDkDataset.resourceTitle'), + 'is-valid': formFailedSubmit && !errorFields.includes('openDataDkDataset.resourceTitle') + }" + />
      @@ -165,7 +165,7 @@

      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t
      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t required [(ngModel)]="datatarget.openDataDkDataset.description" [ngClass]="{ - 'is-invalid': - formFailedSubmit && - errorFields.includes('openDataDkDataset.description'), - 'is-valid': - formFailedSubmit && - !errorFields.includes('openDataDkDataset.description') + 'is-invalid': formFailedSubmit && errorFields.includes('openDataDkDataset.description'), + 'is-valid': formFailedSubmit && !errorFields.includes('openDataDkDataset.description') }" />
      @@ -191,7 +187,7 @@

      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t
      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t [matTooltip]="'OPENDATADK.QUESTION.GIVE-OPENDATADK-AUTHORNAME-INFO' | translate" matTooltipPosition="above" matTooltipShowDelay="600" - matTooltipHideDelay="2000"> + matTooltipHideDelay="2000" + > {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t required [(ngModel)]="datatarget.openDataDkDataset.authorName" [ngClass]="{ - 'is-invalid': - formFailedSubmit && - errorFields.includes('openDataDkDataset.authorName'), - 'is-valid': - formFailedSubmit && - !errorFields.includes('openDataDkDataset.authorName') + 'is-invalid': formFailedSubmit && errorFields.includes('openDataDkDataset.authorName'), + 'is-valid': formFailedSubmit && !errorFields.includes('openDataDkDataset.authorName') }" />
      @@ -225,7 +218,7 @@

      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t
      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t required [(ngModel)]="datatarget.openDataDkDataset.authorEmail" [ngClass]="{ - 'is-invalid': - formFailedSubmit && - errorFields.includes('openDataDkDataset.authorEmail'), - 'is-valid': - formFailedSubmit && - !errorFields.includes('openDataDkDataset.authorEmail') + 'is-invalid': formFailedSubmit && errorFields.includes('openDataDkDataset.authorEmail'), + 'is-valid': formFailedSubmit && !errorFields.includes('openDataDkDataset.authorEmail') }" />
      @@ -251,7 +240,7 @@

      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t
      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t [placeholder]="'OPENDATADK.QUESTION.GIVE-OPENDATADK-KEYWORDS-PLACEHOLDER' | translate" class="form-control" [ngClass]="{ - 'is-invalid': - formFailedSubmit && - errorFields.includes('openDataDkDataset.keywords'), - 'is-valid': - formFailedSubmit && - !errorFields.includes('openDataDkDataset.keywords') - }"> - {{kw}} + 'is-invalid': formFailedSubmit && errorFields.includes('openDataDkDataset.keywords'), + 'is-valid': formFailedSubmit && !errorFields.includes('openDataDkDataset.keywords') + }" + > + {{ kw }}
      @@ -279,9 +265,9 @@

      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t

      - {{ 'OPENDATADK.QUESTION.ACCEPT-TERMS-PART-ONE' | translate }} + {{ "OPENDATADK.QUESTION.ACCEPT-TERMS-PART-ONE" | translate }} - {{ 'OPENDATADK.QUESTION.TERMS-AND-CONDITIONS' | translate }} + {{ "OPENDATADK.QUESTION.TERMS-AND-CONDITIONS" | translate }}

      @@ -289,13 +275,13 @@

      {{(datatargetId ? 'FORM.EDIT-DATATARGET' : 'FORM.CREATE-NEW-DATATARGET') | t

      -

      {{ 'QUESTION.DATATARGET.RELATIONS' | translate }}
      +
      {{ "QUESTION.DATATARGET.RELATIONS" | translate }}
      - {{'QUESTION.ADD-RELATIONS' | translate}} + {{ "QUESTION.ADD-RELATIONS" | translate }} @@ -304,34 +290,22 @@
      {{ 'QUESTION.DATATARGET.RELATIONS' |
      @@ -380,10 +342,10 @@
      {{ 'QUESTION.DATATARGET.RELATIONS' |
      diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.scss b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.scss index 84d479e94..7f23ca5f6 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.scss +++ b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.scss @@ -1,4 +1,4 @@ -@import 'src/assets/scss/setup/fonts'; +@import "src/assets/scss/setup/fonts"; :host { h3 { diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.spec.ts b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.spec.ts index dbecd5a55..a54732b29 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.spec.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { OpendatadkEditComponent } from './opendatadk-edit.component'; +import { OpendatadkEditComponent } from "./opendatadk-edit.component"; -describe('OpendatadkEditComponent', () => { +describe("OpendatadkEditComponent", () => { let component: OpendatadkEditComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ OpendatadkEditComponent ] - }) - .compileComponents(); + declarations: [OpendatadkEditComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('OpendatadkEditComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.ts b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.ts index a51ddf462..58b1b7b00 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-edit.component.ts @@ -1,64 +1,61 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnDestroy } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Application } from '@applications/application.model'; -import { ApplicationService } from '@applications/application.service'; -import { DatatargetEdit } from '@applications/datatarget/datatarget-edit/datatarget-edit'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { - faQuestionCircle, - faTimesCircle, -} from '@fortawesome/free-solid-svg-icons'; -import { TranslateService } from '@ngx-translate/core'; -import { PayloadDecoderMappedResponse } from '@payload-decoder/payload-decoder.model'; -import { PayloadDecoderService } from '@payload-decoder/payload-decoder.service'; +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnDestroy } from "@angular/core"; +import { MatDialog } from "@angular/material/dialog"; +import { ActivatedRoute, Router } from "@angular/router"; +import { Application } from "@applications/application.model"; +import { ApplicationService } from "@applications/application.service"; +import { DatatargetEdit } from "@applications/datatarget/datatarget-edit/datatarget-edit"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { faQuestionCircle, faTimesCircle } from "@fortawesome/free-solid-svg-icons"; +import { TranslateService } from "@ngx-translate/core"; +import { PayloadDecoderMappedResponse } from "@payload-decoder/payload-decoder.model"; +import { PayloadDecoderService } from "@payload-decoder/payload-decoder.service"; import { PayloadDeviceDatatarget, PayloadDeviceDatatargetGetByDataTargetResponse, -} from '@payload-decoder/payload-device-data.model'; -import { PayloadDeviceDatatargetService } from '@payload-decoder/payload-device-datatarget.service'; -import { DeleteDialogComponent } from '@shared/components/delete-dialog/delete-dialog.component'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { DataTargetType } from '@shared/enums/datatarget-type'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { MeService } from '@shared/services/me.service'; -import { ScrollToTopService } from '@shared/services/scroll-to-top.service'; -import { SnackService } from '@shared/services/snack.service'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { first } from 'rxjs/operators'; -import { Datatarget, OddkMailInfo } from '../../datatarget.model'; -import { DatatargetService } from '../../datatarget.service'; -import { OpenDataDkDataset } from '../../opendatadk/opendatadk-dataset.model'; -import { OpenDataDkMailDialogComponent } from './opendatadk-mail-dialog/opendatadk-mail-dialog'; -import { OpenDataDkWarningDialogComponent } from './opendatadk-warning-dialog/opendatadk-warning-dialog'; +} from "@payload-decoder/payload-device-data.model"; +import { PayloadDeviceDatatargetService } from "@payload-decoder/payload-device-datatarget.service"; +import { DeleteDialogComponent } from "@shared/components/delete-dialog/delete-dialog.component"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { DataTargetType } from "@shared/enums/datatarget-type"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { MeService } from "@shared/services/me.service"; +import { ScrollToTopService } from "@shared/services/scroll-to-top.service"; +import { SnackService } from "@shared/services/snack.service"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { first } from "rxjs/operators"; +import { Datatarget, OddkMailInfo } from "../../datatarget.model"; +import { DatatargetService } from "../../datatarget.service"; +import { OpenDataDkDataset } from "../../opendatadk/opendatadk-dataset.model"; +import { OpenDataDkMailDialogComponent } from "./opendatadk-mail-dialog/opendatadk-mail-dialog"; +import { OpenDataDkWarningDialogComponent } from "./opendatadk-warning-dialog/opendatadk-warning-dialog"; @Component({ - selector: 'app-opendatadk-edit', - templateUrl: './opendatadk-edit.component.html', - styleUrls: ['./opendatadk-edit.component.scss'], + selector: "app-opendatadk-edit", + templateUrl: "./opendatadk-edit.component.html", + styleUrls: ["./opendatadk-edit.component.scss"], }) export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { faQuestionCircle = faQuestionCircle; faTimesCircle = faTimesCircle; - title = 'FORM.CREATE-NEW-DATATARGET'; + title = "FORM.CREATE-NEW-DATATARGET"; selectableKeyword = [ - 'Befolkning og samfund', - 'Energi', - 'Internationale spørgsmål', - 'Landbrug, fiskeri, skovbrug og fødevarer', - 'Midlertidige data', - 'Miljø', - 'Regeringen og den offentlige sektor', - 'Regioner og byer', - 'Retfærdighed, retssystem og offentlig sikkerhed', - 'Sundhed', - 'Transport', - 'Uddannelse, kultur og sport', - 'Videnskab og teknologi', - 'Økonomi og finanser', + "Befolkning og samfund", + "Energi", + "Internationale spørgsmål", + "Landbrug, fiskeri, skovbrug og fødevarer", + "Midlertidige data", + "Miljø", + "Regeringen og den offentlige sektor", + "Regioner og byer", + "Retfærdighed, retssystem og offentlig sikkerhed", + "Sundhed", + "Transport", + "Uddannelse, kultur og sport", + "Videnskab og teknologi", + "Økonomi og finanser", ]; errorMessages: any[]; @@ -94,19 +91,19 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { private meService: MeService, private sharedVariableService: SharedVariableService ) { - translate.use('da'); + translate.use("da"); this.datatarget.type = DataTargetType.OPENDATADK; this.datatarget.setToOpendataDk = true; - this.datatargetId = +this.route.snapshot.paramMap.get('datatargetId'); - this.applicationId = +this.route.snapshot.paramMap.get('id'); + this.datatargetId = +this.route.snapshot.paramMap.get("datatargetId"); + this.applicationId = +this.route.snapshot.paramMap.get("id"); if (this.applicationId !== 0) { this.getDevices(); this.getPayloadDecoders(); } if (this.datatargetId !== 0) { - this.title = 'FORM.EDIT-DATATARGET'; + this.title = "FORM.EDIT-DATATARGET"; this.getDatatarget(this.datatargetId); this.getPayloadDeviceDatatarget(this.datatargetId); } @@ -120,7 +117,7 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { } ngOnDestroy(): void { - this.subscriptions.forEach((s) => s?.unsubscribe()); + this.subscriptions.forEach(s => s?.unsubscribe()); } private getPayloadDeviceDatatarget(id: number) { @@ -129,14 +126,11 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { .getByDataTarget(id) .subscribe((dto: PayloadDeviceDatatargetGetByDataTargetResponse) => { this.payloadDeviceDatatarget = []; - dto.data.forEach((element) => { + dto.data.forEach(element => { this.payloadDeviceDatatarget.push({ id: element.id, - iotDeviceIds: element.iotDevices.map((x) => x.id), - payloadDecoderId: - element.payloadDecoder?.id === undefined - ? 0 - : element.payloadDecoder?.id, + iotDeviceIds: element.iotDevices.map(x => x.id), + payloadDecoderId: element.payloadDecoder?.id === undefined ? 0 : element.payloadDecoder?.id, dataTargetId: element.dataTarget.id, }); }); @@ -159,8 +153,7 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { this.resetErrors(); if (this.datatargetId) { if (!this.validatePayloadDeviceDatatarget()) return; - this.pendingRequestsCounter = - 1 + (this.payloadDeviceDatatarget?.length ?? 0); + this.pendingRequestsCounter = 1 + (this.payloadDeviceDatatarget?.length ?? 0); this.updateDatatarget(); this.addPayloadDeviceDatatarget(); } else { @@ -186,7 +179,7 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { ); } private addPayloadDeviceDatatarget() { - this.payloadDeviceDatatarget.forEach((relation) => { + this.payloadDeviceDatatarget.forEach(relation => { if (relation.payloadDecoderId === 0) { relation.payloadDecoderId = null; } @@ -194,28 +187,24 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { this.subscriptions.push( this.payloadDeviceDataTargetService.put(relation).subscribe( () => this.countToRedirect(), - (error) => this.handleError(error) + error => this.handleError(error) ) ); } else { this.subscriptions.push( this.payloadDeviceDataTargetService.post(relation).subscribe( () => this.countToRedirect(), - (error) => this.handleError(error) + error => this.handleError(error) ) ); } }); } private validatePayloadDeviceDatatarget = () => { - const isError = this.payloadDeviceDatatarget?.some( - (relation) => (relation.iotDeviceIds?.length ?? 0) < 1 - ); + const isError = this.payloadDeviceDatatarget?.some(relation => (relation.iotDeviceIds?.length ?? 0) < 1); if (isError) { - this.errorFields = ['devices']; - this.errorMessages = [ - 'Must attach at least one IoT-device for each element in list of devices / decoders', - ]; + this.errorFields = ["devices"]; + this.errorMessages = ["Must attach at least one IoT-device for each element in list of devices / decoders"]; this.scrollToTopService.scrollToTop(); } return !isError; @@ -275,40 +264,31 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { this.scrollToTopService.scrollToTop(); } - routeToDatatargets = () => this.router.navigate(['applications', this.applicationId, 'data-targets']); + routeToDatatargets = () => this.router.navigate(["applications", this.applicationId, "data-targets"]); routeToCreatedDatatarget = () => - this.router.navigate( - ['applications', this.applicationId, 'datatarget', this.datatarget.id], - { replaceUrl: true } - ); + this.router.navigate(["applications", this.applicationId, "datatarget", this.datatarget.id], { + replaceUrl: true, + }); // For mail dialog private getAlreadySentOddkMail = () => { const orgId = this.sharedVariableService.getSelectedOrganisationId(); this.subscriptions.push( - this.datatargetService - .getOpenDataDkRegistered(orgId) - .subscribe((response) => { - this.alreadySentOddkMail = !!response; - }) + this.datatargetService.getOpenDataDkRegistered(orgId).subscribe(response => { + this.alreadySentOddkMail = !!response; + }) ); }; private setAlreadySentOddkMail = async () => { const orgId = this.sharedVariableService.getSelectedOrganisationId(); - await this.datatargetService - .updateOpenDataDkRegistered(orgId) - .pipe(first()) - .toPromise(); + await this.datatargetService.updateOpenDataDkRegistered(orgId).pipe(first()).toPromise(); }; private openMailDialog = () => { const dialog = this.dialog.open(OpenDataDkMailDialogComponent); dialog.afterClosed().subscribe(async (result: OddkMailInfo) => { if (result) { // User accepted -> Send mail and continue - await this.datatargetService - .sendOpenDataDkMail(result) - .pipe(first()) - .toPromise(); + await this.datatargetService.sendOpenDataDkMail(result).pipe(first()).toPromise(); this.routeToCreatedDatatarget(); } else { // User cancelled -> Show the warning @@ -318,7 +298,7 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { }; private openMailWarningDialog = () => { const dialog = this.dialog.open(OpenDataDkWarningDialogComponent); - dialog.afterClosed().subscribe(async (result) => { + dialog.afterClosed().subscribe(async result => { if (result) { // User accepted -> Save if 'never again' was checked, then continue if (result.neverAgain) { @@ -335,23 +315,17 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { // For list of devices / payload-decoders private getDevices(): void { this.subscriptions.push( - this.applicationService - .getApplication(this.applicationId) - .subscribe((application: Application) => { - this.devices = application.iotDevices.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); - }) + this.applicationService.getApplication(this.applicationId).subscribe((application: Application) => { + this.devices = application.iotDevices.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); + }) ); } private getPayloadDecoders() { this.subscriptions.push( this.payloadDecoderService - .getMultiple(1000, 0, 'id', 'ASC') + .getMultiple(1000, 0, "id", "ASC") .subscribe((response: PayloadDecoderMappedResponse) => { - this.payloadDecoders = response.data.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); + this.payloadDecoders = response.data.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); }) ); } @@ -372,11 +346,9 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { this.payloadDeviceDatatarget.splice(index, 1); } else { this.subscriptions.push( - this.payloadDeviceDataTargetService - .delete(this.payloadDeviceDatatarget[index].id) - .subscribe((response) => { - this.payloadDeviceDatatarget.splice(index, 1); - }) + this.payloadDeviceDataTargetService.delete(this.payloadDeviceDatatarget[index].id).subscribe(response => { + this.payloadDeviceDatatarget.splice(index, 1); + }) ); } } @@ -385,10 +357,10 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { data: { showAccept: true, showCancel: true, - message: 'Er du sikker på at du vil slette?', + message: "Er du sikker på at du vil slette?", }, }); - dialog.afterClosed().subscribe((result) => { + dialog.afterClosed().subscribe(result => { if (result === true) { this.deleteRow(index); } @@ -396,9 +368,7 @@ export class OpendatadkEditComponent implements DatatargetEdit, OnDestroy { } payloadDevicesDropdownCompare = (o1: any, o2: any): boolean => o1 === o2; selectAllDevices(index: number) { - this.payloadDeviceDatatarget[index].iotDeviceIds = this.devices.map( - (device) => device.id - ); + this.payloadDeviceDatatarget[index].iotDeviceIds = this.devices.map(device => device.id); } deSelectAllDevices(index: number) { this.payloadDeviceDatatarget[index].iotDeviceIds = []; diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog.html b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog.html index 3a60ee7ab..0a7c10e21 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog.html +++ b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog.html @@ -1,37 +1,43 @@

      {{'OPENDATADK.MAIL.DIALOG_TITLE' | translate}}

      -

      - {{'OPENDATADK.MAIL.DIALOG_TEXT1' | translate}} - {{selectedOrganizationName ?? ('OPENDATADK.MAIL.SELECTED_ORG_FALLBACK' | translate)}}{{'OPENDATADK.MAIL.DIALOG_TEXT2' | translate}} -

      -

      +

      + {{'OPENDATADK.MAIL.DIALOG_TEXT1' | translate}} {{selectedOrganizationName ?? + ('OPENDATADK.MAIL.SELECTED_ORG_FALLBACK' | translate)}}{{'OPENDATADK.MAIL.DIALOG_TEXT2' | translate}} +

      +

      -
      -
      - - -
      +
      +
      + +
      -
      -
      - - -
      +
      +
      +
      + +
      +
      - - -
      \ No newline at end of file + + +
      diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog.ts b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog.ts index 6eb667ffe..72f3b2df9 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-mail-dialog/opendatadk-mail-dialog.ts @@ -1,17 +1,17 @@ -import { Component } from '@angular/core'; -import { MatDialogRef } from '@angular/material/dialog'; -import { OddkMailInfo } from '@applications/datatarget/datatarget.model'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; +import { Component } from "@angular/core"; +import { MatDialogRef } from "@angular/material/dialog"; +import { OddkMailInfo } from "@applications/datatarget/datatarget.model"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; @Component({ - selector: 'app-opendatadk-mail-dialog', - templateUrl: './opendatadk-mail-dialog.html', - styleUrls: ['./opendatadk-mail-dialog.scss'], + selector: "app-opendatadk-mail-dialog", + templateUrl: "./opendatadk-mail-dialog.html", + styleUrls: ["./opendatadk-mail-dialog.scss"], }) export class OpenDataDkMailDialogComponent { sendAttempted: boolean = false; - organizationInput: string = ''; - commentInput: string = ''; + organizationInput: string = ""; + commentInput: string = ""; selectedOrganizationName: string; @@ -22,7 +22,7 @@ export class OpenDataDkMailDialogComponent { const selectedOrganisationId = sharedVariableService.getSelectedOrganisationId(); this.selectedOrganizationName = sharedVariableService .getOrganizationInfo() - ?.find((o) => o.id === selectedOrganisationId)?.name; + ?.find(o => o.id === selectedOrganisationId)?.name; } send() { diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog.html b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog.html index 698444655..aa627aa7c 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog.html +++ b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog.html @@ -1,24 +1,17 @@

      {{'OPENDATADK.MAIL.WARNING' | translate}}

      -

      - {{'OPENDATADK.MAIL.WARNING-TEXT' | translate}} -
      -

      +

      + {{'OPENDATADK.MAIL.WARNING-TEXT' | translate}} +
      +

      -
      -
      - - {{ 'OPENDATADK.MAIL.NEVER-AGAIN' | translate }} - -
      +
      +
      + {{ 'OPENDATADK.MAIL.NEVER-AGAIN' | translate }}
      - +
      - - -
      \ No newline at end of file + + +
      diff --git a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog.ts b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog.ts index a79b5fd1d..dba7e3a0f 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk-edit/opendatadk-warning-dialog/opendatadk-warning-dialog.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; -import { MatDialogRef } from '@angular/material/dialog'; +import { Component } from "@angular/core"; +import { MatDialogRef } from "@angular/material/dialog"; @Component({ - selector: 'app-opendatadk-warning-dialog', - templateUrl: './opendatadk-warning-dialog.html', - styleUrls: ['./opendatadk-warning-dialog.scss'], + selector: "app-opendatadk-warning-dialog", + templateUrl: "./opendatadk-warning-dialog.html", + styleUrls: ["./opendatadk-warning-dialog.scss"], }) export class OpenDataDkWarningDialogComponent { neverAgain: boolean = false; diff --git a/src/app/applications/datatarget/opendatadk/opendatadk.component.spec.ts b/src/app/applications/datatarget/opendatadk/opendatadk.component.spec.ts index 5c4c4e9f4..5b4424188 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk.component.spec.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { OpendatadkComponent } from './opendatadk.component'; +import { OpendatadkComponent } from "./opendatadk.component"; -describe('OpendatadkComponent', () => { +describe("OpendatadkComponent", () => { let component: OpendatadkComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ OpendatadkComponent ] - }) - .compileComponents(); + declarations: [OpendatadkComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('OpendatadkComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/datatarget/opendatadk/opendatadk.component.ts b/src/app/applications/datatarget/opendatadk/opendatadk.component.ts index 08eb8ea97..718100481 100644 --- a/src/app/applications/datatarget/opendatadk/opendatadk.component.ts +++ b/src/app/applications/datatarget/opendatadk/opendatadk.component.ts @@ -1,15 +1,12 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-opendatadk', - templateUrl: './opendatadk.component.html', - styleUrls: ['./opendatadk.component.scss'] + selector: "app-opendatadk", + templateUrl: "./opendatadk.component.html", + styleUrls: ["./opendatadk.component.scss"], }) export class OpendatadkComponent implements OnInit { + constructor() {} - constructor() { } - - ngOnInit(): void { - } - + ngOnInit(): void {} } diff --git a/src/app/applications/enums/status.enum.ts b/src/app/applications/enums/status.enum.ts index 54eb3d6da..9c888c2ec 100644 --- a/src/app/applications/enums/status.enum.ts +++ b/src/app/applications/enums/status.enum.ts @@ -1,11 +1,11 @@ import { recordToEntries } from "@shared/helpers/record.helper"; export enum ApplicationStatus { - "NONE" = "NONE", - "IN-OPERATION" = "IN-OPERATION", - "PROJECT" = "PROJECT", - "PROTOTYPE" = "PROTOTYPE", - "OTHER" = "OTHER", + "NONE" = "NONE", + "IN-OPERATION" = "IN-OPERATION", + "PROJECT" = "PROJECT", + "PROTOTYPE" = "PROTOTYPE", + "OTHER" = "OTHER", } export const ApplicationStatusEntries = recordToEntries(ApplicationStatus); diff --git a/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.html b/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.html index 0e5de9d5b..54dd6a8f3 100644 --- a/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.html @@ -1,21 +1,21 @@ - - -

      - {{'IOTDEVICE.LATEST-DATAPACKAGE' | translate}} + + +

      + {{ "IOTDEVICE.LATEST-DATAPACKAGE" | translate }} - {{latestReceivedMessage.sentTime | tableDateWithSecondsPipe}} -

      -
      -
      - - -
      {{latestReceivedMessage.rawData | json }}
      -
      -
      + {{ latestReceivedMessage.sentTime | tableDateWithSecondsPipe }} +

      + + + + +
      {{ latestReceivedMessage.rawData | json }}
      +
      +
      -

      - {{'IOTDEVICE.NO-DATAPACKAGE' | translate}} -

      +

      + {{ "IOTDEVICE.NO-DATAPACKAGE" | translate }} +

      diff --git a/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.spec.ts b/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.spec.ts index b63cf2899..921ace5f5 100644 --- a/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.spec.ts +++ b/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { DataPackageComponent } from './data-package.component'; +import { DataPackageComponent } from "./data-package.component"; -describe('DataPackageComponent', () => { +describe("DataPackageComponent", () => { let component: DataPackageComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ DataPackageComponent ] - }) - .compileComponents(); + declarations: [DataPackageComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('DataPackageComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.ts b/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.ts index 1f9a84540..e6210273f 100644 --- a/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.ts @@ -1,17 +1,15 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { LatestReceivedMessage } from '@applications/iot-devices/latestReceivedMessage.model'; +import { Component, Input, OnInit } from "@angular/core"; +import { LatestReceivedMessage } from "@applications/iot-devices/latestReceivedMessage.model"; @Component({ - selector: 'app-data-package', - templateUrl: './data-package.component.html', - styleUrls: ['./data-package.component.scss'] + selector: "app-data-package", + templateUrl: "./data-package.component.html", + styleUrls: ["./data-package.component.scss"], }) export class DataPackageComponent implements OnInit { @Input() latestReceivedMessage: LatestReceivedMessage; - constructor() { } - - ngOnInit(): void { - } + constructor() {} + ngOnInit(): void {} } diff --git a/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.html b/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.html index 17f2037ce..4f76b6357 100644 --- a/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.html @@ -2,24 +2,18 @@

      - {{ 'IOTDEVICE.LATEST-DATAPACKAGES' | translate }} + {{ "IOTDEVICE.LATEST-DATAPACKAGES" | translate }}

      -

      +

      {{ i + 1 }}

      -

      +

      {{ metadata.sentTime | tableDateWithSecondsPipe }}

      diff --git a/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.scss b/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.scss index 618f3711a..a3b88984d 100644 --- a/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.scss +++ b/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.scss @@ -1,4 +1,3 @@ .timestamps-container { display: flex; } - diff --git a/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.ts b/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.ts index 708d1334d..653c9a784 100644 --- a/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.ts @@ -1,17 +1,11 @@ -import { - Component, - Input, - OnChanges, - OnInit, - SimpleChanges, -} from '@angular/core'; -import { sortBy } from '@shared/helpers/array.helper'; -import { ReceivedMessageMetadata } from '@shared/models/received-message-metadata.model'; +import { Component, Input, OnChanges, OnInit, SimpleChanges } from "@angular/core"; +import { sortBy } from "@shared/helpers/array.helper"; +import { ReceivedMessageMetadata } from "@shared/models/received-message-metadata.model"; @Component({ - selector: 'app-data-packages-timestamp', - templateUrl: './data-packages-timestamp.component.html', - styleUrls: ['./data-packages-timestamp.component.scss'], + selector: "app-data-packages-timestamp", + templateUrl: "./data-packages-timestamp.component.html", + styleUrls: ["./data-packages-timestamp.component.scss"], }) export class DataPackagesTimestampComponent implements OnInit, OnChanges { @Input() receivedMessagesMetadata: ReceivedMessageMetadata[] = []; @@ -21,15 +15,8 @@ export class DataPackagesTimestampComponent implements OnInit, OnChanges { ngOnChanges(changes: SimpleChanges): void { const { receivedMessagesMetadata } = changes; - if ( - receivedMessagesMetadata.currentValue !== - receivedMessagesMetadata.previousValue - ) { - this.sortedMetadata = sortBy( - receivedMessagesMetadata.currentValue, - 'sentTime', - 'desc' - ); + if (receivedMessagesMetadata.currentValue !== receivedMessagesMetadata.previousValue) { + this.sortedMetadata = sortBy(receivedMessagesMetadata.currentValue, "sentTime", "desc"); } } } diff --git a/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.html b/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.html index 9bbc3d610..5d72120ac 100644 --- a/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.html @@ -1,7 +1,12 @@ -

      {{ 'IOTDEVICE.DEVICEMODEL' | translate }}

      - +

      {{ "IOTDEVICE.DEVICEMODEL" | translate }}

      + -

      {{ 'IOTDEVICE.DEVICEMODEL-ERROR' | translate }}

      -
      \ No newline at end of file +

      {{ "IOTDEVICE.DEVICEMODEL-ERROR" | translate }}

      + diff --git a/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.scss b/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.scss index 31e665bf5..65afa5748 100644 --- a/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.scss +++ b/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.scss @@ -1,4 +1,4 @@ div { - resize: vertical; - overflow: auto; - } \ No newline at end of file + resize: vertical; + overflow: auto; +} diff --git a/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.spec.ts b/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.spec.ts index 094e8cff3..dc0e6b943 100644 --- a/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.spec.ts +++ b/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { DeviceModelComponent } from './device-model.component'; +import { DeviceModelComponent } from "./device-model.component"; -describe('DeviceModelComponent', () => { +describe("DeviceModelComponent", () => { let component: DeviceModelComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ DeviceModelComponent ] - }) - .compileComponents(); + declarations: [DeviceModelComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('DeviceModelComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.ts b/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.ts index d6182930c..3d18017a0 100644 --- a/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/device-model/device-model.component.ts @@ -1,22 +1,27 @@ -import { Component, Input, OnChanges, OnInit } from '@angular/core'; -import { DeviceModelService } from '@app/device-model/device-model.service'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; +import { Component, Input, OnChanges, OnInit } from "@angular/core"; +import { DeviceModelService } from "@app/device-model/device-model.service"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; @Component({ - selector: 'app-device-model', - templateUrl: './device-model.component.html', - styleUrls: ['./device-model.component.scss'] + selector: "app-device-model", + templateUrl: "./device-model.component.html", + styleUrls: ["./device-model.component.scss"], }) export class DeviceModelComponent implements OnInit, OnChanges { @Input() device: IotDevice; public deviceModel: string; - editorJsonOutpuOptions = { theme: 'vs', language: 'json', autoIndent: true, roundedSelection: true, minimap: { enabled: false }, readOnly: true }; + editorJsonOutpuOptions = { + theme: "vs", + language: "json", + autoIndent: true, + roundedSelection: true, + minimap: { enabled: false }, + readOnly: true, + }; + constructor(private deviceModelService: DeviceModelService) {} - constructor(private deviceModelService: DeviceModelService) { } - - ngOnInit(): void { - } + ngOnInit(): void {} ngOnChanges() { if (this.device.deviceModelId) { @@ -25,11 +30,8 @@ export class DeviceModelComponent implements OnInit, OnChanges { } getDeviceModel(id: number) { - this.deviceModelService.get(id).subscribe( - (response) => { - this.deviceModel = JSON.stringify(response.body, null, 4); - } - ); + this.deviceModelService.get(id).subscribe(response => { + this.deviceModel = JSON.stringify(response.body, null, 4); + }); } - } diff --git a/src/app/applications/iot-devices/iot-device-detail/downlink/downlink-dialog/downlink-dialog.component.html b/src/app/applications/iot-devices/iot-device-detail/downlink/downlink-dialog/downlink-dialog.component.html index 115715847..a2102bfae 100644 --- a/src/app/applications/iot-devices/iot-device-detail/downlink/downlink-dialog/downlink-dialog.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/downlink/downlink-dialog/downlink-dialog.component.html @@ -1,8 +1,12 @@ -

      {{'IOTDEVICE.DOWNLINK.DIALOG-TITLE' | translate}}

      +

      {{ "IOTDEVICE.DOWNLINK.DIALOG-TITLE" | translate }}

      - {{'IOTDEVICE.DOWNLINK.DIALOG-MESSAGE' | translate}} + {{ "IOTDEVICE.DOWNLINK.DIALOG-MESSAGE" | translate }}
      - - + +
      diff --git a/src/app/applications/iot-devices/iot-device-detail/downlink/downlink-dialog/downlink-dialog.component.ts b/src/app/applications/iot-devices/iot-device-detail/downlink/downlink-dialog/downlink-dialog.component.ts index 37c6355b6..b74863749 100644 --- a/src/app/applications/iot-devices/iot-device-detail/downlink/downlink-dialog/downlink-dialog.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/downlink/downlink-dialog/downlink-dialog.component.ts @@ -1,21 +1,18 @@ -import { Component, OnInit } from '@angular/core'; -import { MatDialogRef } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; -import { DownlinkComponent } from '../downlink.component'; +import { Component, OnInit } from "@angular/core"; +import { MatDialogRef } from "@angular/material/dialog"; +import { TranslateService } from "@ngx-translate/core"; +import { DownlinkComponent } from "../downlink.component"; @Component({ - selector: 'app-downlink-dialog', - templateUrl: './downlink-dialog.component.html', - styleUrls: ['./downlink-dialog.component.scss'], + selector: "app-downlink-dialog", + templateUrl: "./downlink-dialog.component.html", + styleUrls: ["./downlink-dialog.component.scss"], }) export class DownlinkDialogComponent implements OnInit { - constructor( - private translate: TranslateService, - public dialog: MatDialogRef - ) {} + constructor(private translate: TranslateService, public dialog: MatDialogRef) {} ngOnInit(): void { - this.translate.use('da'); + this.translate.use("da"); } cancel() { diff --git a/src/app/applications/iot-devices/iot-device-detail/downlink/downlink.component.html b/src/app/applications/iot-devices/iot-device-detail/downlink/downlink.component.html index 84728130b..7edc2d4e1 100644 --- a/src/app/applications/iot-devices/iot-device-detail/downlink/downlink.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/downlink/downlink.component.html @@ -1,41 +1,58 @@
      -
      -
        -
      • - {{error | translate}} -
      • -
      -
      -

      {{'IOTDEVICE.DOWNLINK.DESCRIPTION' | translate}}

      -
      - {{'IOTDEVICE.DOWNLINK.CONFIRMEDDOWNLINK' | translate}} - - -
      -
      - - -
      -
      - - -
      -
      -

      {{'IOTDEVICE.DOWNLINK.SIGFOX-PAYLOAD-LENGTH' | translate}}

      -
      -
      - -
      +
      +
        +
      • + {{ error | translate }} +
      • +
      +
      +

      {{ "IOTDEVICE.DOWNLINK.DESCRIPTION" | translate }}

      +
      + {{ "IOTDEVICE.DOWNLINK.CONFIRMEDDOWNLINK" | translate }} + + +
      +
      + + +
      +
      + + +
      +
      +

      {{ "IOTDEVICE.DOWNLINK.SIGFOX-PAYLOAD-LENGTH" | translate }}

      +
      +
      + +
      -
      -

      - {{'IOTDEVICE.DOWNLINK.NOTIMPLEMENTED' | translate}} -

      -
      -
      \ No newline at end of file +
      +

      + {{ "IOTDEVICE.DOWNLINK.NOTIMPLEMENTED" | translate }} +

      +
      + diff --git a/src/app/applications/iot-devices/iot-device-detail/downlink/downlink.component.ts b/src/app/applications/iot-devices/iot-device-detail/downlink/downlink.component.ts index 2862319cd..ae5033e7f 100644 --- a/src/app/applications/iot-devices/iot-device-detail/downlink/downlink.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/downlink/downlink.component.ts @@ -1,19 +1,19 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, Input, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { Downlink } from '@applications/iot-devices/downlink.model'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { TranslateService } from '@ngx-translate/core'; -import { DeviceType } from '@shared/enums/device-type'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { DownlinkService } from '@shared/services/downlink.service'; -import { DownlinkDialogComponent } from './downlink-dialog/downlink-dialog.component'; +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, Input, OnInit } from "@angular/core"; +import { MatDialog } from "@angular/material/dialog"; +import { MatSnackBar } from "@angular/material/snack-bar"; +import { Downlink } from "@applications/iot-devices/downlink.model"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { TranslateService } from "@ngx-translate/core"; +import { DeviceType } from "@shared/enums/device-type"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { DownlinkService } from "@shared/services/downlink.service"; +import { DownlinkDialogComponent } from "./downlink-dialog/downlink-dialog.component"; @Component({ - selector: 'app-downlink', - templateUrl: './downlink.component.html', - styleUrls: ['./downlink.component.scss'], + selector: "app-downlink", + templateUrl: "./downlink.component.html", + styleUrls: ["./downlink.component.scss"], }) export class DownlinkComponent implements OnInit { @Input() device: IotDevice; @@ -43,7 +43,7 @@ export class DownlinkComponent implements OnInit { this.startDownlink(); } }, - (error) => { + error => { this.handleError(error); console.log(error); } @@ -53,7 +53,7 @@ export class DownlinkComponent implements OnInit { private handleError(error: HttpErrorResponse) { if (error?.error?.chirpstackError?.error == "f_port must be > 0") { - this.errorMessages = ["port must be > 0"] + this.errorMessages = ["port must be > 0"]; return; } this.errorMessages = this.errorMessageService.handleErrorMessage(error); @@ -62,12 +62,12 @@ export class DownlinkComponent implements OnInit { private startDownlink() { this.errorMessages = []; this.downlinkService.post(this.downlink, this.device.id).subscribe( - (response) => { - this.snackBar.open('Element sat i kø', 'Downlink', { + response => { + this.snackBar.open("Element sat i kø", "Downlink", { duration: 10000, }); }, - (error) => { + error => { this.handleError(error); } ); @@ -77,38 +77,38 @@ export class DownlinkComponent implements OnInit { const isHexinput = /^[a-fA-F\d]+$/.test(input); let validator = false; if (isHexinput) { - if (this.device.type === 'SIGFOX' && input.length != 16) { - this.addToErrorMessage('IOTDEVICE.DOWNLINK.SIGFOX-PAYLOAD-LENGTH'); + if (this.device.type === "SIGFOX" && input.length != 16) { + this.addToErrorMessage("IOTDEVICE.DOWNLINK.SIGFOX-PAYLOAD-LENGTH"); } validator = true; } else { this.device.type === DeviceType.LORAWAN - ? this.addToErrorMessage('IOTDEVICE.DOWNLINK.NO-PORT-OR-PAYLOAD') - : this.addToErrorMessage('IOTDEVICE.DOWNLINK.NO-PAYLOAD'); - this.addToErrorMessage('IOTDEVICE.DOWNLINK.FORMAT-ERROR'); + ? this.addToErrorMessage("IOTDEVICE.DOWNLINK.NO-PORT-OR-PAYLOAD") + : this.addToErrorMessage("IOTDEVICE.DOWNLINK.NO-PAYLOAD"); + this.addToErrorMessage("IOTDEVICE.DOWNLINK.FORMAT-ERROR"); validator = false; } return validator; } addToErrorMessage(text: string) { - this.translate.get([text]).subscribe((translations) => { + this.translate.get([text]).subscribe(translations => { this.errorMessages.push(translations[text]); }); } getMaxDownloadLength(): number { if (this.device.type === DeviceType.SIGFOX) { - return 16 + return 16; } else { - return 256 + return 256; } } openDownlinkDialog() { const dialog = this.dialog.open(DownlinkDialogComponent, {}); - dialog.afterClosed().subscribe((result) => { + dialog.afterClosed().subscribe(result => { if (result === true) { this.startDownlink(); console.log(`Dialog result: ${result}`); diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component.html index 59c24dece..e82e7f38e 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component.html @@ -1,14 +1,13 @@
      - - +

      - {{ 'IOTDEVICE.NO-DATAPACKAGE' | translate }} + {{ "IOTDEVICE.NO-DATAPACKAGE" | translate }}

      diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component.ts index 4d45cceb1..7758e4d6f 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-data-packets-tab/iot-device-data-packets-tab.component.ts @@ -1,11 +1,11 @@ -import { Component, OnInit } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { IotDeviceDetailsService } from '@applications/iot-devices/iot-device-details-service'; +import { Component, OnInit } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { IotDeviceDetailsService } from "@applications/iot-devices/iot-device-details-service"; @Component({ - selector: 'app-iot-device-data-packets-tab', - templateUrl: './iot-device-data-packets-tab.component.html', - styleUrls: ['./iot-device-data-packets-tab.component.scss'], + selector: "app-iot-device-data-packets-tab", + templateUrl: "./iot-device-data-packets-tab.component.html", + styleUrls: ["./iot-device-data-packets-tab.component.scss"], }) export class IotDeviceDataPacketsTabComponent implements OnInit { device: IotDevice; diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.html index ec7542301..ab8a85585 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.html @@ -1,96 +1,112 @@
      -
      -
      -

      {{ 'IOTDEVICE.DETAIL' | translate }}

      -

      {{ 'IOT-TABLE.APPLICATION' | translate }}{{device.application.name}}

      - - - - -
      -

      {{ 'IOT-TABLE.BATTERY' | translate }}

      - -
      -
      - +
      +
      +

      {{ "IOTDEVICE.DETAIL" | translate }}

      +

      + {{ "IOT-TABLE.APPLICATION" | translate }}{{ device.application.name }} +

      + + + + +
      +

      + {{ "IOT-TABLE.BATTERY" | translate }} +

      + +
      +
      + - -

      {{ 'IOTDEVICE.TYPE' | translate }}{{ 'IOT-DEVICE-TYPES.' + device.type | translate}} -

      - - - - - - - - - - -

      - {{ 'IOTDEVICE.GENERIC_HTTP.APIKEY' | translate }} - {{ httpDeviceUrl }} -

      -
      - - - - -

      {{ 'IOTDEVICE.MQTT.NOCONNECTION' | translate}}

      - -
      - - + +

      + {{ "IOTDEVICE.TYPE" | translate }}{{ "IOT-DEVICE-TYPES." + device.type | translate }} +

      + + + + + + + + + + +

      + {{ "IOTDEVICE.GENERIC_HTTP.APIKEY" | translate }} + {{ httpDeviceUrl }} +

      +
      + + + + +

      + {{ "IOTDEVICE.MQTT.NOCONNECTION" | translate }} +

      + +
      + + +

      + {{ "IOTDEVICE.COMMENT" | translate }} + + {{ device.comment }} + + + {{ "IOTDEVICE.NOCOMMENT" | translate }} + +

      + + +

      + {{ "QUESTION.METADATA" | translate }} +

      +

      + {{ i + 1 }}: {{ tag.key }} + {{ tag.value }} +

      +
      +
      +
      +
      +
      +

      {{ "IOTDEVICE.LOCATION" | translate }}

      +
      +
      + +
      +
      +

      - {{ 'IOTDEVICE.COMMENT' | translate }} - - {{device.comment}} - - - {{ 'IOTDEVICE.NOCOMMENT' | translate}} - + {{ "IOTDEVICE.LATITUDE" | translate }}{{ latitude | number : "2.1-9" }}

      - - -

      {{ 'QUESTION.METADATA' | translate }}

      -

      - {{i + 1}}: {{ tag.key }} - {{ tag.value }} -

      -
      -
      -
      -
      -
      -

      {{ 'IOTDEVICE.LOCATION' | translate }}

      -
      -
      - -
      -
      -
      -

      {{ 'IOTDEVICE.LATITUDE' | translate }}{{latitude | number:'2.1-9'}}

      -
      -
      -

      {{ 'IOTDEVICE.LONGITUDE' | translate }}{{longitude | number:'2.1-9'}}

      -
      -
      -
      - -

      {{ 'IOTDEVICE.NOLOCATION' | translate}}

      -
      +
      +

      - - {{ 'IOTDEVICE.COMMENTONLOCATION' | translate }} - - - {{device.commentOnLocation}} - - - {{ 'IOTDEVICE.NOCOMMENTONLOCATION' | translate}} - + {{ "IOTDEVICE.LONGITUDE" | translate }}{{ longitude | number : "2.1-9" }}

      +
      +
      + +

      {{ "IOTDEVICE.NOLOCATION" | translate }}

      +
      +

      + + {{ "IOTDEVICE.COMMENTONLOCATION" | translate }} + + + {{ device.commentOnLocation }} + + + {{ "IOTDEVICE.NOCOMMENTONLOCATION" | translate }} + +

      +
      diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.scss b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.scss index 2f7d4fa0d..75c6a1161 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.scss +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.scss @@ -1,19 +1,19 @@ -@import 'src/assets/scss/setup/variables'; +@import "src/assets/scss/setup/variables"; .pre { - white-space: pre-wrap; - white-space: -moz-pre-wrap; - white-space: -o-pre-wrap; - font-family: monospace; + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -o-pre-wrap; + font-family: monospace; } .alarmText { - color: #ff0000; - font-size: 1em; + color: #ff0000; + font-size: 1em; } .latLonWrapWidth { - @media (max-width: 1250px) { - width: 100%; - } + @media (max-width: 1250px) { + width: 100%; + } } diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.ts index a2e2110d1..451d3452c 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.ts @@ -1,29 +1,20 @@ -import { Location } from '@angular/common'; -import { - Component, - EventEmitter, - Input, - OnChanges, - OnDestroy, - OnInit, - SimpleChanges, -} from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { IoTDeviceService } from '@applications/iot-devices/iot-device.service'; -import { environment } from '@environments/environment'; -import { TranslateService } from '@ngx-translate/core'; -import { jsonToList } from '@shared/helpers/json.helper'; -import { KeyValue } from '@shared/types/tuple.type'; -import { DeviceType } from '@shared/enums/device-type'; +import { Location } from "@angular/common"; +import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { IoTDeviceService } from "@applications/iot-devices/iot-device.service"; +import { environment } from "@environments/environment"; +import { TranslateService } from "@ngx-translate/core"; +import { jsonToList } from "@shared/helpers/json.helper"; +import { KeyValue } from "@shared/types/tuple.type"; +import { DeviceType } from "@shared/enums/device-type"; @Component({ - selector: 'app-iot-device-detail-generic', - templateUrl: './iot-device-detail-generic.component.html', - styleUrls: ['./iot-device-detail-generic.component.scss'], + selector: "app-iot-device-detail-generic", + templateUrl: "./iot-device-detail-generic.component.html", + styleUrls: ["./iot-device-detail-generic.component.scss"], }) -export class IotDeviceDetailGenericComponent - implements OnInit, OnChanges, OnDestroy { - batteryStatusColor = 'green'; +export class IotDeviceDetailGenericComponent implements OnInit, OnChanges, OnDestroy { + batteryStatusColor = "green"; batteryStatusPercentage: number; metadataTags: KeyValue[] = []; @Input() device: IotDevice; @@ -46,11 +37,7 @@ export class IotDeviceDetailGenericComponent ngOnChanges(changes: SimpleChanges): void { this.batteryStatusPercentage = this.getBatteryProcentage(); this.httpDeviceUrl = this.getGenericHttpDeviceUrl(); - if ( - changes?.device?.previousValue?.metadata !== - changes?.device?.currentValue?.metadata && - this.device.metadata - ) { + if (changes?.device?.previousValue?.metadata !== changes?.device?.currentValue?.metadata && this.device.metadata) { this.metadataTags = jsonToList(this.device.metadata); } } @@ -69,10 +56,7 @@ export class IotDeviceDetailGenericComponent } private getBatteryProcentage(): number { - if ( - this.device?.lorawanSettings?.deviceStatusBattery === - this.CHIRPSTACK_BATTERY_NOT_AVAILIBLE - ) { + if (this.device?.lorawanSettings?.deviceStatusBattery === this.CHIRPSTACK_BATTERY_NOT_AVAILIBLE) { return null; } return Math.round(this.device?.lorawanSettings?.deviceStatusBattery); diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-lorawan/iot-device-detail-lorawan.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-lorawan/iot-device-detail-lorawan.component.html index 9d75c49b9..0f96b1b64 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-lorawan/iot-device-detail-lorawan.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-lorawan/iot-device-detail-lorawan.component.html @@ -1,17 +1,40 @@ -

      {{ 'IOTDEVICE.LORA.DEVEUI' | translate }}{{device.lorawanSettings.devEUI}}

      -

      {{ 'IOTDEVICE.LORA.DEVICEPROFILE' | translate }}{{deviceProfileName}}

      +

      + {{ "IOTDEVICE.LORA.DEVEUI" | translate }}{{ device.lorawanSettings.devEUI }} +

      +

      + {{ "IOTDEVICE.LORA.DEVICEPROFILE" | translate }}{{ deviceProfileName }} +

      -

      {{ 'IOTDEVICE.LORA.OTAAAPPLICATIONKEY' | translate }}{{device.lorawanSettings?.OTAAapplicationKey}} -

      +

      + {{ "IOTDEVICE.LORA.OTAAAPPLICATIONKEY" | translate }}{{ device.lorawanSettings?.OTAAapplicationKey }} +

      -

      {{ 'IOTDEVICE.LORA.DEVADDR' | translate }}{{device.lorawanSettings?.devAddr}}

      -

      {{ 'IOTDEVICE.LORA.NETWORKSESSIONKEY' | translate }}{{device.lorawanSettings?.activationType}} -

      -

      {{ 'IOTDEVICE.LORA.APPLICATIONSESSIONKEY' | translate }}{{device.lorawanSettings?.applicationSessionKey}} -

      -

      {{ 'IOTDEVICE.LORA.FCNTUP' | translate }}{{device.lorawanSettings?.fCntUp}}

      -

      {{ 'IOTDEVICE.LORA.NFCNTDOWN' | translate }}{{device.lorawanSettings?.nFCntDown }}

      +

      + {{ "IOTDEVICE.LORA.DEVADDR" | translate }}{{ device.lorawanSettings?.devAddr }} +

      +

      + {{ "IOTDEVICE.LORA.NETWORKSESSIONKEY" | translate }}{{ device.lorawanSettings?.activationType }} +

      +

      + {{ "IOTDEVICE.LORA.APPLICATIONSESSIONKEY" | translate }}{{ device.lorawanSettings?.applicationSessionKey }} +

      +

      + {{ "IOTDEVICE.LORA.FCNTUP" | translate }}{{ device.lorawanSettings?.fCntUp }} +

      +

      + {{ "IOTDEVICE.LORA.NFCNTDOWN" | translate }}{{ device.lorawanSettings?.nFCntDown }} +

      -

      {{ 'IOTDEVICE.LORA.SKIPFCNTCHECK' | translate }}{{device.lorawanSettings?.skipFCntCheck | yesNo}} +

      + {{ "IOTDEVICE.LORA.SKIPFCNTCHECK" | translate }}{{ device.lorawanSettings?.skipFCntCheck | yesNo }}

      diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-lorawan/iot-device-detail-lorawan.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-lorawan/iot-device-detail-lorawan.component.ts index c0307b004..91c8ef3b6 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-lorawan/iot-device-detail-lorawan.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-lorawan/iot-device-detail-lorawan.component.ts @@ -1,33 +1,31 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { DeviceProfileService } from '@profiles/device-profiles/device-profile.service'; -import { Subscription } from 'rxjs'; +import { Component, Input, OnInit } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { DeviceProfileService } from "@profiles/device-profiles/device-profile.service"; +import { Subscription } from "rxjs"; @Component({ - selector: 'app-iot-device-detail-lorawan', - templateUrl: './iot-device-detail-lorawan.component.html', - styleUrls: ['./iot-device-detail-lorawan.component.scss'] + selector: "app-iot-device-detail-lorawan", + templateUrl: "./iot-device-detail-lorawan.component.html", + styleUrls: ["./iot-device-detail-lorawan.component.scss"], }) export class IotDeviceDetailLorawanComponent implements OnInit { - @Input() device: IotDevice; deviceProfileSubscription: Subscription; public OTAA: boolean; public deviceProfileName: string; - constructor( - private deviceProfileService: DeviceProfileService, - ) { } + constructor(private deviceProfileService: DeviceProfileService) {} ngOnInit(): void { this.getDeviceProfil(); } getDeviceProfil() { - this.deviceProfileSubscription = this.deviceProfileService.getOne(this.device.lorawanSettings?.deviceProfileID) - .subscribe((response) => { - this.OTAA = response.deviceProfile.supportsJoin; - this.deviceProfileName = response.deviceProfile.name; - }); + this.deviceProfileSubscription = this.deviceProfileService + .getOne(this.device.lorawanSettings?.deviceProfileID) + .subscribe(response => { + this.OTAA = response.deviceProfile.supportsJoin; + this.deviceProfileName = response.deviceProfile.name; + }); } } diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-sigfox/iot-device-detail-sigfox.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-sigfox/iot-device-detail-sigfox.component.html index 951b4b800..f7e083e2b 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-sigfox/iot-device-detail-sigfox.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-sigfox/iot-device-detail-sigfox.component.html @@ -1,8 +1,24 @@ -

      {{ 'IOTDEVICE.SIGFOX.DEVICEID' | translate }}{{device.sigfoxSettings.deviceId}}

      -

      {{ 'IOTDEVICE.SIGFOX.GROUP-NAME' | translate }}{{device.sigfoxSettings.groupName}}

      -

      {{ 'IOTDEVICE.SIGFOX.DEVICETYPE' | translate }}{{device.sigfoxSettings.deviceTypeName}}

      -

      {{ 'IOTDEVICE.SIGFOX.PAC' | translate }}{{device.sigfoxSettings.pac}}

      -

      {{ 'IOTDEVICE.SIGFOX.ENDPRODUCTCERTIFICATE' | translate }}{{device.sigfoxSettings.endProductCertificate}} -

      -

      {{ 'IOTDEVICE.SIGFOX.PROTOTYPE' | translate }}{{device.sigfoxSettings.prototype ? 'true' : 'false' | translate}} -

      \ No newline at end of file +

      + {{ "IOTDEVICE.SIGFOX.DEVICEID" | translate }}{{ device.sigfoxSettings.deviceId }} +

      +

      + {{ "IOTDEVICE.SIGFOX.GROUP-NAME" | translate }}{{ device.sigfoxSettings.groupName }} +

      +

      + {{ "IOTDEVICE.SIGFOX.DEVICETYPE" | translate }}{{ device.sigfoxSettings.deviceTypeName }} +

      +

      + {{ "IOTDEVICE.SIGFOX.PAC" | translate }}{{ device.sigfoxSettings.pac }} +

      +

      + {{ "IOTDEVICE.SIGFOX.ENDPRODUCTCERTIFICATE" | translate }}{{ device.sigfoxSettings.endProductCertificate }} +

      +

      + {{ "IOTDEVICE.SIGFOX.PROTOTYPE" | translate }}{{ device.sigfoxSettings.prototype ? "true" : ("false" | translate) }} +

      diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-sigfox/iot-device-detail-sigfox.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-sigfox/iot-device-detail-sigfox.component.ts index fda93f1c5..f793dba79 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-sigfox/iot-device-detail-sigfox.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail-sigfox/iot-device-detail-sigfox.component.ts @@ -1,18 +1,15 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; +import { Component, Input, OnInit } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; @Component({ - selector: 'app-iot-device-detail-sigfox', - templateUrl: './iot-device-detail-sigfox.component.html', - styleUrls: ['./iot-device-detail-sigfox.component.scss'] + selector: "app-iot-device-detail-sigfox", + templateUrl: "./iot-device-detail-sigfox.component.html", + styleUrls: ["./iot-device-detail-sigfox.component.scss"], }) export class IotDeviceDetailSigfoxComponent implements OnInit { - @Input() device: IotDevice; - constructor() { } - - ngOnInit(): void { - } + constructor() {} + ngOnInit(): void {} } diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.html index 7034ffb91..c5f4e5948 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.html @@ -1,15 +1,25 @@ diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.scss b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.scss index fb64ad961..854e33731 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.scss +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.scss @@ -1,5 +1,5 @@ -@import 'src/assets/scss/setup/breakpoints'; -@import 'src/assets/scss/setup/variables'; +@import "src/assets/scss/setup/breakpoints"; +@import "src/assets/scss/setup/variables"; .iot-device-component { width: 100%; diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.spec.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.spec.ts index e41c22e08..7f340dde7 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.spec.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { IoTDeviceDetailComponent } from './iot-device-detail.component'; +import { IoTDeviceDetailComponent } from "./iot-device-detail.component"; -describe('IoTDeviceDetailComponent', () => { +describe("IoTDeviceDetailComponent", () => { let component: IoTDeviceDetailComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [IoTDeviceDetailComponent] - }) - .compileComponents(); + declarations: [IoTDeviceDetailComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('IoTDeviceDetailComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.ts index 8034ac3e5..7c6d9a7eb 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-detail.component.ts @@ -1,55 +1,52 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Application } from '@applications/application.model'; -import { TranslateService } from '@ngx-translate/core'; -import { DeleteDialogComponent } from '@shared/components/delete-dialog/delete-dialog.component'; -import { DeleteDialogService } from '@shared/components/delete-dialog/delete-dialog.service'; -import { DeviceType } from '@shared/enums/device-type'; -import { BackButton } from '@shared/models/back-button.model'; -import { Subscription } from 'rxjs'; -import { IotDevice } from '../iot-device.model'; -import { IoTDeviceService } from '../iot-device.service'; -import { - DropdownButton, - ExtraDropdownOption, -} from '@shared/models/dropdown-button.model'; -import { Title } from '@angular/platform-browser'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { IotDeviceDetailsService } from '@applications/iot-devices/iot-device-details-service'; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { MatDialog } from "@angular/material/dialog"; +import { ActivatedRoute, Router } from "@angular/router"; +import { Application } from "@applications/application.model"; +import { TranslateService } from "@ngx-translate/core"; +import { DeleteDialogComponent } from "@shared/components/delete-dialog/delete-dialog.component"; +import { DeleteDialogService } from "@shared/components/delete-dialog/delete-dialog.service"; +import { DeviceType } from "@shared/enums/device-type"; +import { BackButton } from "@shared/models/back-button.model"; +import { Subscription } from "rxjs"; +import { IotDevice } from "../iot-device.model"; +import { IoTDeviceService } from "../iot-device.service"; +import { DropdownButton, ExtraDropdownOption } from "@shared/models/dropdown-button.model"; +import { Title } from "@angular/platform-browser"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { IotDeviceDetailsService } from "@applications/iot-devices/iot-device-details-service"; @Component({ - selector: 'app-iot-device', - templateUrl: './iot-device-detail.component.html', - styleUrls: ['./iot-device-detail.component.scss'], + selector: "app-iot-device", + templateUrl: "./iot-device-detail.component.html", + styleUrls: ["./iot-device-detail.component.scss"], }) export class IoTDeviceDetailComponent implements OnInit, OnDestroy { public navTabs: any[] = [ { - label: 'APPLICATION.DETAILS', - link: './details', + label: "APPLICATION.DETAILS", + link: "./details", index: 0, }, { - label: 'IOTDEVICE.HISTORY', - link: './history', + label: "IOTDEVICE.HISTORY", + link: "./history", index: 1, }, { - label: 'IOTDEVICE.DATA-PACKETS', - link: './data-packets', + label: "IOTDEVICE.DATA-PACKETS", + link: "./data-packets", index: 2, }, { - label: 'IOTDEVICE.DOWNLINK-TAB', - link: './downlink', + label: "IOTDEVICE.DOWNLINK-TAB", + link: "./downlink", index: 3, }, ]; device: IotDevice; public deviceId: number; - public backButton: BackButton = { label: '', routerLink: 'undefined' }; + public backButton: BackButton = { label: "", routerLink: "undefined" }; public application: Application; public iotDeviceSubscription: Subscription; @@ -58,7 +55,7 @@ export class IoTDeviceDetailComponent implements OnInit, OnDestroy { public dropdownButton: DropdownButton; public canEdit = false; - private resetApiKeyId = 'RESET-API-KEY'; + private resetApiKeyId = "RESET-API-KEY"; private resetApiKeyOption: ExtraDropdownOption; private resetApiKeyBody: string; private resetApiKeyConfirm: string; @@ -77,8 +74,8 @@ export class IoTDeviceDetailComponent implements OnInit, OnDestroy { ) {} ngOnInit(): void { - this.deviceId = +this.route.snapshot.paramMap.get('deviceId'); - const appId: number = +this.route.snapshot.paramMap.get('id'); + this.deviceId = +this.route.snapshot.paramMap.get("deviceId"); + const appId: number = +this.route.snapshot.paramMap.get("id"); this.canEdit = this.meService.hasAccessToTargetOrganization( OrganizationAccessScope.ApplicationWrite, undefined, @@ -89,69 +86,64 @@ export class IoTDeviceDetailComponent implements OnInit, OnDestroy { if (this.deviceId) { this.bindIoTDeviceAndApplication(this.deviceId); this.dropdownButton = { - label: '', - editRouterLink: '../../iot-device-edit/' + this.deviceId, + label: "", + editRouterLink: "../../iot-device-edit/" + this.deviceId, isErasable: true, }; } this.translate .get([ - 'NAV.APPLICATIONS', - 'IOTDEVICE-TABLE-ROW.SHOW-OPTIONS', - 'TITLE.IOTDEVICE', - 'IOTDEVICE-TABLE-ROW.RESET-API-KEY', - 'IOTDEVICE.GENERIC_HTTP.RESET-API-KEY', - 'GEN.CANCEL', + "NAV.APPLICATIONS", + "IOTDEVICE-TABLE-ROW.SHOW-OPTIONS", + "TITLE.IOTDEVICE", + "IOTDEVICE-TABLE-ROW.RESET-API-KEY", + "IOTDEVICE.GENERIC_HTTP.RESET-API-KEY", + "GEN.CANCEL", ]) - .subscribe((translations) => { - this.backButton.label = translations['NAV.APPLICATIONS']; - this.dropdownButton.label = - translations['IOTDEVICE-TABLE-ROW.SHOW-OPTIONS']; - this.titleService.setTitle(translations['TITLE.IOTDEVICE']); + .subscribe(translations => { + this.backButton.label = translations["NAV.APPLICATIONS"]; + this.dropdownButton.label = translations["IOTDEVICE-TABLE-ROW.SHOW-OPTIONS"]; + this.titleService.setTitle(translations["TITLE.IOTDEVICE"]); this.resetApiKeyOption = { id: this.resetApiKeyId, - label: translations['IOTDEVICE-TABLE-ROW.RESET-API-KEY'], + label: translations["IOTDEVICE-TABLE-ROW.RESET-API-KEY"], }; - this.resetApiKeyBody = - translations['IOTDEVICE.GENERIC_HTTP.RESET-API-KEY']['BODY']; - this.resetApiKeyConfirm = - translations['IOTDEVICE.GENERIC_HTTP.RESET-API-KEY']['YESRESET']; - this.resetApiKeyCancel = translations['GEN.CANCEL']; + this.resetApiKeyBody = translations["IOTDEVICE.GENERIC_HTTP.RESET-API-KEY"]["BODY"]; + this.resetApiKeyConfirm = translations["IOTDEVICE.GENERIC_HTTP.RESET-API-KEY"]["YESRESET"]; + this.resetApiKeyCancel = translations["GEN.CANCEL"]; }); this.dropdownButton.extraOptions = []; - if (this.router.url.split('/').length <= 5) { - this.router.navigateByUrl(this.router.url + '/details', { + if (this.router.url.split("/").length <= 5) { + this.router.navigateByUrl(this.router.url + "/details", { replaceUrl: true, }); } } bindIoTDeviceAndApplication(deviceId: number) { - this.iotDeviceSubscription = this.iotDeviceService - .getIoTDevice(deviceId) - .subscribe((device: IotDevice) => { - this.device = device; - this.iotDeviceDetailsService.device = device; - this.application = device.application; - if (this.device.location) { - this.iotDeviceDetailsService.longitude = this.device.location.coordinates[0]; - this.iotDeviceDetailsService.latitude = this.device.location.coordinates[1]; - } - - if (this.canEdit && this.device.type === DeviceType.GENERIC_HTTP) { - this.dropdownButton.extraOptions.push(this.resetApiKeyOption); - } - }); + this.iotDeviceSubscription = this.iotDeviceService.getIoTDevice(deviceId).subscribe((device: IotDevice) => { + this.device = device; + this.iotDeviceDetailsService.device = device; + this.application = device.application; + if (this.device.location) { + this.iotDeviceDetailsService.longitude = this.device.location.coordinates[0]; + this.iotDeviceDetailsService.latitude = this.device.location.coordinates[1]; + } + + if (this.canEdit && this.device.type === DeviceType.GENERIC_HTTP) { + this.dropdownButton.extraOptions.push(this.resetApiKeyOption); + } + }); } showSigfoxDeleteDialog() { const dialog = this.dialog.open(DeleteDialogComponent, { data: { message: - 'Sigfox enheder kan ikke slettes fra OS2IoT, de skal slettes fra backend.sigfox.com, hvorefter de automatisk bliver slettet fra OS2IoT inden for få minutter', + "Sigfox enheder kan ikke slettes fra OS2IoT, de skal slettes fra backend.sigfox.com, hvorefter de automatisk bliver slettet fra OS2IoT inden for få minutter", showAccept: false, showCancel: true, }, @@ -159,26 +151,22 @@ export class IoTDeviceDetailComponent implements OnInit, OnDestroy { } routeToApplication(): void { - this.router.navigate(['applications', this.application.id, 'iot-devices']); + this.router.navigate(["applications", this.application.id, "iot-devices"]); } clickDelete() { if (this.device.type === DeviceType.SIGFOX) { this.showSigfoxDeleteDialog(); } else { - this.deleteDialogSubscription = this.deleteDialogService - .showSimpleDialog() - .subscribe((response) => { - if (response) { - this.iotDeviceService - .deleteIoTDevice(this.device.id) - .subscribe((response) => { - this.routeToApplication(); - }); - } else { - console.log(response); - } - }); + this.deleteDialogSubscription = this.deleteDialogService.showSimpleDialog().subscribe(response => { + if (response) { + this.iotDeviceService.deleteIoTDevice(this.device.id).subscribe(response => { + this.routeToApplication(); + }); + } else { + console.log(response); + } + }); } } @@ -200,21 +188,19 @@ export class IoTDeviceDetailComponent implements OnInit, OnDestroy { true, true, false, - '', + "", false, this.resetApiKeyConfirm, this.resetApiKeyCancel ) - .subscribe((isConfirmed) => { + .subscribe(isConfirmed => { if (isConfirmed) { - this.iotDeviceService - .resetHttpDeviceApiKey(this.device.id) - .subscribe((response) => { - this.device = { - ...this.device, - apiKey: response.apiKey, - }; - }); + this.iotDeviceService.resetHttpDeviceApiKey(this.device.id).subscribe(response => { + this.device = { + ...this.device, + apiKey: response.apiKey, + }; + }); } }); } diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component.html index 6aa1198ec..b1c04d548 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component.html @@ -1,11 +1,38 @@ -

      {{ 'IOTDEVICE.MQTT.URL' | translate }}{{ device.mqttExternalBrokerSettings.mqttURL }}

      -

      {{ 'IOTDEVICE.MQTT.PORT' | translate }}{{ device.mqttExternalBrokerSettings.mqttPort }}

      -

      {{ 'IOTDEVICE.MQTT.TOPIC_NAME' | translate }}{{ device.mqttExternalBrokerSettings.mqtttopicname }}

      - -

      {{ 'QUESTION.MQTT.USERNAME-LABEL' | translate }}{{ device.mqttExternalBrokerSettings.mqttusername }}

      +

      + {{ "IOTDEVICE.MQTT.URL" | translate }}{{ device.mqttExternalBrokerSettings.mqttURL }} +

      +

      + {{ "IOTDEVICE.MQTT.PORT" | translate }}{{ device.mqttExternalBrokerSettings.mqttPort }} +

      +

      + {{ "IOTDEVICE.MQTT.TOPIC_NAME" | translate }}{{ device.mqttExternalBrokerSettings.mqtttopicname }} +

      + +

      + {{ "QUESTION.MQTT.USERNAME-LABEL" | translate }}{{ device.mqttExternalBrokerSettings.mqttusername }} +

      -

      {{ 'QUESTION.MQTT.CA-CERTIFICATE' | translate }}

      -

      {{ 'QUESTION.MQTT.DEVICE-CERTIFICATE' | translate }}

      -

      {{ 'QUESTION.MQTT.DEVICE-CERTIFICATE-KEY' | translate }}

      +

      + {{ "QUESTION.MQTT.CA-CERTIFICATE" | translate }} +

      +

      + {{ "QUESTION.MQTT.DEVICE-CERTIFICATE" | translate }} +

      +

      + {{ "QUESTION.MQTT.DEVICE-CERTIFICATE-KEY" | translate }} +

      diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component.ts index e74f503fb..2e28baef9 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component.ts @@ -1,11 +1,11 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { AuthenticationType } from '@shared/enums/authentication-type'; +import { Component, Input, OnInit } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { AuthenticationType } from "@shared/enums/authentication-type"; @Component({ - selector: 'app-iot-device-details-mqtt-external-broker', - templateUrl: './iot-device-details-mqtt-external-broker.component.html', - styleUrls: ['./iot-device-details-mqtt-external-broker.component.scss'], + selector: "app-iot-device-details-mqtt-external-broker", + templateUrl: "./iot-device-details-mqtt-external-broker.component.html", + styleUrls: ["./iot-device-details-mqtt-external-broker.component.scss"], }) export class IotDeviceDetailsMqttExternalBrokerComponent implements OnInit { @Input() device: IotDevice; diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component.html index cf321b63f..8094c461e 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component.html @@ -1,23 +1,61 @@ -

      {{ 'IOTDEVICE.MQTT.URL' | translate }}{{ device.mqttInternalBrokerSettings.mqttURL }}

      -

      {{ 'IOTDEVICE.MQTT.PORT' | translate }}{{ device.mqttInternalBrokerSettings.mqttPort }}

      -

      {{ 'IOTDEVICE.MQTT.TOPIC_NAME' | translate }}{{device.mqttInternalBrokerSettings.mqtttopicname}}

      +

      + {{ "IOTDEVICE.MQTT.URL" | translate }}{{ device.mqttInternalBrokerSettings.mqttURL }} +

      +

      + {{ "IOTDEVICE.MQTT.PORT" | translate }}{{ device.mqttInternalBrokerSettings.mqttPort }} +

      +

      + {{ "IOTDEVICE.MQTT.TOPIC_NAME" | translate }}{{ device.mqttInternalBrokerSettings.mqtttopicname }} +

      -

      {{ 'QUESTION.MQTT.USERNAME-LABEL' | translate }}{{ device.mqttInternalBrokerSettings.mqttusername }}

      +

      + {{ "QUESTION.MQTT.USERNAME-LABEL" | translate }}{{ device.mqttInternalBrokerSettings.mqttusername }} +

      -

      {{ 'QUESTION.MQTT.CA-CERTIFICATE' | translate }} - - -

      +

      + {{ "QUESTION.MQTT.CA-CERTIFICATE" | translate }} + + + +

      -

      {{ 'QUESTION.MQTT.DEVICE-CERTIFICATE' | translate }} - - - +

      + {{ "QUESTION.MQTT.DEVICE-CERTIFICATE" | translate }} + + +

      -

      {{ 'QUESTION.MQTT.DEVICE-CERTIFICATE-KEY' | translate }} - - - +

      + {{ "QUESTION.MQTT.DEVICE-CERTIFICATE-KEY" | translate }} + + +

      diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component.ts index 03a0c5312..726536290 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component.ts @@ -1,12 +1,12 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { AuthenticationType } from '@shared/enums/authentication-type'; -import { simpleDownload } from '@shared/helpers/download.helper'; +import { Component, Input, OnInit } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { AuthenticationType } from "@shared/enums/authentication-type"; +import { simpleDownload } from "@shared/helpers/download.helper"; @Component({ - selector: 'app-iot-device-details-mqtt-internal-broker', - templateUrl: './iot-device-details-mqtt-internal-broker.component.html', - styleUrls: ['./iot-device-details-mqtt-internal-broker.component.scss'], + selector: "app-iot-device-details-mqtt-internal-broker", + templateUrl: "./iot-device-details-mqtt-internal-broker.component.html", + styleUrls: ["./iot-device-details-mqtt-internal-broker.component.scss"], }) export class IotDeviceDetailsMqttInternalBrokerComponent implements OnInit { @Input() device: IotDevice; diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component.html index 1f4c4401a..9e9ea0570 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component.html @@ -1,5 +1,5 @@
      - +
      diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component.ts index 5af0a2a01..953842227 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-details-tab/iot-device-details-tab.component.ts @@ -1,11 +1,11 @@ -import { Component, OnInit } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { IotDeviceDetailsService } from '@applications/iot-devices/iot-device-details-service'; +import { Component, OnInit } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { IotDeviceDetailsService } from "@applications/iot-devices/iot-device-details-service"; @Component({ - selector: 'app-iot-device-details-tab', - templateUrl: './iot-device-details-tab.component.html', - styleUrls: ['./iot-device-details-tab.component.scss'], + selector: "app-iot-device-details-tab", + templateUrl: "./iot-device-details-tab.component.html", + styleUrls: ["./iot-device-details-tab.component.scss"], }) export class IotDeviceDetailsTabComponent implements OnInit { device: IotDevice; diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-downlink-tab/iot-device-downlink-tab.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-downlink-tab/iot-device-downlink-tab.component.ts index 830b9f9b4..e604919ec 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-downlink-tab/iot-device-downlink-tab.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-downlink-tab/iot-device-downlink-tab.component.ts @@ -1,11 +1,11 @@ -import { Component, OnInit } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { IotDeviceDetailsService } from '@applications/iot-devices/iot-device-details-service'; +import { Component, OnInit } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { IotDeviceDetailsService } from "@applications/iot-devices/iot-device-details-service"; @Component({ - selector: 'app-iot-device-downlink-tab', - templateUrl: './iot-device-downlink-tab.component.html', - styleUrls: ['./iot-device-downlink-tab.component.scss'], + selector: "app-iot-device-downlink-tab", + templateUrl: "./iot-device-downlink-tab.component.html", + styleUrls: ["./iot-device-downlink-tab.component.scss"], }) export class IotDeviceDownlinkTabComponent implements OnInit { device: IotDevice; diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component.html b/src/app/applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component.html index 8829281b7..366a2331c 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component.html @@ -2,20 +2,33 @@
      - +
      - +
      - +
      @@ -23,7 +36,7 @@

      - {{ 'IOTDEVICE.HISTORY-TAB.HISTORY-NOT-SUPPORTED' | translate }} + {{ "IOTDEVICE.HISTORY-TAB.HISTORY-NOT-SUPPORTED" | translate }}

      diff --git a/src/app/applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component.ts b/src/app/applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component.ts index df44ef648..7726bdc45 100644 --- a/src/app/applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component.ts +++ b/src/app/applications/iot-devices/iot-device-detail/iot-device-history-tab/iot-device-history-tab.component.ts @@ -1,54 +1,42 @@ -import { Component, OnInit } from '@angular/core'; -import { IotDeviceDetailsService } from '@applications/iot-devices/iot-device-details-service'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { DeviceType } from '@shared/enums/device-type'; -import { ChartConfiguration } from 'chart.js'; -import moment from 'moment/moment'; -import { ColorGraphBlue1 } from '@shared/constants/color-constants'; -import { recordToEntries } from '@shared/helpers/record.helper'; -import { IoTDeviceService } from '@applications/iot-devices/iot-device.service'; +import { Component, OnInit } from "@angular/core"; +import { IotDeviceDetailsService } from "@applications/iot-devices/iot-device-details-service"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { DeviceType } from "@shared/enums/device-type"; +import { ChartConfiguration } from "chart.js"; +import moment from "moment/moment"; +import { ColorGraphBlue1 } from "@shared/constants/color-constants"; +import { recordToEntries } from "@shared/helpers/record.helper"; +import { IoTDeviceService } from "@applications/iot-devices/iot-device.service"; /** * Ordered from "worst" to "best" (from DR0 and up) */ -const dataRateColors = [ - '#F57A2F', - '#FFA620', - '#F6CE06', - '#FFEB3B', - '#CDDC39', - '#93E528', - '#72D144', - '#56B257', -]; +const dataRateColors = ["#F57A2F", "#FFA620", "#F6CE06", "#FFEB3B", "#CDDC39", "#93E528", "#72D144", "#56B257"]; @Component({ - selector: 'app-iot-device-history-tab', - templateUrl: './iot-device-history-tab.component.html', - styleUrls: ['./iot-device-history-tab.component.scss'], + selector: "app-iot-device-history-tab", + templateUrl: "./iot-device-history-tab.component.html", + styleUrls: ["./iot-device-history-tab.component.scss"], }) export class IotDeviceHistoryTabComponent implements OnInit { device: IotDevice; - dataRateChartData: ChartConfiguration['data'] = { datasets: [] }; - rssiChartData: ChartConfiguration['data'] = { datasets: [] }; - snrChartData: ChartConfiguration['data'] = { datasets: [] }; + dataRateChartData: ChartConfiguration["data"] = { datasets: [] }; + rssiChartData: ChartConfiguration["data"] = { datasets: [] }; + snrChartData: ChartConfiguration["data"] = { datasets: [] }; - dataRateChartOptions: ChartConfiguration['options'] = { + dataRateChartOptions: ChartConfiguration["options"] = { scales: { x: { stacked: true }, y: { stacked: true }, }, plugins: { tooltip: { - mode: 'index', - position: 'average', + mode: "index", + position: "average", }, }, }; - constructor( - private iotDeviceDetailsService: IotDeviceDetailsService, - private iotDeviceService: IoTDeviceService - ) {} + constructor(private iotDeviceDetailsService: IotDeviceDetailsService, private iotDeviceService: IoTDeviceService) {} ngOnInit(): void { this.device = this.iotDeviceDetailsService.device; @@ -56,31 +44,23 @@ export class IotDeviceHistoryTabComponent implements OnInit { } private getDeviceStats(): void { - if ( - this.device?.type !== DeviceType.LORAWAN && - this.device?.type !== DeviceType.SIGFOX - ) { + if (this.device?.type !== DeviceType.LORAWAN && this.device?.type !== DeviceType.SIGFOX) { return; } this.iotDeviceService.getDeviceStats(this.device.id).subscribe( - (response) => { + response => { if (!response) { return; } - const { - rssiDatasets, - snrDatasets, - dataRateDatasets, - labels, - } = response.reduce( + const { rssiDatasets, snrDatasets, dataRateDatasets, labels } = response.reduce( ( res: { - rssiDatasets: ChartConfiguration['data']['datasets']; - snrDatasets: ChartConfiguration['data']['datasets']; - dataRateDatasets: ChartConfiguration['data']['datasets']; - labels: ChartConfiguration['data']['labels']; + rssiDatasets: ChartConfiguration["data"]["datasets"]; + snrDatasets: ChartConfiguration["data"]["datasets"]; + dataRateDatasets: ChartConfiguration["data"]["datasets"]; + labels: ChartConfiguration["data"]["labels"]; }, data ) => { @@ -89,7 +69,7 @@ export class IotDeviceHistoryTabComponent implements OnInit { res.snrDatasets[0].data.push(data.snr || null); this.addDataRate(res.dataRateDatasets, data.rxPacketsPerDr); - res.labels.push(moment(data.timestamp).format('MMM D')); + res.labels.push(moment(data.timestamp).format("MMM D")); return res; }, { @@ -119,11 +99,11 @@ export class IotDeviceHistoryTabComponent implements OnInit { this.snrChartData = { datasets: snrDatasets, labels }; this.dataRateChartData = { datasets: dataRateDatasets, labels }; }, - (_error) => {} + _error => {} ); } - private initDataRates(): ChartConfiguration['data']['datasets'] { + private initDataRates(): ChartConfiguration["data"]["datasets"] { return dataRateColors.map((color, i) => ({ data: [], label: i.toString(), @@ -132,34 +112,27 @@ export class IotDeviceHistoryTabComponent implements OnInit { })); } - private addDataRate( - datasets: ChartConfiguration['data']['datasets'], - dataRate: Record | undefined - ) { + private addDataRate(datasets: ChartConfiguration["data"]["datasets"], dataRate: Record | undefined) { if (!dataRate) { return; } const dataRateList = recordToEntries(dataRate, false); - datasets.forEach((dataset) => { + datasets.forEach(dataset => { if (!dataRateList.length) { dataset.data.push(0); return; } - const match = dataRateList.find( - (record) => record.key.toString() === dataset.label - ); + const match = dataRateList.find(record => record.key.toString() === dataset.label); match ? dataset.data.push(match.value) : dataset.data.push(0); }); } - private removeEmptyDatasets( - datasets: ChartConfiguration['data']['datasets'] - ): void { + private removeEmptyDatasets(datasets: ChartConfiguration["data"]["datasets"]): void { for (let i = datasets.length - 1; i >= 0; i--) { const dataset = datasets[i]; - if (!dataset.data.some((point) => point !== 0)) { + if (!dataset.data.some(point => point !== 0)) { datasets.splice(i, 1); } } diff --git a/src/app/applications/iot-devices/iot-device-details-service.ts b/src/app/applications/iot-devices/iot-device-details-service.ts index a5c16e25c..67aa8da58 100644 --- a/src/app/applications/iot-devices/iot-device-details-service.ts +++ b/src/app/applications/iot-devices/iot-device-details-service.ts @@ -1,7 +1,7 @@ -import { Injectable } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; +import { Injectable } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; -@Injectable({ providedIn: 'root' }) +@Injectable({ providedIn: "root" }) export class IotDeviceDetailsService { device: IotDevice; latitude: number; diff --git a/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.html b/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.html index 6094bf137..d61f94a6f 100644 --- a/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.html +++ b/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.html @@ -1,32 +1,56 @@ - +
      • - {{error | translate}} + {{ error | translate }}
      -
      +
      @@ -55,91 +95,180 @@
      - * - + * +
      - - {{application.name}} + + {{ application.name }}
      - - + +
      - +
      -

      {{'DBLCLICKINFO' | translate}}

      +

      {{ "DBLCLICKINFO" | translate }}

      - - + +
      - - + +
      - - + +
      - - + + - {{'QUESTION.DEVICE-MODEL-SELECT-NON' | translate }} + {{ "QUESTION.DEVICE-MODEL-SELECT-NON" | translate }} - {{deviceModel.body.name}} + {{ deviceModel.body.name }}
      -
      -

      {{'IOTDEVICE.LORAWANSETUP' | translate}}

      +

      {{ "IOTDEVICE.LORAWANSETUP" | translate }}

      - - + +
      - * - +
      @@ -147,70 +276,123 @@

      {{'IOTDEVICE.LORAWANSETUP' | translate}}

      -

      {{'QUESTION.OTAA' | translate}}

      -

      {{'QUESTION.OTAA-ABP-CONFIG-HELP' | translate}}

      +

      {{ "QUESTION.OTAA" | translate }}

      +

      {{ "QUESTION.OTAA-ABP-CONFIG-HELP" | translate }}

      - - + +
      -

      {{'QUESTION.ABP' | translate}}

      -

      {{'QUESTION.OTAA-ABP-CONFIG-HELP' | translate}}

      +

      {{ "QUESTION.ABP" | translate }}

      +

      {{ "QUESTION.OTAA-ABP-CONFIG-HELP" | translate }}

      - - + +
      - - + +
      - - + +
      - +
      - - + +
      - +
      - {{'QUESTION.SKIPFCNTCHECK-YES' | translate}} + {{ "QUESTION.SKIPFCNTCHECK-YES" | translate }}
      @@ -226,17 +408,17 @@

      {{'QUESTION.ABP' | translate}}

      [iotDevice]="iotDevice" [errorFields]="errorFields" [formFailedSubmit]="formFailedSubmit" - [editMode]="editmode"> + [editMode]="editmode" + >
      -

      {{ "QUESTION.METADATA" | translate}}

      - - +

      {{ "QUESTION.METADATA" | translate }}

      +
      - - + +
      diff --git a/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.spec.ts b/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.spec.ts index 461449ee2..7bda1d79e 100644 --- a/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.spec.ts +++ b/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { IotDeviceEditComponent } from './iot-device-edit.component'; +import { IotDeviceEditComponent } from "./iot-device-edit.component"; -describe('IotDeviceEditComponent', () => { +describe("IotDeviceEditComponent", () => { let component: IotDeviceEditComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [IotDeviceEditComponent] - }) - .compileComponents(); + declarations: [IotDeviceEditComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('IotDeviceEditComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.ts b/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.ts index a4126d51f..1e561111a 100644 --- a/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.ts +++ b/src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.ts @@ -24,327 +24,327 @@ import { MeService } from "@shared/services/me.service"; import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: "app-iot-device-edit", - templateUrl: "./iot-device-edit.component.html", - styleUrls: ["./iot-device-edit.component.scss"], + selector: "app-iot-device-edit", + templateUrl: "./iot-device-edit.component.html", + styleUrls: ["./iot-device-edit.component.scss"], }) export class IotDeviceEditComponent implements OnInit, OnDestroy { - public errorMessages: any; - public errorFields: string[]; - public formFailedSubmit = false; - public application: Application; - private deviceId: number; - public disableChoseApplication = true; - public loraDevice = DeviceType.LORAWAN; - public sigfoxDevice = DeviceType.SIGFOX; - public deviceProfiles: DeviceProfile[]; - public deviceModels: DeviceModel[]; - iotDevice = new IotDevice(); - editmode = false; - public OTAA = true; - metadataTags: { key?: string; value?: string }[] = []; - errorMetadataFieldId: string | undefined; - public deviceSubscription: Subscription; - private applicationsSubscription: Subscription; - private deviceProfileSubscription: Subscription; - private devicesProfileSubscription: Subscription; - canEdit: boolean; - - constructor( - private route: ActivatedRoute, - public translate: TranslateService, - private router: Router, - private deviceProfileService: DeviceProfileService, - private applicationService: ApplicationService, - private iotDeviceService: IoTDeviceService, - private location: Location, - private shareVariable: SharedVariableService, - private deviceModelService: DeviceModelService, - private errorMessageService: ErrorMessageService, - private scrollToTopService: ScrollToTopService, - private titleService: Title, - private meService: MeService - ) {} - - ngOnInit(): void { - this.translate.use("da"); - this.iotDevice.applicationId = +this.route.snapshot.paramMap.get("id"); - this.deviceId = +this.route.snapshot.paramMap.get("deviceId"); - - if (this.iotDevice.applicationId && this.deviceId) { - this.editmode = true; - this.getDevice(this.deviceId); - this.disableChoseApplication = false; - } - - this.translate.get(["TITLE.IOTDEVICE"]).subscribe(translations => { - this.titleService.setTitle(translations["TITLE.IOTDEVICE"]); - }); - - this.getApplication(); - this.getDeviceProfiles(); - this.getDeviceModels(); - this.canEdit = this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.ApplicationWrite, - undefined, - this.iotDevice.applicationId - ); - } - - public compare(o1: any, o2: any): boolean { - return o1 === o2; - } - - getDeviceModels() { - this.deviceModelService - .getMultiple(1000, 0, "id", "ASC", this.shareVariable.getSelectedOrganisationId()) - .subscribe(response => { - this.deviceModels = response.data.sort((a, b) => - a.body.name.localeCompare(b.body.name, "en", { numeric: true }) - ); - }); - } - - getApplication(): void { - this.applicationsSubscription = this.applicationService - .getApplication(this.iotDevice.applicationId) - .subscribe((application: Application) => { - this.application = application; - }); - } - - isChecked(event) { - if (event.target.checked) { - this.iotDevice.type = event.target.name; - } else if (!event.target.checked && this.iotDevice.type.toString().includes(event.target.name)) { - event.target.checked = true; - } + public errorMessages: any; + public errorFields: string[]; + public formFailedSubmit = false; + public application: Application; + private deviceId: number; + public disableChoseApplication = true; + public loraDevice = DeviceType.LORAWAN; + public sigfoxDevice = DeviceType.SIGFOX; + public deviceProfiles: DeviceProfile[]; + public deviceModels: DeviceModel[]; + iotDevice = new IotDevice(); + editmode = false; + public OTAA = true; + metadataTags: { key?: string; value?: string }[] = []; + errorMetadataFieldId: string | undefined; + public deviceSubscription: Subscription; + private applicationsSubscription: Subscription; + private deviceProfileSubscription: Subscription; + private devicesProfileSubscription: Subscription; + canEdit: boolean; + + constructor( + private route: ActivatedRoute, + public translate: TranslateService, + private router: Router, + private deviceProfileService: DeviceProfileService, + private applicationService: ApplicationService, + private iotDeviceService: IoTDeviceService, + private location: Location, + private shareVariable: SharedVariableService, + private deviceModelService: DeviceModelService, + private errorMessageService: ErrorMessageService, + private scrollToTopService: ScrollToTopService, + private titleService: Title, + private meService: MeService + ) {} + + ngOnInit(): void { + this.translate.use("da"); + this.iotDevice.applicationId = +this.route.snapshot.paramMap.get("id"); + this.deviceId = +this.route.snapshot.paramMap.get("deviceId"); + + if (this.iotDevice.applicationId && this.deviceId) { + this.editmode = true; + this.getDevice(this.deviceId); + this.disableChoseApplication = false; } - getDevice(id: number): void { - this.deviceSubscription = this.iotDeviceService.getIoTDevice(id).subscribe((device: IotDevice) => { - this.iotDevice = device; - if (this.iotDevice?.application?.id) { - this.iotDevice.applicationId = device.application?.id; - } - if (device.location) { - this.iotDevice.longitude = device.location.coordinates[0]; - this.iotDevice.latitude = device.location.coordinates[1]; - } - this.OTAA = this.iotDevice.lorawanSettings?.OTAAapplicationKey ? true : false; - if (device.sigfoxSettings) { - } - if (!device.deviceModelId || device.deviceModelId === null) { - this.iotDevice.deviceModelId = 0; - } - if (device.metadata) { - this.metadataTags = jsonToList(device.metadata); - } - }); - } - - onChangeDeviceProfile(deviceProfileId: string) { - this.getDeviceProfile(deviceProfileId); + this.translate.get(["TITLE.IOTDEVICE"]).subscribe(translations => { + this.titleService.setTitle(translations["TITLE.IOTDEVICE"]); + }); + + this.getApplication(); + this.getDeviceProfiles(); + this.getDeviceModels(); + this.canEdit = this.meService.hasAccessToTargetOrganization( + OrganizationAccessScope.ApplicationWrite, + undefined, + this.iotDevice.applicationId + ); + } + + public compare(o1: any, o2: any): boolean { + return o1 === o2; + } + + getDeviceModels() { + this.deviceModelService + .getMultiple(1000, 0, "id", "ASC", this.shareVariable.getSelectedOrganisationId()) + .subscribe(response => { + this.deviceModels = response.data.sort((a, b) => + a.body.name.localeCompare(b.body.name, "en", { numeric: true }) + ); + }); + } + + getApplication(): void { + this.applicationsSubscription = this.applicationService + .getApplication(this.iotDevice.applicationId) + .subscribe((application: Application) => { + this.application = application; + }); + } + + isChecked(event) { + if (event.target.checked) { + this.iotDevice.type = event.target.name; + } else if (!event.target.checked && this.iotDevice.type.toString().includes(event.target.name)) { + event.target.checked = true; } - - getDeviceProfile(deviceProfileId: string) { - this.deviceProfileSubscription = this.deviceProfileService.getOne(deviceProfileId).subscribe(response => { - this.OTAA = response.deviceProfile.supportsJoin; - }); + } + + getDevice(id: number): void { + this.deviceSubscription = this.iotDeviceService.getIoTDevice(id).subscribe((device: IotDevice) => { + this.iotDevice = device; + if (this.iotDevice?.application?.id) { + this.iotDevice.applicationId = device.application?.id; + } + if (device.location) { + this.iotDevice.longitude = device.location.coordinates[0]; + this.iotDevice.latitude = device.location.coordinates[1]; + } + this.OTAA = this.iotDevice.lorawanSettings?.OTAAapplicationKey ? true : false; + if (device.sigfoxSettings) { + } + if (!device.deviceModelId || device.deviceModelId === null) { + this.iotDevice.deviceModelId = 0; + } + if (device.metadata) { + this.metadataTags = jsonToList(device.metadata); + } + }); + } + + onChangeDeviceProfile(deviceProfileId: string) { + this.getDeviceProfile(deviceProfileId); + } + + getDeviceProfile(deviceProfileId: string) { + this.deviceProfileSubscription = this.deviceProfileService.getOne(deviceProfileId).subscribe(response => { + this.OTAA = response.deviceProfile.supportsJoin; + }); + } + + getDeviceProfiles() { + this.devicesProfileSubscription = this.deviceProfileService.getMultiple().subscribe(result => { + this.deviceProfiles = result.result.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); + }); + } + + getCoordinates() { + return { + longitude: this.iotDevice.longitude, + latitude: this.iotDevice.latitude, + draggable: true, + editEnabled: false, + useGeolocation: !this.editmode, + }; + } + + updateCoordinates(event: any) { + this.iotDevice.longitude = event.longitude; + this.iotDevice.latitude = event.latitude; + } + + onSubmit(): void { + this.adjustModelBasedOnType(); + + if (this.metadataTags.length === 0) { + this.iotDevice.metadata = JSON.stringify({}); + } else if (this.isMetadataSet()) { + const invalidKey = this.validateMetadata(); + + if (!invalidKey) { + this.setMetadata(); + } else { + this.handleMetadataError(invalidKey); + return; + } } - getDeviceProfiles() { - this.devicesProfileSubscription = this.deviceProfileService.getMultiple().subscribe(result => { - this.deviceProfiles = result.result.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); - }); + if (this.deviceId !== 0) { + this.updateIoTDevice(this.deviceId); + } else { + this.postIoTDevice(); } - - getCoordinates() { - return { - longitude: this.iotDevice.longitude, - latitude: this.iotDevice.latitude, - draggable: true, - editEnabled: false, - useGeolocation: !this.editmode, - }; + } + + private handleMetadataError(invalidKey: string) { + this.handleError({ + error: { + message: [ + { + field: "metadata", + message: "MESSAGE.DUPLICATE-METADATA-KEY", + }, + ], + }, + }); + this.errorMetadataFieldId = invalidKey; + this.formFailedSubmit = true; + } + + setActivationType() { + if (this.OTAA) { + this.iotDevice.lorawanSettings.activationType = ActivationType.OTAA; + } else { + this.iotDevice.lorawanSettings.activationType = ActivationType.ABP; } + } - updateCoordinates(event: any) { - this.iotDevice.longitude = event.longitude; - this.iotDevice.latitude = event.latitude; + private adjustModelBasedOnType() { + if (this.iotDevice.deviceModelId === 0) { + this.iotDevice.deviceModelId = null; } - - onSubmit(): void { - this.adjustModelBasedOnType(); - - if (this.metadataTags.length === 0) { - this.iotDevice.metadata = JSON.stringify({}); - } else if (this.isMetadataSet()) { - const invalidKey = this.validateMetadata(); - - if (!invalidKey) { - this.setMetadata(); - } else { - this.handleMetadataError(invalidKey); - return; - } + switch (this.iotDevice.type) { + case DeviceType.GENERIC_HTTP: { + this.iotDevice.lorawanSettings = undefined; + this.iotDevice.sigfoxSettings = undefined; + break; + } + case DeviceType.LORAWAN: { + this.setActivationType(); + this.iotDevice.sigfoxSettings = undefined; + if (this.iotDevice.lorawanSettings.devEUI) { + this.iotDevice.lorawanSettings.devEUI = this.iotDevice.lorawanSettings.devEUI.toLowerCase(); } - - if (this.deviceId !== 0) { - this.updateIoTDevice(this.deviceId); - } else { - this.postIoTDevice(); + break; + } + case DeviceType.SIGFOX: { + this.iotDevice.lorawanSettings = undefined; + if (this.iotDevice.sigfoxSettings.endProductCertificate) { + this.iotDevice.sigfoxSettings.prototype = false; } + break; + } } + } - private handleMetadataError(invalidKey: string) { - this.handleError({ - error: { - message: [ - { - field: "metadata", - message: "MESSAGE.DUPLICATE-METADATA-KEY", - }, - ], - }, - }); - this.errorMetadataFieldId = invalidKey; - this.formFailedSubmit = true; - } + private isMetadataSet(): boolean { + return this.metadataTags.length && this.metadataTags.some(tag => tag.key && tag.value); + } - setActivationType() { - if (this.OTAA) { - this.iotDevice.lorawanSettings.activationType = ActivationType.OTAA; - } else { - this.iotDevice.lorawanSettings.activationType = ActivationType.ABP; - } - } - - private adjustModelBasedOnType() { - if (this.iotDevice.deviceModelId === 0) { - this.iotDevice.deviceModelId = null; - } - switch (this.iotDevice.type) { - case DeviceType.GENERIC_HTTP: { - this.iotDevice.lorawanSettings = undefined; - this.iotDevice.sigfoxSettings = undefined; - break; - } - case DeviceType.LORAWAN: { - this.setActivationType(); - this.iotDevice.sigfoxSettings = undefined; - if (this.iotDevice.lorawanSettings.devEUI) { - this.iotDevice.lorawanSettings.devEUI = this.iotDevice.lorawanSettings.devEUI.toLowerCase(); - } - break; - } - case DeviceType.SIGFOX: { - this.iotDevice.lorawanSettings = undefined; - if (this.iotDevice.sigfoxSettings.endProductCertificate) { - this.iotDevice.sigfoxSettings.prototype = false; - } - break; - } - } - } + private validateMetadata(): string | undefined { + const seen = new Set(); - private isMetadataSet(): boolean { - return this.metadataTags.length && this.metadataTags.some(tag => tag.key && tag.value); + for (const tag of this.metadataTags) { + if (seen.size === seen.add(tag.key).size) { + return tag.key; + } } - - private validateMetadata(): string | undefined { - const seen = new Set(); - - for (const tag of this.metadataTags) { - if (seen.size === seen.add(tag.key).size) { - return tag.key; - } + } + + private setMetadata(): void { + if (this.metadataTags.length && this.metadataTags.some(tag => tag.key && tag.value)) { + const metadata: Record = {}; + this.metadataTags.forEach(tag => { + if (!tag.key) { + return; } + metadata[tag.key] = tag.value; + }); + this.iotDevice.metadata = JSON.stringify(metadata); } + } - private setMetadata(): void { - if (this.metadataTags.length && this.metadataTags.some(tag => tag.key && tag.value)) { - const metadata: Record = {}; - this.metadataTags.forEach(tag => { - if (!tag.key) { - return; - } - metadata[tag.key] = tag.value; - }); - this.iotDevice.metadata = JSON.stringify(metadata); - } + postIoTDevice() { + // Sanitize devEUI for non-hex characters + if (this.iotDevice.type === DeviceType.LORAWAN && this.iotDevice.lorawanSettings.devEUI) { + this.iotDevice.lorawanSettings.devEUI = this.iotDevice.lorawanSettings.devEUI.replace(/[^0-9A-Fa-f]/g, ""); } - postIoTDevice() { - // Sanitize devEUI for non-hex characters - if (this.iotDevice.type === DeviceType.LORAWAN && this.iotDevice.lorawanSettings.devEUI) { - this.iotDevice.lorawanSettings.devEUI = this.iotDevice.lorawanSettings.devEUI.replace(/[^0-9A-Fa-f]/g, ""); - } - - this.iotDeviceService.createIoTDevice(this.iotDevice).subscribe( - (response: IotDevice) => { - this.router.navigate([ - "applications/" + this.iotDevice.applicationId + "/iot-device/" + response.id + "/details", - ]); - }, - (error: HttpErrorResponse) => { - this.handleError(error); - this.formFailedSubmit = true; - } - ); + this.iotDeviceService.createIoTDevice(this.iotDevice).subscribe( + (response: IotDevice) => { + this.router.navigate([ + "applications/" + this.iotDevice.applicationId + "/iot-device/" + response.id + "/details", + ]); + }, + (error: HttpErrorResponse) => { + this.handleError(error); + this.formFailedSubmit = true; + } + ); + } + + updateIoTDevice(id: number) { + this.iotDevice.applicationId = Number(this.iotDevice.applicationId); + this.iotDeviceService.updateIoTDevice(this.iotDevice, id).subscribe( + () => { + this.routeBack(); + }, + (error: HttpErrorResponse) => { + this.handleError(error); + this.formFailedSubmit = true; + } + ); + } + + routeBack(): void { + this.location.back(); + } + + handleError(error: Pick) { + if (error?.error?.message === "MESSAGE.OTAA-INFO-MISSING") { + this.errorFields = ["OTAAapplicationKey"]; + this.errorMessages = [error?.error?.message]; + } else if (error?.error?.message === "MESSAGE.ID-INVALID-OR-ALREADY-IN-USE") { + this.errorFields = ["devEUI"]; + this.errorMessages = [error?.error?.message]; + } else { + const errorMessage: ErrorMessage = this.errorMessageService.handleErrorMessageWithFields(error); + this.errorFields = errorMessage.errorFields; + this.errorMessages = errorMessage.errorMessages; } + this.scrollToTopService.scrollToTop(); + } - updateIoTDevice(id: number) { - this.iotDevice.applicationId = Number(this.iotDevice.applicationId); - this.iotDeviceService.updateIoTDevice(this.iotDevice, id).subscribe( - () => { - this.routeBack(); - }, - (error: HttpErrorResponse) => { - this.handleError(error); - this.formFailedSubmit = true; - } - ); + onCoordinateKey(event: any) { + if (event.target.value.length > event.target.maxLength) { + event.target.value = event.target.value.slice(0, event.target.maxLength); } + } - routeBack(): void { - this.location.back(); + ngOnDestroy() { + // prevent memory leak by unsubscribing + if (this.applicationsSubscription) { + this.applicationsSubscription.unsubscribe(); } - - handleError(error: Pick) { - if (error?.error?.message === "MESSAGE.OTAA-INFO-MISSING") { - this.errorFields = ["OTAAapplicationKey"]; - this.errorMessages = [error?.error?.message]; - } else if (error?.error?.message === "MESSAGE.ID-INVALID-OR-ALREADY-IN-USE") { - this.errorFields = ["devEUI"]; - this.errorMessages = [error?.error?.message]; - } else { - const errorMessage: ErrorMessage = this.errorMessageService.handleErrorMessageWithFields(error); - this.errorFields = errorMessage.errorFields; - this.errorMessages = errorMessage.errorMessages; - } - this.scrollToTopService.scrollToTop(); + if (this.deviceSubscription) { + this.deviceSubscription.unsubscribe(); } - - onCoordinateKey(event: any) { - if (event.target.value.length > event.target.maxLength) { - event.target.value = event.target.value.slice(0, event.target.maxLength); - } + if (this.deviceProfileSubscription) { + this.deviceProfileSubscription.unsubscribe(); } - - ngOnDestroy() { - // prevent memory leak by unsubscribing - if (this.applicationsSubscription) { - this.applicationsSubscription.unsubscribe(); - } - if (this.deviceSubscription) { - this.deviceSubscription.unsubscribe(); - } - if (this.deviceProfileSubscription) { - this.deviceProfileSubscription.unsubscribe(); - } - if (this.devicesProfileSubscription) { - this.devicesProfileSubscription.unsubscribe(); - } + if (this.devicesProfileSubscription) { + this.devicesProfileSubscription.unsubscribe(); } + } } diff --git a/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-authentication-select/mqtt-authentication-select.component.html b/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-authentication-select/mqtt-authentication-select.component.html index eb30c3d8c..fea14de5e 100644 --- a/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-authentication-select/mqtt-authentication-select.component.html +++ b/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-authentication-select/mqtt-authentication-select.component.html @@ -1,26 +1,29 @@
      - +
      - + + matTooltipHideDelay="2000" + >
      - + + matTooltipHideDelay="2000" + >
      diff --git a/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-authentication-select/mqtt-authentication-select.component.ts b/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-authentication-select/mqtt-authentication-select.component.ts index 557c2f2ca..67d4cc19c 100644 --- a/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-authentication-select/mqtt-authentication-select.component.ts +++ b/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-authentication-select/mqtt-authentication-select.component.ts @@ -1,12 +1,12 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { AuthenticationType } from '@shared/enums/authentication-type'; -import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; -import { MqttSharedSettings } from '@shared/models/mqtt-shared-settings.model'; +import { Component, Input, OnInit } from "@angular/core"; +import { AuthenticationType } from "@shared/enums/authentication-type"; +import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons"; +import { MqttSharedSettings } from "@shared/models/mqtt-shared-settings.model"; @Component({ - selector: 'app-mqtt-authentication-select', - templateUrl: './mqtt-authentication-select.component.html', - styleUrls: ['./mqtt-authentication-select.component.scss'], + selector: "app-mqtt-authentication-select", + templateUrl: "./mqtt-authentication-select.component.html", + styleUrls: ["./mqtt-authentication-select.component.scss"], }) export class MqttAuthenticationSelectComponent implements OnInit { @Input() settings: MqttSharedSettings; diff --git a/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-device-edit.component.html b/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-device-edit.component.html index 5318ee5db..5806c0591 100644 --- a/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-device-edit.component.html +++ b/src/app/applications/iot-devices/iot-device-edit/mqtt-device-edit/mqtt-device-edit.component.html @@ -1,16 +1,17 @@
      -

      {{'QUESTION.MQTT.TITLE' | translate}}

      +

      {{ "QUESTION.MQTT.TITLE" | translate }}

      - + + matTooltipHideDelay="2000" + >
      @@ -36,7 +37,7 @@

      {{'QUESTION.MQTT.TITLE' | translate}}

      - + {{'QUESTION.MQTT.TITLE' | translate}}
      required [(ngModel)]="iotDevice.mqttExternalBrokerSettings.mqttURL" [ngClass]="{ - 'is-invalid': formFailedSubmit && errorFields.includes('mqttURL'), - 'is-valid': formFailedSubmit && !errorFields.includes('mqttURL') + 'is-invalid': formFailedSubmit && errorFields.includes('mqttURL'), + 'is-valid': formFailedSubmit && !errorFields.includes('mqttURL') }" />
      - + {{'QUESTION.MQTT.TITLE' | translate}} required [(ngModel)]="iotDevice.mqttExternalBrokerSettings.mqttPort" [ngClass]="{ - 'is-invalid': formFailedSubmit && errorFields.includes('mqttPort'), - 'is-valid': formFailedSubmit && !errorFields.includes('mqttPort') + 'is-invalid': formFailedSubmit && errorFields.includes('mqttPort'), + 'is-valid': formFailedSubmit && !errorFields.includes('mqttPort') }" />
      - + {{'QUESTION.MQTT.TITLE' | translate}} required [(ngModel)]="iotDevice.mqttExternalBrokerSettings.mqtttopicname" [ngClass]="{ - 'is-invalid': formFailedSubmit && errorFields.includes('mqtttopicname'), - 'is-valid': formFailedSubmit && !errorFields.includes('mqtttopicname') + 'is-invalid': formFailedSubmit && errorFields.includes('mqtttopicname'), + 'is-valid': formFailedSubmit && !errorFields.includes('mqtttopicname') }" />
      @@ -91,14 +92,15 @@

      {{'QUESTION.MQTT.TITLE' | translate}}

      >
      - + + matTooltipHideDelay="2000" + >
      - + + matTooltipHideDelay="2000" + >
      - + + matTooltipHideDelay="2000" + > -
      +
      + + +
      -
      - * - -
      +
      + * + +
      -
      - -
      +
      + +
      -
      -

      {{ "DBLCLICKINFO" | translate }}

      -

      {{ "HEIGHTCURVESINFO" | translate }}

      -
      +
      +

      {{ "DBLCLICKINFO" | translate }}

      +

      {{ "HEIGHTCURVESINFO" | translate }}

      +
      -
      -
      - - -
      -
      - - -
      +
      +
      + + +
      +
      + + +
      -
      - - -
      -
      - - - - {{ placementOption.label }} - - -
      -
      - - -
      -
      - - -
      -
      - - - - {{ statusOption.label }} - - -
      -
      - - -
      -
      - - -
      -
      - - -
      -
      - - -
      -
      - - -
      -
      -
      - - -
      +
      + + +
      +
      + + + + {{ placementOption.label }} + + +
      +
      + + +
      +
      + + +
      +
      + + + + {{ statusOption.label }} + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      - -
      - - +
      + +
      +
      + +
      + + +
      diff --git a/src/app/gateway/gateway-edit/gateway-edit.component.ts b/src/app/gateway/gateway-edit/gateway-edit.component.ts index dd9cdbdb9..6fbe19088 100644 --- a/src/app/gateway/gateway-edit/gateway-edit.component.ts +++ b/src/app/gateway/gateway-edit/gateway-edit.component.ts @@ -9,158 +9,158 @@ import { Subscription } from "rxjs"; import { ChirpstackGatewayService } from "src/app/shared/services/chirpstack-gateway.service"; import { Gateway, GatewayResponse } from "../gateway.model"; import { - GatewayPlacement, - GatewayPlacementEntries, - GatewaySetupStatus, - GatewayStatusEntries, + GatewayPlacement, + GatewayPlacementEntries, + GatewaySetupStatus, + GatewayStatusEntries, } from "@app/gateway/enums/gateway-status-interval.enum"; interface DropdownOption { - label: string; - value: string | number; + label: string; + value: string | number; } @Component({ - selector: "app-gateway-edit", - templateUrl: "./gateway-edit.component.html", - styleUrls: ["./gateway-edit.component.scss"], + selector: "app-gateway-edit", + templateUrl: "./gateway-edit.component.html", + styleUrls: ["./gateway-edit.component.scss"], }) export class GatewayEditComponent implements OnInit, OnDestroy { - public backButton: BackButton = { label: "", routerLink: ["gateways"] }; - public title = ""; - public submitButton = ""; - - public gatewaySubscription: Subscription; - public errorMessage: string; - public errorMessages: any; - public errorFields: string[]; - public formFailedSubmit = false; - public editMode = false; - private gatewayId: string; - - gateway = new Gateway(); - - placements: DropdownOption[] = []; - statuses: DropdownOption[] = []; - - constructor( - private route: ActivatedRoute, - public translate: TranslateService, - private router: Router, - private loraGatewayService: ChirpstackGatewayService, - private errorMessageService: ErrorMessageService, - private scrollToTopService: ScrollToTopService - ) {} - - ngOnInit(): void { - this.translate.use("da"); - this.gatewayId = this.route.snapshot.paramMap.get("id"); - if (this.gatewayId) { - this.getGateway(this.gatewayId); - this.editMode = true; - this.backButton.routerLink = ["gateways", "gateway-detail", this.gatewayId]; - } - this.translate.get(["NAV.LORA-GATEWAYS", "FORM.EDIT-NEW-GATEWAY", "GATEWAY.SAVE"]).subscribe(translations => { - this.backButton.label = translations["NAV.LORA-GATEWAYS"]; - this.title = translations["FORM.EDIT-NEW-GATEWAY"]; - this.submitButton = translations["GATEWAY.SAVE"]; - }); - - const placementTranslationPrefix = "GATEWAY.PLACEMENT."; - const placementTranslationKeys = GatewayPlacementEntries.map(x => placementTranslationPrefix + x.key); - const statusTranslationPrefix = "GATEWAY.STATUS."; - const statusTranslationKeys = GatewayStatusEntries.map(x => statusTranslationPrefix + x.key); - - this.translate.get([...statusTranslationKeys, ...placementTranslationKeys]).subscribe(translations => { - const placementOptions: DropdownOption[] = GatewayPlacementEntries.map(entry => ({ - label: translations[placementTranslationPrefix + entry.key], - value: GatewayPlacement[entry.key], - })); - this.placements.push(...placementOptions); - const statusOptions: DropdownOption[] = GatewayStatusEntries.map(entry => ({ - label: translations[statusTranslationPrefix + entry.key], - value: GatewaySetupStatus[entry.key], - })); - this.statuses.push(...statusOptions); - }); + public backButton: BackButton = { label: "", routerLink: ["gateways"] }; + public title = ""; + public submitButton = ""; + + public gatewaySubscription: Subscription; + public errorMessage: string; + public errorMessages: any; + public errorFields: string[]; + public formFailedSubmit = false; + public editMode = false; + private gatewayId: string; + + gateway = new Gateway(); + + placements: DropdownOption[] = []; + statuses: DropdownOption[] = []; + + constructor( + private route: ActivatedRoute, + public translate: TranslateService, + private router: Router, + private loraGatewayService: ChirpstackGatewayService, + private errorMessageService: ErrorMessageService, + private scrollToTopService: ScrollToTopService + ) {} + + ngOnInit(): void { + this.translate.use("da"); + this.gatewayId = this.route.snapshot.paramMap.get("id"); + if (this.gatewayId) { + this.getGateway(this.gatewayId); + this.editMode = true; + this.backButton.routerLink = ["gateways", "gateway-detail", this.gatewayId]; } - - getGateway(gatewayId: string): void { - this.gatewaySubscription = this.loraGatewayService.get(gatewayId).subscribe((result: GatewayResponse) => { - this.gateway = result.gateway; - }); - } - - getCoordinates() { - return { - longitude: this.gateway.location.longitude, - latitude: this.gateway.location.latitude, - draggable: true, - useGeolocation: !this.editMode, - editMode: this.editMode, - }; - } - - createGateway(): void { - this.gateway.gatewayId = this.gateway.gatewayId?.replace(/[^0-9A-Fa-f]/g, ""); - this.loraGatewayService.post(this.gateway).subscribe( - response => { - this.routeBack(); - }, - (error: HttpErrorResponse) => { - this.showError(error); - this.formFailedSubmit = true; - } - ); - } - - updateGateway(): void { - // Gateway ID not allowed in update. - this.gateway.gatewayId = undefined; - this.loraGatewayService.put(this.gateway, this.gatewayId).subscribe( - response => { - this.routeBack(); - }, - error => { - this.showError(error); - this.formFailedSubmit = true; - } - ); + this.translate.get(["NAV.LORA-GATEWAYS", "FORM.EDIT-NEW-GATEWAY", "GATEWAY.SAVE"]).subscribe(translations => { + this.backButton.label = translations["NAV.LORA-GATEWAYS"]; + this.title = translations["FORM.EDIT-NEW-GATEWAY"]; + this.submitButton = translations["GATEWAY.SAVE"]; + }); + + const placementTranslationPrefix = "GATEWAY.PLACEMENT."; + const placementTranslationKeys = GatewayPlacementEntries.map(x => placementTranslationPrefix + x.key); + const statusTranslationPrefix = "GATEWAY.STATUS."; + const statusTranslationKeys = GatewayStatusEntries.map(x => statusTranslationPrefix + x.key); + + this.translate.get([...statusTranslationKeys, ...placementTranslationKeys]).subscribe(translations => { + const placementOptions: DropdownOption[] = GatewayPlacementEntries.map(entry => ({ + label: translations[placementTranslationPrefix + entry.key], + value: GatewayPlacement[entry.key], + })); + this.placements.push(...placementOptions); + const statusOptions: DropdownOption[] = GatewayStatusEntries.map(entry => ({ + label: translations[statusTranslationPrefix + entry.key], + value: GatewaySetupStatus[entry.key], + })); + this.statuses.push(...statusOptions); + }); + } + + getGateway(gatewayId: string): void { + this.gatewaySubscription = this.loraGatewayService.get(gatewayId).subscribe((result: GatewayResponse) => { + this.gateway = result.gateway; + }); + } + + getCoordinates() { + return { + longitude: this.gateway.location.longitude, + latitude: this.gateway.location.latitude, + draggable: true, + useGeolocation: !this.editMode, + editMode: this.editMode, + }; + } + + createGateway(): void { + this.gateway.gatewayId = this.gateway.gatewayId?.replace(/[^0-9A-Fa-f]/g, ""); + this.loraGatewayService.post(this.gateway).subscribe( + response => { + this.routeBack(); + }, + (error: HttpErrorResponse) => { + this.showError(error); + this.formFailedSubmit = true; + } + ); + } + + updateGateway(): void { + // Gateway ID not allowed in update. + this.gateway.gatewayId = undefined; + this.loraGatewayService.put(this.gateway, this.gatewayId).subscribe( + response => { + this.routeBack(); + }, + error => { + this.showError(error); + this.formFailedSubmit = true; + } + ); + } + + onSubmit(): void { + if (this.gatewayId) { + this.updateGateway(); + } else { + this.createGateway(); } + } - onSubmit(): void { - if (this.gatewayId) { - this.updateGateway(); - } else { - this.createGateway(); - } - } - - routeBack(): void { - this.router.navigateByUrl("/gateways"); - } - - ngOnDestroy() { - if (this.gatewaySubscription) { - this.gatewaySubscription.unsubscribe(); - } - } - - onCoordinateKey(event: any) { - if (event.target.value.length > event.target.maxLength) { - event.target.value = event.target.value.slice(0, event.target.maxLength); - } - } + routeBack(): void { + this.router.navigateByUrl("/gateways"); + } - updateCoordinates(event: any) { - this.gateway.location.longitude = event.longitude; - this.gateway.location.latitude = event.latitude; + ngOnDestroy() { + if (this.gatewaySubscription) { + this.gatewaySubscription.unsubscribe(); } + } - private showError(error: HttpErrorResponse) { - const errorResponse = this.errorMessageService.handleErrorMessageWithFields(error); - this.errorFields = errorResponse.errorFields; - this.errorMessages = errorResponse.errorMessages; - this.scrollToTopService.scrollToTop(); + onCoordinateKey(event: any) { + if (event.target.value.length > event.target.maxLength) { + event.target.value = event.target.value.slice(0, event.target.maxLength); } + } + + updateCoordinates(event: any) { + this.gateway.location.longitude = event.longitude; + this.gateway.location.latitude = event.latitude; + } + + private showError(error: HttpErrorResponse) { + const errorResponse = this.errorMessageService.handleErrorMessageWithFields(error); + this.errorFields = errorResponse.errorFields; + this.errorMessages = errorResponse.errorMessages; + this.scrollToTopService.scrollToTop(); + } } diff --git a/src/app/gateway/gateway-overview/gateway-overview.component.html b/src/app/gateway/gateway-overview/gateway-overview.component.html index a9dd6ed59..6a0cb33da 100644 --- a/src/app/gateway/gateway-overview/gateway-overview.component.html +++ b/src/app/gateway/gateway-overview/gateway-overview.component.html @@ -1,20 +1,32 @@ - +
      - + -
      diff --git a/src/app/gateway/gateway-overview/gateway-overview.component.scss b/src/app/gateway/gateway-overview/gateway-overview.component.scss index efcb18989..21e0497ae 100644 --- a/src/app/gateway/gateway-overview/gateway-overview.component.scss +++ b/src/app/gateway/gateway-overview/gateway-overview.component.scss @@ -1,4 +1,4 @@ -.select-all{ +.select-all { margin-left: 17px; font-size: inherit; line-height: 3em; diff --git a/src/app/gateway/gateway-overview/gateway-overview.component.ts b/src/app/gateway/gateway-overview/gateway-overview.component.ts index c91c1468e..75b1dbabf 100644 --- a/src/app/gateway/gateway-overview/gateway-overview.component.ts +++ b/src/app/gateway/gateway-overview/gateway-overview.component.ts @@ -1,36 +1,36 @@ -import { Component, OnChanges, OnDestroy, OnInit } from '@angular/core'; -import { Organisation } from '@app/admin/organisation/organisation.model'; -import { TranslateService } from '@ngx-translate/core'; -import moment from 'moment'; -import { Subscription } from 'rxjs'; -import { MeService } from '@shared/services/me.service'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { environment } from '@environments/environment'; -import { Title } from '@angular/platform-browser'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { GatewayService } from '@app/gateway/gateway.service'; -import { NavigationEnd, Router } from '@angular/router'; +import { Component, OnChanges, OnDestroy, OnInit } from "@angular/core"; +import { Organisation } from "@app/admin/organisation/organisation.model"; +import { TranslateService } from "@ngx-translate/core"; +import moment from "moment"; +import { Subscription } from "rxjs"; +import { MeService } from "@shared/services/me.service"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { environment } from "@environments/environment"; +import { Title } from "@angular/platform-browser"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { GatewayService } from "@app/gateway/gateway.service"; +import { NavigationEnd, Router } from "@angular/router"; @Component({ - selector: 'app-gateway-list', - templateUrl: './gateway-overview.component.html', - styleUrls: ['./gateway-overview.component.scss'], + selector: "app-gateway-list", + templateUrl: "./gateway-overview.component.html", + styleUrls: ["./gateway-overview.component.scss"], }) export class GatewayOverviewComponent implements OnInit, OnChanges, OnDestroy { public navTabs: any[] = [ { - label: 'GATEWAY.TABEL-TAB', - link: './list', + label: "GATEWAY.TABEL-TAB", + link: "./list", index: 0, }, { - label: 'GATEWAY.MAP-TAB', - link: './map', + label: "GATEWAY.MAP-TAB", + link: "./map", index: 1, }, { - label: 'LORA-GATEWAY-TABLE.STATUS', - link: './status', + label: "LORA-GATEWAY-TABLE.STATUS", + link: "./status", index: 2, }, ]; @@ -51,28 +51,24 @@ export class GatewayOverviewComponent implements OnInit, OnChanges, OnDestroy { public gatewayService: GatewayService, private router: Router ) { - translate.use('da'); - moment.locale('da'); + translate.use("da"); + moment.locale("da"); } ngOnInit(): void { this.organisations = this.sharedVariableService.getOrganizationInfo(); - this.organisations.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); - this.translate.get(['TITLE.LORAWAN-GATEWAY']).subscribe((translations) => { - this.titleService.setTitle(translations['TITLE.LORAWAN-GATEWAY']); + this.organisations.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); + this.translate.get(["TITLE.LORAWAN-GATEWAY"]).subscribe(translations => { + this.titleService.setTitle(translations["TITLE.LORAWAN-GATEWAY"]); }); - this.canEdit = this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.GatewayWrite - ); - if (this.router.url === '/gateways') { - this.router.navigateByUrl('/gateways/list', { replaceUrl: true }); + this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.GatewayWrite); + if (this.router.url === "/gateways") { + this.router.navigateByUrl("/gateways/list", { replaceUrl: true }); } // Subscribe to route change to root and route to list view - this.routerSubscription = this.router.events.subscribe((e) => { - if (e instanceof NavigationEnd && e.url === '/gateways') { - this.router.navigateByUrl('/gateways/list', { replaceUrl: true }); + this.routerSubscription = this.router.events.subscribe(e => { + if (e instanceof NavigationEnd && e.url === "/gateways") { + this.router.navigateByUrl("/gateways/list", { replaceUrl: true }); } }); } diff --git a/src/app/gateway/gateway-overview/gateway-tabs/gateway-list/gateway-list.component.html b/src/app/gateway/gateway-overview/gateway-tabs/gateway-list/gateway-list.component.html index 879f78ff1..6e85a45b0 100644 --- a/src/app/gateway/gateway-overview/gateway-tabs/gateway-list/gateway-list.component.html +++ b/src/app/gateway/gateway-overview/gateway-tabs/gateway-list/gateway-list.component.html @@ -1,4 +1,3 @@
      - - +
      diff --git a/src/app/gateway/gateway-overview/gateway-tabs/gateway-list/gateway-list.component.ts b/src/app/gateway/gateway-overview/gateway-tabs/gateway-list/gateway-list.component.ts index 7867e6cd7..857538eac 100644 --- a/src/app/gateway/gateway-overview/gateway-tabs/gateway-list/gateway-list.component.ts +++ b/src/app/gateway/gateway-overview/gateway-tabs/gateway-list/gateway-list.component.ts @@ -1,17 +1,15 @@ -import { AfterViewInit, Component } from '@angular/core'; -import { GatewayService } from '@app/gateway/gateway.service'; +import { AfterViewInit, Component } from "@angular/core"; +import { GatewayService } from "@app/gateway/gateway.service"; @Component({ - selector: 'app-gateway-list', - templateUrl: './gateway-list.component.html', - styleUrls: ['./gateway-list.component.scss'], + selector: "app-gateway-list", + templateUrl: "./gateway-list.component.html", + styleUrls: ["./gateway-list.component.scss"], }) export class GatewayListComponent implements AfterViewInit { constructor(public gatewayService: GatewayService) {} ngAfterViewInit(): void { - this.gatewayService.organisationChangeSubject.next( - this.gatewayService.selectedOrg - ); + this.gatewayService.organisationChangeSubject.next(this.gatewayService.selectedOrg); } } diff --git a/src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.html b/src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.html index a9ad787c7..d6bcb40ca 100644 --- a/src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.html +++ b/src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.html @@ -1,4 +1,3 @@
      - - +
      diff --git a/src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.ts b/src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.ts index 0924dd5fd..e1d59e033 100644 --- a/src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.ts +++ b/src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.ts @@ -7,108 +7,108 @@ import { GatewayService } from "@app/gateway/gateway.service"; import { MeService } from "@shared/services/me.service"; @Component({ - selector: "app-gateway-map", - templateUrl: "./gateway-map.component.html", - styleUrls: ["./gateway-map.component.scss"], + selector: "app-gateway-map", + templateUrl: "./gateway-map.component.html", + styleUrls: ["./gateway-map.component.scss"], }) export class GatewayMapComponent implements OnInit, OnDestroy, AfterViewInit { - public gateways: Gateway[]; - public coordinateList = []; - private gatewaySubscription: Subscription; - private organizationChangeSubscription: Subscription; - isLoadingResults = true; + public gateways: Gateway[]; + public coordinateList = []; + private gatewaySubscription: Subscription; + private organizationChangeSubscription: Subscription; + isLoadingResults = true; - constructor( - private chirpstackGatewayService: ChirpstackGatewayService, - private gatewayService: GatewayService, - private meService: MeService - ) {} + constructor( + private chirpstackGatewayService: ChirpstackGatewayService, + private gatewayService: GatewayService, + private meService: MeService + ) {} - ngOnInit(): void {} + ngOnInit(): void {} - ngAfterViewInit() { - this.organizationChangeSubscription = this.gatewayService.organisationChangeSubject.subscribe(x => { - if (x) { - this.getGatewayWith(x); - } else { - this.getGateways(); - } - }); - if (this.gatewayService.selectedOrg) { - this.getGatewayWith(this.gatewayService.selectedOrg); - } else { - this.getGateways(); - } + ngAfterViewInit() { + this.organizationChangeSubscription = this.gatewayService.organisationChangeSubject.subscribe(x => { + if (x) { + this.getGatewayWith(x); + } else { + this.getGateways(); + } + }); + if (this.gatewayService.selectedOrg) { + this.getGatewayWith(this.gatewayService.selectedOrg); + } else { + this.getGateways(); } + } - private getGateways(): void { - this.gatewaySubscription = this.chirpstackGatewayService - .getMultiple({ - limit: null, - offset: null, - sort: null, - }) - .subscribe((gateways: GatewayResponseMany) => { - this.gateways = gateways.resultList; - this.mapToCoordinateList(); - this.setCanEdit(); - this.isLoadingResults = false; - }); - } + private getGateways(): void { + this.gatewaySubscription = this.chirpstackGatewayService + .getMultiple({ + limit: null, + offset: null, + sort: null, + }) + .subscribe((gateways: GatewayResponseMany) => { + this.gateways = gateways.resultList; + this.mapToCoordinateList(); + this.setCanEdit(); + this.isLoadingResults = false; + }); + } - private getGatewayWith(orgId: number): void { - this.gatewaySubscription = this.chirpstackGatewayService - .getMultiple({ - limit: null, - offset: null, - sort: null, - organizationId: orgId, - }) - .subscribe((gateways: GatewayResponseMany) => { - this.gateways = gateways.resultList; - this.mapToCoordinateList(); - this.setCanEdit(); - this.isLoadingResults = false; - }); - } + private getGatewayWith(orgId: number): void { + this.gatewaySubscription = this.chirpstackGatewayService + .getMultiple({ + limit: null, + offset: null, + sort: null, + organizationId: orgId, + }) + .subscribe((gateways: GatewayResponseMany) => { + this.gateways = gateways.resultList; + this.mapToCoordinateList(); + this.setCanEdit(); + this.isLoadingResults = false; + }); + } - private mapToCoordinateList() { - const tempcoordinateList = []; - this.gateways.map(gateway => - tempcoordinateList.push({ - longitude: gateway.location.longitude, - latitude: gateway.location.latitude, - draggable: false, - editEnabled: false, - useGeolocation: false, - markerInfo: { - name: gateway.name, - active: this.gatewayStatus(gateway), - id: gateway.gatewayId, - internalOrganizationId: gateway.organizationId, - internalOrganizationName: gateway.organizationName, - }, - }) - ); - this.coordinateList = tempcoordinateList; - } + private mapToCoordinateList() { + const tempcoordinateList = []; + this.gateways.map(gateway => + tempcoordinateList.push({ + longitude: gateway.location.longitude, + latitude: gateway.location.latitude, + draggable: false, + editEnabled: false, + useGeolocation: false, + markerInfo: { + name: gateway.name, + active: this.gatewayStatus(gateway), + id: gateway.gatewayId, + internalOrganizationId: gateway.organizationId, + internalOrganizationName: gateway.organizationName, + }, + }) + ); + this.coordinateList = tempcoordinateList; + } - gatewayStatus(gateway: Gateway): boolean { - return this.chirpstackGatewayService.isGatewayActive(gateway); - } + gatewayStatus(gateway: Gateway): boolean { + return this.chirpstackGatewayService.isGatewayActive(gateway); + } - setCanEdit() { - this.gateways.forEach(gateway => { - gateway.canEdit = this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.GatewayWrite, - gateway.organizationId - ); - }); - } + setCanEdit() { + this.gateways.forEach(gateway => { + gateway.canEdit = this.meService.hasAccessToTargetOrganization( + OrganizationAccessScope.GatewayWrite, + gateway.organizationId + ); + }); + } - ngOnDestroy() { - // prevent memory leak by unsubscribing - this.gatewaySubscription?.unsubscribe(); - this.organizationChangeSubscription.unsubscribe(); - } + ngOnDestroy() { + // prevent memory leak by unsubscribing + this.gatewaySubscription?.unsubscribe(); + this.organizationChangeSubscription.unsubscribe(); + } } diff --git a/src/app/gateway/gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component.html b/src/app/gateway/gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component.html index b4e786a10..67810cae5 100644 --- a/src/app/gateway/gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component.html +++ b/src/app/gateway/gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component.html @@ -1,4 +1,6 @@
      - +
      diff --git a/src/app/gateway/gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component.ts b/src/app/gateway/gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component.ts index 7c61bedd4..5bd14b942 100644 --- a/src/app/gateway/gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component.ts +++ b/src/app/gateway/gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component.ts @@ -1,23 +1,16 @@ -import { - AfterContentInit, - AfterViewChecked, - AfterViewInit, - Component, -} from '@angular/core'; -import { GatewayService } from '@app/gateway/gateway.service'; +import { AfterContentInit, AfterViewChecked, AfterViewInit, Component } from "@angular/core"; +import { GatewayService } from "@app/gateway/gateway.service"; @Component({ - selector: 'app-gateway-status-overview', - templateUrl: './gateway-status-overview.component.html', - styleUrls: ['./gateway-status-overview.component.scss'], + selector: "app-gateway-status-overview", + templateUrl: "./gateway-status-overview.component.html", + styleUrls: ["./gateway-status-overview.component.scss"], }) export class GatewayStatusOverviewComponent implements AfterViewInit { constructor(public gatewayService: GatewayService) {} ngAfterViewInit(): void { - this.gatewayService.organisationChangeSubject.next( - this.gatewayService.selectedOrg - ); + this.gatewayService.organisationChangeSubject.next(this.gatewayService.selectedOrg); this.gatewayService.isGatewayStatusVisibleSubject.next(); } } diff --git a/src/app/gateway/gateway-status/gateway-status.component.html b/src/app/gateway/gateway-status/gateway-status.component.html index b050143a4..294aa0a0a 100644 --- a/src/app/gateway/gateway-status/gateway-status.component.html +++ b/src/app/gateway/gateway-status/gateway-status.component.html @@ -1,15 +1,18 @@ -

      {{ 'GEN.NO-DATA' | translate }}

      +

      {{ "GEN.NO-DATA" | translate }}

      -

      {{title}}

      +

      {{ title }}

      - - {{ 'LORA-GATEWAY-STATUS.INTERVAL.' + interval | translate }} + + {{ "LORA-GATEWAY-STATUS.INTERVAL." + interval | translate }}
      @@ -17,54 +20,78 @@

      {{title}}

      -
      - {{'QUESTION.DATATARGET.SELECT-DEVICES' | translate}} + {{ "QUESTION.DATATARGET.SELECT-DEVICES" | translate }} + [(value)]="element.iotDeviceIds" + > - - - {{ device.name }} + {{ device.name }}
      @@ -339,24 +313,12 @@
      {{ 'QUESTION.DATATARGET.RELATIONS' |
      - {{ - 'QUESTION.DATATARGET.SELECT-PAYLOADDECODER' | translate - }} - + {{ "QUESTION.DATATARGET.SELECT-PAYLOADDECODER" | translate }} + - {{ - 'QUESTION.DATATARGET.NO-PAYLOAD-DECODER-SELECTED' - | translate - }} + {{ "QUESTION.DATATARGET.NO-PAYLOAD-DECODER-SELECTED" | translate }} - + {{ payloadDecoder.name }} @@ -367,7 +329,7 @@
      {{ 'QUESTION.DATATARGET.RELATIONS' |
      -

      {{ 'DATATARGET.DELETE' | translate }}

      +

      {{ "DATATARGET.DELETE" | translate }}

      +
      - - - + - +
      - {{element.name}} - {{element.name}} + {{ element.name }} + {{ element.name }} - {{'GEN.DATE' | translate}} + {{ "GEN.DATE" | translate }}
      - {{'LORA-GATEWAY-STATUS.TIMESTAMP' | translate}} + {{ "LORA-GATEWAY-STATUS.TIMESTAMP" | translate }}
      + - {{time.datePart}} + [ngClass]="gateway.statusTimestamps | gatewayStatusClass : time.exactTimestamp" + > + {{ time.datePart }}
      - {{time.timePart}} + {{ time.timePart }}
      - +
      - {{ "GEN.ONLINE" | translate}} + {{ "GEN.ONLINE" | translate }}
      - {{ "GEN.OFFLINE" | translate}} + {{ "GEN.OFFLINE" | translate }}
      - {{ "GEN.NEVER-SEEN" | translate}} + {{ "GEN.NEVER-SEEN" | translate }}
      diff --git a/src/app/gateway/gateway-status/gateway-status.component.scss b/src/app/gateway/gateway-status/gateway-status.component.scss index a0594995e..55a6c8ee7 100644 --- a/src/app/gateway/gateway-status/gateway-status.component.scss +++ b/src/app/gateway/gateway-status/gateway-status.component.scss @@ -1,4 +1,4 @@ -@import 'src/assets/scss/setup/variables'; +@import "src/assets/scss/setup/variables"; $online: #56b257; $offline: #e74c3c; diff --git a/src/app/gateway/gateway-status/gateway-status.component.ts b/src/app/gateway/gateway-status/gateway-status.component.ts index f9bb6b7a2..9a03e44b9 100644 --- a/src/app/gateway/gateway-status/gateway-status.component.ts +++ b/src/app/gateway/gateway-status/gateway-status.component.ts @@ -1,26 +1,17 @@ -import { - AfterContentInit, - Component, - Input, - OnDestroy, - ViewChild, -} from '@angular/core'; -import { MatOptionSelectionChange } from '@angular/material/core'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatTableDataSource } from '@angular/material/table'; -import { environment } from '@environments/environment'; -import { TranslateService } from '@ngx-translate/core'; -import { recordToEntries } from '@shared/helpers/record.helper'; -import { LoRaWANGatewayService } from '@shared/services/lorawan-gateway.service'; -import moment from 'moment'; -import { Observable, Subject, Subscription } from 'rxjs'; -import { - GatewayStatusInterval, - gatewayStatusIntervalToDate, -} from '../enums/gateway-status-interval.enum'; -import { GatewayStatus, AllGatewayStatusResponse } from '../gateway.model'; -import { map } from 'rxjs/operators'; -import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; +import { AfterContentInit, Component, Input, OnDestroy, ViewChild } from "@angular/core"; +import { MatOptionSelectionChange } from "@angular/material/core"; +import { MatPaginator } from "@angular/material/paginator"; +import { MatTableDataSource } from "@angular/material/table"; +import { environment } from "@environments/environment"; +import { TranslateService } from "@ngx-translate/core"; +import { recordToEntries } from "@shared/helpers/record.helper"; +import { LoRaWANGatewayService } from "@shared/services/lorawan-gateway.service"; +import moment from "moment"; +import { Observable, Subject, Subscription } from "rxjs"; +import { GatewayStatusInterval, gatewayStatusIntervalToDate } from "../enums/gateway-status-interval.enum"; +import { GatewayStatus, AllGatewayStatusResponse } from "../gateway.model"; +import { map } from "rxjs/operators"; +import { DefaultPageSizeOptions } from "@shared/constants/page.constants"; interface TimeColumn { exactTimestamp: string; @@ -30,9 +21,9 @@ interface TimeColumn { } @Component({ - selector: 'app-gateway-status', - templateUrl: './gateway-status.component.html', - styleUrls: ['./gateway-status.component.scss'], + selector: "app-gateway-status", + templateUrl: "./gateway-status.component.html", + styleUrls: ["./gateway-status.component.scss"], }) export class GatewayStatusComponent implements AfterContentInit, OnDestroy { @Input() organisationChangeSubject: Subject; @@ -43,7 +34,7 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { @Input() shouldLinkToDetails = true; private gatewayStatusSubscription: Subscription; - private readonly columnGatewayName = 'gatewayName'; + private readonly columnGatewayName = "gatewayName"; dataSource: MatTableDataSource; /** * List of pre-processed timestamps for performance @@ -53,9 +44,9 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { * Columns to display. Must not contain objects in order for the table to render. */ displayedColumns: string[] = []; - nameText = ''; - neverSeenText = ''; - timestampText = ''; + nameText = ""; + neverSeenText = ""; + timestampText = ""; visibleFooterTimeInterval = 1; pageSize = environment.tablePageSize; public pageSizeOptions = DefaultPageSizeOptions; @@ -68,21 +59,16 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { @ViewChild(MatPaginator) paginator: MatPaginator; - constructor( - private translate: TranslateService, - private lorawanGatewayService: LoRaWANGatewayService - ) {} + constructor(private translate: TranslateService, private lorawanGatewayService: LoRaWANGatewayService) {} ngAfterContentInit(): void { - this.translate - .get(['GEN.NAME', 'GEN.NEVER-SEEN', 'LORA-GATEWAY-STATUS.TIMESTAMP']) - .subscribe((translations) => { - this.nameText = translations['GEN.NAME']; - this.neverSeenText = translations['GEN.NEVER-SEEN']; - this.timestampText = translations['LORA-GATEWAY-STATUS.TIMESTAMP']; - }); + this.translate.get(["GEN.NAME", "GEN.NEVER-SEEN", "LORA-GATEWAY-STATUS.TIMESTAMP"]).subscribe(translations => { + this.nameText = translations["GEN.NAME"]; + this.neverSeenText = translations["GEN.NEVER-SEEN"]; + this.timestampText = translations["LORA-GATEWAY-STATUS.TIMESTAMP"]; + }); - this.organisationChangeSubject?.subscribe((orgId) => { + this.organisationChangeSubject?.subscribe(orgId => { if (this.organizationId !== orgId) { this.organizationId = orgId; this.isDirty = true; @@ -98,9 +84,7 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { this.subscribeToGetAllGatewayStatus(); }); - this.statusIntervals = recordToEntries(GatewayStatusInterval).map( - (interval) => interval.value - ); + this.statusIntervals = recordToEntries(GatewayStatusInterval).map(interval => interval.value); } private getGatewayStatus( @@ -122,12 +106,7 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { ? this.lorawanGatewayService.getAllStatus(params) : this.lorawanGatewayService .getStatus(this.gatewayId, { timeInterval }) - .pipe( - map( - (response) => - ({ data: [response], count: 1 } as AllGatewayStatusResponse) - ) - ); + .pipe(map(response => ({ data: [response], count: 1 } as AllGatewayStatusResponse))); } private subscribeToGetAllGatewayStatus( @@ -136,10 +115,7 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { ): void { this.isLoadingResults = true; this.paginator.pageIndex = 0; - this.gatewayStatusSubscription = this.getGatewayStatus( - organizationId, - timeInterval - ).subscribe((response) => { + this.gatewayStatusSubscription = this.getGatewayStatus(organizationId, timeInterval).subscribe(response => { this.isLoadingResults = false; // Get the earliest date from the selected interval const fromDate = gatewayStatusIntervalToDate(timeInterval); @@ -150,33 +126,22 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { }); } - private handleStatusResponse( - response: AllGatewayStatusResponse, - fromDate: Date - ) { + private handleStatusResponse(response: AllGatewayStatusResponse, fromDate: Date) { this.resultsLength = response.count; - const gatewaysWithLatestTimestampsPerHour = this.takeLatestTimestampInHour( - response.data - ); - const gatewaysWithWholeHourTimestamps = this.toWholeHour( - gatewaysWithLatestTimestampsPerHour - ); + const gatewaysWithLatestTimestampsPerHour = this.takeLatestTimestampInHour(response.data); + const gatewaysWithWholeHourTimestamps = this.toWholeHour(gatewaysWithLatestTimestampsPerHour); // Sort the gateways and their status timestamps const sortedData = gatewaysWithWholeHourTimestamps .slice() .sort((a, b) => a.name.localeCompare(b.name)) - .map((gateway) => ({ + .map(gateway => ({ ...gateway, - statusTimestamps: gateway.statusTimestamps.sort( - (a, b) => a.timestamp.getTime() - b.timestamp.getTime() - ), + statusTimestamps: gateway.statusTimestamps.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime()), })); this.buildColumns(fromDate, new Date()); - this.visibleFooterTimeInterval = Math.round( - this.clamp(this.timeColumns.length / 4, 1, 6) - ); + this.visibleFooterTimeInterval = Math.round(this.clamp(this.timeColumns.length / 4, 1, 6)); this.dataSource = new MatTableDataSource(sortedData); this.dataSource.paginator = this.paginator; @@ -188,31 +153,28 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { // If there's a date range, build the columns from them if (fromDate && toDate) { - const currDate = moment(fromDate).startOf('hour'); - const lastDate = moment(toDate).startOf('hour'); + const currDate = moment(fromDate).startOf("hour"); + const lastDate = moment(toDate).startOf("hour"); do { this.timeColumns.push({ exactTimestamp: currDate.toISOString(), - tooltip: currDate.format('DD-MM-YYYY HH:00'), - datePart: currDate.format('DD-MM'), - timePart: currDate.format('HH:00'), + tooltip: currDate.format("DD-MM-YYYY HH:00"), + datePart: currDate.format("DD-MM"), + timePart: currDate.format("HH:00"), }); - } while (currDate.add(1, 'hour').startOf('hour').diff(lastDate) <= 0); + } while (currDate.add(1, "hour").startOf("hour").diff(lastDate) <= 0); } - this.displayedColumns = [ - this.columnGatewayName, - ...this.timeColumns.map((column) => column.exactTimestamp), - ]; + this.displayedColumns = [this.columnGatewayName, ...this.timeColumns.map(column => column.exactTimestamp)]; } private toWholeHour(data: GatewayStatus[]): typeof data { - return data.map((gateway) => ({ + return data.map(gateway => ({ ...gateway, - statusTimestamps: gateway.statusTimestamps.map((status) => ({ + statusTimestamps: gateway.statusTimestamps.map(status => ({ ...status, - timestamp: moment(status.timestamp).startOf('hour').toDate(), + timestamp: moment(status.timestamp).startOf("hour").toDate(), })), })); } @@ -224,33 +186,28 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { * @param data A list of gateway status' */ private takeLatestTimestampInHour(data: GatewayStatus[]): typeof data { - return data.map((gateway) => { - const timestamps = gateway.statusTimestamps.reduce( - (res: typeof gateway.statusTimestamps, currentStatus) => { - // Check if we already passed a timestamp in the same hour slot as the current one and if it's older - const currentTimestamp = moment(currentStatus.timestamp); - const sameHourTimestampIndex = res.findIndex((storedStatus) => { - const storedTimestamp = moment(storedStatus.timestamp); - return storedTimestamp.isSame(currentTimestamp, 'hour'); - }); + return data.map(gateway => { + const timestamps = gateway.statusTimestamps.reduce((res: typeof gateway.statusTimestamps, currentStatus) => { + // Check if we already passed a timestamp in the same hour slot as the current one and if it's older + const currentTimestamp = moment(currentStatus.timestamp); + const sameHourTimestampIndex = res.findIndex(storedStatus => { + const storedTimestamp = moment(storedStatus.timestamp); + return storedTimestamp.isSame(currentTimestamp, "hour"); + }); - if (sameHourTimestampIndex >= 0) { - // Only keep the latest timestamp in the same slot - if ( - res[sameHourTimestampIndex].timestamp < currentStatus.timestamp - ) { - res.splice(sameHourTimestampIndex, 1); - } else { - // Don't store the current timestamp as it's older than the stored one - return res; - } + if (sameHourTimestampIndex >= 0) { + // Only keep the latest timestamp in the same slot + if (res[sameHourTimestampIndex].timestamp < currentStatus.timestamp) { + res.splice(sameHourTimestampIndex, 1); + } else { + // Don't store the current timestamp as it's older than the stored one + return res; } + } - res.push(currentStatus); - return res; - }, - [] - ); + res.push(currentStatus); + return res; + }, []); return { ...gateway, @@ -263,15 +220,8 @@ export class GatewayStatusComponent implements AfterContentInit, OnDestroy { return Math.max(min, Math.min(max, value)); } - onSelectInterval({ - isUserInput, - source: { value: newInterval }, - }: MatOptionSelectionChange) { - if ( - isUserInput && - newInterval !== this.selectedStatusInterval && - !this.isLoadingResults - ) { + onSelectInterval({ isUserInput, source: { value: newInterval } }: MatOptionSelectionChange) { + if (isUserInput && newInterval !== this.selectedStatusInterval && !this.isLoadingResults) { this.subscribeToGetAllGatewayStatus(this.organizationId, newInterval); } } diff --git a/src/app/gateway/gateway-table/gateway-table.component.html b/src/app/gateway/gateway-table/gateway-table.component.html index 40be24cc5..25b77036c 100644 --- a/src/app/gateway/gateway-table/gateway-table.component.html +++ b/src/app/gateway/gateway-table/gateway-table.component.html @@ -9,13 +9,16 @@
      - - + @@ -23,7 +26,7 @@ + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -139,19 +165,19 @@ - +
      - {{ 'LORA-GATEWAY-TABLE.NAME' | translate }} + {{ "LORA-GATEWAY-TABLE.NAME" | translate }} - + {{ gateway.name }} - {{ 'LORA-GATEWAY-TABLE.GATEWAYID' | translate }} + {{ "LORA-GATEWAY-TABLE.GATEWAYID" | translate }} {{ gateway.gatewayId }} @@ -31,7 +34,8 @@ - {{ 'LORA-GATEWAY-TABLE.ORGANIZATION' | translate }} + + {{ "LORA-GATEWAY-TABLE.ORGANIZATION" | translate }} {{ gateway.organizationName }} @@ -39,99 +43,121 @@ - {{ 'LORA-GATEWAY-TABLE.PACKETS-RECEIVED' | translate }} + {{ "LORA-GATEWAY-TABLE.PACKETS-RECEIVED" | translate }} + {{ gateway.rxPacketsReceived }} {{ 'LORA-GATEWAY-TABLE.PACKETS-SENT' | translate }} + {{ "LORA-GATEWAY-TABLE.PACKETS-SENT" | translate }} + {{ gateway.txPacketsEmitted }} {{ 'LORA-GATEWAY-TABLE.PLACEMENT' | translate }}{{ "LORA-GATEWAY-TABLE.PLACEMENT" | translate }} - {{ gateway.placement ? ('GATEWAY.PLACEMENT.' + gateway.placement | translate) : '' }} + {{ gateway.placement ? ("GATEWAY.PLACEMENT." + gateway.placement | translate) : "" }} {{ 'LORA-GATEWAY-TABLE.MODEL-NAME' | translate }} + {{ "LORA-GATEWAY-TABLE.MODEL-NAME" | translate }} + {{ gateway.modelName }} {{ 'LORA-GATEWAY-TABLE.ANTENNA-TYPE' | translate }} + {{ "LORA-GATEWAY-TABLE.ANTENNA-TYPE" | translate }} + {{ gateway.antennaType }} {{ 'LORA-GATEWAY-TABLE.STATUS' | translate }}{{ "LORA-GATEWAY-TABLE.STATUS" | translate }} - {{ gateway.status ? ("GATEWAY.STATUS." + gateway.status | translate) : '' }} + {{ gateway.status ? ("GATEWAY.STATUS." + gateway.status | translate) : "" }} {{ 'LORA-GATEWAY-TABLE.RESPONSIBLE-NAME' | translate }} + {{ "LORA-GATEWAY-TABLE.RESPONSIBLE-NAME" | translate }} + {{ gateway.gatewayResponsibleName }} {{ 'LORA-GATEWAY-TABLE.RESPONSIBLE-EMAIL' | translate }} + {{ "LORA-GATEWAY-TABLE.RESPONSIBLE-EMAIL" | translate }} + {{ gateway.gatewayResponsibleEmail }} {{ 'LORA-GATEWAY-TABLE.RESPONSIBLE-PHONE-NUMBER' | translate }} + {{ "LORA-GATEWAY-TABLE.RESPONSIBLE-PHONE-NUMBER" | translate }} + {{ gateway.gatewayResponsiblePhoneNumber }} {{ 'LORA-GATEWAY-TABLE.OPERATIONAL-NAME' | translate }} + {{ "LORA-GATEWAY-TABLE.OPERATIONAL-NAME" | translate }} + {{ gateway.operationalResponsibleName }} {{ 'LORA-GATEWAY-TABLE.OPERATIONAL-EMAIL' | translate }} + {{ "LORA-GATEWAY-TABLE.OPERATIONAL-EMAIL" | translate }} + {{ gateway.operationalResponsibleEmail }} {{ 'LORA-GATEWAY-TABLE.TAGS' | translate }} + {{ "LORA-GATEWAY-TABLE.TAGS" | translate }} + - {{gateway.tagsString}} + {{ gateway.tagsString }} {{ 'LORA-GATEWAY-TABLE.LOCATION' | translate }} + {{ "LORA-GATEWAY-TABLE.LOCATION" | translate }} + - {{ gateway.location.latitude | number:'2.1-6' }}, - {{ gateway.location.longitude | number:'2.1-6' }} + {{ gateway.location.latitude | number : "2.1-6" }}, + {{ gateway.location.longitude | number : "2.1-6" }} {{ 'LORA-GATEWAY-TABLE.CREATED-AT' | translate }}{{ "LORA-GATEWAY-TABLE.CREATED-AT" | translate }} {{ gateway.createdAt | dateOnly }} - {{ 'LORA-GATEWAY-TABLE.LAST-SEEN-AT' | translate }} + {{ "LORA-GATEWAY-TABLE.LAST-SEEN-AT" | translate }} - {{lastActive(gateway)}} + {{ lastActive(gateway) }} - {{ 'LORA-GATEWAY-TABLE.STATUS' | translate }} + {{ "LORA-GATEWAY-TABLE.STATUS" | translate }} - + @@ -165,17 +191,23 @@ @@ -183,9 +215,13 @@
      - +

      diff --git a/src/app/gateway/gateway-table/gateway-table.component.scss b/src/app/gateway/gateway-table/gateway-table.component.scss index 2ac450395..b00a2928e 100644 --- a/src/app/gateway/gateway-table/gateway-table.component.scss +++ b/src/app/gateway/gateway-table/gateway-table.component.scss @@ -1,9 +1,9 @@ .fa-error { - color: red !important; + color: red !important; } .fa-ok { - color: green !important; + color: green !important; } .min-width-150 { diff --git a/src/app/gateway/gateway-table/gateway-table.component.ts b/src/app/gateway/gateway-table/gateway-table.component.ts index d8cda2a9d..813fa9563 100644 --- a/src/app/gateway/gateway-table/gateway-table.component.ts +++ b/src/app/gateway/gateway-table/gateway-table.component.ts @@ -16,246 +16,243 @@ import { TableColumn } from "@shared/types/table.type"; import { catchError, map, startWith, switchMap } from "rxjs/operators"; const columnDefinitions: TableColumn[] = [ - { - id: "name", - display: "LORA-GATEWAY-TABLE.NAME", - toggleable: false, - default: true, - }, - { - id: "gatewayId", - display: "LORA-GATEWAY-TABLE.GATEWAYID", - toggleable: true, - default: true, - }, - { - id: "organizationName", - display: "LORA-GATEWAY-TABLE.ORGANIZATION", - toggleable: true, - default: true, - }, - { - id: "rxPacketsReceived", - display: "LORA-GATEWAY-TABLE.PACKETS-RECEIVED", - toggleable: true, - default: true, - }, - { - id: "txPacketsEmitted", - display: "LORA-GATEWAY-TABLE.PACKETS-SENT", - toggleable: true, - default: true, - }, - { - id: "placement", - display: "LORA-GATEWAY-TABLE.PLACEMENT", - toggleable: true, - default: false, - }, - { - id: "modelName", - display: "LORA-GATEWAY-TABLE.MODEL-NAME", - toggleable: true, - default: false, - }, - { - id: "antennaType", - display: "LORA-GATEWAY-TABLE.ANTENNA-TYPE", - toggleable: true, - default: false, - }, - { - id: "status", - display: "LORA-GATEWAY-TABLE.STATUS", - toggleable: true, - default: false, - }, - { - id: "gatewayResponsibleName", - display: "LORA-GATEWAY-TABLE.RESPONSIBLE-NAME", - toggleable: true, - default: false, - }, - { - id: "tags", - display: "LORA-GATEWAY-TABLE.TAGS", - toggleable: true, - default: false, - }, - { - id: "createdAt", - display: "LORA-GATEWAY-TABLE.CREATED-AT", - toggleable: true, - default: false, - }, - { - id: "lastSeenAt", - display: "LORA-GATEWAY-TABLE.LAST-SEEN-AT", - toggleable: true, - default: true, - }, - { - id: "onlineStatus", - display: "LORA-GATEWAY-TABLE.STATUS", - toggleable: true, - default: true, - }, - { - id: "menu", - display: "", - toggleable: false, - default: true, - }, + { + id: "name", + display: "LORA-GATEWAY-TABLE.NAME", + toggleable: false, + default: true, + }, + { + id: "gatewayId", + display: "LORA-GATEWAY-TABLE.GATEWAYID", + toggleable: true, + default: true, + }, + { + id: "organizationName", + display: "LORA-GATEWAY-TABLE.ORGANIZATION", + toggleable: true, + default: true, + }, + { + id: "rxPacketsReceived", + display: "LORA-GATEWAY-TABLE.PACKETS-RECEIVED", + toggleable: true, + default: true, + }, + { + id: "txPacketsEmitted", + display: "LORA-GATEWAY-TABLE.PACKETS-SENT", + toggleable: true, + default: true, + }, + { + id: "placement", + display: "LORA-GATEWAY-TABLE.PLACEMENT", + toggleable: true, + default: false, + }, + { + id: "modelName", + display: "LORA-GATEWAY-TABLE.MODEL-NAME", + toggleable: true, + default: false, + }, + { + id: "antennaType", + display: "LORA-GATEWAY-TABLE.ANTENNA-TYPE", + toggleable: true, + default: false, + }, + { + id: "status", + display: "LORA-GATEWAY-TABLE.STATUS", + toggleable: true, + default: false, + }, + { + id: "gatewayResponsibleName", + display: "LORA-GATEWAY-TABLE.RESPONSIBLE-NAME", + toggleable: true, + default: false, + }, + { + id: "tags", + display: "LORA-GATEWAY-TABLE.TAGS", + toggleable: true, + default: false, + }, + { + id: "createdAt", + display: "LORA-GATEWAY-TABLE.CREATED-AT", + toggleable: true, + default: false, + }, + { + id: "lastSeenAt", + display: "LORA-GATEWAY-TABLE.LAST-SEEN-AT", + toggleable: true, + default: true, + }, + { + id: "onlineStatus", + display: "LORA-GATEWAY-TABLE.STATUS", + toggleable: true, + default: true, + }, + { + id: "menu", + display: "", + toggleable: false, + default: true, + }, ]; @Component({ - selector: "app-gateway-table", - templateUrl: "./gateway-table.component.html", - styleUrls: ["./gateway-table.component.scss"], + selector: "app-gateway-table", + templateUrl: "./gateway-table.component.html", + styleUrls: ["./gateway-table.component.scss"], }) export class GatewayTableComponent implements AfterViewInit, OnDestroy, OnInit { - @Input() organisationChangeSubject: Subject; - organizationId?: number; - displayedColumns: string[] = []; - data: Gateway[] = []; - public pageSize = environment.tablePageSize; - public pageSizeOptions = DefaultPageSizeOptions; + @Input() organisationChangeSubject: Subject; + organizationId?: number; + displayedColumns: string[] = []; + data: Gateway[] = []; + public pageSize = environment.tablePageSize; + public pageSizeOptions = DefaultPageSizeOptions; - faExclamationTriangle = faExclamationTriangle; - faCheckCircle = faCheckCircle; - refetchIntervalId: NodeJS.Timeout; - resultsLength = 0; - isLoadingResults = true; - private fetchSubscription: Subscription; + faExclamationTriangle = faExclamationTriangle; + faCheckCircle = faCheckCircle; + refetchIntervalId: NodeJS.Timeout; + resultsLength = 0; + isLoadingResults = true; + private fetchSubscription: Subscription; - gatewayTableSavedColumns = "gatewayTableSavedColumns"; + gatewayTableSavedColumns = "gatewayTableSavedColumns"; - @ViewChild(MatPaginator) paginator: MatPaginator; - @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; - constructor( - private chirpstackGatewayService: ChirpstackGatewayService, - public translate: TranslateService, - private meService: MeService, - private deleteDialogService: DeleteDialogService, - private cdRef: ChangeDetectorRef - ) { - this.translate.use("da"); - moment.locale("da"); - } + constructor( + private chirpstackGatewayService: ChirpstackGatewayService, + public translate: TranslateService, + private meService: MeService, + private deleteDialogService: DeleteDialogService, + private cdRef: ChangeDetectorRef + ) { + this.translate.use("da"); + moment.locale("da"); + } - ngOnInit() { - // Detect changes done by child column selector - this.cdRef.detectChanges(); - } + ngOnInit() { + // Detect changes done by child column selector + this.cdRef.detectChanges(); + } - ngAfterViewInit() { - this.fetchSubscription = this.organisationChangeSubject.subscribe(x => { - this.organizationId = x; - this.refresh(); - }); - this.refetchIntervalId = setInterval(() => this.refresh(), 60 * 1000); + ngAfterViewInit() { + this.fetchSubscription = this.organisationChangeSubject.subscribe(x => { + this.organizationId = x; + this.refresh(); + }); + this.refetchIntervalId = setInterval(() => this.refresh(), 60 * 1000); - this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); + this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); - // TODO: Much of this is deprecated and should be redesigned, same case for the other tables - merge(this.sort.sortChange, this.paginator.page) - .pipe( - startWith({}), - switchMap(() => { - this.isLoadingResults = true; - return this.getGateways(this.sort.active, this.sort.direction); - }), - map(data => { - this.isLoadingResults = false; - this.resultsLength = data.totalCount; + // TODO: Much of this is deprecated and should be redesigned, same case for the other tables + merge(this.sort.sortChange, this.paginator.page) + .pipe( + startWith({}), + switchMap(() => { + this.isLoadingResults = true; + return this.getGateways(this.sort.active, this.sort.direction); + }), + map(data => { + this.isLoadingResults = false; + this.resultsLength = data.totalCount; - return data.resultList; - }), - catchError(() => { - this.isLoadingResults = false; - return []; - }) - ) - .subscribe(data => { - this.data = data; - data.forEach(gw => { - gw.canEdit = this.canEdit(gw.organizationId); - gw.tagsString = JSON.stringify(gw.tags ?? {}); - }); - }); - } + return data.resultList; + }), + catchError(() => { + this.isLoadingResults = false; + return []; + }) + ) + .subscribe(data => { + this.data = data; + data.forEach(gw => { + gw.canEdit = this.canEdit(gw.organizationId); + gw.tagsString = JSON.stringify(gw.tags ?? {}); + }); + }); + } - ngOnDestroy() { - clearInterval(this.refetchIntervalId); - this.fetchSubscription.unsubscribe(); - } + ngOnDestroy() { + clearInterval(this.refetchIntervalId); + this.fetchSubscription.unsubscribe(); + } - private refresh() { - this.getGateways(this.sort.active, this.sort.direction).subscribe(data => { - data.resultList.forEach(gw => { - gw.canEdit = this.canEdit(gw.organizationId); - gw.tagsString = JSON.stringify(gw.tags ?? {}); - }); - this.data = data.resultList; - this.resultsLength = data.totalCount; - this.isLoadingResults = false; - }); - } + private refresh() { + this.getGateways(this.sort.active, this.sort.direction).subscribe(data => { + data.resultList.forEach(gw => { + gw.canEdit = this.canEdit(gw.organizationId); + gw.tagsString = JSON.stringify(gw.tags ?? {}); + }); + this.data = data.resultList; + this.resultsLength = data.totalCount; + this.isLoadingResults = false; + }); + } - canEdit(internalOrganizationId: number): boolean { - return this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.GatewayWrite, - internalOrganizationId - ); - } + canEdit(internalOrganizationId: number): boolean { + return this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.GatewayWrite, internalOrganizationId); + } - private getGateways(orderByColumn: string, orderByDirection: string): Observable { - const params = { - limit: this.paginator.pageSize, - offset: this.paginator.pageIndex * this.paginator.pageSize, - orderOn: orderByColumn, - sort: orderByDirection, - }; - if (this.organizationId > 0) { - params["organizationId"] = this.organizationId; - } - return this.chirpstackGatewayService.getMultiple(params); + private getGateways(orderByColumn: string, orderByDirection: string): Observable { + const params = { + limit: this.paginator.pageSize, + offset: this.paginator.pageIndex * this.paginator.pageSize, + orderOn: orderByColumn, + sort: orderByDirection, + }; + if (this.organizationId > 0) { + params["organizationId"] = this.organizationId; } + return this.chirpstackGatewayService.getMultiple(params); + } - gatewayStatus(gateway: Gateway): boolean { - return this.chirpstackGatewayService.isGatewayActive(gateway); - } + gatewayStatus(gateway: Gateway): boolean { + return this.chirpstackGatewayService.isGatewayActive(gateway); + } - lastActive(gateway: Gateway): string { - if (gateway?.lastSeenAt) { - const date = gateway.lastSeenAt; + lastActive(gateway: Gateway): string { + if (gateway?.lastSeenAt) { + const date = gateway.lastSeenAt; - const lastSeenAtUnixTimestamp = moment(date).valueOf(); - const now = moment(new Date()).valueOf(); - return moment(Math.min(lastSeenAtUnixTimestamp, now)).fromNow(); - } else { - return this.translate.instant("ACTIVITY.NEVER"); - } + const lastSeenAtUnixTimestamp = moment(date).valueOf(); + const now = moment(new Date()).valueOf(); + return moment(Math.min(lastSeenAtUnixTimestamp, now)).fromNow(); + } else { + return this.translate.instant("ACTIVITY.NEVER"); } + } - clickDelete(element: Gateway) { - this.deleteGateway(element.gatewayId); - } + clickDelete(element: Gateway) { + this.deleteGateway(element.gatewayId); + } - deleteGateway(gatewayId: string) { - this.deleteDialogService.showSimpleDialog().subscribe(response => { - if (response) { - this.chirpstackGatewayService.delete(gatewayId).subscribe(response => { - if (response.ok && response.body.success === true) { - this.refresh(); - } - }); - } else { - console.error(response); - } + deleteGateway(gatewayId: string) { + this.deleteDialogService.showSimpleDialog().subscribe(response => { + if (response) { + this.chirpstackGatewayService.delete(gatewayId).subscribe(response => { + if (response.ok && response.body.success === true) { + this.refresh(); + } }); - } + } else { + console.error(response); + } + }); + } - protected readonly columnDefinitions = columnDefinitions; + protected readonly columnDefinitions = columnDefinitions; } diff --git a/src/app/gateway/gateway.model.ts b/src/app/gateway/gateway.model.ts index 468547cb5..090b61542 100644 --- a/src/app/gateway/gateway.model.ts +++ b/src/app/gateway/gateway.model.ts @@ -3,93 +3,93 @@ import { CommonLocation } from "@shared/models/common-location.model"; import { GatewayPlacement, GatewaySetupStatus, GatewayStatusInterval } from "./enums/gateway-status-interval.enum"; export class Gateway extends EditPermission { - id: number; - gatewayId: string; - name: string; - description?: string; - location: CommonLocation = new CommonLocation(); + id: number; + gatewayId: string; + name: string; + description?: string; + location: CommonLocation = new CommonLocation(); - placement: GatewayPlacement = GatewayPlacement.NONE; - modelName?: string; - antennaType?: string; - status?: GatewaySetupStatus = GatewaySetupStatus.NONE; - gatewayResponsibleName?: string; - gatewayResponsibleEmail?: string; - gatewayResponsiblePhoneNumber?: string; - operationalResponsibleName?: string; - operationalResponsibleEmail?: string; + placement: GatewayPlacement = GatewayPlacement.NONE; + modelName?: string; + antennaType?: string; + status?: GatewaySetupStatus = GatewaySetupStatus.NONE; + gatewayResponsibleName?: string; + gatewayResponsibleEmail?: string; + gatewayResponsiblePhoneNumber?: string; + operationalResponsibleName?: string; + operationalResponsibleEmail?: string; - tagsString: string; - tags?: JSON; - rxPacketsReceived: number; - txPacketsEmitted: number; - lastSeenAt: Date; - organizationId: number; - organizationName: string; - createdAt: Date; - updatedAt: Date; - createdBy: number; - updatedBy: number; - createdByName: string; - updatedByName: string; + tagsString: string; + tags?: JSON; + rxPacketsReceived: number; + txPacketsEmitted: number; + lastSeenAt: Date; + organizationId: number; + organizationName: string; + createdAt: Date; + updatedAt: Date; + createdBy: number; + updatedBy: number; + createdByName: string; + updatedByName: string; } export class GatewayData { - data: Gateway[]; - ok?: boolean; - count?: number; + data: Gateway[]; + ok?: boolean; + count?: number; } export class GatewayRequest { - gateway: Gateway; - organizationId: number; + gateway: Gateway; + organizationId: number; } export class GatewayResponseMany { - resultList: Gateway[]; - totalCount: number; + resultList: Gateway[]; + totalCount: number; } export class GatewayResponse { - createdAt: string; - updatedAt: string; - firstSeenAt: string; - lastSeenAt: string; - gateway: Gateway; - stats: GatewayStats[]; + createdAt: string; + updatedAt: string; + firstSeenAt: string; + lastSeenAt: string; + gateway: Gateway; + stats: GatewayStats[]; } export interface GatewayStats { - timestamp: Date; - rxPacketsReceived: number; - rxPacketsReceivedOK: number; - txPacketsReceived: number; - txPacketsEmitted: number; + timestamp: Date; + rxPacketsReceived: number; + rxPacketsReceivedOK: number; + txPacketsReceived: number; + txPacketsEmitted: number; } export interface GetAllGatewayStatusParameters { - limit?: number; - offset?: number; - organizationId?: number; - timeInterval?: GatewayStatusInterval; + limit?: number; + offset?: number; + organizationId?: number; + timeInterval?: GatewayStatusInterval; } export interface StatusTimestamp { - timestamp: Date; - wasOnline: boolean; + timestamp: Date; + wasOnline: boolean; } export interface GetGatewayStatusParameters { - timeInterval?: GatewayStatusInterval; + timeInterval?: GatewayStatusInterval; } export interface GatewayStatus { - id: string; - name: string; - statusTimestamps: StatusTimestamp[]; + id: string; + name: string; + statusTimestamps: StatusTimestamp[]; } export interface AllGatewayStatusResponse { - data: GatewayStatus[]; - count: number; + data: GatewayStatus[]; + count: number; } diff --git a/src/app/gateway/gateway.module.ts b/src/app/gateway/gateway.module.ts index c73455411..16283bb26 100644 --- a/src/app/gateway/gateway.module.ts +++ b/src/app/gateway/gateway.module.ts @@ -1,41 +1,41 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule, Routes } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; -import { GatewayTableComponent } from './gateway-table/gateway-table.component'; -import { GatewaysComponent } from './gateways/gateways.component'; -import { GatewayOverviewComponent } from './gateway-overview/gateway-overview.component'; -import { GatewayEditComponent } from './gateway-edit/gateway-edit.component'; -import { FormsModule } from '@angular/forms'; -import { GatewayDetailComponent } from './gateway-detail/gateway-detail.component'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { NGMaterialModule } from '@shared/Modules/materiale.module'; -import { FormModule } from '@shared/components/forms/form.module'; -import { SharedModule } from '@shared/shared.module'; -import { PipesModule } from '@shared/pipes/pipes.module'; -import { GatewayStatusComponent } from './gateway-status/gateway-status.component'; -import { GraphModule } from '@app/graph/graph.module'; -import { GatewayListComponent } from './gateway-overview/gateway-tabs/gateway-list/gateway-list.component'; -import { GatewayMapComponent } from './gateway-overview/gateway-tabs/gateway-map/gateway-map.component'; -import { GatewayStatusOverviewComponent } from './gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule, Routes } from "@angular/router"; +import { TranslateModule } from "@ngx-translate/core"; +import { GatewayTableComponent } from "./gateway-table/gateway-table.component"; +import { GatewaysComponent } from "./gateways/gateways.component"; +import { GatewayOverviewComponent } from "./gateway-overview/gateway-overview.component"; +import { GatewayEditComponent } from "./gateway-edit/gateway-edit.component"; +import { FormsModule } from "@angular/forms"; +import { GatewayDetailComponent } from "./gateway-detail/gateway-detail.component"; +import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"; +import { NGMaterialModule } from "@shared/Modules/materiale.module"; +import { FormModule } from "@shared/components/forms/form.module"; +import { SharedModule } from "@shared/shared.module"; +import { PipesModule } from "@shared/pipes/pipes.module"; +import { GatewayStatusComponent } from "./gateway-status/gateway-status.component"; +import { GraphModule } from "@app/graph/graph.module"; +import { GatewayListComponent } from "./gateway-overview/gateway-tabs/gateway-list/gateway-list.component"; +import { GatewayMapComponent } from "./gateway-overview/gateway-tabs/gateway-map/gateway-map.component"; +import { GatewayStatusOverviewComponent } from "./gateway-overview/gateway-tabs/gateway-status-overview/gateway-status-overview.component"; const gatewayRoutes: Routes = [ { - path: '', + path: "", component: GatewaysComponent, children: [ { - path: '', + path: "", component: GatewayOverviewComponent, children: [ - { path: 'list', component: GatewayListComponent }, - { path: 'map', component: GatewayMapComponent }, - { path: 'status', component: GatewayStatusOverviewComponent }, + { path: "list", component: GatewayListComponent }, + { path: "map", component: GatewayMapComponent }, + { path: "status", component: GatewayStatusOverviewComponent }, ], }, - { path: 'gateway-edit/:id', component: GatewayEditComponent }, - { path: 'gateway-edit', component: GatewayEditComponent }, - { path: 'gateway-detail/:id', component: GatewayDetailComponent }, + { path: "gateway-edit/:id", component: GatewayEditComponent }, + { path: "gateway-edit", component: GatewayEditComponent }, + { path: "gateway-detail/:id", component: GatewayDetailComponent }, ], }, ]; diff --git a/src/app/gateway/gateway.service.ts b/src/app/gateway/gateway.service.ts index 24debf78b..498a907a0 100644 --- a/src/app/gateway/gateway.service.ts +++ b/src/app/gateway/gateway.service.ts @@ -1,7 +1,7 @@ -import { Injectable } from '@angular/core'; -import { Subject } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { Subject } from "rxjs"; -@Injectable({ providedIn: 'root' }) +@Injectable({ providedIn: "root" }) export class GatewayService { organisationChangeSubject: Subject = new Subject(); isGatewayStatusVisibleSubject: Subject = new Subject(); diff --git a/src/app/gateway/gateways/gateways.component.html b/src/app/gateway/gateways/gateways.component.html index 90c6b6463..0680b43f9 100644 --- a/src/app/gateway/gateways/gateways.component.html +++ b/src/app/gateway/gateways/gateways.component.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/app/gateway/gateways/gateways.component.ts b/src/app/gateway/gateways/gateways.component.ts index 986622b55..d6f54abdb 100644 --- a/src/app/gateway/gateways/gateways.component.ts +++ b/src/app/gateway/gateways/gateways.component.ts @@ -1,15 +1,12 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-gateways', - templateUrl: './gateways.component.html', - styleUrls: ['./gateways.component.scss'] + selector: "app-gateways", + templateUrl: "./gateways.component.html", + styleUrls: ["./gateways.component.scss"], }) export class GatewaysComponent implements OnInit { + constructor() {} - constructor() { } - - ngOnInit(): void { - } - + ngOnInit(): void {} } diff --git a/src/app/graph/graph.component.html b/src/app/graph/graph.component.html index 1c8030cf3..49c3418e4 100644 --- a/src/app/graph/graph.component.html +++ b/src/app/graph/graph.component.html @@ -1,13 +1,13 @@ - + - {{title}} + {{ title }}
      - {{ 'GEN.NO-DATA' | translate }} + {{ "GEN.NO-DATA" | translate }}
      - +
      diff --git a/src/app/graph/graph.component.ts b/src/app/graph/graph.component.ts index 89dac1a80..7e3d5860d 100644 --- a/src/app/graph/graph.component.ts +++ b/src/app/graph/graph.component.ts @@ -1,24 +1,17 @@ -import { - Component, - ElementRef, - Input, - OnChanges, - SimpleChanges, - ViewChild, -} from '@angular/core'; -import { Chart, ChartConfiguration } from 'chart.js'; +import { Component, ElementRef, Input, OnChanges, SimpleChanges, ViewChild } from "@angular/core"; +import { Chart, ChartConfiguration } from "chart.js"; -const canvasId = 'someGraph'; +const canvasId = "someGraph"; @Component({ - selector: 'app-graph', - templateUrl: './graph.component.html', - styleUrls: ['./graph.component.scss'], + selector: "app-graph", + templateUrl: "./graph.component.html", + styleUrls: ["./graph.component.scss"], }) export class GraphComponent implements OnChanges { - @Input() data: ChartConfiguration['data']; - @Input() type: ChartConfiguration['type']; - @Input() options: ChartConfiguration['options'] = { + @Input() data: ChartConfiguration["data"]; + @Input() type: ChartConfiguration["type"]; + @Input() options: ChartConfiguration["options"] = { plugins: { legend: { display: false } }, responsive: true, layout: { @@ -57,7 +50,7 @@ export class GraphComponent implements OnChanges { const options = this.buildOptionsForNoData(this.options); - this.chartInstance = new Chart(this.chart.nativeElement.getContext('2d'), { + this.chartInstance = new Chart(this.chart.nativeElement.getContext("2d"), { data: this.data, type: this.type, options, @@ -69,15 +62,11 @@ export class GraphComponent implements OnChanges { return ( !this.data?.datasets?.length || (this.data.datasets.length === 1 && - !this.data.datasets[0].data.some( - (point) => point !== null && point !== undefined - )) + !this.data.datasets[0].data.some(point => point !== null && point !== undefined)) ); } - private buildOptionsForNoData( - options: ChartConfiguration['options'] - ): typeof options { + private buildOptionsForNoData(options: ChartConfiguration["options"]): typeof options { this.isGraphEmpty = this.checkIfGraphIsEmpty(); return this.isGraphEmpty diff --git a/src/app/graph/graph.module.ts b/src/app/graph/graph.module.ts index c675024f1..a301f6ca3 100644 --- a/src/app/graph/graph.module.ts +++ b/src/app/graph/graph.module.ts @@ -1,9 +1,9 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { NGMaterialModule } from '@shared/Modules/materiale.module'; -import { Chart, registerables } from 'chart.js'; -import { GraphComponent } from './graph.component'; +import { CommonModule } from "@angular/common"; +import { NgModule } from "@angular/core"; +import { TranslateModule } from "@ngx-translate/core"; +import { NGMaterialModule } from "@shared/Modules/materiale.module"; +import { Chart, registerables } from "chart.js"; +import { GraphComponent } from "./graph.component"; // Register everything necessary to cover all configurations Chart.register(...registerables); diff --git a/src/app/navbar/global-admin/global-admin.component.html b/src/app/navbar/global-admin/global-admin.component.html index 11bc45cc5..8e55f771e 100644 --- a/src/app/navbar/global-admin/global-admin.component.html +++ b/src/app/navbar/global-admin/global-admin.component.html @@ -1,32 +1,29 @@ - - - - - - + + + + + + - - - \ No newline at end of file + + diff --git a/src/app/navbar/global-admin/global-admin.component.scss b/src/app/navbar/global-admin/global-admin.component.scss index d3f5a12fa..e69de29bb 100644 --- a/src/app/navbar/global-admin/global-admin.component.scss +++ b/src/app/navbar/global-admin/global-admin.component.scss @@ -1 +0,0 @@ - diff --git a/src/app/navbar/global-admin/global-admin.component.ts b/src/app/navbar/global-admin/global-admin.component.ts index 4db06ad28..dec1dbb46 100644 --- a/src/app/navbar/global-admin/global-admin.component.ts +++ b/src/app/navbar/global-admin/global-admin.component.ts @@ -1,14 +1,14 @@ -import { Component, OnInit } from '@angular/core'; -import { PermissionType } from '@app/admin/permission/permission.model'; -import { UserResponse } from '@app/admin/users/user.model'; -import { faGlobe, faUsers, faIdBadge, faSitemap, faUser } from '@fortawesome/free-solid-svg-icons'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { MeService } from '@shared/services/me.service'; +import { Component, OnInit } from "@angular/core"; +import { PermissionType } from "@app/admin/permission/permission.model"; +import { UserResponse } from "@app/admin/users/user.model"; +import { faGlobe, faUsers, faIdBadge, faSitemap, faUser } from "@fortawesome/free-solid-svg-icons"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { MeService } from "@shared/services/me.service"; @Component({ - selector: 'app-global-admin', - templateUrl: './global-admin.component.html', - styleUrls: ['./global-admin.component.scss'], + selector: "app-global-admin", + templateUrl: "./global-admin.component.html", + styleUrls: ["./global-admin.component.scss"], }) export class GlobalAdminComponent implements OnInit { faGlobe = faGlobe; @@ -20,10 +20,7 @@ export class GlobalAdminComponent implements OnInit { public user: UserResponse; public isGlobalAdmin = false; - constructor( - private sharedVariableService: SharedVariableService, - private meService: MeService - ) {} + constructor(private sharedVariableService: SharedVariableService, private meService: MeService) {} ngOnInit(): void { this.user = this.sharedVariableService.getUserInfo().user; diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index 412185bb9..227b92d9c 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -1,6 +1,7 @@ -

      -

      (click)="ctaActionButtonOnClick()" class="btn btn-secondary" type="button" - [attr.aria-label]="ctaActionButtonLabel"> - {{ctaActionButtonLabel}} + [attr.aria-label]="ctaActionButtonLabel" + > + {{ ctaActionButtonLabel }} + + - - + - {{dropdownLabel}} + {{ dropdownLabel }} - --{{dropdownDefaultOption}}-- + --{{ dropdownDefaultOption }}-- - {{option.name}} + {{ option.name }} diff --git a/src/app/shared/components/top-bar-table/top-bar-table.component.spec.ts b/src/app/shared/components/top-bar-table/top-bar-table.component.spec.ts index bca989258..0d87edbe8 100644 --- a/src/app/shared/components/top-bar-table/top-bar-table.component.spec.ts +++ b/src/app/shared/components/top-bar-table/top-bar-table.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { TopBarTableComponent } from './top-bar-table.component'; +import { TopBarTableComponent } from "./top-bar-table.component"; -describe('TopBarTableComponent', () => { +describe("TopBarTableComponent", () => { let component: TopBarTableComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ TopBarTableComponent ] - }) - .compileComponents(); + declarations: [TopBarTableComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('TopBarTableComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/shared/components/top-bar-table/top-bar-table.component.ts b/src/app/shared/components/top-bar-table/top-bar-table.component.ts index 7e3953161..10bfdc127 100644 --- a/src/app/shared/components/top-bar-table/top-bar-table.component.ts +++ b/src/app/shared/components/top-bar-table/top-bar-table.component.ts @@ -1,12 +1,12 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { Location } from '@angular/common'; -import { TranslateService } from '@ngx-translate/core'; -import { MatDialog } from '@angular/material/dialog'; +import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; +import { Location } from "@angular/common"; +import { TranslateService } from "@ngx-translate/core"; +import { MatDialog } from "@angular/material/dialog"; @Component({ - selector: 'app-top-bar-table', - templateUrl: './top-bar-table.component.html', - styleUrls: ['./top-bar-table.component.scss'], + selector: "app-top-bar-table", + templateUrl: "./top-bar-table.component.html", + styleUrls: ["./top-bar-table.component.scss"], }) export class TopBarTableComponent implements OnInit { @Input() title: string; @@ -27,7 +27,7 @@ export class TopBarTableComponent implements OnInit { @Input() dropdownDefaultOption: string; constructor(public translate: TranslateService, private location: Location) { - translate.use('da'); + translate.use("da"); } ngOnInit(): void {} diff --git a/src/app/shared/components/top-bar/top-bar.component.html b/src/app/shared/components/top-bar/top-bar.component.html index f29b83b70..c95744bf7 100644 --- a/src/app/shared/components/top-bar/top-bar.component.html +++ b/src/app/shared/components/top-bar/top-bar.component.html @@ -1,8 +1,6 @@ @@ -15,22 +13,12 @@
      @@ -118,7 +96,7 @@

      {{ title || staticTitle }}

      --> - {{ 'SEARCH.PLACEHOLDER' | translate }} + {{ "SEARCH.PLACEHOLDER" | translate }} {{ title || staticTitle }}

      [value]="decode(searchQuery)" (keyup.enter)="search(searchInput.value)" /> - +
      @@ -152,22 +126,17 @@

      {{ title || staticTitle }}

      -
      {{ 'USER_PAGE.USER_PAGE' | translate }} - + {{ "USER_PAGE.USER_PAGE" | translate }} {{ 'NAV.LOGOUT' | translate }} + >{{ "NAV.LOGOUT" | translate }}
    diff --git a/src/app/shared/components/top-bar/top-bar.component.scss b/src/app/shared/components/top-bar/top-bar.component.scss index a8bc3782b..085b64e45 100644 --- a/src/app/shared/components/top-bar/top-bar.component.scss +++ b/src/app/shared/components/top-bar/top-bar.component.scss @@ -1,5 +1,5 @@ -@import 'src/assets/scss/setup/breakpoints'; -@import 'src/assets/scss/setup/variables'; +@import "src/assets/scss/setup/breakpoints"; +@import "src/assets/scss/setup/variables"; .per-page { line-height: 40px; @@ -39,7 +39,7 @@ button:focus { align-items: center; } -.invisible{ +.invisible { display: none; visibility: hidden; height: 0; diff --git a/src/app/shared/components/top-bar/top-bar.component.spec.ts b/src/app/shared/components/top-bar/top-bar.component.spec.ts index 81f9af4c8..06e81e6be 100644 --- a/src/app/shared/components/top-bar/top-bar.component.spec.ts +++ b/src/app/shared/components/top-bar/top-bar.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { TopBarComponent } from './top-bar.component'; +import { TopBarComponent } from "./top-bar.component"; -describe('TopBarComponent', () => { +describe("TopBarComponent", () => { let component: TopBarComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ TopBarComponent ] - }) - .compileComponents(); + declarations: [TopBarComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('TopBarComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/shared/components/top-bar/top-bar.component.ts b/src/app/shared/components/top-bar/top-bar.component.ts index 50015635e..5c771d9a3 100644 --- a/src/app/shared/components/top-bar/top-bar.component.ts +++ b/src/app/shared/components/top-bar/top-bar.component.ts @@ -1,34 +1,29 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Location } from '@angular/common'; -import { Sort } from '@shared/models/sort.model'; -import { Router } from '@angular/router'; -import { - faSearch, - faChevronLeft, - faUser, - faQuestionCircle, -} from '@fortawesome/free-solid-svg-icons'; -import { Application } from '@applications/application.model'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { BackButton } from '@shared/models/back-button.model'; -import { QuickActionButton } from '@shared/models/quick-action-button.model'; -import { OrganisationResponse } from '@app/admin/organisation/organisation.model'; -import { Gateway } from '@app/gateway/gateway.model'; -import { DatatargetResponse } from '@applications/datatarget/datatarget-response.model'; -import { PayloadDecoder } from '@payload-decoder/payload-decoder.model'; -import { PermissionResponse } from '@app/admin/permission/permission.model'; -import { UserResponse } from '@app/admin/users/user.model'; -import { DropdownButton } from '@shared/models/dropdown-button.model'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { AuthService } from '@auth/auth.service'; -import { LoggedInService } from '@shared/services/loggedin.service'; -import { environment } from '@environments/environment'; +import { Component, OnInit, Input, Output, EventEmitter } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; +import { Location } from "@angular/common"; +import { Sort } from "@shared/models/sort.model"; +import { Router } from "@angular/router"; +import { faSearch, faChevronLeft, faUser, faQuestionCircle } from "@fortawesome/free-solid-svg-icons"; +import { Application } from "@applications/application.model"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { BackButton } from "@shared/models/back-button.model"; +import { QuickActionButton } from "@shared/models/quick-action-button.model"; +import { OrganisationResponse } from "@app/admin/organisation/organisation.model"; +import { Gateway } from "@app/gateway/gateway.model"; +import { DatatargetResponse } from "@applications/datatarget/datatarget-response.model"; +import { PayloadDecoder } from "@payload-decoder/payload-decoder.model"; +import { PermissionResponse } from "@app/admin/permission/permission.model"; +import { UserResponse } from "@app/admin/users/user.model"; +import { DropdownButton } from "@shared/models/dropdown-button.model"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { AuthService } from "@auth/auth.service"; +import { LoggedInService } from "@shared/services/loggedin.service"; +import { environment } from "@environments/environment"; @Component({ - selector: 'app-top-bar', - templateUrl: './top-bar.component.html', - styleUrls: ['./top-bar.component.scss'], + selector: "app-top-bar", + templateUrl: "./top-bar.component.html", + styleUrls: ["./top-bar.component.scss"], }) export class TopBarComponent implements OnInit { @Input() data: @@ -81,7 +76,7 @@ export class TopBarComponent implements OnInit { private authService: AuthService, private loggedInService: LoggedInService ) { - translate.use('da'); + translate.use("da"); } ngOnInit(): void { @@ -95,15 +90,9 @@ export class TopBarComponent implements OnInit { } routeTo(): void { - if ( - this.backButton?.routerLink && - Array.isArray(this.backButton.routerLink) - ) { + if (this.backButton?.routerLink && Array.isArray(this.backButton.routerLink)) { this.router.navigate(this.backButton.routerLink); - } else if ( - this.backButton?.routerLink && - typeof this.backButton.routerLink === 'string' - ) { + } else if (this.backButton?.routerLink && typeof this.backButton.routerLink === "string") { this.router.navigate([this.backButton.routerLink]); } else { this.location.back(); @@ -115,15 +104,15 @@ export class TopBarComponent implements OnInit { const urlEncoded = encodeURIComponent(value); if (value) { - this.router.navigate(['/search'], { queryParams: { q: urlEncoded } }); + this.router.navigate(["/search"], { queryParams: { q: urlEncoded } }); } else { - this.decode(''); + this.decode(""); } } decode(val: string): string { if (val === undefined) { - return ''; + return ""; } return decodeURIComponent(val); } @@ -137,7 +126,7 @@ export class TopBarComponent implements OnInit { } public goToHelp() { - window.open('https://os2iot.os2.eu/'); + window.open("https://os2iot.os2.eu/"); } getUsername(): string { @@ -146,7 +135,7 @@ export class TopBarComponent implements OnInit { onLogout() { this.authService.logout(); - this.router.navigateByUrl('auth'); + this.router.navigateByUrl("auth"); this.loggedInService.emitChange(false); } @@ -155,7 +144,7 @@ export class TopBarComponent implements OnInit { if (this.authService.isLoggedInWithKombit()) { return `${environment.baseUrl}auth/kombit/logout?secret_token=${jwt}`; } else { - return ''; + return ""; } } diff --git a/src/app/shared/components/welcome-dialog/welcome-dialog.component.html b/src/app/shared/components/welcome-dialog/welcome-dialog.component.html index b965a1d19..5452f0680 100644 --- a/src/app/shared/components/welcome-dialog/welcome-dialog.component.html +++ b/src/app/shared/components/welcome-dialog/welcome-dialog.component.html @@ -4,37 +4,47 @@

    - {{'WELCOME-DIALOG.WELCOME' | translate}} + {{ "WELCOME-DIALOG.WELCOME" | translate }}

    -

    {{ (dialogModel?.hasSomePermission ? 'WELCOME-DIALOG.WELCOME-SUB' : 'WELCOME-DIALOG.NO-ACCESS') | translate}}

    +

    + {{ (dialogModel?.hasSomePermission ? "WELCOME-DIALOG.WELCOME-SUB" : "WELCOME-DIALOG.NO-ACCESS") | translate }} +

    -

    {{'WELCOME-DIALOG.SUB-HEADER-1' | translate}}

    -

    {{'WELCOME-DIALOG.WELCOME-MESSAGE' | translate}} +

    + {{ "WELCOME-DIALOG.SUB-HEADER-1" | translate }} +

    +

    + {{ "WELCOME-DIALOG.WELCOME-MESSAGE" | translate }} - {{'WELCOME-DIALOG.LINK-1' | - translate}} - {{'WELCOME-DIALOG.WELCOME-MESSAGE-2' | translate}} + {{ "WELCOME-DIALOG.LINK-1" | translate }} {{ "WELCOME-DIALOG.WELCOME-MESSAGE-2" | translate }} +

    +

    + {{ "WELCOME-DIALOG.SUB-HEADER-2" | translate }}

    -

    {{'WELCOME-DIALOG.SUB-HEADER-2' | translate}}

    -

    {{'WELCOME-DIALOG.WELCOME-MESSAGE-3' | translate}} +

    + {{ "WELCOME-DIALOG.WELCOME-MESSAGE-3" | translate }} - {{'WELCOME-DIALOG.LINK-2' | - translate}} + {{ "WELCOME-DIALOG.LINK-2" | translate }} - {{'WELCOME-DIALOG.WELCOME-MESSAGE-4' | translate}} + {{ "WELCOME-DIALOG.WELCOME-MESSAGE-4" | translate }} - {{'WELCOME-DIALOG.LINK-3' | - translate}}. + {{ "WELCOME-DIALOG.LINK-3" | translate }}.

    -{{ - 'DIALOG.WELCOME.DONT-SHOW-AGAIN' | translate}} +{{ "DIALOG.WELCOME.DONT-SHOW-AGAIN" | translate }} diff --git a/src/app/shared/components/welcome-dialog/welcome-dialog.component.scss b/src/app/shared/components/welcome-dialog/welcome-dialog.component.scss index 135c1b7dc..f5c35c3a9 100644 --- a/src/app/shared/components/welcome-dialog/welcome-dialog.component.scss +++ b/src/app/shared/components/welcome-dialog/welcome-dialog.component.scss @@ -1,4 +1,4 @@ -@import 'src/assets/scss/setup/variables'; +@import "src/assets/scss/setup/variables"; $spacing: 5rem; diff --git a/src/app/shared/components/welcome-dialog/welcome-dialog.component.ts b/src/app/shared/components/welcome-dialog/welcome-dialog.component.ts index 7388c1649..97e53a8a6 100644 --- a/src/app/shared/components/welcome-dialog/welcome-dialog.component.ts +++ b/src/app/shared/components/welcome-dialog/welcome-dialog.component.ts @@ -1,13 +1,13 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { UserService } from '@app/admin/users/user.service'; -import { WelcomeDialogModel } from '@shared/models/dialog.model'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; +import { Component, Inject, OnInit } from "@angular/core"; +import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; +import { UserService } from "@app/admin/users/user.service"; +import { WelcomeDialogModel } from "@shared/models/dialog.model"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; @Component({ - selector: 'app-welcome-dialog', - templateUrl: './welcome-dialog.component.html', - styleUrls: ['./welcome-dialog.component.scss'], + selector: "app-welcome-dialog", + templateUrl: "./welcome-dialog.component.html", + styleUrls: ["./welcome-dialog.component.scss"], }) export class WelcomeDialogComponent implements OnInit { dontShowAgain = false; @@ -25,8 +25,8 @@ export class WelcomeDialogComponent implements OnInit { if (this.dontShowAgain) { const userResponse = this.sharedVariableService.getUserInfo(); this.userService.hideWelcome(userResponse.user.id).subscribe( - (_response) => {}, - (_error) => {} + _response => {}, + _error => {} ); } diff --git a/src/app/shared/components/welcome-dialog/welcome-dialog.module.ts b/src/app/shared/components/welcome-dialog/welcome-dialog.module.ts index 51e1804a2..f17779806 100644 --- a/src/app/shared/components/welcome-dialog/welcome-dialog.module.ts +++ b/src/app/shared/components/welcome-dialog/welcome-dialog.module.ts @@ -1,19 +1,13 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { NGMaterialModule } from '@shared/Modules/materiale.module'; -import { SharedModule } from '@shared/shared.module'; -import { WelcomeDialogComponent } from './welcome-dialog.component'; +import { CommonModule } from "@angular/common"; +import { NgModule } from "@angular/core"; +import { FormsModule } from "@angular/forms"; +import { RouterModule } from "@angular/router"; +import { NGMaterialModule } from "@shared/Modules/materiale.module"; +import { SharedModule } from "@shared/shared.module"; +import { WelcomeDialogComponent } from "./welcome-dialog.component"; @NgModule({ declarations: [WelcomeDialogComponent], - imports: [ - CommonModule, - SharedModule, - RouterModule, - NGMaterialModule, - FormsModule, - ], + imports: [CommonModule, SharedModule, RouterModule, NGMaterialModule, FormsModule], }) export class WelcomeDialogModule {} diff --git a/src/app/shared/constants/color-constants.ts b/src/app/shared/constants/color-constants.ts index 19b9b6c5a..90a070e16 100644 --- a/src/app/shared/constants/color-constants.ts +++ b/src/app/shared/constants/color-constants.ts @@ -1 +1 @@ -export const ColorGraphBlue1 = '#03AEEF'; +export const ColorGraphBlue1 = "#03AEEF"; diff --git a/src/app/shared/constants/date.constants.ts b/src/app/shared/constants/date.constants.ts index e637d971a..4e6f97cba 100644 --- a/src/app/shared/constants/date.constants.ts +++ b/src/app/shared/constants/date.constants.ts @@ -1,13 +1,13 @@ -import { MatDateFormats } from '@angular/material/core'; +import { MatDateFormats } from "@angular/material/core"; export const DayMonthYearPickerFormat: MatDateFormats = { parse: { - dateInput: 'DD-MM-YYYY', + dateInput: "DD-MM-YYYY", }, display: { - dateInput: 'DD-MM-YYYY', - monthYearLabel: 'MM-YYYY', - dateA11yLabel: 'DD-MM-YYYY', - monthYearA11yLabel: 'MM-YYYY', + dateInput: "DD-MM-YYYY", + monthYearLabel: "MM-YYYY", + dateA11yLabel: "DD-MM-YYYY", + monthYearA11yLabel: "MM-YYYY", }, }; diff --git a/src/app/shared/directives/directives.module.ts b/src/app/shared/directives/directives.module.ts index 067fd4efe..4e328056f 100644 --- a/src/app/shared/directives/directives.module.ts +++ b/src/app/shared/directives/directives.module.ts @@ -1,24 +1,12 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { DropdownDirective } from './dropdown.directive'; -import { PlaceholderDirective } from './placeholder.directive'; -import { DragDropDirective } from './drag-drop.directive'; - - +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { DropdownDirective } from "./dropdown.directive"; +import { PlaceholderDirective } from "./placeholder.directive"; +import { DragDropDirective } from "./drag-drop.directive"; @NgModule({ - declarations: [ - DropdownDirective, - PlaceholderDirective, - DragDropDirective - ], - imports: [ - CommonModule - ], - exports: [ - DropdownDirective, - PlaceholderDirective, - DragDropDirective - ] + declarations: [DropdownDirective, PlaceholderDirective, DragDropDirective], + imports: [CommonModule], + exports: [DropdownDirective, PlaceholderDirective, DragDropDirective], }) -export class DirectivesModule { } +export class DirectivesModule {} diff --git a/src/app/shared/directives/drag-drop.directive.ts b/src/app/shared/directives/drag-drop.directive.ts index 1bb42f38e..e3443c1fa 100644 --- a/src/app/shared/directives/drag-drop.directive.ts +++ b/src/app/shared/directives/drag-drop.directive.ts @@ -1,42 +1,39 @@ - -import { Directive, Output, Input, EventEmitter, HostBinding, HostListener } from '@angular/core'; +import { Directive, Output, Input, EventEmitter, HostBinding, HostListener } from "@angular/core"; @Directive({ - selector: '[appDragDrop]' + selector: "[appDragDrop]", }) export class DragDropDirective { - - @Output() onFileDropped = new EventEmitter(); - - @HostBinding('style.background-color') private background = '#f5fcff' - @HostBinding('style.opacity') private opacity = '1' - - //Dragover listener - @HostListener('dragover', ['$event']) onDragOver(evt) { - evt.preventDefault(); - evt.stopPropagation(); - this.background = '#9ecbec'; - this.opacity = '0.8' + @Output() onFileDropped = new EventEmitter(); + + @HostBinding("style.background-color") private background = "#f5fcff"; + @HostBinding("style.opacity") private opacity = "1"; + + //Dragover listener + @HostListener("dragover", ["$event"]) onDragOver(evt) { + evt.preventDefault(); + evt.stopPropagation(); + this.background = "#9ecbec"; + this.opacity = "0.8"; + } + + //Dragleave listener + @HostListener("dragleave", ["$event"]) public onDragLeave(evt) { + evt.preventDefault(); + evt.stopPropagation(); + this.background = "#f5fcff"; + this.opacity = "1"; + } + + //Drop listener + @HostListener("drop", ["$event"]) public ondrop(evt) { + evt.preventDefault(); + evt.stopPropagation(); + this.background = "#f5fcff"; + this.opacity = "1"; + let files = evt.dataTransfer.files; + if (files.length > 0) { + this.onFileDropped.emit(files); } - - //Dragleave listener - @HostListener('dragleave', ['$event']) public onDragLeave(evt) { - evt.preventDefault(); - evt.stopPropagation(); - this.background = '#f5fcff' - this.opacity = '1' - } - - //Drop listener - @HostListener('drop', ['$event']) public ondrop(evt) { - evt.preventDefault(); - evt.stopPropagation(); - this.background = '#f5fcff' - this.opacity = '1' - let files = evt.dataTransfer.files; - if (files.length > 0) { - this.onFileDropped.emit(files) - } - } - -} \ No newline at end of file + } +} diff --git a/src/app/shared/directives/dropdown.directive.ts b/src/app/shared/directives/dropdown.directive.ts index 77c93ee11..7b78d9081 100644 --- a/src/app/shared/directives/dropdown.directive.ts +++ b/src/app/shared/directives/dropdown.directive.ts @@ -1,12 +1,12 @@ -import { Directive, HostListener, HostBinding } from '@angular/core'; +import { Directive, HostListener, HostBinding } from "@angular/core"; @Directive({ - selector: '[appDropdown]' + selector: "[appDropdown]", }) export class DropdownDirective { - @HostBinding('class.open') isOpen = false; + @HostBinding("class.open") isOpen = false; - @HostListener('click') toggleOpen() { - this.isOpen = !this.isOpen; - } -} \ No newline at end of file + @HostListener("click") toggleOpen() { + this.isOpen = !this.isOpen; + } +} diff --git a/src/app/shared/directives/placeholder.directive.ts b/src/app/shared/directives/placeholder.directive.ts index 1cde7668b..2d063aaac 100644 --- a/src/app/shared/directives/placeholder.directive.ts +++ b/src/app/shared/directives/placeholder.directive.ts @@ -1,8 +1,8 @@ -import { Directive, ViewContainerRef } from '@angular/core'; +import { Directive, ViewContainerRef } from "@angular/core"; @Directive({ - selector: '[appPlaceholder]' + selector: "[appPlaceholder]", }) export class PlaceholderDirective { - constructor(public viewContainerRef: ViewContainerRef) { } + constructor(public viewContainerRef: ViewContainerRef) {} } diff --git a/src/app/shared/enums/activation-type.ts b/src/app/shared/enums/activation-type.ts index 79836dc03..7b062538c 100644 --- a/src/app/shared/enums/activation-type.ts +++ b/src/app/shared/enums/activation-type.ts @@ -1,5 +1,5 @@ export enum ActivationType { - NONE = 'NONE', - OTAA = 'OTAA', - ABP = 'ABP', + NONE = "NONE", + OTAA = "OTAA", + ABP = "ABP", } diff --git a/src/app/shared/enums/authentication-type.ts b/src/app/shared/enums/authentication-type.ts index 971b15420..1226361cd 100644 --- a/src/app/shared/enums/authentication-type.ts +++ b/src/app/shared/enums/authentication-type.ts @@ -1,4 +1,4 @@ export enum AuthenticationType { - PASSWORD = 'PASSWORD', - CERTIFICATE = 'CERTIFICATE', + PASSWORD = "PASSWORD", + CERTIFICATE = "CERTIFICATE", } diff --git a/src/app/shared/enums/datatarget-type.ts b/src/app/shared/enums/datatarget-type.ts index d157fb9bf..dc126d563 100644 --- a/src/app/shared/enums/datatarget-type.ts +++ b/src/app/shared/enums/datatarget-type.ts @@ -1,6 +1,6 @@ export enum DataTargetType { - HTTPPUSH = 'HTTP_PUSH', - OPENDATADK = 'OPENDATADK', - FIWARE = 'FIWARE', - MQTT = 'MQTT' + HTTPPUSH = "HTTP_PUSH", + OPENDATADK = "OPENDATADK", + FIWARE = "FIWARE", + MQTT = "MQTT", } diff --git a/src/app/shared/enums/device-type.ts b/src/app/shared/enums/device-type.ts index 2a5f8d12f..7ba843d46 100644 --- a/src/app/shared/enums/device-type.ts +++ b/src/app/shared/enums/device-type.ts @@ -1,16 +1,16 @@ -import { recordToEntries } from '@shared/helpers/record.helper'; +import { recordToEntries } from "@shared/helpers/record.helper"; export enum DeviceType { - GENERIC_HTTP = 'GENERIC_HTTP', - LORAWAN = 'LORAWAN', - SIGFOX = 'SIGFOX', - MQTT = 'MQTT', - MQTT_INTERNAL_BROKER = 'MQTT_INTERNAL_BROKER', - MQTT_EXTERNAL_BROKER = 'MQTT_EXTERNAL_BROKER', + GENERIC_HTTP = "GENERIC_HTTP", + LORAWAN = "LORAWAN", + SIGFOX = "SIGFOX", + MQTT = "MQTT", + MQTT_INTERNAL_BROKER = "MQTT_INTERNAL_BROKER", + MQTT_EXTERNAL_BROKER = "MQTT_EXTERNAL_BROKER", } enum ApplicationExtraDeviceType { - OTHER = 'OTHER', + OTHER = "OTHER", } export type ApplicationDeviceTypeUnion = @@ -22,6 +22,4 @@ export const ApplicationDeviceTypes = { ...DeviceType, ...ApplicationExtraDeviceType, }; -export const ApplicationDeviceTypeEntries = recordToEntries( - ApplicationDeviceTypes -); +export const ApplicationDeviceTypeEntries = recordToEntries(ApplicationDeviceTypes); diff --git a/src/app/shared/enums/multicast-type.ts b/src/app/shared/enums/multicast-type.ts index acb0283de..90f7499e1 100644 --- a/src/app/shared/enums/multicast-type.ts +++ b/src/app/shared/enums/multicast-type.ts @@ -1,4 +1,4 @@ export enum MulticastType { // Class-B: {ClassB = 'Class-B'}, - ClassC = 'CLASS_C', + ClassC = "CLASS_C", } diff --git a/src/app/shared/error-message.service.ts b/src/app/shared/error-message.service.ts index 67108b33c..c70307a3b 100644 --- a/src/app/shared/error-message.service.ts +++ b/src/app/shared/error-message.service.ts @@ -3,64 +3,64 @@ import { Injectable } from "@angular/core"; import { ErrorMessage } from "./models/error-message.model"; @Injectable({ - providedIn: "root", + providedIn: "root", }) export class ErrorMessageService { - public handleErrorMessage(err: HttpErrorResponse): string[] { - let errorMessages = []; - if (typeof err.error.message === "string") { - errorMessages.push(err.error.message); - } else if (err.error.chirpstackError) { - errorMessages.push(err.error.chirpstackError.message); + public handleErrorMessage(err: HttpErrorResponse): string[] { + let errorMessages = []; + if (typeof err.error.message === "string") { + errorMessages.push(err.error.message); + } else if (err.error.chirpstackError) { + errorMessages.push(err.error.chirpstackError.message); + } else { + err.error.message.forEach(err => { + if (err.property === "lorawanSettings") { + err.children.forEach(element => { + errorMessages = errorMessages.concat(Object.values(element.constraints)); + }); } else { - err.error.message.forEach(err => { - if (err.property === "lorawanSettings") { - err.children.forEach(element => { - errorMessages = errorMessages.concat(Object.values(element.constraints)); - }); - } else { - errorMessages.push(Object.values(err.constraints)); - } - }); + errorMessages.push(Object.values(err.constraints)); } - return errorMessages; + }); } + return errorMessages; + } - public handleErrorMessageWithFields(error: HttpErrorResponse | Pick): ErrorMessage { - const errors: ErrorMessage = { errorFields: [], errorMessages: [] }; - if (typeof error.error === "string") { - errors.errorMessages.push(error.error); - } else if (typeof error.error?.error === "string" && !Array.isArray(error.error?.message)) { - errors.errorMessages.push(error.error.error); - } else if (typeof error.error?.message === "string") { - errors.errorMessages.push(error.error.message); - } else { - error.error.message.forEach(err => { - if (err.children.length > 0) { - this.handleNestedErrorFields(err.children, errors); - } else if (err.message) { - errors.errorFields.push(err.field); - errors.errorMessages.push(err.message); - } else if (err.constraints) { - errors.errorFields.push(err.property); - errors.errorMessages = errors.errorMessages.concat(Object.values(err.constraints)); - } - }); + public handleErrorMessageWithFields(error: HttpErrorResponse | Pick): ErrorMessage { + const errors: ErrorMessage = { errorFields: [], errorMessages: [] }; + if (typeof error.error === "string") { + errors.errorMessages.push(error.error); + } else if (typeof error.error?.error === "string" && !Array.isArray(error.error?.message)) { + errors.errorMessages.push(error.error.error); + } else if (typeof error.error?.message === "string") { + errors.errorMessages.push(error.error.message); + } else { + error.error.message.forEach(err => { + if (err.children.length > 0) { + this.handleNestedErrorFields(err.children, errors); + } else if (err.message) { + errors.errorFields.push(err.field); + errors.errorMessages.push(err.message); + } else if (err.constraints) { + errors.errorFields.push(err.property); + errors.errorMessages = errors.errorMessages.concat(Object.values(err.constraints)); } - return errors; + }); } + return errors; + } - private handleNestedErrorFields(errorChildren: any, errors: ErrorMessage) { - errorChildren.forEach(error => { - if (error.constraints) { - errors.errorFields.push( - error.property === "openDataDkDataset" ? "openDataDkDataset." + error.property : error.property - ); - console.log(errors.errorFields); - errors.errorMessages = errors.errorMessages.concat(Object.values(error.constraints)); - } else if (error.children) { - this.handleNestedErrorFields(error.children, errors); - } - }); - } + private handleNestedErrorFields(errorChildren: any, errors: ErrorMessage) { + errorChildren.forEach(error => { + if (error.constraints) { + errors.errorFields.push( + error.property === "openDataDkDataset" ? "openDataDkDataset." + error.property : error.property + ); + console.log(errors.errorFields); + errors.errorMessages = errors.errorMessages.concat(Object.values(error.constraints)); + } else if (error.children) { + this.handleNestedErrorFields(error.children, errors); + } + }); + } } diff --git a/src/app/shared/helpers/array.helper.ts b/src/app/shared/helpers/array.helper.ts index 795c234c0..547439910 100644 --- a/src/app/shared/helpers/array.helper.ts +++ b/src/app/shared/helpers/array.helper.ts @@ -1,10 +1,7 @@ -import type { Tail } from './type.helper'; +import type { Tail } from "./type.helper"; -export const splitList = ( - data: T[], - batchSize = 50 -): typeof data[] => { - const dataBatches: typeof data[] = []; +export const splitList = (data: T[], batchSize = 50): (typeof data)[] => { + const dataBatches: (typeof data)[] = []; for (let i = 0; i < data.length; i += batchSize) { dataBatches.push(data.slice(i, i + batchSize)); } @@ -14,11 +11,8 @@ export const splitList = ( const sortByGeneric = ( value: T[], - order: 'asc' | 'desc' = 'asc', - sortByDelegate: ( - arr: typeof value, - ...params: DelegateParams[] - ) => typeof value, + order: "asc" | "desc" = "asc", + sortByDelegate: (arr: typeof value, ...params: DelegateParams[]) => typeof value, ...sortByParams: Tail> ): T[] => { if (!value?.length) { @@ -26,44 +20,27 @@ const sortByGeneric = ( } const copy = sortByDelegate(value, ...sortByParams); - return order === 'asc' ? copy : copy.reverse(); + return order === "asc" ? copy : copy.reverse(); }; const sortByColumnAsc = (value: T[], column: keyof T): T[] => { - return value - .slice() - .sort((a, b) => - a[column] === b[column] ? 0 : a[column] > b[column] ? 1 : -1 - ); + return value.slice().sort((a, b) => (a[column] === b[column] ? 0 : a[column] > b[column] ? 1 : -1)); }; -const sortBySelectorAsc = ( - value: T[], - valueSelector: (e: T) => string | number -): T[] => { +const sortBySelectorAsc = (value: T[], valueSelector: (e: T) => string | number): T[] => { return value .slice() - .sort((a, b) => - valueSelector(a) === valueSelector(b) - ? 0 - : valueSelector(a) > valueSelector(b) - ? 1 - : -1 - ); + .sort((a, b) => (valueSelector(a) === valueSelector(b) ? 0 : valueSelector(a) > valueSelector(b) ? 1 : -1)); }; -export const sortBy = ( - value: T[], - column: keyof T, - order: 'asc' | 'desc' = 'asc' -): T[] => { +export const sortBy = (value: T[], column: keyof T, order: "asc" | "desc" = "asc"): T[] => { return sortByGeneric(value, order, sortByColumnAsc, column); }; export const sortBySelector = ( value: T[], valueSelector: (e: T) => string | number, - order: 'asc' | 'desc' = 'asc' + order: "asc" | "desc" = "asc" ): T[] => { return sortByGeneric(value, order, sortBySelectorAsc, valueSelector); }; diff --git a/src/app/shared/helpers/auth-jwt.interceptor.ts b/src/app/shared/helpers/auth-jwt.interceptor.ts index 788de68bf..fabdea06b 100644 --- a/src/app/shared/helpers/auth-jwt.interceptor.ts +++ b/src/app/shared/helpers/auth-jwt.interceptor.ts @@ -1,35 +1,27 @@ -import { Injectable } from '@angular/core'; -import { - HttpEvent, - HttpRequest, - HttpHandler, - HttpInterceptor, -} from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { environment } from '../../../environments/environment'; +import { Injectable } from "@angular/core"; +import { HttpEvent, HttpRequest, HttpHandler, HttpInterceptor } from "@angular/common/http"; +import { Observable } from "rxjs"; +import { environment } from "../../../environments/environment"; @Injectable() export class AuthJwtInterceptor implements HttpInterceptor { - intercept( - req: HttpRequest, - next: HttpHandler - ): Observable> { - // If we're not calling the baseurl skip this. Is there a better way? - if (req.url.indexOf(environment.baseUrl) != 0) { - console.warn(`Skip adding Bearer since we're not calling baseUrl ... URL: '${req.url}'`); - return next.handle(req); - } + intercept(req: HttpRequest, next: HttpHandler): Observable> { + // If we're not calling the baseurl skip this. Is there a better way? + if (req.url.indexOf(environment.baseUrl) != 0) { + console.warn(`Skip adding Bearer since we're not calling baseUrl ... URL: '${req.url}'`); + return next.handle(req); + } - const idToken = localStorage.getItem('id_token'); + const idToken = localStorage.getItem("id_token"); - if (idToken) { - const cloned = req.clone({ - headers: req.headers.set('Authorization', 'Bearer ' + idToken), - }); + if (idToken) { + const cloned = req.clone({ + headers: req.headers.set("Authorization", "Bearer " + idToken), + }); - return next.handle(cloned); - } else { - return next.handle(req); - } + return next.handle(cloned); + } else { + return next.handle(req); } + } } diff --git a/src/app/shared/helpers/download.helper.ts b/src/app/shared/helpers/download.helper.ts index aad10a672..8e8b841d2 100644 --- a/src/app/shared/helpers/download.helper.ts +++ b/src/app/shared/helpers/download.helper.ts @@ -1,44 +1,30 @@ -import { - HttpEvent, - HttpEventType, - HttpProgressEvent, - HttpResponse, -} from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { distinctUntilChanged, scan, map, tap } from 'rxjs/operators'; +import { HttpEvent, HttpEventType, HttpProgressEvent, HttpResponse } from "@angular/common/http"; +import { Observable } from "rxjs"; +import { distinctUntilChanged, scan, map, tap } from "rxjs/operators"; function isHttpResponse(event: HttpEvent): event is HttpResponse { return event.type === HttpEventType.Response; } -function isHttpProgressEvent( - event: HttpEvent -): event is HttpProgressEvent { - return ( - event.type === HttpEventType.DownloadProgress || - event.type === HttpEventType.UploadProgress - ); +function isHttpProgressEvent(event: HttpEvent): event is HttpProgressEvent { + return event.type === HttpEventType.DownloadProgress || event.type === HttpEventType.UploadProgress; } export interface Download { content: Blob | null; progress: number; - state: 'PENDING' | 'IN_PROGRESS' | 'DONE'; + state: "PENDING" | "IN_PROGRESS" | "DONE"; } -export function download( - saver?: (b: Blob) => void -): (source: Observable>) => Observable { +export function download(saver?: (b: Blob) => void): (source: Observable>) => Observable { return (source: Observable>) => source.pipe( scan( (download: Download, event): Download => { if (isHttpProgressEvent(event)) { return { - progress: event.total - ? Math.round((100 * event.loaded) / event.total) - : download.progress, - state: 'IN_PROGRESS', + progress: event.total ? Math.round((100 * event.loaded) / event.total) : download.progress, + state: "IN_PROGRESS", content: null, }; } @@ -48,31 +34,26 @@ export function download( } return { progress: 100, - state: 'DONE', + state: "DONE", content: event.body, }; } return download; }, - { state: 'PENDING', progress: 0, content: null } + { state: "PENDING", progress: 0, content: null } ), - distinctUntilChanged( - (a, b) => - a.state === b.state && - a.progress === b.progress && - a.content === b.content - ) + distinctUntilChanged((a, b) => a.state === b.state && a.progress === b.progress && a.content === b.content) ); } export function simpleDownload(data: string, filename: string) { - const blob = new Blob([data], { type: 'text/plain' }); + const blob = new Blob([data], { type: "text/plain" }); const url = URL.createObjectURL(blob); - const link = document.createElement('a'); + const link = document.createElement("a"); link.href = url; - link.target = '_blank'; - link.setAttribute('download', filename); + link.target = "_blank"; + link.setAttribute("download", filename); document.body.appendChild(link); link.click(); document.body.removeChild(link); diff --git a/src/app/shared/helpers/global-error-handler.ts b/src/app/shared/helpers/global-error-handler.ts index ff6fc25d1..ab21c46bf 100644 --- a/src/app/shared/helpers/global-error-handler.ts +++ b/src/app/shared/helpers/global-error-handler.ts @@ -1,34 +1,32 @@ -import { ErrorHandler, Injectable, Injector } from '@angular/core'; -import { HttpErrorResponse } from '@angular/common/http'; -import { ErrorService } from '@shared/services/error.service'; -import { NotificationService } from '@shared/services/notification.service'; -import { LoggingService } from '@shared/services/logging.service'; - +import { ErrorHandler, Injectable, Injector } from "@angular/core"; +import { HttpErrorResponse } from "@angular/common/http"; +import { ErrorService } from "@shared/services/error.service"; +import { NotificationService } from "@shared/services/notification.service"; +import { LoggingService } from "@shared/services/logging.service"; @Injectable() export class GlobalErrorHandler implements ErrorHandler { + constructor(private injector: Injector) {} - constructor(private injector: Injector) { } - - handleError(error: Error | HttpErrorResponse) { - const errorService = this.injector.get(ErrorService); - const logger = this.injector.get(LoggingService); - const notifier = this.injector.get(NotificationService); + handleError(error: Error | HttpErrorResponse) { + const errorService = this.injector.get(ErrorService); + const logger = this.injector.get(LoggingService); + const notifier = this.injector.get(NotificationService); - let message; - let stackTrace; - if (error instanceof HttpErrorResponse) { - // Server error - message = errorService.getServerErrorMessage(error); - //stackTrace = errorService.getServerErrorStackTrace(error); - notifier.showError(message); - } else { - // Client Error - message = errorService.getClientErrorMessage(error); - notifier.showError(message); - } - // Always log errors - logger.logError(message, stackTrace); - console.error(error); + let message; + let stackTrace; + if (error instanceof HttpErrorResponse) { + // Server error + message = errorService.getServerErrorMessage(error); + //stackTrace = errorService.getServerErrorStackTrace(error); + notifier.showError(message); + } else { + // Client Error + message = errorService.getClientErrorMessage(error); + notifier.showError(message); } -} \ No newline at end of file + // Always log errors + logger.logError(message, stackTrace); + console.error(error); + } +} diff --git a/src/app/shared/helpers/json.helper.ts b/src/app/shared/helpers/json.helper.ts index 06fc161ee..fe604fec1 100644 --- a/src/app/shared/helpers/json.helper.ts +++ b/src/app/shared/helpers/json.helper.ts @@ -1,9 +1,6 @@ -import { KeyValue } from '@shared/types/tuple.type'; +import { KeyValue } from "@shared/types/tuple.type"; -export const jsonToList = ( - json: string, - shouldThrowOnError = false -): KeyValue[] => { +export const jsonToList = (json: string, shouldThrowOnError = false): KeyValue[] => { try { const deserialized = JSON.parse(json) as Record; diff --git a/src/app/shared/helpers/mat-paginator-intl-da.ts b/src/app/shared/helpers/mat-paginator-intl-da.ts index 069fdae35..b2956e869 100644 --- a/src/app/shared/helpers/mat-paginator-intl-da.ts +++ b/src/app/shared/helpers/mat-paginator-intl-da.ts @@ -1,13 +1,13 @@ -import { Injectable } from '@angular/core'; -import { MatPaginatorIntl } from '@angular/material/paginator'; -import { TranslateService } from '@ngx-translate/core'; +import { Injectable } from "@angular/core"; +import { MatPaginatorIntl } from "@angular/material/paginator"; +import { TranslateService } from "@ngx-translate/core"; -const ITEMS_PER_PAGE = 'PAGINATOR.ITEM_PER_PAGE'; -const NEXT_PAGE = 'PAGINATOR.NEXT_PAGE'; -const PREV_PAGE = 'PAGINATOR.PREVIOUS_PAGE'; -const FIRST_PAGE = 'PAGINATOR.FIRST_PAGE'; -const LAST_PAGE = 'PAGINATOR.LAST_PAGE'; -const OF = 'PAGINATOR.OF'; +const ITEMS_PER_PAGE = "PAGINATOR.ITEM_PER_PAGE"; +const NEXT_PAGE = "PAGINATOR.NEXT_PAGE"; +const PREV_PAGE = "PAGINATOR.PREVIOUS_PAGE"; +const FIRST_PAGE = "PAGINATOR.FIRST_PAGE"; +const LAST_PAGE = "PAGINATOR.LAST_PAGE"; +const OF = "PAGINATOR.OF"; @Injectable() export class MatPaginatorIntlDa extends MatPaginatorIntl { @@ -22,11 +22,7 @@ export class MatPaginatorIntlDa extends MatPaginatorIntl { } ofLabel: string; - public getRangeLabel = ( - page: number, - pageSize: number, - length: number - ): string => { + public getRangeLabel = (page: number, pageSize: number, length: number): string => { if (length === 0 || pageSize === 0) { return `0 ${this.ofLabel} ${length}`; } @@ -34,10 +30,7 @@ export class MatPaginatorIntlDa extends MatPaginatorIntl { length = Math.max(length, 0); const startIndex: number = page * pageSize; - const endIndex: number = - startIndex < length - ? Math.min(startIndex + pageSize, length) - : startIndex + pageSize; + const endIndex: number = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize; return `${startIndex + 1} - ${endIndex} ${this.ofLabel} ${length}`; }; diff --git a/src/app/shared/helpers/record.helper.ts b/src/app/shared/helpers/record.helper.ts index d26209a8a..d53854756 100644 --- a/src/app/shared/helpers/record.helper.ts +++ b/src/app/shared/helpers/record.helper.ts @@ -1,9 +1,6 @@ -export const recordToEntries = >( - record: T, - isEnum = true, -) => { +export const recordToEntries = >(record: T, isEnum = true) => { return Object.keys(record) - .filter((entry) => !isEnum || isNaN(Number(entry))) + .filter(entry => !isEnum || isNaN(Number(entry))) .map((key: keyof typeof record) => ({ key, value: record[key], diff --git a/src/app/shared/helpers/server-error.interceptor.ts b/src/app/shared/helpers/server-error.interceptor.ts index 0fba95abf..d4bada638 100644 --- a/src/app/shared/helpers/server-error.interceptor.ts +++ b/src/app/shared/helpers/server-error.interceptor.ts @@ -1,25 +1,20 @@ -import { Injectable } from '@angular/core'; -import { - HttpEvent, HttpRequest, HttpHandler, - HttpInterceptor, HttpErrorResponse -} from '@angular/common/http'; -import { Observable, throwError } from 'rxjs'; -import { retry, catchError } from 'rxjs/operators'; +import { Injectable } from "@angular/core"; +import { HttpEvent, HttpRequest, HttpHandler, HttpInterceptor, HttpErrorResponse } from "@angular/common/http"; +import { Observable, throwError } from "rxjs"; +import { retry, catchError } from "rxjs/operators"; @Injectable() export class ServerErrorInterceptor implements HttpInterceptor { - - intercept(request: HttpRequest, next: HttpHandler): Observable> { - - return next.handle(request).pipe( - retry(1), - catchError((error: HttpErrorResponse) => { - if (error.status === 401) { - // refresh token - } else { - return throwError(error); - } - }) - ); - } -} \ No newline at end of file + intercept(request: HttpRequest, next: HttpHandler): Observable> { + return next.handle(request).pipe( + retry(1), + catchError((error: HttpErrorResponse) => { + if (error.status === 401) { + // refresh token + } else { + return throwError(error); + } + }) + ); + } +} diff --git a/src/app/shared/helpers/string.helper.ts b/src/app/shared/helpers/string.helper.ts index 1b9a160f9..824498df6 100644 --- a/src/app/shared/helpers/string.helper.ts +++ b/src/app/shared/helpers/string.helper.ts @@ -3,13 +3,11 @@ */ export const toKebabCase = (str: string) => { return str - .split('') + .split("") .map((letter, idx) => { - return letter.toUpperCase() === letter - ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}` - : letter; + return letter.toUpperCase() === letter ? `${idx !== 0 ? "-" : ""}${letter.toLowerCase()}` : letter; }) - .join(''); + .join(""); }; export const toPascalKebabCase = (str: string) => toKebabCase(str).toUpperCase(); diff --git a/src/app/shared/helpers/table-sorting.helper.ts b/src/app/shared/helpers/table-sorting.helper.ts index fe599f6e3..d6a63499d 100644 --- a/src/app/shared/helpers/table-sorting.helper.ts +++ b/src/app/shared/helpers/table-sorting.helper.ts @@ -1,45 +1,45 @@ export function tableSorter(item, property) { - if (property === 'battery') { + if (property === "battery") { // IoTDevice table battery return item?.lorawanSettings?.deviceStatusBattery; - } else if (property === 'active') { + } else if (property === "active") { // IoTDevice table is active const arr = item?.receivedMessagesMetadata; return arr?.length > 0 ? arr[arr.length - 1].sentTime : null; - } else if (property === 'login') { + } else if (property === "login") { // user table is login return item?.lastLogin; - } else if (property === 'updatedAt') { + } else if (property === "updatedAt") { // application table is latest-update return Date.parse(item.updatedAt).valueOf(); - } else if (property === 'last-seen') { + } else if (property === "last-seen") { if (item?.lastSeenAt == null) { return -1; } // gateway table is latest-seen return Date.parse(item.lastSeenAt).valueOf(); - } else if (property === 'organisations') { + } else if (property === "organisations") { // permissions table is organization name return item?.organization?.name; - } else if (property === 'members') { + } else if (property === "members") { // permissions table member count return item?.users?.length; - } else if (property === 'devices') { + } else if (property === "devices") { // applications table device count return item?.iotDevices?.length; - } else if (property === 'gateway-status' || property === 'status') { + } else if (property === "gateway-status" || property === "status") { // gateway table status return item?.lastSeenAt; - } else if (property === 'gateway-id') { + } else if (property === "gateway-id") { // gateway table status return item?.id; - } else if (property === 'payload-decoder-id') { + } else if (property === "payload-decoder-id") { // payload decoder table id return item?.id; } else { // Default string to be case-insensitive const val = item[property]; - if (typeof val == 'string') { + if (typeof val == "string") { return val.toLocaleLowerCase(); } diff --git a/src/app/shared/helpers/type.helper.ts b/src/app/shared/helpers/type.helper.ts index bfc49c324..9df91691a 100644 --- a/src/app/shared/helpers/type.helper.ts +++ b/src/app/shared/helpers/type.helper.ts @@ -11,9 +11,4 @@ export const nameof = (name: Extract): string => name; * * @see https://stackoverflow.com/a/56370310 */ -export type Tail = ((...t: T) => void) extends ( - h: unknown, - ...r: infer R -) => void - ? R - : never; +export type Tail = ((...t: T) => void) extends (h: unknown, ...r: infer R) => void ? R : never; diff --git a/src/app/shared/models/Json-location.model.ts b/src/app/shared/models/Json-location.model.ts index b9df8bb73..ae764b9c8 100644 --- a/src/app/shared/models/Json-location.model.ts +++ b/src/app/shared/models/Json-location.model.ts @@ -1,4 +1,4 @@ export interface JsonLocation { - type: string; - coordinates: number[]; + type: string; + coordinates: number[]; } diff --git a/src/app/shared/models/alert.model.ts b/src/app/shared/models/alert.model.ts index 66bc85570..202c3613d 100644 --- a/src/app/shared/models/alert.model.ts +++ b/src/app/shared/models/alert.model.ts @@ -1,6 +1,6 @@ -export type AlertType = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info'; +export type AlertType = "primary" | "secondary" | "success" | "danger" | "warning" | "info"; export interface Alert { - message: string; - type: AlertType; + message: string; + type: AlertType; } diff --git a/src/app/shared/models/back-button.model.ts b/src/app/shared/models/back-button.model.ts index 2bc10cd48..aa8e72bdf 100644 --- a/src/app/shared/models/back-button.model.ts +++ b/src/app/shared/models/back-button.model.ts @@ -1,4 +1,4 @@ export interface BackButton { - label: string; - routerLink: string | string[]; + label: string; + routerLink: string | string[]; } diff --git a/src/app/shared/models/common-location.model.ts b/src/app/shared/models/common-location.model.ts index 22b42dfcb..452bbd93b 100644 --- a/src/app/shared/models/common-location.model.ts +++ b/src/app/shared/models/common-location.model.ts @@ -1,14 +1,14 @@ export class CommonLocation { - longitude = 11.764445; - latitude = 55.959443; - altitude = 0; - source?: - | 'UNKNOWN' - | 'GPS' - | 'CONFIG' - | 'GEO_RESOLVER_TDOA' - | 'GEO_RESOLVER_RSSI' - | 'GEO_RESOLVER_GNSS' - | 'GEO_RESOLVER_WIFI'; - accuracy?: number; + longitude = 11.764445; + latitude = 55.959443; + altitude = 0; + source?: + | "UNKNOWN" + | "GPS" + | "CONFIG" + | "GEO_RESOLVER_TDOA" + | "GEO_RESOLVER_RSSI" + | "GEO_RESOLVER_GNSS" + | "GEO_RESOLVER_WIFI"; + accuracy?: number; } diff --git a/src/app/shared/models/controlled-property.model.ts b/src/app/shared/models/controlled-property.model.ts index f2398f201..5ba1e9194 100644 --- a/src/app/shared/models/controlled-property.model.ts +++ b/src/app/shared/models/controlled-property.model.ts @@ -1,5 +1,5 @@ -import { ControlledPropertyTypes } from '@app/device-model/Enums/controlled-propperty.enum'; -import { Application } from '@applications/application.model'; +import { ControlledPropertyTypes } from "@app/device-model/Enums/controlled-propperty.enum"; +import { Application } from "@applications/application.model"; export class ControlledProperty { public applications: Application[]; diff --git a/src/app/shared/models/dropdown-button.model.ts b/src/app/shared/models/dropdown-button.model.ts index 74eb40c13..7d5555f62 100644 --- a/src/app/shared/models/dropdown-button.model.ts +++ b/src/app/shared/models/dropdown-button.model.ts @@ -6,15 +6,15 @@ export interface ExtraDropdownOption { } export interface DropdownButton { - label: string; - editRouterLink: string | string[]; - isErasable: boolean; - /** - * Show extra dropdown options - * - * **NB**: This interface does not scale well. It doesn't work for generic options and it's used in many components. - * - * By representing any new options in a separate property, this avoids changes in all dependent components and thus merge conflicts. - */ - extraOptions?: ExtraDropdownOption[]; + label: string; + editRouterLink: string | string[]; + isErasable: boolean; + /** + * Show extra dropdown options + * + * **NB**: This interface does not scale well. It doesn't work for generic options and it's used in many components. + * + * By representing any new options in a separate property, this avoids changes in all dependent components and thus merge conflicts. + */ + extraOptions?: ExtraDropdownOption[]; } diff --git a/src/app/shared/models/edit-permission.model.ts b/src/app/shared/models/edit-permission.model.ts index d5a032889..6e8805207 100644 --- a/src/app/shared/models/edit-permission.model.ts +++ b/src/app/shared/models/edit-permission.model.ts @@ -1,3 +1,3 @@ export class EditPermission { - canEdit = false; + canEdit = false; } diff --git a/src/app/shared/models/error-message.model.ts b/src/app/shared/models/error-message.model.ts index 3606ca089..e34eae69d 100644 --- a/src/app/shared/models/error-message.model.ts +++ b/src/app/shared/models/error-message.model.ts @@ -10,4 +10,4 @@ export class ErrorMessage { export class ErrorPageMessage { code: number; message: string; -} \ No newline at end of file +} diff --git a/src/app/shared/models/error.model.ts b/src/app/shared/models/error.model.ts index e6fa940d3..7df3289be 100644 --- a/src/app/shared/models/error.model.ts +++ b/src/app/shared/models/error.model.ts @@ -1,4 +1,4 @@ export interface Error { - field: string; - message: string; -} \ No newline at end of file + field: string; + message: string; +} diff --git a/src/app/shared/models/lorawan-settings.model.ts b/src/app/shared/models/lorawan-settings.model.ts index f24abca7a..800ac516b 100644 --- a/src/app/shared/models/lorawan-settings.model.ts +++ b/src/app/shared/models/lorawan-settings.model.ts @@ -1,16 +1,16 @@ -import { ActivationType } from '@shared/enums/activation-type'; +import { ActivationType } from "@shared/enums/activation-type"; export class LorawanSettings { - devEUI: string; - skipFCntCheck = false; - activationType: ActivationType; - OTAAapplicationKey?: string; - devAddr?: string; - networkSessionKey?: string; - applicationSessionKey?: string; - deviceProfileID: string; - fCntUp = 0; - nFCntDown = 0; - deviceStatusBattery: number; - deviceStatusMargin: number; + devEUI: string; + skipFCntCheck = false; + activationType: ActivationType; + OTAAapplicationKey?: string; + devAddr?: string; + networkSessionKey?: string; + applicationSessionKey?: string; + deviceProfileID: string; + fCntUp = 0; + nFCntDown = 0; + deviceStatusBattery: number; + deviceStatusMargin: number; } diff --git a/src/app/shared/models/mqtt-broker-settings.model.ts b/src/app/shared/models/mqtt-broker-settings.model.ts index 43cfc80aa..94f09047f 100644 --- a/src/app/shared/models/mqtt-broker-settings.model.ts +++ b/src/app/shared/models/mqtt-broker-settings.model.ts @@ -1,3 +1,3 @@ -import { MqttSharedSettings } from '@shared/models/mqtt-shared-settings.model'; +import { MqttSharedSettings } from "@shared/models/mqtt-shared-settings.model"; export class MqttInternalBrokerSettings extends MqttSharedSettings {} diff --git a/src/app/shared/models/mqtt-shared-settings.model.ts b/src/app/shared/models/mqtt-shared-settings.model.ts index adca9abbb..82f561440 100644 --- a/src/app/shared/models/mqtt-shared-settings.model.ts +++ b/src/app/shared/models/mqtt-shared-settings.model.ts @@ -1,4 +1,4 @@ -import { AuthenticationType } from '@shared/enums/authentication-type'; +import { AuthenticationType } from "@shared/enums/authentication-type"; export class MqttSharedSettings { mqttURL: string; diff --git a/src/app/shared/models/mqtt-subscriber-settings.model.ts b/src/app/shared/models/mqtt-subscriber-settings.model.ts index 5c1d19602..007d8a617 100644 --- a/src/app/shared/models/mqtt-subscriber-settings.model.ts +++ b/src/app/shared/models/mqtt-subscriber-settings.model.ts @@ -1,4 +1,4 @@ -import { MqttSharedSettings } from '@shared/models/mqtt-shared-settings.model'; +import { MqttSharedSettings } from "@shared/models/mqtt-shared-settings.model"; export class MqttExternalBrokerSettings extends MqttSharedSettings { invalidMqttConfig: boolean; diff --git a/src/app/shared/models/organization.model.ts b/src/app/shared/models/organization.model.ts index 0d18f8410..231543cf0 100644 --- a/src/app/shared/models/organization.model.ts +++ b/src/app/shared/models/organization.model.ts @@ -1,3 +1,3 @@ export class OrganizationInterface { - organizationId: number; + organizationId: number; } diff --git a/src/app/shared/models/quick-action-button.model.ts b/src/app/shared/models/quick-action-button.model.ts index 9b76b8e81..01d094ca7 100644 --- a/src/app/shared/models/quick-action-button.model.ts +++ b/src/app/shared/models/quick-action-button.model.ts @@ -1,4 +1,4 @@ export interface QuickActionButton { - label: string; - type: 'delete' | 'restart' | 'edit'; + label: string; + type: "delete" | "restart" | "edit"; } diff --git a/src/app/shared/models/received-message-metadata.model.ts b/src/app/shared/models/received-message-metadata.model.ts index d663219fd..5d280c1aa 100644 --- a/src/app/shared/models/received-message-metadata.model.ts +++ b/src/app/shared/models/received-message-metadata.model.ts @@ -1,7 +1,7 @@ export interface ReceivedMessageMetadata { - id: number; - createdAt: Date; - updatedAt: Date; - sentTime: string; - signalData: JSON; + id: number; + createdAt: Date; + updatedAt: Date; + sentTime: string; + signalData: JSON; } diff --git a/src/app/shared/models/sigfox-contract.model.ts b/src/app/shared/models/sigfox-contract.model.ts index a35b6853d..f18da5fba 100644 --- a/src/app/shared/models/sigfox-contract.model.ts +++ b/src/app/shared/models/sigfox-contract.model.ts @@ -1,28 +1,27 @@ - export interface SigfoxContract { - id: string; - name: string; - order: string; - contractId: string; - group: string; - userId: string; - startTime: number; - communicationEndTime: number; - timezone: string; - maxUplinkFrames: number; - maxDownlinkFrames: number; - tokenDuration: number; - maxTokens: number; - activationEndTime: number; - automaticRenewal: boolean; - renewalDuration: number; - blacklistedTerritories: any[]; - createdBy: string; - lastEditionTime: number; - lastEditedBy: string; - bidir: boolean; - highPriorityDownlink: boolean; - tokensInUse: number; - tokensUsed: number; - creationTime: number; + id: string; + name: string; + order: string; + contractId: string; + group: string; + userId: string; + startTime: number; + communicationEndTime: number; + timezone: string; + maxUplinkFrames: number; + maxDownlinkFrames: number; + tokenDuration: number; + maxTokens: number; + activationEndTime: number; + automaticRenewal: boolean; + renewalDuration: number; + blacklistedTerritories: any[]; + createdBy: string; + lastEditionTime: number; + lastEditedBy: string; + bidir: boolean; + highPriorityDownlink: boolean; + tokensInUse: number; + tokensUsed: number; + creationTime: number; } diff --git a/src/app/shared/models/sigfox-device-type.model.ts b/src/app/shared/models/sigfox-device-type.model.ts index 74242c99c..b4ccfb9f8 100644 --- a/src/app/shared/models/sigfox-device-type.model.ts +++ b/src/app/shared/models/sigfox-device-type.model.ts @@ -1,15 +1,15 @@ -import { SigfoxGroup } from './sigfox-group.model'; +import { SigfoxGroup } from "./sigfox-group.model"; export class SigfoxDeviceType { - id: string; - name: string; - contractId: string; - description: string; - keepAlive?: number; - alertEmail?: string; - groupId?: number; + id: string; + name: string; + contractId: string; + description: string; + keepAlive?: number; + alertEmail?: string; + groupId?: number; } export class SigfoxDeviceTypeResponse { - data: SigfoxDeviceType[]; + data: SigfoxDeviceType[]; } diff --git a/src/app/shared/models/sigfox-group.model.ts b/src/app/shared/models/sigfox-group.model.ts index 06ce17ec0..d89e5f4b6 100644 --- a/src/app/shared/models/sigfox-group.model.ts +++ b/src/app/shared/models/sigfox-group.model.ts @@ -1,19 +1,19 @@ -import { Organisation } from '@app/admin/organisation/organisation.model'; -import { SigfoxGroupData } from '@app/sigfox/sigfox-settings.model'; -import { OrganizationInterface } from './organization.model'; +import { Organisation } from "@app/admin/organisation/organisation.model"; +import { SigfoxGroupData } from "@app/sigfox/sigfox-settings.model"; +import { OrganizationInterface } from "./organization.model"; export class SigfoxGroup extends OrganizationInterface { - public id: number; - public name: string; - public username: string; - public password?: string; - public createdAt: Date; - public updatedAt: Date; - public belongsTo: Organisation; - public sigfoxGroupData: SigfoxGroupData; + public id: number; + public name: string; + public username: string; + public password?: string; + public createdAt: Date; + public updatedAt: Date; + public belongsTo: Organisation; + public sigfoxGroupData: SigfoxGroupData; } export class SigfoxgroupsResponse { - result: SigfoxGroup[]; - totalCount?: string; + result: SigfoxGroup[]; + totalCount?: string; } diff --git a/src/app/shared/models/sort.model.ts b/src/app/shared/models/sort.model.ts index e22904af8..a2b832af4 100644 --- a/src/app/shared/models/sort.model.ts +++ b/src/app/shared/models/sort.model.ts @@ -1,5 +1,5 @@ -export type SortDir = 'ASC' | 'DESC' | 'asc' | 'desc' | ''; -export type SortCol = 'active' | 'updatedAt' | 'name' | 'createdAt' | string; +export type SortDir = "ASC" | "DESC" | "asc" | "desc" | ""; +export type SortCol = "active" | "updatedAt" | "name" | "createdAt" | string; export interface Sort { id: number; diff --git a/src/app/shared/models/step.model.ts b/src/app/shared/models/step.model.ts index b95ca5e56..4c4e3a97d 100644 --- a/src/app/shared/models/step.model.ts +++ b/src/app/shared/models/step.model.ts @@ -1,5 +1,5 @@ export interface Step { - label: string; - step: number; - id: string; + label: string; + step: number; + id: string; } diff --git a/src/app/shared/pipes/activeDeactive.pipe.ts b/src/app/shared/pipes/activeDeactive.pipe.ts index 74543585b..bc4b48922 100644 --- a/src/app/shared/pipes/activeDeactive.pipe.ts +++ b/src/app/shared/pipes/activeDeactive.pipe.ts @@ -1,10 +1,10 @@ -import { Pipe, PipeTransform } from '@angular/core'; +import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ - name: 'activeDeactive' + name: "activeDeactive", }) export class ActiveDeactivePipe implements PipeTransform { - transform(value: any, ...args: any[]): any { - return value ? 'Aktiveret' : 'Deaktiveret'; - } -} \ No newline at end of file + transform(value: any, ...args: any[]): any { + return value ? "Aktiveret" : "Deaktiveret"; + } +} diff --git a/src/app/shared/pipes/created-updated-by.pipe.ts b/src/app/shared/pipes/created-updated-by.pipe.ts index 37e9ec986..e2b88f351 100644 --- a/src/app/shared/pipes/created-updated-by.pipe.ts +++ b/src/app/shared/pipes/created-updated-by.pipe.ts @@ -1,12 +1,11 @@ -import { Pipe, PipeTransform } from '@angular/core'; +import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ - name: 'createdUpdatedBy' + name: "createdUpdatedBy", }) export class CreatedUpdatedByPipe implements PipeTransform { - transform(value: any, ...args: any[]): any { - const createdBy = ' af ' + value; + const createdBy = " af " + value; return createdBy; } } diff --git a/src/app/shared/pipes/custom-date.pipe.ts b/src/app/shared/pipes/custom-date.pipe.ts index 4ec3129db..ab19873f7 100644 --- a/src/app/shared/pipes/custom-date.pipe.ts +++ b/src/app/shared/pipes/custom-date.pipe.ts @@ -1,8 +1,8 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { DatePipe } from '@angular/common'; +import { Pipe, PipeTransform } from "@angular/core"; +import { DatePipe } from "@angular/common"; @Pipe({ - name: 'dkTime', + name: "dkTime", }) export class CustomDatePipe extends DatePipe implements PipeTransform { transform(value: any, args?: any): any { @@ -11,29 +11,28 @@ export class CustomDatePipe extends DatePipe implements PipeTransform { } @Pipe({ - name: 'tableDatePipe', + name: "tableDatePipe", }) export class CustomTableDatePipe extends DatePipe implements PipeTransform { transform(value: any, args?: any): any { - return super.transform(value, 'dd MMM, yyyy - HH:mm'); + return super.transform(value, "dd MMM, yyyy - HH:mm"); } } @Pipe({ - name: 'tableDateWithSecondsPipe', + name: "tableDateWithSecondsPipe", }) -export class CustomTableDateWithSecondsPipe extends DatePipe - implements PipeTransform { +export class CustomTableDateWithSecondsPipe extends DatePipe implements PipeTransform { transform(value: any, args?: any): any { - return super.transform(value, 'dd MMM, yyyy - HH:mm:ss'); + return super.transform(value, "dd MMM, yyyy - HH:mm:ss"); } } @Pipe({ - name: 'dateOnly', + name: "dateOnly", }) export class DateOnlyPipe extends DatePipe implements PipeTransform { transform(value: any, args?: any): any { - return super.transform(value, 'dd MMM, yyyy'); + return super.transform(value, "dd MMM, yyyy"); } } diff --git a/src/app/shared/pipes/filter-devices.pipe.ts b/src/app/shared/pipes/filter-devices.pipe.ts index 47edb0bfc..d0ae59c48 100644 --- a/src/app/shared/pipes/filter-devices.pipe.ts +++ b/src/app/shared/pipes/filter-devices.pipe.ts @@ -1,9 +1,9 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { IotDevice } from '@applications/iot-devices/iot-device.model'; -import { DeviceType } from '@shared/enums/device-type'; +import { Pipe, PipeTransform } from "@angular/core"; +import { IotDevice } from "@applications/iot-devices/iot-device.model"; +import { DeviceType } from "@shared/enums/device-type"; @Pipe({ - name: 'filterDevices', + name: "filterDevices", }) export class FilterDevicesPipe implements PipeTransform { transform(value: IotDevice[] | undefined, ..._: unknown[]): IotDevice[] { @@ -13,7 +13,7 @@ export class FilterDevicesPipe implements PipeTransform { if (!value) { return lorawanDevices; } - value.forEach((device) => { + value.forEach(device => { if (device.type === DeviceType.LORAWAN) { lorawanDevices.push(device); } diff --git a/src/app/shared/pipes/gateway/gateway-status-class.pipe.ts b/src/app/shared/pipes/gateway/gateway-status-class.pipe.ts index 52206b4ba..df921fcdb 100644 --- a/src/app/shared/pipes/gateway/gateway-status-class.pipe.ts +++ b/src/app/shared/pipes/gateway/gateway-status-class.pipe.ts @@ -1,24 +1,20 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { StatusTimestamp } from '@app/gateway/gateway.model'; -import moment from 'moment'; +import { Pipe, PipeTransform } from "@angular/core"; +import { StatusTimestamp } from "@app/gateway/gateway.model"; +import moment from "moment"; -const neverSeenClass = 'never-seen'; -const offlineClass = 'offline'; -const onlineClass = 'online'; +const neverSeenClass = "never-seen"; +const offlineClass = "offline"; +const onlineClass = "online"; @Pipe({ - name: 'gatewayStatusClass', + name: "gatewayStatusClass", }) /** * Separate pipe to format text to avoid renders if none of the values * have changed. */ export class GatewayStatusClassPipe implements PipeTransform { - transform( - statusTimestamps: StatusTimestamp[], - timestamp: string, - ..._: unknown[] - ): string { + transform(statusTimestamps: StatusTimestamp[], timestamp: string, ..._: unknown[]): string { if (!statusTimestamps.length) { return neverSeenClass; } diff --git a/src/app/shared/pipes/gateway/gateway-status-tooltip.pipe.ts b/src/app/shared/pipes/gateway/gateway-status-tooltip.pipe.ts index cbc272ffe..3a29232b6 100644 --- a/src/app/shared/pipes/gateway/gateway-status-tooltip.pipe.ts +++ b/src/app/shared/pipes/gateway/gateway-status-tooltip.pipe.ts @@ -1,7 +1,7 @@ -import { Pipe, PipeTransform } from '@angular/core'; +import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ - name: 'gatewayStatusTooltip', + name: "gatewayStatusTooltip", }) /** * Separate pipe to format text to avoid renders if none of the values diff --git a/src/app/shared/pipes/permission/can-edit-application.pipe.ts b/src/app/shared/pipes/permission/can-edit-application.pipe.ts index 545892866..1b5a6d55e 100644 --- a/src/app/shared/pipes/permission/can-edit-application.pipe.ts +++ b/src/app/shared/pipes/permission/can-edit-application.pipe.ts @@ -1,18 +1,14 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { MeService } from '@shared/services/me.service'; +import { Pipe, PipeTransform } from "@angular/core"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { MeService } from "@shared/services/me.service"; @Pipe({ - name: 'canEditApplication', + name: "canEditApplication", }) export class CanEditApplicationPipe implements PipeTransform { constructor(private meService: MeService) {} transform(id: number | undefined): boolean { - return this.meService.hasAccessToTargetOrganization( - OrganizationAccessScope.ApplicationWrite, - undefined, - id - ); + return this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.ApplicationWrite, undefined, id); } } diff --git a/src/app/shared/pipes/permission/is-global-admin.pipe.ts b/src/app/shared/pipes/permission/is-global-admin.pipe.ts index 6ca74b72e..20ceaeb57 100644 --- a/src/app/shared/pipes/permission/is-global-admin.pipe.ts +++ b/src/app/shared/pipes/permission/is-global-admin.pipe.ts @@ -1,16 +1,13 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { - PermissionResponse, - PermissionType, -} from '@app/admin/permission/permission.model'; +import { Pipe, PipeTransform } from "@angular/core"; +import { PermissionResponse, PermissionType } from "@app/admin/permission/permission.model"; @Pipe({ - name: 'isGlobalAdmin', + name: "isGlobalAdmin", }) export class IsGlobalAdminPipe implements PipeTransform { transform(value: PermissionResponse[], ...args: any[]): boolean { const res = value?.some(({ type: response }) => - response?.some((pmTypes) => pmTypes.type === PermissionType.GlobalAdmin) + response?.some(pmTypes => pmTypes.type === PermissionType.GlobalAdmin) ); return res; diff --git a/src/app/shared/pipes/permission/translate-permissions.pipe.ts b/src/app/shared/pipes/permission/translate-permissions.pipe.ts index 2e743d9bd..17a357785 100644 --- a/src/app/shared/pipes/permission/translate-permissions.pipe.ts +++ b/src/app/shared/pipes/permission/translate-permissions.pipe.ts @@ -1,18 +1,18 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { PermissionTypes } from '@app/admin/permission/permission.model'; -import { TranslateService } from '@ngx-translate/core'; +import { Pipe, PipeTransform } from "@angular/core"; +import { PermissionTypes } from "@app/admin/permission/permission.model"; +import { TranslateService } from "@ngx-translate/core"; @Pipe({ - name: 'translatePermissions', + name: "translatePermissions", }) export class TranslatePermissionsPipe implements PipeTransform { constructor(private translate: TranslateService) {} transform(permissions: PermissionTypes[] | undefined): string { const formattedPermissions = permissions - .map(({ type }) => this.translate.instant('PERMISSION-TYPE.' + type)) + .map(({ type }) => this.translate.instant("PERMISSION-TYPE." + type)) .sort() - .join(', '); + .join(", "); return formattedPermissions; } diff --git a/src/app/shared/pipes/pipes.module.ts b/src/app/shared/pipes/pipes.module.ts index c70ba9808..c11555e6c 100644 --- a/src/app/shared/pipes/pipes.module.ts +++ b/src/app/shared/pipes/pipes.module.ts @@ -1,22 +1,17 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { YesNoPipe } from './yesNo.pipe'; -import { ActiveDeactivePipe } from './activeDeactive.pipe'; -import { IsGlobalAdminPipe } from './permission/is-global-admin.pipe'; -import { CreatedUpdatedByPipe } from './created-updated-by.pipe'; -import { - CustomDatePipe, - CustomTableDatePipe, - CustomTableDateWithSecondsPipe, - DateOnlyPipe, -} from './custom-date.pipe'; -import { FilterDevicesPipe } from './filter-devices.pipe'; -import { TranslatePermissionsPipe } from './permission/translate-permissions.pipe'; -import { SortByPipe } from './sort-by.pipe'; -import { GatewayStatusTooltipPipe } from './gateway/gateway-status-tooltip.pipe'; -import { GatewayStatusClassPipe } from './gateway/gateway-status-class.pipe'; -import { CanEditApplicationPipe } from './permission/can-edit-application.pipe'; -import { SortByTranslationPipe } from './sort-by-translation.pipe'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { YesNoPipe } from "./yesNo.pipe"; +import { ActiveDeactivePipe } from "./activeDeactive.pipe"; +import { IsGlobalAdminPipe } from "./permission/is-global-admin.pipe"; +import { CreatedUpdatedByPipe } from "./created-updated-by.pipe"; +import { CustomDatePipe, CustomTableDatePipe, CustomTableDateWithSecondsPipe, DateOnlyPipe } from "./custom-date.pipe"; +import { FilterDevicesPipe } from "./filter-devices.pipe"; +import { TranslatePermissionsPipe } from "./permission/translate-permissions.pipe"; +import { SortByPipe } from "./sort-by.pipe"; +import { GatewayStatusTooltipPipe } from "./gateway/gateway-status-tooltip.pipe"; +import { GatewayStatusClassPipe } from "./gateway/gateway-status-class.pipe"; +import { CanEditApplicationPipe } from "./permission/can-edit-application.pipe"; +import { SortByTranslationPipe } from "./sort-by-translation.pipe"; @NgModule({ declarations: [ diff --git a/src/app/shared/pipes/sort-by-translation.pipe.ts b/src/app/shared/pipes/sort-by-translation.pipe.ts index 5bd73436f..16f3b70ac 100644 --- a/src/app/shared/pipes/sort-by-translation.pipe.ts +++ b/src/app/shared/pipes/sort-by-translation.pipe.ts @@ -1,8 +1,8 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { sortBySelector } from '@shared/helpers/array.helper'; +import { Pipe, PipeTransform } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; +import { sortBySelector } from "@shared/helpers/array.helper"; -@Pipe({ name: 'sortByTranslation' }) +@Pipe({ name: "sortByTranslation" }) export class SortByTranslationPipe implements PipeTransform { constructor(private translate: TranslateService) {} @@ -15,14 +15,13 @@ export class SortByTranslationPipe implements PipeTransform { transform( translationValues: T[], column: keyof T | undefined, - order: 'asc' | 'desc' = 'asc', - prefix: string = '', - suffix: string = '' + order: "asc" | "desc" = "asc", + prefix: string = "", + suffix: string = "" ): T[] { const res = sortBySelector( translationValues, - (val) => - this.translate.instant(prefix + (column ? val[column] : val) + suffix), + val => this.translate.instant(prefix + (column ? val[column] : val) + suffix), order ); diff --git a/src/app/shared/pipes/sort-by.pipe.ts b/src/app/shared/pipes/sort-by.pipe.ts index 8f7a75fb2..02422def7 100644 --- a/src/app/shared/pipes/sort-by.pipe.ts +++ b/src/app/shared/pipes/sort-by.pipe.ts @@ -1,7 +1,7 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { sortBy } from '@shared/helpers/array.helper'; +import { Pipe, PipeTransform } from "@angular/core"; +import { sortBy } from "@shared/helpers/array.helper"; -@Pipe({ name: 'sortBy' }) +@Pipe({ name: "sortBy" }) export class SortByPipe implements PipeTransform { /** * Example: @@ -9,11 +9,7 @@ export class SortByPipe implements PipeTransform { * *ngFor="let c of arrayOfObjects | sortBy::'asc'" * ``` */ - transform( - value: T[], - column: keyof T, - order: 'asc' | 'desc' = 'asc' - ): T[] { + transform(value: T[], column: keyof T, order: "asc" | "desc" = "asc"): T[] { return sortBy(value, column, order); } } diff --git a/src/app/shared/pipes/yesNo.pipe.ts b/src/app/shared/pipes/yesNo.pipe.ts index 9a09e9432..aa69d8ac1 100644 --- a/src/app/shared/pipes/yesNo.pipe.ts +++ b/src/app/shared/pipes/yesNo.pipe.ts @@ -1,10 +1,10 @@ -import { Pipe, PipeTransform } from '@angular/core'; +import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ - name: 'yesNo' + name: "yesNo", }) export class YesNoPipe implements PipeTransform { - transform(value: any, ...args: any[]): any { - return value ? 'Ja' : 'Nej'; - } -} \ No newline at end of file + transform(value: any, ...args: any[]): any { + return value ? "Ja" : "Nej"; + } +} diff --git a/src/app/shared/providers/saver.provider.ts b/src/app/shared/providers/saver.provider.ts index d42f58dd6..cddafc1b2 100644 --- a/src/app/shared/providers/saver.provider.ts +++ b/src/app/shared/providers/saver.provider.ts @@ -1,10 +1,10 @@ -import { InjectionToken } from '@angular/core'; -import { saveAs } from 'file-saver'; +import { InjectionToken } from "@angular/core"; +import { saveAs } from "file-saver"; export type Saver = (blob: Blob, filename?: string) => void; -export const SAVER = new InjectionToken('saver'); +export const SAVER = new InjectionToken("saver"); export function getSaver(): Saver { - return saveAs; + return saveAs; } diff --git a/src/app/shared/services/alert.service.spec.ts b/src/app/shared/services/alert.service.spec.ts index b20ed8c38..e6ebd6fc0 100644 --- a/src/app/shared/services/alert.service.spec.ts +++ b/src/app/shared/services/alert.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { AlertService } from './alert.service'; +import { AlertService } from "./alert.service"; -describe('AlertService', () => { +describe("AlertService", () => { let service: AlertService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('AlertService', () => { service = TestBed.inject(AlertService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/shared/services/alert.service.ts b/src/app/shared/services/alert.service.ts index e43a68e27..1c39cc15c 100644 --- a/src/app/shared/services/alert.service.ts +++ b/src/app/shared/services/alert.service.ts @@ -1,9 +1,8 @@ -import { Injectable } from '@angular/core'; -import { Alert } from '@shared/models/alert.model'; - +import { Injectable } from "@angular/core"; +import { Alert } from "@shared/models/alert.model"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class AlertService { alerts: Alert[] = []; @@ -15,4 +14,4 @@ export class AlertService { clear() { this.alerts = []; } -} \ No newline at end of file +} diff --git a/src/app/shared/services/bulk-import.service.ts b/src/app/shared/services/bulk-import.service.ts index b093be00a..b07f7f86c 100644 --- a/src/app/shared/services/bulk-import.service.ts +++ b/src/app/shared/services/bulk-import.service.ts @@ -1,8 +1,8 @@ -import { Injectable } from '@angular/core'; -import { Subject } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { Subject } from "rxjs"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class BulkImportService { public readonly nextCreateIotDeviceBatchIndex$: Subject = new Subject(); diff --git a/src/app/shared/services/chirpstack-gateway.service.ts b/src/app/shared/services/chirpstack-gateway.service.ts index 7743e9495..3776a5329 100644 --- a/src/app/shared/services/chirpstack-gateway.service.ts +++ b/src/app/shared/services/chirpstack-gateway.service.ts @@ -8,81 +8,81 @@ import { map } from "rxjs/operators"; import { UserMinimalService } from "@app/admin/users/user-minimal.service"; @Injectable({ - providedIn: "root", + providedIn: "root", }) export class ChirpstackGatewayService { - private chripstackGatewayUrl = "chirpstack/gateway"; + private chripstackGatewayUrl = "chirpstack/gateway"; - constructor( - private restService: RestService, - private sharedVariableService: SharedVariableService, - private userMinimalService: UserMinimalService - ) { - moment.locale("da"); - } - - public get(id: string, params = {}): Observable { - return this.restService.get(this.chripstackGatewayUrl, params, id).pipe( - map((response: GatewayResponse) => { - response.gateway.organizationName = this.sharedVariableService - .getOrganizationInfo() - .find(org => org.id === response.gateway.organizationId)?.name; + constructor( + private restService: RestService, + private sharedVariableService: SharedVariableService, + private userMinimalService: UserMinimalService + ) { + moment.locale("da"); + } - // We want to show helper text if tags is empty. To show empty text, the tagsString has to be undefined. - response.gateway.tagsString = - Object.keys(response.gateway.tags).length === 0 ? undefined : JSON.stringify(response.gateway.tags); + public get(id: string, params = {}): Observable { + return this.restService.get(this.chripstackGatewayUrl, params, id).pipe( + map((response: GatewayResponse) => { + response.gateway.organizationName = this.sharedVariableService + .getOrganizationInfo() + .find(org => org.id === response.gateway.organizationId)?.name; - // Move createdat and updatedat to next level ease the use. - response.gateway.createdByName = this.userMinimalService.getUserNameFrom(response.gateway.createdBy); + // We want to show helper text if tags is empty. To show empty text, the tagsString has to be undefined. + response.gateway.tagsString = + Object.keys(response.gateway.tags).length === 0 ? undefined : JSON.stringify(response.gateway.tags); - response.gateway.updatedByName = this.userMinimalService.getUserNameFrom(response.gateway.updatedBy); - return response; - }) - ); - } + // Move createdat and updatedat to next level ease the use. + response.gateway.createdByName = this.userMinimalService.getUserNameFrom(response.gateway.createdBy); - public getMultiple(params = {}): Observable { - return this.restService.get(this.chripstackGatewayUrl, params).pipe( - map((response: GatewayResponseMany) => { - response.resultList.map(gateway => { - gateway.organizationName = this.sharedVariableService - .getOrganizationInfo() - .find(org => org.id === gateway.organizationId)?.name; - }); - return response; - }) - ); - } + response.gateway.updatedByName = this.userMinimalService.getUserNameFrom(response.gateway.updatedBy); + return response; + }) + ); + } - public post(gateway: Gateway): Observable { - const gatewayRequest: GatewayRequest = new GatewayRequest(); - gatewayRequest.gateway = gateway; - gatewayRequest.organizationId = this.sharedVariableService.getSelectedOrganisationId(); - return this.restService.post(this.chripstackGatewayUrl, gatewayRequest, { - observe: "response", + public getMultiple(params = {}): Observable { + return this.restService.get(this.chripstackGatewayUrl, params).pipe( + map((response: GatewayResponseMany) => { + response.resultList.map(gateway => { + gateway.organizationName = this.sharedVariableService + .getOrganizationInfo() + .find(org => org.id === gateway.organizationId)?.name; }); - } + return response; + }) + ); + } - public put(gateway: Gateway, id: string): Observable { - const gatewayRequest: GatewayRequest = new GatewayRequest(); - gatewayRequest.gateway = gateway; - return this.restService.put(this.chripstackGatewayUrl, gatewayRequest, id); - } + public post(gateway: Gateway): Observable { + const gatewayRequest: GatewayRequest = new GatewayRequest(); + gatewayRequest.gateway = gateway; + gatewayRequest.organizationId = this.sharedVariableService.getSelectedOrganisationId(); + return this.restService.post(this.chripstackGatewayUrl, gatewayRequest, { + observe: "response", + }); + } - public delete(gatewayId: string): Observable { - return this.restService.delete(this.chripstackGatewayUrl, gatewayId); - } + public put(gateway: Gateway, id: string): Observable { + const gatewayRequest: GatewayRequest = new GatewayRequest(); + gatewayRequest.gateway = gateway; + return this.restService.put(this.chripstackGatewayUrl, gatewayRequest, id); + } + + public delete(gatewayId: string): Observable { + return this.restService.delete(this.chripstackGatewayUrl, gatewayId); + } - public isGatewayActive(gateway: Gateway): boolean { - const errorTime = new Date(); - errorTime.setSeconds(errorTime.getSeconds() - 150); - if (gateway?.lastSeenAt) { - const date = gateway.lastSeenAt; - const lastSeenAtUnixTimestamp = moment(date).unix(); - const errorTimeUnixTimestamp = moment(errorTime).unix(); - return errorTimeUnixTimestamp < lastSeenAtUnixTimestamp; - } else { - return false; - } + public isGatewayActive(gateway: Gateway): boolean { + const errorTime = new Date(); + errorTime.setSeconds(errorTime.getSeconds() - 150); + if (gateway?.lastSeenAt) { + const date = gateway.lastSeenAt; + const lastSeenAtUnixTimestamp = moment(date).unix(); + const errorTimeUnixTimestamp = moment(errorTime).unix(); + return errorTimeUnixTimestamp < lastSeenAtUnixTimestamp; + } else { + return false; } + } } diff --git a/src/app/shared/services/chripstack-gateway.service.spec.ts b/src/app/shared/services/chripstack-gateway.service.spec.ts index 3c3c38319..09f24891c 100644 --- a/src/app/shared/services/chripstack-gateway.service.spec.ts +++ b/src/app/shared/services/chripstack-gateway.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { ChirpstackGatewayService } from './chirpstack-gateway.service'; +import { ChirpstackGatewayService } from "./chirpstack-gateway.service"; -describe('ChirpstackGatewayService', () => { +describe("ChirpstackGatewayService", () => { let service: ChirpstackGatewayService; beforeEach(() => { @@ -10,9 +10,9 @@ describe('ChirpstackGatewayService', () => { service = TestBed.inject(ChirpstackGatewayService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); - const test = service.get('1'); + const test = service.get("1"); console.log(test); }); }); diff --git a/src/app/shared/services/downlink.service.ts b/src/app/shared/services/downlink.service.ts index 585c6dffe..b695f11a3 100644 --- a/src/app/shared/services/downlink.service.ts +++ b/src/app/shared/services/downlink.service.ts @@ -1,39 +1,31 @@ -import { Injectable } from '@angular/core'; -import { RestService } from './rest.service'; -import { Observable } from 'rxjs'; -import { Downlink } from '@applications/iot-devices/downlink.model'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { TranslateService } from '@ngx-translate/core'; +import { Injectable } from "@angular/core"; +import { RestService } from "./rest.service"; +import { Observable } from "rxjs"; +import { Downlink } from "@applications/iot-devices/downlink.model"; +import { MatSnackBar } from "@angular/material/snack-bar"; +import { TranslateService } from "@ngx-translate/core"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class DownlinkService { - private IOTDEVICEURL = 'iot-device/'; - private DOWNLINKURL = 'downlink'; + private IOTDEVICEURL = "iot-device/"; + private DOWNLINKURL = "downlink"; - constructor( - private restService: RestService, - private snackBar: MatSnackBar, - public translate: TranslateService - ) {} + constructor(private restService: RestService, private snackBar: MatSnackBar, public translate: TranslateService) {} - public get(deviceId: number, params = {}): Observable { - const url = this.IOTDEVICEURL + deviceId + '/' + this.DOWNLINKURL; - return this.restService.get(url, params); - } + public get(deviceId: number, params = {}): Observable { + const url = this.IOTDEVICEURL + deviceId + "/" + this.DOWNLINKURL; + return this.restService.get(url, params); + } - public post(downlink: Downlink, deviceId: number, params = {}): Observable { - const url = this.IOTDEVICEURL + deviceId + '/' + this.DOWNLINKURL; - return this.restService.post(url, downlink, params); - } - public showSendDownlinkFailNoDevices() { - this.snackBar.open( - this.translate.instant('SNACK.NODEVICES'), - this.translate.instant('SNACK.CLOSE'), - { - duration: 10000, - } - ); - } + public post(downlink: Downlink, deviceId: number, params = {}): Observable { + const url = this.IOTDEVICEURL + deviceId + "/" + this.DOWNLINKURL; + return this.restService.post(url, downlink, params); + } + public showSendDownlinkFailNoDevices() { + this.snackBar.open(this.translate.instant("SNACK.NODEVICES"), this.translate.instant("SNACK.CLOSE"), { + duration: 10000, + }); + } } diff --git a/src/app/shared/services/download.service.ts b/src/app/shared/services/download.service.ts index e119386e0..97bbd9a62 100644 --- a/src/app/shared/services/download.service.ts +++ b/src/app/shared/services/download.service.ts @@ -1,10 +1,10 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { download, Download } from '../helpers/download.helper'; -import { Observable } from 'rxjs'; -import { SAVER, Saver } from '../providers/saver.provider'; +import { Injectable, Inject } from "@angular/core"; +import { HttpClient } from "@angular/common/http"; +import { download, Download } from "../helpers/download.helper"; +import { Observable } from "rxjs"; +import { SAVER, Saver } from "../providers/saver.provider"; -@Injectable({ providedIn: 'root' }) +@Injectable({ providedIn: "root" }) export class DownloadService { constructor(private http: HttpClient, @Inject(SAVER) private save: Saver) {} @@ -12,15 +12,15 @@ export class DownloadService { return this.http .get(url, { reportProgress: true, - observe: 'events', - responseType: 'blob', + observe: "events", + responseType: "blob", }) - .pipe(download((blob) => this.save(blob, filename))); + .pipe(download(blob => this.save(blob, filename))); } blob(url: string, filename?: string): Observable { return this.http.get(url, { - responseType: 'blob', + responseType: "blob", }); } } diff --git a/src/app/shared/services/error.service.ts b/src/app/shared/services/error.service.ts index 18140c8d9..4dd1741eb 100644 --- a/src/app/shared/services/error.service.ts +++ b/src/app/shared/services/error.service.ts @@ -1,20 +1,15 @@ -import { Injectable } from '@angular/core'; -import { HttpErrorResponse } from '@angular/common/http'; +import { Injectable } from "@angular/core"; +import { HttpErrorResponse } from "@angular/common/http"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class ErrorService { + getClientErrorMessage(error: Error): string { + return error.message ? "Client error: " + error.message : error.toString(); + } - getClientErrorMessage(error: Error): string { - return error.message ? - 'Client error: ' + error.message : - error.toString(); - } - - getServerErrorMessage(error: HttpErrorResponse): string { - return navigator.onLine ? - 'Server error: ' + error.message : - 'No Internet Connection'; - } -} \ No newline at end of file + getServerErrorMessage(error: HttpErrorResponse): string { + return navigator.onLine ? "Server error: " + error.message : "No Internet Connection"; + } +} diff --git a/src/app/shared/services/loggedin.service.ts b/src/app/shared/services/loggedin.service.ts index 60a80c8b9..63ef29fba 100644 --- a/src/app/shared/services/loggedin.service.ts +++ b/src/app/shared/services/loggedin.service.ts @@ -1,13 +1,11 @@ -import { Injectable } from '@angular/core'; -import { Subject } from 'rxjs'; - +import { Injectable } from "@angular/core"; +import { Subject } from "rxjs"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class LoggedInService { - - private emitChangeSource = new Subject(); + private emitChangeSource = new Subject(); public changeEmitted = this.emitChangeSource.asObservable(); emitChange(change: any) { diff --git a/src/app/shared/services/logging.service.ts b/src/app/shared/services/logging.service.ts index 025268f16..80187eb25 100644 --- a/src/app/shared/services/logging.service.ts +++ b/src/app/shared/services/logging.service.ts @@ -1,12 +1,11 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class LoggingService { - - logError(message: string, stack: string) { - // Send errors to server here - console.log('LoggingService: ' + message); - } + logError(message: string, stack: string) { + // Send errors to server here + console.log("LoggingService: " + message); + } } diff --git a/src/app/shared/services/lorawan-gateway.service.ts b/src/app/shared/services/lorawan-gateway.service.ts index 21b0afb87..3c69bf7b8 100644 --- a/src/app/shared/services/lorawan-gateway.service.ts +++ b/src/app/shared/services/lorawan-gateway.service.ts @@ -1,35 +1,26 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; import { AllGatewayStatusResponse, GetAllGatewayStatusParameters, GetGatewayStatusParameters, GatewayStatus, -} from '@app/gateway/gateway.model'; -import { Observable } from 'rxjs'; -import { RestService } from './rest.service'; +} from "@app/gateway/gateway.model"; +import { Observable } from "rxjs"; +import { RestService } from "./rest.service"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class LoRaWANGatewayService { - private baseUrl = 'lorawan/gateway'; + private baseUrl = "lorawan/gateway"; constructor(private restService: RestService) {} - public getAllStatus( - params: GetAllGatewayStatusParameters - ): Observable { + public getAllStatus(params: GetAllGatewayStatusParameters): Observable { return this.restService.get(`${this.baseUrl}/status`, params); } - public getStatus( - id: string, - params: GetGatewayStatusParameters - ): Observable { - return this.restService.get( - `${this.baseUrl}/status`, - params, - id - ); + public getStatus(id: string, params: GetGatewayStatusParameters): Observable { + return this.restService.get(`${this.baseUrl}/status`, params, id); } } diff --git a/src/app/shared/services/me.service.ts b/src/app/shared/services/me.service.ts index e8ab46a95..8cd9411c6 100644 --- a/src/app/shared/services/me.service.ts +++ b/src/app/shared/services/me.service.ts @@ -1,15 +1,11 @@ -import { Injectable } from '@angular/core'; -import { - PermissionResponse, - PermissionType, - PermissionTypes, -} from '@app/admin/permission/permission.model'; -import { UserResponse } from '@app/admin/users/user.model'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; +import { Injectable } from "@angular/core"; +import { PermissionResponse, PermissionType, PermissionTypes } from "@app/admin/permission/permission.model"; +import { UserResponse } from "@app/admin/users/user.model"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class MeService { private user: UserResponse; @@ -27,24 +23,15 @@ export class MeService { return false; } - if ( - permissions.some((p) => - this.hasPermissions(p, PermissionType.GlobalAdmin) - ) - ) { + if (permissions.some(p => this.hasPermissions(p, PermissionType.GlobalAdmin))) { return true; } - let canWriteCallback: ( - p: PermissionResponse, - appId: number | undefined - ) => boolean; + let canWriteCallback: (p: PermissionResponse, appId: number | undefined) => boolean; switch (scope) { case OrganizationAccessScope.ApplicationWrite: - canWriteCallback = this.canWriteApplicationInTargetOrganization.bind( - this - ); + canWriteCallback = this.canWriteApplicationInTargetOrganization.bind(this); break; case OrganizationAccessScope.GatewayWrite: canWriteCallback = this.canWriteGatewayInTargetOrganization.bind(this); @@ -58,31 +45,21 @@ export class MeService { } return permissions.some( - (permission) => + permission => this.hasPermissions(permission, PermissionType.GlobalAdmin) || - (permission.organization.id === organizationId && - canWriteCallback(permission, applicationId)) + (permission.organization.id === organizationId && canWriteCallback(permission, applicationId)) ); } - hasPermissionTypes( - types: PermissionTypes[], - ...targetPermissions: PermissionType[] - ) { + hasPermissionTypes(types: PermissionTypes[], ...targetPermissions: PermissionType[]) { return types && this.hasPermissions({ type: types }, ...targetPermissions); } - hasPermissions( - { type }: Partial, - ...targetPermissions: PermissionType[] - ) { + hasPermissions({ type }: Partial, ...targetPermissions: PermissionType[]) { return type?.some(({ type }) => targetPermissions.includes(type)); } - hasNotTargetPermissions( - response: PermissionResponse, - ...targetPermissions: PermissionType[] - ) { + hasNotTargetPermissions(response: PermissionResponse, ...targetPermissions: PermissionType[]) { return response.type.every(({ type }) => !targetPermissions.includes(type)); } @@ -91,37 +68,21 @@ export class MeService { targetAppId: number | undefined ): boolean { return ( - this.hasPermissions( - permission, - PermissionType.OrganizationApplicationAdmin - ) && - (!targetAppId || - permission.applicationIds?.some((appId) => appId === targetAppId)) + this.hasPermissions(permission, PermissionType.OrganizationApplicationAdmin) && + (!targetAppId || permission.applicationIds?.some(appId => appId === targetAppId)) ); } - private canWriteGatewayInTargetOrganization( - permission: PermissionResponse - ): boolean { - return this.hasPermissions( - permission, - PermissionType.OrganizationGatewayAdmin - ); + private canWriteGatewayInTargetOrganization(permission: PermissionResponse): boolean { + return this.hasPermissions(permission, PermissionType.OrganizationGatewayAdmin); } - private canWriteUserInTargetOrganization( - permission: PermissionResponse - ): boolean { - return this.hasPermissions( - permission, - PermissionType.OrganizationUserAdmin - ); + private canWriteUserInTargetOrganization(permission: PermissionResponse): boolean { + return this.hasPermissions(permission, PermissionType.OrganizationUserAdmin); } hasGlobalAdmin() { const userInfo = this.sharedVariableService.getUserInfo(); - return userInfo.user.permissions.some((permission) => - this.hasPermissions(permission, PermissionType.GlobalAdmin) - ); + return userInfo.user.permissions.some(permission => this.hasPermissions(permission, PermissionType.GlobalAdmin)); } } diff --git a/src/app/shared/services/notification.service.ts b/src/app/shared/services/notification.service.ts index 686646ac6..0ac652011 100644 --- a/src/app/shared/services/notification.service.ts +++ b/src/app/shared/services/notification.service.ts @@ -1,27 +1,24 @@ -import { Injectable, NgZone } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; +import { Injectable, NgZone } from "@angular/core"; +import { MatSnackBar } from "@angular/material/snack-bar"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class NotificationService { + constructor(public snackBar: MatSnackBar, private zone: NgZone) {} - constructor( - public snackBar: MatSnackBar, - private zone: NgZone) { } + showSuccess(message: string): void { + // Had an issue with the snackbar being ran outside of angular's zone. + this.zone.run(() => { + this.snackBar.open(message); + }); + } - showSuccess(message: string): void { - // Had an issue with the snackbar being ran outside of angular's zone. - this.zone.run(() => { - this.snackBar.open(message); - }); - } - - showError(message: string): void { - this.zone.run(() => { - // The second parameter is the text in the button. - // In the third, we send in the css class for the snack bar. - this.snackBar.open(message, 'X', { panelClass: ['error'] }); - }); - } -} \ No newline at end of file + showError(message: string): void { + this.zone.run(() => { + // The second parameter is the text in the button. + // In the third, we send in the css class for the snack bar. + this.snackBar.open(message, "X", { panelClass: ["error"] }); + }); + } +} diff --git a/src/app/shared/services/opendatadk.service.ts b/src/app/shared/services/opendatadk.service.ts index f3cefaa9d..1bae7bdb5 100644 --- a/src/app/shared/services/opendatadk.service.ts +++ b/src/app/shared/services/opendatadk.service.ts @@ -1,20 +1,18 @@ -import { Injectable } from '@angular/core'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { RestService } from './rest.service'; -import { Observable } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { RestService } from "./rest.service"; +import { Observable } from "rxjs"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class OpendatadkService { + private OPENDATADKSHARINGURL = "open-data-dk-sharing"; - private OPENDATADKSHARINGURL = 'open-data-dk-sharing'; + constructor(private restService: RestService, private sharedVariableService: SharedVariableService) {} - constructor(private restService: RestService, private sharedVariableService: SharedVariableService ) { - } - - get(): Observable { - const organizationId = this.sharedVariableService.getSelectedOrganisationId(); - return this.restService.get(this.OPENDATADKSHARINGURL, null, organizationId); - } + get(): Observable { + const organizationId = this.sharedVariableService.getSelectedOrganisationId(); + return this.restService.get(this.OPENDATADKSHARINGURL, null, organizationId); + } } diff --git a/src/app/shared/services/rest.service.spec.ts b/src/app/shared/services/rest.service.spec.ts index cd730691e..4779a7054 100644 --- a/src/app/shared/services/rest.service.spec.ts +++ b/src/app/shared/services/rest.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { RestService } from './rest.service'; +import { RestService } from "./rest.service"; -describe('RestService', () => { +describe("RestService", () => { let service: RestService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('RestService', () => { service = TestBed.inject(RestService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/shared/services/rest.service.ts b/src/app/shared/services/rest.service.ts index 8e4556411..5b760fac2 100644 --- a/src/app/shared/services/rest.service.ts +++ b/src/app/shared/services/rest.service.ts @@ -1,37 +1,33 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; -import { Observable, of } from 'rxjs'; -import { catchError, tap } from 'rxjs/operators'; -import { AlertService } from './alert.service'; -import { environment } from '@environments/environment'; -import { Alert } from '@shared/models/alert.model'; +import { Injectable } from "@angular/core"; +import { HttpClient, HttpHeaders, HttpParams } from "@angular/common/http"; +import { Observable, of } from "rxjs"; +import { catchError, tap } from "rxjs/operators"; +import { AlertService } from "./alert.service"; +import { environment } from "@environments/environment"; +import { Alert } from "@shared/models/alert.model"; interface IHttpOptions { headers?: HttpHeaders; - observe?: 'body'; + observe?: "body"; params?: HttpParams; reportProgress?: boolean; - responseType?: 'json'; + responseType?: "json"; withCredentials?: boolean; } -@Injectable({ providedIn: 'root' }) +@Injectable({ providedIn: "root" }) export class RestService { constructor(private http: HttpClient, private alertService: AlertService) { this.options = { - responseType: 'json', - headers: new HttpHeaders({ 'Content-Type': 'application/json' }), + responseType: "json", + headers: new HttpHeaders({ "Content-Type": "application/json" }), }; } private readonly options: IHttpOptions; private baseUrl = environment.baseUrl; - public get( - url: string, - params?: { [index: string]: any }, - id?: string | number - ): Observable { + public get(url: string, params?: { [index: string]: any }, id?: string | number): Observable { const resourceUrl = this.createResourceUrl(url, id); const httpParams = this.buildParams(params); @@ -41,40 +37,32 @@ export class RestService { params: httpParams, }) .pipe( - tap((_) => this.log({ message: 'Success', type: 'success' })), - catchError(this.handleError('get', [])) + tap(_ => this.log({ message: "Success", type: "success" })), + catchError(this.handleError("get", [])) ); } - public create( - url: string, - object: any, - params?: { [index: string]: any } - ): Observable { + public create(url: string, object: any, params?: { [index: string]: any }): Observable { const httpParams = this.buildParams(params); return this.http .post(this.baseUrl + url, object, { ...this.options, params: httpParams, - observe: 'response', + observe: "response", }) .pipe( - tap((_) => + tap(_ => this.log({ - message: 'Succesfully created', - type: 'success', + message: "Succesfully created", + type: "success", }) ), - catchError(this.handleError('create', [])) + catchError(this.handleError("create", [])) ); } - public createAt( - url: string, - object: any, - params?: { [index: string]: any } - ): Observable { + public createAt(url: string, object: any, params?: { [index: string]: any }): Observable { const httpParams = this.buildParams(params); const path = this.baseUrl + url; @@ -82,25 +70,20 @@ export class RestService { .post(path, object, { ...this.options, params: httpParams, - observe: 'response', + observe: "response", }) .pipe( - tap((_) => + tap(_ => this.log({ - message: 'Succesfully created', - type: 'success', + message: "Succesfully created", + type: "success", }) ), - catchError(this.handleError('createAt', [])) + catchError(this.handleError("createAt", [])) ); } - public update( - url: string, - object: any, - id?: string | number, - params?: { [index: string]: any } - ): Observable { + public update(url: string, object: any, id?: string | number, params?: { [index: string]: any }): Observable { const resourceUrl = this.createResourceUrl(url, id); const httpParams = this.buildParams(params); @@ -108,39 +91,34 @@ export class RestService { .patch(resourceUrl, object, { ...this.options, params: httpParams, - observe: 'response', + observe: "response", }) .pipe( - tap((_) => + tap(_ => this.log({ - message: 'Succesfully patched', - type: 'success', + message: "Succesfully patched", + type: "success", }) ), - catchError(this.handleError('patch', [])) + catchError(this.handleError("patch", [])) ); } public delete(url: string, id: string | number): Observable { const resourceUrl = this.createResourceUrl(url, id); - return this.http.delete(resourceUrl, { observe: 'response' }).pipe( - tap((_) => + return this.http.delete(resourceUrl, { observe: "response" }).pipe( + tap(_ => this.log({ - message: 'Successfully deleted', - type: 'success', + message: "Successfully deleted", + type: "success", }) ), - catchError(this.handleError('delete', [])) + catchError(this.handleError("delete", [])) ); } - public put( - url: string, - object: any, - id?: string | number, - params?: { [index: string]: any } - ): Observable { + public put(url: string, object: any, id?: string | number, params?: { [index: string]: any }): Observable { const resourceUrl = this.createResourceUrl(url, id); const httpParams = this.buildParams(params); return this.http @@ -149,21 +127,17 @@ export class RestService { params: httpParams, }) .pipe( - tap((_) => + tap(_ => this.log({ - message: 'Succesfully updated', - type: 'success', + message: "Succesfully updated", + type: "success", }) ) // catchError(this.handleError('replace', [])) ); } - public post( - url: string, - body: any, - params?: { [index: string]: any } - ): Observable { + public post(url: string, body: any, params?: { [index: string]: any }): Observable { const httpParams = this.buildParams(params); return this.http @@ -172,7 +146,7 @@ export class RestService { params: httpParams, }) .pipe( - tap((_) => this.log({ message: 'Succesfully added', type: 'success' })) + tap(_ => this.log({ message: "Succesfully added", type: "success" })) // catchError(this.handleError('post', [])) ); } @@ -181,7 +155,7 @@ export class RestService { let resourceUrl = this.baseUrl + url; if (id != null) { - resourceUrl += '/' + id; + resourceUrl += "/" + id; } return resourceUrl; @@ -214,13 +188,13 @@ export class RestService { * @param operation - name of the operation that failed * @param result - optional value to return as the observable result */ - private handleError(operation = 'operation', result?: T) { + private handleError(operation = "operation", result?: T) { return (error: any): Observable => { console.error(error); this.log({ message: `${operation} failed: ${error.message}`, - type: 'danger', + type: "danger", }); return of(error as T); diff --git a/src/app/shared/services/scroll-to-top.service.spec.ts b/src/app/shared/services/scroll-to-top.service.spec.ts index a3c1fcd0c..309e50cd6 100644 --- a/src/app/shared/services/scroll-to-top.service.spec.ts +++ b/src/app/shared/services/scroll-to-top.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { ScrollToTopService } from './scroll-to-top.service'; +import { ScrollToTopService } from "./scroll-to-top.service"; -describe('ScrollToTopService', () => { +describe("ScrollToTopService", () => { let service: ScrollToTopService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('ScrollToTopService', () => { service = TestBed.inject(ScrollToTopService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/shared/services/scroll-to-top.service.ts b/src/app/shared/services/scroll-to-top.service.ts index f92c10200..b8afb14a2 100644 --- a/src/app/shared/services/scroll-to-top.service.ts +++ b/src/app/shared/services/scroll-to-top.service.ts @@ -1,18 +1,17 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class ScrollToTopService { - - constructor() { } + constructor() {} scrollToTop(): void { (function smoothscroll() { const currentScroll = document.documentElement.scrollTop || document.body.scrollTop; if (currentScroll > 0) { window.requestAnimationFrame(smoothscroll); - window.scrollTo(0, currentScroll - (currentScroll / 5)); + window.scrollTo(0, currentScroll - currentScroll / 5); } })(); } diff --git a/src/app/shared/services/sigfox.service.ts b/src/app/shared/services/sigfox.service.ts index 5d09db367..f873d2567 100644 --- a/src/app/shared/services/sigfox.service.ts +++ b/src/app/shared/services/sigfox.service.ts @@ -1,22 +1,20 @@ -import { Injectable } from '@angular/core'; -import { RestService } from './rest.service'; -import { Observable } from 'rxjs'; -import { SigfoxGroup } from '@shared/models/sigfox-group.model'; -import { SigfoxDeviceType, SigfoxDeviceTypeResponse } from '@shared/models/sigfox-device-type.model'; -import { SigfoxDevicesResponse } from '@app/sigfox/sigfox-device.model'; +import { Injectable } from "@angular/core"; +import { RestService } from "./rest.service"; +import { Observable } from "rxjs"; +import { SigfoxGroup } from "@shared/models/sigfox-group.model"; +import { SigfoxDeviceType, SigfoxDeviceTypeResponse } from "@shared/models/sigfox-device-type.model"; +import { SigfoxDevicesResponse } from "@app/sigfox/sigfox-device.model"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class SigfoxService { + private SIGFOXCONTRACTURL = "sigfox-contract"; + private SIGFOXDEVICEURL = "sigfox-api-device"; + private SIGFOXGROUPURL = "sigfox-group"; + private SIGFOXDEVICETYPEURL = "sigfox-device-type"; - private SIGFOXCONTRACTURL = 'sigfox-contract'; - private SIGFOXDEVICEURL = 'sigfox-api-device'; - private SIGFOXGROUPURL = 'sigfox-group'; - private SIGFOXDEVICETYPEURL = 'sigfox-device-type'; - - constructor( - private restService: RestService) { } + constructor(private restService: RestService) {} // Contract public getContracts(groupId: number): Observable { @@ -60,13 +58,13 @@ export class SigfoxService { } public postDeviceType(sigfoxGroup: SigfoxDeviceType): Observable { - const url = this.SIGFOXDEVICETYPEURL + '?groupId=' + sigfoxGroup.groupId.toString(); + const url = this.SIGFOXDEVICETYPEURL + "?groupId=" + sigfoxGroup.groupId.toString(); console.log(url); - return this.restService.post(url, sigfoxGroup, { observe: 'response' }); + return this.restService.post(url, sigfoxGroup, { observe: "response" }); } public putDeviceType(sigfoxGroup: SigfoxDeviceType): Observable { - const url = this.SIGFOXDEVICETYPEURL + '/' + sigfoxGroup.id + '?groupId=' + sigfoxGroup.groupId; + const url = this.SIGFOXDEVICETYPEURL + "/" + sigfoxGroup.id + "?groupId=" + sigfoxGroup.groupId; console.log(url); return this.restService.put(url, sigfoxGroup); } diff --git a/src/app/shared/services/snack.service.ts b/src/app/shared/services/snack.service.ts index f759968fc..6c7c9aa8f 100644 --- a/src/app/shared/services/snack.service.ts +++ b/src/app/shared/services/snack.service.ts @@ -1,45 +1,41 @@ -import { Injectable } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { TranslateService } from '@ngx-translate/core'; -import { SnackBarComponent } from '@shared/components/snack-bar/snack-bar.component'; - +import { Injectable } from "@angular/core"; +import { MatSnackBar } from "@angular/material/snack-bar"; +import { TranslateService } from "@ngx-translate/core"; +import { SnackBarComponent } from "@shared/components/snack-bar/snack-bar.component"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class SnackService { - constructor( - private snackBar: MatSnackBar, - public translate: TranslateService - ) {} + constructor(private snackBar: MatSnackBar, public translate: TranslateService) {} public showSavedSnack() { - this.snackBar.open(this.translate.instant('SNACK.SAVE'), this.translate.instant('SNACK.CLOSE'), { + this.snackBar.open(this.translate.instant("SNACK.SAVE"), this.translate.instant("SNACK.CLOSE"), { duration: 10000, }); } public showDeletedSnack() { - this.snackBar.open(this.translate.instant('SNACK.DELETE'), this.translate.instant('SNACK.CLOSE'), { + this.snackBar.open(this.translate.instant("SNACK.DELETE"), this.translate.instant("SNACK.CLOSE"), { duration: 10000, }); } public showUpdatedSnack() { - this.snackBar.open(this.translate.instant('SNACK.UPDATE'), this.translate.instant('SNACK.CLOSE'), { + this.snackBar.open(this.translate.instant("SNACK.UPDATE"), this.translate.instant("SNACK.CLOSE"), { duration: 10000, }); } public showFailSnack() { - this.snackBar.open(this.translate.instant('SNACK.FAIL'), this.translate.instant('SNACK.CLOSE'), { + this.snackBar.open(this.translate.instant("SNACK.FAIL"), this.translate.instant("SNACK.CLOSE"), { duration: 10000, }); } public showLoadFailSnack() { - this.snackBar.open(this.translate.instant('SNACK.LOADFAIL'), this.translate.instant('SNACK.CLOSE'), { + this.snackBar.open(this.translate.instant("SNACK.LOADFAIL"), this.translate.instant("SNACK.CLOSE"), { duration: 10000, }); } public showInQueueSnack() { - this.snackBar.open(this.translate.instant('SNACK.QUEUE'), this.translate.instant('SNACK.CLOSE'), { + this.snackBar.open(this.translate.instant("SNACK.QUEUE"), this.translate.instant("SNACK.CLOSE"), { duration: 10000, }); } @@ -49,12 +45,12 @@ export class SnackService { data: { title: title, message: displayMessage, - buttonText: buttonText + buttonText: buttonText, }, duration: 5000, - horizontalPosition: 'right', - verticalPosition: 'top', - panelClass: 'snackBar' + horizontalPosition: "right", + verticalPosition: "top", + panelClass: "snackBar", }); } } diff --git a/src/app/shared/shared-variable/shared-variable.module.ts b/src/app/shared/shared-variable/shared-variable.module.ts index 8ca9db9ac..5a7bf2847 100644 --- a/src/app/shared/shared-variable/shared-variable.module.ts +++ b/src/app/shared/shared-variable/shared-variable.module.ts @@ -1,12 +1,12 @@ -import { ModuleWithProviders, NgModule } from '@angular/core'; -import { SharedVariableService } from './shared-variable.service'; +import { ModuleWithProviders, NgModule } from "@angular/core"; +import { SharedVariableService } from "./shared-variable.service"; @NgModule({}) export class SharedVariableModule { static forRoot(): ModuleWithProviders { return { - ngModule: SharedVariableModule, - providers: [SharedVariableService], + ngModule: SharedVariableModule, + providers: [SharedVariableService], }; -} + } } diff --git a/src/app/shared/shared-variable/shared-variable.service.ts b/src/app/shared/shared-variable/shared-variable.service.ts index 13ffabc0a..230c45524 100644 --- a/src/app/shared/shared-variable/shared-variable.service.ts +++ b/src/app/shared/shared-variable/shared-variable.service.ts @@ -1,23 +1,23 @@ -import { Injectable } from '@angular/core'; -import { Organisation, OrganisationGetMinimalResponse } from '@app/admin/organisation/organisation.model'; -import { OrganisationService } from '@app/admin/organisation/organisation.service'; -import { PermissionType } from '@app/admin/permission/permission.model'; -import { UserMinimal, UserMinimalResponse } from '@app/admin/users/user-minimal.model'; -import { UserMinimalService } from '@app/admin/users/user-minimal.service'; -import { AuthService, CurrentUserInfoResponse } from '@auth/auth.service'; -import { BehaviorSubject, Observable } from 'rxjs'; -import { tap } from 'rxjs/operators'; +import { Injectable } from "@angular/core"; +import { Organisation, OrganisationGetMinimalResponse } from "@app/admin/organisation/organisation.model"; +import { OrganisationService } from "@app/admin/organisation/organisation.service"; +import { PermissionType } from "@app/admin/permission/permission.model"; +import { UserMinimal, UserMinimalResponse } from "@app/admin/users/user-minimal.model"; +import { UserMinimalService } from "@app/admin/users/user-minimal.service"; +import { AuthService, CurrentUserInfoResponse } from "@auth/auth.service"; +import { BehaviorSubject, Observable } from "rxjs"; +import { tap } from "rxjs/operators"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class SharedVariableService { - constructor( private authService: AuthService, private organisationService: OrganisationService, - private userMinimalService: UserMinimalService) { - this.routerInfo = new BehaviorSubject(0); + private userMinimalService: UserMinimalService + ) { + this.routerInfo = new BehaviorSubject(0); } private selectedOrganisationId: number; private routerInfo: BehaviorSubject; @@ -34,7 +34,7 @@ export class SharedVariableService { } setSelectedOrganisationId(value: number) { - localStorage.setItem('selected_organisation', value.toString()); + localStorage.setItem("selected_organisation", value.toString()); this.selectedOrganisationId = value; } @@ -43,10 +43,7 @@ export class SharedVariableService { .me() .pipe( tap((response: CurrentUserInfoResponse) => { - localStorage.setItem( - 'userInfo', - JSON.stringify(response) - ); + localStorage.setItem("userInfo", JSON.stringify(response)); }) ) .toPromise(); @@ -57,10 +54,7 @@ export class SharedVariableService { .getMinimalNoPerm() .pipe( tap((response: OrganisationGetMinimalResponse) => { - localStorage.setItem( - 'organizationInfo', - JSON.stringify(response.data) - ); + localStorage.setItem("organizationInfo", JSON.stringify(response.data)); }) ) .toPromise(); @@ -70,7 +64,7 @@ export class SharedVariableService { if (this.organizationInfo != null) { return this.organizationInfo; } - this.organizationInfo = new Object(JSON.parse(localStorage.getItem('organizationInfo'))) as Organisation[]; + this.organizationInfo = new Object(JSON.parse(localStorage.getItem("organizationInfo"))) as Organisation[]; return this.organizationInfo; } @@ -86,10 +80,10 @@ export class SharedVariableService { if (this.selectedOrganisationId != null) { return +this.selectedOrganisationId; } - return +localStorage.getItem('selected_organisation'); + return +localStorage.getItem("selected_organisation"); } getUserInfo(): CurrentUserInfoResponse { - return new Object(JSON.parse(localStorage.getItem('userInfo'))) as CurrentUserInfoResponse; + return new Object(JSON.parse(localStorage.getItem("userInfo"))) as CurrentUserInfoResponse; } } diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index aa2d94fb9..303a03fbb 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -1,25 +1,25 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; // Components -import { TranslateModule } from '@ngx-translate/core'; -import { DirectivesModule } from './directives/directives.module'; -import { LoadingSpinnerComponent } from './components/loading-spinner/loading-spinner.component'; -import { AlertComponent } from './components/alert/alert.component'; -import { BatteriStatusComponent } from './components/batteri-status/batteri-status.component'; -import { MapComponent } from './components/map/map.component'; -import { NGMaterialModule } from './Modules/materiale.module'; -import { DeleteDialogComponent } from './components/delete-dialog/delete-dialog.component'; -import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { TopBarComponent } from './components/top-bar/top-bar.component'; -import { TopBarTableComponent } from './components/top-bar-table/top-bar-table.component'; -import { GeneralDetailsComponent } from './components/general-details/general-details.component'; -import { PipesModule } from './pipes/pipes.module'; -import { DynamicImgComponent } from './components/dynamic-img/dynamic-img.component'; -import { MetadataDetailsComponent } from './components/metadata-details/metadata-details.component'; -import { ColumnSelectorComponent } from './components/column-selector/column-selector.component'; +import { TranslateModule } from "@ngx-translate/core"; +import { DirectivesModule } from "./directives/directives.module"; +import { LoadingSpinnerComponent } from "./components/loading-spinner/loading-spinner.component"; +import { AlertComponent } from "./components/alert/alert.component"; +import { BatteriStatusComponent } from "./components/batteri-status/batteri-status.component"; +import { MapComponent } from "./components/map/map.component"; +import { NGMaterialModule } from "./Modules/materiale.module"; +import { DeleteDialogComponent } from "./components/delete-dialog/delete-dialog.component"; +import { FormsModule } from "@angular/forms"; +import { RouterModule } from "@angular/router"; +import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"; +import { TopBarComponent } from "./components/top-bar/top-bar.component"; +import { TopBarTableComponent } from "./components/top-bar-table/top-bar-table.component"; +import { GeneralDetailsComponent } from "./components/general-details/general-details.component"; +import { PipesModule } from "./pipes/pipes.module"; +import { DynamicImgComponent } from "./components/dynamic-img/dynamic-img.component"; +import { MetadataDetailsComponent } from "./components/metadata-details/metadata-details.component"; +import { ColumnSelectorComponent } from "./components/column-selector/column-selector.component"; @NgModule({ declarations: [ diff --git a/src/app/shared/styles/leaflet-styles.scss b/src/app/shared/styles/leaflet-styles.scss index f71675d0a..64a4fb06d 100644 --- a/src/app/shared/styles/leaflet-styles.scss +++ b/src/app/shared/styles/leaflet-styles.scss @@ -1,83 +1,84 @@ app-iot-device-edit app-map .leaflet-control-geosearch form input { - height: 30px !important + height: 30px !important; } app-gateway-edit app-map .leaflet-control-geosearch form input { - height: 30px !important + height: 30px !important; } -.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow { - -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in; - -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in; - -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in; - transition: transform 0.3s ease-out, opacity 0.3s ease-in; +.leaflet-cluster-anim .leaflet-marker-icon, +.leaflet-cluster-anim .leaflet-marker-shadow { + -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in; + -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in; + -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in; + transition: transform 0.3s ease-out, opacity 0.3s ease-in; } .leaflet-cluster-spider-leg { - /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */ - -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in; - -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in; - -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in; - transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in; + /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */ + -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in; + -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in; + -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in; + transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in; } .marker-cluster-small { - background-color: rgba(181, 226, 140, 0.6); - } + background-color: rgba(181, 226, 140, 0.6); +} .marker-cluster-small div { - background-color: rgba(110, 204, 57, 0.6); - } + background-color: rgba(110, 204, 57, 0.6); +} .marker-cluster-medium { - background-color: rgba(241, 211, 87, 0.6); - } + background-color: rgba(241, 211, 87, 0.6); +} .marker-cluster-medium div { - background-color: rgba(240, 194, 12, 0.6); - } + background-color: rgba(240, 194, 12, 0.6); +} .marker-cluster-large { - background-color: rgba(253, 156, 115, 0.6); - } + background-color: rgba(253, 156, 115, 0.6); +} .marker-cluster-large div { - background-color: rgba(241, 128, 23, 0.6); - } + background-color: rgba(241, 128, 23, 0.6); +} - /* IE 6-8 fallback colors */ +/* IE 6-8 fallback colors */ .leaflet-oldie .marker-cluster-small { - background-color: rgb(181, 226, 140); - } + background-color: rgb(181, 226, 140); +} .leaflet-oldie .marker-cluster-small div { - background-color: rgb(110, 204, 57); - } + background-color: rgb(110, 204, 57); +} .leaflet-oldie .marker-cluster-medium { - background-color: rgb(241, 211, 87); - } + background-color: rgb(241, 211, 87); +} .leaflet-oldie .marker-cluster-medium div { - background-color: rgb(240, 194, 12); - } + background-color: rgb(240, 194, 12); +} .leaflet-oldie .marker-cluster-large { - background-color: rgb(253, 156, 115); - } + background-color: rgb(253, 156, 115); +} .leaflet-oldie .marker-cluster-large div { - background-color: rgb(241, 128, 23); + background-color: rgb(241, 128, 23); } .marker-cluster { - background-clip: padding-box; - border-radius: 20px; - } + background-clip: padding-box; + border-radius: 20px; +} .marker-cluster div { - width: 30px; - height: 30px; - margin-left: 5px; - margin-top: 5px; + width: 30px; + height: 30px; + margin-left: 5px; + margin-top: 5px; - text-align: center; - border-radius: 15px; - font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif; - } + text-align: center; + border-radius: 15px; + font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif; +} .marker-cluster span { - line-height: 30px; - } + line-height: 30px; +} diff --git a/src/app/shared/validators/name.validator.ts b/src/app/shared/validators/name.validator.ts index 5432822b2..ffb8228a5 100644 --- a/src/app/shared/validators/name.validator.ts +++ b/src/app/shared/validators/name.validator.ts @@ -1,11 +1,11 @@ -import { AbstractControl, ValidationErrors } from '@angular/forms'; +import { AbstractControl, ValidationErrors } from "@angular/forms"; export class NameValidator { - static cannotContainSpace(control: AbstractControl): ValidationErrors | null { - if ((control.value as string).indexOf(' ') >= 0) { - return { cannotContainSpace: true } - } - - return null; + static cannotContainSpace(control: AbstractControl): ValidationErrors | null { + if ((control.value as string).indexOf(" ") >= 0) { + return { cannotContainSpace: true }; } -} \ No newline at end of file + + return null; + } +} diff --git a/src/app/shared/validators/phone-number.validator.ts b/src/app/shared/validators/phone-number.validator.ts index d444607db..04546006f 100644 --- a/src/app/shared/validators/phone-number.validator.ts +++ b/src/app/shared/validators/phone-number.validator.ts @@ -1,4 +1,4 @@ -import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms'; +import { AbstractControl, ValidationErrors, ValidatorFn } from "@angular/forms"; const phoneNumberRegex = /[-+0-9]{6,}/; diff --git a/src/app/sigfox/sigfox-device.model.ts b/src/app/sigfox/sigfox-device.model.ts index a0fe47aec..ee1834076 100644 --- a/src/app/sigfox/sigfox-device.model.ts +++ b/src/app/sigfox/sigfox-device.model.ts @@ -1,38 +1,38 @@ export interface SigfoxDevice { - id: string; - name: string; - satelliteCapable: boolean; - sequenceNumber: number; - lastCom: any; - state: number; - comState: number; - pac: string; - location: Location; - deviceType: string; - group: string; - lqi: number; - activationTime: any; - token: Token; - contract: string; - creationTime: any; - modemCertificate: string; - prototype: boolean; - productCertificate: string; - automaticRenewal: boolean; - automaticRenewalStatus: number; - lastEditionTime: any; - lastEditedBy: string; - activable: boolean; + id: string; + name: string; + satelliteCapable: boolean; + sequenceNumber: number; + lastCom: any; + state: number; + comState: number; + pac: string; + location: Location; + deviceType: string; + group: string; + lqi: number; + activationTime: any; + token: Token; + contract: string; + creationTime: any; + modemCertificate: string; + prototype: boolean; + productCertificate: string; + automaticRenewal: boolean; + automaticRenewalStatus: number; + lastEditionTime: any; + lastEditedBy: string; + activable: boolean; } export interface Token { - state: number; - detailMessage: string; - end: any; - freeMessages?: number; - freeMessagesSent?: number; + state: number; + detailMessage: string; + end: any; + freeMessages?: number; + freeMessagesSent?: number; } export interface SigfoxDevicesResponse { - data: SigfoxDevice[]; + data: SigfoxDevice[]; } diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.html b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.html index 6ca580148..0acd0dbeb 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.html +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.html @@ -1,22 +1,21 @@
    - - - - - +
    {{ 'SIGFOX-GROUP.PROFILES.DEVICE-TYPE-NAME' | translate }} - - {{element.name}} - -
    + + + + - - - - + + + + - - -
    {{ "SIGFOX-GROUP.PROFILES.DEVICE-TYPE-NAME" | translate }} + + {{ element.name }} + + {{ 'SIGFOX-GROUP.PROFILES.DEVICE-TYPE-ALERT-EMAIL' | translate }} - {{element.alertEmail}}{{ "SIGFOX-GROUP.PROFILES.DEVICE-TYPE-ALERT-EMAIL" | translate }}{{ element.alertEmail }}
    - + + + +
    diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.scss b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.scss index d3f5a12fa..e69de29bb 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.scss +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.scss @@ -1 +0,0 @@ - diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.spec.ts b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.spec.ts index 124383475..925dda933 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.spec.ts +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { SigfoxDeviceTypeTableComponent } from './sigfox-device-type-table.component'; +import { SigfoxDeviceTypeTableComponent } from "./sigfox-device-type-table.component"; -describe('SigfoxDeviceTypeTableComponent', () => { +describe("SigfoxDeviceTypeTableComponent", () => { let component: SigfoxDeviceTypeTableComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ SigfoxDeviceTypeTableComponent ] - }) - .compileComponents(); + declarations: [SigfoxDeviceTypeTableComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('SigfoxDeviceTypeTableComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.ts b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.ts index 7cd94008b..c38a9aada 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.ts +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component.ts @@ -1,17 +1,17 @@ -import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatTableDataSource } from '@angular/material/table'; -import { ActivatedRoute, Router } from '@angular/router'; -import { environment } from '@environments/environment'; -import { TranslateService } from '@ngx-translate/core'; -import { SigfoxDeviceType } from '@shared/models/sigfox-device-type.model'; -import { SigfoxGroup } from '@shared/models/sigfox-group.model'; -import { DefaultPageSizeOptions } from '@shared/constants/page.constants'; +import { Component, Input, OnChanges, OnInit, ViewChild } from "@angular/core"; +import { MatPaginator } from "@angular/material/paginator"; +import { MatTableDataSource } from "@angular/material/table"; +import { ActivatedRoute, Router } from "@angular/router"; +import { environment } from "@environments/environment"; +import { TranslateService } from "@ngx-translate/core"; +import { SigfoxDeviceType } from "@shared/models/sigfox-device-type.model"; +import { SigfoxGroup } from "@shared/models/sigfox-group.model"; +import { DefaultPageSizeOptions } from "@shared/constants/page.constants"; @Component({ - selector: 'app-sigfox-device-type-table', - templateUrl: './sigfox-device-type-table.component.html', - styleUrls: ['./sigfox-device-type-table.component.scss'], + selector: "app-sigfox-device-type-table", + templateUrl: "./sigfox-device-type-table.component.html", + styleUrls: ["./sigfox-device-type-table.component.scss"], }) export class SigfoxDeviceTypeTableComponent implements OnInit, OnChanges { @Input() sigfoxDevices: SigfoxDeviceType[]; @@ -19,34 +19,28 @@ export class SigfoxDeviceTypeTableComponent implements OnInit, OnChanges { @Input() sigfoxGroup: SigfoxGroup; @ViewChild(MatPaginator) paginator: MatPaginator; - displayedColumns: string[] = ['name', 'alertEmail']; + displayedColumns: string[] = ["name", "alertEmail"]; public pageSize = environment.tablePageSize; public pageSizeOptions = DefaultPageSizeOptions; @Input() isLoadingResults: boolean; resultsLength: number; - constructor( - private translate: TranslateService, - private route: ActivatedRoute, - private router: Router - ) { - this.translate.use('da'); + constructor(private translate: TranslateService, private route: ActivatedRoute, private router: Router) { + this.translate.use("da"); } ngOnInit(): void {} ngOnChanges() { if (this.sigfoxDevices) { - this.dataSource.data = this.sigfoxDevices.sort((a, b) => - a.name.localeCompare(b.name, 'en', { numeric: true }) - ); + this.dataSource.data = this.sigfoxDevices.sort((a, b) => a.name.localeCompare(b.name, "en", { numeric: true })); this.dataSource.paginator = this.paginator; this.resultsLength = this.sigfoxDevices.length; } } editDeviceType(row: any) { - this.router.navigate([row.id, 'edit-device-type'], { + this.router.navigate([row.id, "edit-device-type"], { relativeTo: this.route, }); } diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.html b/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.html index 6b22f17a2..38007dc36 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.html +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.html @@ -1,58 +1,96 @@
    -
    -
      -
      -
    • - {{error | translate}} -
    • -
      -
    -
    +
    +
      +
      +
    • + {{ error | translate }} +
    • +
      +
    +
    -
    -
    - * - -
    -
    - - -
    -
    - * - -
    -
    -
    - - {{'QUESTION.SIGFOX.DEVICETYPE.CHOOSE-CONTRACT' | translate}} - - -
    -
    +
    +
    + * +
    - -
    - - +
    + + +
    +
    + * +
    - \ No newline at end of file +
    +
    + + {{ "QUESTION.SIGFOX.DEVICETYPE.CHOOSE-CONTRACT" | translate }} + + +
    +
    +
    + +
    + + +
    + diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.spec.ts b/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.spec.ts index 54c170a46..11dc0df83 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.spec.ts +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { SigfoxDeviceTypesEditComponent } from './sigfox-device-types-edit.component'; +import { SigfoxDeviceTypesEditComponent } from "./sigfox-device-types-edit.component"; -describe('SigfoxDeviceTypesEditComponent', () => { +describe("SigfoxDeviceTypesEditComponent", () => { let component: SigfoxDeviceTypesEditComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ SigfoxDeviceTypesEditComponent ] - }) - .compileComponents(); + declarations: [SigfoxDeviceTypesEditComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('SigfoxDeviceTypesEditComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.ts b/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.ts index f1ae3c86c..bb3729f43 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.ts +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component.ts @@ -1,26 +1,25 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { BackButton } from '@shared/models/back-button.model'; -import { SigfoxContract } from '@shared/models/sigfox-contract.model'; -import { SigfoxDeviceType } from '@shared/models/sigfox-device-type.model'; -import { SigfoxGroup } from '@shared/models/sigfox-group.model'; -import { SigfoxService } from '@shared/services/sigfox.service'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { Subscription } from 'rxjs'; -import { Location } from '@angular/common'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { ErrorMessage } from '@shared/models/error-message.model'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; - +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnInit } from "@angular/core"; +import { UntypedFormGroup } from "@angular/forms"; +import { ActivatedRoute } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { BackButton } from "@shared/models/back-button.model"; +import { SigfoxContract } from "@shared/models/sigfox-contract.model"; +import { SigfoxDeviceType } from "@shared/models/sigfox-device-type.model"; +import { SigfoxGroup } from "@shared/models/sigfox-group.model"; +import { SigfoxService } from "@shared/services/sigfox.service"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { Subscription } from "rxjs"; +import { Location } from "@angular/common"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { ErrorMessage } from "@shared/models/error-message.model"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-sigfox-device-types-edit', - templateUrl: './sigfox-device-types-edit.component.html', - styleUrls: ['./sigfox-device-types-edit.component.scss'] + selector: "app-sigfox-device-types-edit", + templateUrl: "./sigfox-device-types-edit.component.html", + styleUrls: ["./sigfox-device-types-edit.component.scss"], }) export class SigfoxDeviceTypesEditComponent implements OnInit { sigfoxDeviceType = new SigfoxDeviceType(); @@ -32,9 +31,9 @@ export class SigfoxDeviceTypesEditComponent implements OnInit { public errorFields: string[]; public formFailedSubmit = false; public form: UntypedFormGroup; - public backButton: BackButton = { label: '', routerLink: '/sigfox' }; - public title = ''; - public submitButton = ''; + public backButton: BackButton = { label: "", routerLink: "/sigfox" }; + public title = ""; + public submitButton = ""; public canEdit = false; organizationId: number; subscription: Subscription; @@ -47,20 +46,20 @@ export class SigfoxDeviceTypesEditComponent implements OnInit { private sharedVariable: SharedVariableService, private meService: MeService, private errorMessageService: ErrorMessageService - ) { } + ) {} ngOnInit(): void { - this.translate.use('da'); + this.translate.use("da"); this.translate - .get(['NAV.SIGFOX-DEVICE-TYPES', 'FORM.EDIT-SIGFOX-DEVICE-TYPE', 'ORGANISATION.SAVE']) - .subscribe((translations) => { - this.backButton.label = translations['NAV.SIGFOX-DEVICE-TYPES']; - this.title = translations['FORM.EDIT-SIGFOX-DEVICE-TYPE']; - this.submitButton = translations['ORGANISATION.SAVE']; + .get(["NAV.SIGFOX-DEVICE-TYPES", "FORM.EDIT-SIGFOX-DEVICE-TYPE", "ORGANISATION.SAVE"]) + .subscribe(translations => { + this.backButton.label = translations["NAV.SIGFOX-DEVICE-TYPES"]; + this.title = translations["FORM.EDIT-SIGFOX-DEVICE-TYPE"]; + this.submitButton = translations["ORGANISATION.SAVE"]; }); this.organizationId = this.sharedVariable.getSelectedOrganisationId(); - this.sigfoxGroupId = +this.route.snapshot.paramMap.get('groupId'); - this.deviceTypeId = this.route.snapshot.paramMap.get('deviceTypeId'); + this.sigfoxGroupId = +this.route.snapshot.paramMap.get("groupId"); + this.deviceTypeId = this.route.snapshot.paramMap.get("deviceTypeId"); if (this.deviceTypeId) { this.getDeviceType(); } else { @@ -71,24 +70,22 @@ export class SigfoxDeviceTypesEditComponent implements OnInit { } private getContracts(groupId: number) { - this.sigfoxService.getContracts(groupId) - .subscribe((response: any) => { - this.sigfoxContracts = response; - }); + this.sigfoxService.getContracts(groupId).subscribe((response: any) => { + this.sigfoxContracts = response; + }); } private getDeviceType() { - this.sigfoxService.getDeviceType(this.deviceTypeId, this.sigfoxGroupId) - .subscribe( (response) => { - this.sigfoxDeviceType = response; - this.sigfoxDeviceType.groupId = this.sigfoxGroupId; - this.sigfoxDeviceType.contractId = response.contract?.id; - }); + this.sigfoxService.getDeviceType(this.deviceTypeId, this.sigfoxGroupId).subscribe(response => { + this.sigfoxDeviceType = response; + this.sigfoxDeviceType.groupId = this.sigfoxGroupId; + this.sigfoxDeviceType.contractId = response.contract?.id; + }); } private create(): void { this.sigfoxService.postDeviceType(this.sigfoxDeviceType).subscribe( - (response) => { + response => { console.log(response); this.routeBack(); }, @@ -100,10 +97,10 @@ export class SigfoxDeviceTypesEditComponent implements OnInit { private update(): void { this.sigfoxService.putDeviceType(this.sigfoxDeviceType).subscribe( - (response) => { + response => { this.routeBack(); }, - (error) => { + error => { this.showError(error); } ); @@ -128,5 +125,4 @@ export class SigfoxDeviceTypesEditComponent implements OnInit { routeBack(): void { this.location.back(); } - } diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-groups-detail.component.html b/src/app/sigfox/sigfox-groups-detail/sigfox-groups-detail.component.html index b120e8255..4abe657b3 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-groups-detail.component.html +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-groups-detail.component.html @@ -1,18 +1,22 @@
    - - -
    -
    -
    -
    -

    {{'SIGFOX-GROUP.PROFILES.DEVICE-TYPE' | translate}}

    - - -
    -
    + + +
    +
    +
    +
    +

    {{ "SIGFOX-GROUP.PROFILES.DEVICE-TYPE" | translate }}

    + +
    +
    +
    diff --git a/src/app/sigfox/sigfox-groups-detail/sigfox-groups-detail.component.ts b/src/app/sigfox/sigfox-groups-detail/sigfox-groups-detail.component.ts index 4a572bd30..c575a6b0e 100644 --- a/src/app/sigfox/sigfox-groups-detail/sigfox-groups-detail.component.ts +++ b/src/app/sigfox/sigfox-groups-detail/sigfox-groups-detail.component.ts @@ -1,21 +1,19 @@ - -import { Component, OnInit } from '@angular/core'; -import { Params } from '@angular/router'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { SigfoxDeviceType } from '@shared/models/sigfox-device-type.model'; -import { SigfoxGroup } from '@shared/models/sigfox-group.model'; -import { SigfoxService } from '@shared/services/sigfox.service'; -import { SigfoxGroupData } from '@sigfox/sigfox-settings.model'; -import { Observable } from 'rxjs'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; - +import { Component, OnInit } from "@angular/core"; +import { Params } from "@angular/router"; +import { ActivatedRoute, Router } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { SigfoxDeviceType } from "@shared/models/sigfox-device-type.model"; +import { SigfoxGroup } from "@shared/models/sigfox-group.model"; +import { SigfoxService } from "@shared/services/sigfox.service"; +import { SigfoxGroupData } from "@sigfox/sigfox-settings.model"; +import { Observable } from "rxjs"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-sigfox-groups-detail', - templateUrl: './sigfox-groups-detail.component.html', - styleUrls: ['./sigfox-groups-detail.component.scss'] + selector: "app-sigfox-groups-detail", + templateUrl: "./sigfox-groups-detail.component.html", + styleUrls: ["./sigfox-groups-detail.component.scss"], }) export class SigfoxGroupsDetailComponent implements OnInit { isLoadingResults = true; @@ -29,36 +27,35 @@ export class SigfoxGroupsDetailComponent implements OnInit { private route: ActivatedRoute, private sigfoxService: SigfoxService, private meService: MeService - ) { } + ) {} ngOnInit(): void { - this.sigfoxGroupId = +this.route.snapshot.paramMap.get('groupId'); + this.sigfoxGroupId = +this.route.snapshot.paramMap.get("groupId"); this.getSigFoxGroup(this.sigfoxGroupId); this.getSigFoxDevices(); this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.ApplicationWrite); } getSigFoxDevices() { - this.sigfoxService.getDeviceTypes(this.sigfoxGroupId) - .subscribe((response) => { + this.sigfoxService.getDeviceTypes(this.sigfoxGroupId).subscribe( + response => { this.sigfoxDevices = response.data; this.isLoadingResults = false; }, - (error) => { - console.log(error); - } - ); + error => { + console.log(error); + } + ); } getSigFoxGroup(id: number) { - this.sigfoxService.getGroup(id, {}) - .subscribe((response) => { + this.sigfoxService.getGroup(id, {}).subscribe( + response => { this.sigfoxGroup = response; }, - (error) => { - console.log(error); - } - ); + error => { + console.log(error); + } + ); } - } diff --git a/src/app/sigfox/sigfox-groups-edit/sigfox-groups-edit.component.html b/src/app/sigfox/sigfox-groups-edit/sigfox-groups-edit.component.html index 2cd03675a..07f5fbffa 100644 --- a/src/app/sigfox/sigfox-groups-edit/sigfox-groups-edit.component.html +++ b/src/app/sigfox/sigfox-groups-edit/sigfox-groups-edit.component.html @@ -1,37 +1,55 @@ - +
    -
    -
    -
      -
    • - {{error | translate}} -
    • -
    -
    -
    - -
    -
    -

    {{'SIGFOX-GROUP.API-ACCESS' | translate}} API credential - creation -

    - -
    - - -
    -
    - - -
    -
    - -
    -
    +
    +
    +
      +
    • + {{ error | translate }} +
    • +
    +
    + +
    +
    +

    + {{ "SIGFOX-GROUP.API-ACCESS" | translate }} + API credential creation +

    + +
    + + +
    +
    + + +
    +
    + +
    +
    +
    diff --git a/src/app/sigfox/sigfox-groups-edit/sigfox-groups-edit.component.ts b/src/app/sigfox/sigfox-groups-edit/sigfox-groups-edit.component.ts index 9243c550d..586772e66 100644 --- a/src/app/sigfox/sigfox-groups-edit/sigfox-groups-edit.component.ts +++ b/src/app/sigfox/sigfox-groups-edit/sigfox-groups-edit.component.ts @@ -1,24 +1,23 @@ -import { HttpErrorResponse } from '@angular/common/http'; -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { NgForm } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { BackButton } from '@shared/models/back-button.model'; -import { SigfoxGroup } from '@shared/models/sigfox-group.model'; -import { SigfoxService } from '@shared/services/sigfox.service'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { Subscription } from 'rxjs'; -import { Location } from '@angular/common'; -import { ErrorMessageService } from '@shared/error-message.service'; -import { ErrorMessage } from '@shared/models/error-message.model'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; - +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { NgForm } from "@angular/forms"; +import { ActivatedRoute, Router } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { BackButton } from "@shared/models/back-button.model"; +import { SigfoxGroup } from "@shared/models/sigfox-group.model"; +import { SigfoxService } from "@shared/services/sigfox.service"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { Subscription } from "rxjs"; +import { Location } from "@angular/common"; +import { ErrorMessageService } from "@shared/error-message.service"; +import { ErrorMessage } from "@shared/models/error-message.model"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-sigfox-groups-edit', - templateUrl: './sigfox-groups-edit.component.html', - styleUrls: ['./sigfox-groups-edit.component.scss'] + selector: "app-sigfox-groups-edit", + templateUrl: "./sigfox-groups-edit.component.html", + styleUrls: ["./sigfox-groups-edit.component.scss"], }) export class SigfoxGroupsEditComponent implements OnInit, OnDestroy { sigfoxGroupId: number; @@ -30,8 +29,8 @@ export class SigfoxGroupsEditComponent implements OnInit, OnDestroy { public errorMessages: string[]; public errorFields = []; public formFailedSubmit = false; - public title = ''; - public backButton: BackButton = { label: '', routerLink: '/administration' }; + public title = ""; + public backButton: BackButton = { label: "", routerLink: "/administration" }; canEdit: boolean; constructor( @@ -43,16 +42,15 @@ export class SigfoxGroupsEditComponent implements OnInit, OnDestroy { private sharedVariable: SharedVariableService, private errorMessageService: ErrorMessageService, private meService: MeService - ) { } + ) {} ngOnInit(): void { - this.translate.get(['SIGFOX-GROUP.SIGFOX-GROUP', 'FORM.EDIT-SIGFOX-GROUPS']) - .subscribe(translations => { - this.title = translations['FORM.EDIT-SIGFOX-GROUPS']; - this.backButton.label = translations['SIGFOX-GROUP.SIGFOX-GROUP']; - }); + this.translate.get(["SIGFOX-GROUP.SIGFOX-GROUP", "FORM.EDIT-SIGFOX-GROUPS"]).subscribe(translations => { + this.title = translations["FORM.EDIT-SIGFOX-GROUPS"]; + this.backButton.label = translations["SIGFOX-GROUP.SIGFOX-GROUP"]; + }); - this.sigfoxGroupId = +this.route.snapshot.paramMap.get('groupId'); + this.sigfoxGroupId = +this.route.snapshot.paramMap.get("groupId"); if (this.sigfoxGroupId) { this.getSigfoxGroup(this.sigfoxGroupId); } @@ -61,39 +59,37 @@ export class SigfoxGroupsEditComponent implements OnInit, OnDestroy { } getSigfoxGroup(id: number) { - this.subscription = this.sigfoxService.getGroup(id) - .subscribe( - (response) => { - this.sigfoxGroup = response; - }, - (error: HttpErrorResponse) => { - console.log(error); - } - ); + this.subscription = this.sigfoxService.getGroup(id).subscribe( + response => { + this.sigfoxGroup = response; + }, + (error: HttpErrorResponse) => { + console.log(error); + } + ); } private create(): void { - this.sigfoxService.createGroupConnection(this.sigfoxGroup) - .subscribe( - (response) => { - console.log(response); - this.routeBack(); - }, - (error: HttpErrorResponse) => { - this.showError(error); - } - ); + this.sigfoxService.createGroupConnection(this.sigfoxGroup).subscribe( + response => { + console.log(response); + this.routeBack(); + }, + (error: HttpErrorResponse) => { + this.showError(error); + } + ); } private update(): void { - this.sigfoxService.updateGroupConnection(this.sigfoxGroup, this.sigfoxGroup.id) - .subscribe( - (response) => { - this.routeBack(); - }, - (error) => { - this.showError(error); - }); + this.sigfoxService.updateGroupConnection(this.sigfoxGroup, this.sigfoxGroup.id).subscribe( + response => { + this.routeBack(); + }, + error => { + this.showError(error); + } + ); } routeBack(): void { @@ -112,14 +108,13 @@ export class SigfoxGroupsEditComponent implements OnInit, OnDestroy { return; } - this.sigfoxService.getGroup(this.sigfoxGroupId).subscribe( - (response: any) => { - if (response) { - this.update(); - } else { - this.create(); - } - }); + this.sigfoxService.getGroup(this.sigfoxGroupId).subscribe((response: any) => { + if (response) { + this.update(); + } else { + this.create(); + } + }); } ngOnDestroy() { @@ -128,5 +123,4 @@ export class SigfoxGroupsEditComponent implements OnInit, OnDestroy { this.subscription.unsubscribe(); } } - } diff --git a/src/app/sigfox/sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component.html b/src/app/sigfox/sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component.html index 09874d05c..7548418b2 100644 --- a/src/app/sigfox/sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component.html +++ b/src/app/sigfox/sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component.html @@ -1,17 +1,15 @@ -
    - diff --git a/src/app/sigfox/sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component.ts b/src/app/sigfox/sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component.ts index 8d27cc600..1385c0051 100644 --- a/src/app/sigfox/sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component.ts +++ b/src/app/sigfox/sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component.ts @@ -1,14 +1,14 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { faEdit, faPen, faToolbox } from '@fortawesome/free-solid-svg-icons'; -import { SigfoxGroup } from '@shared/models/sigfox-group.model'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { Component, Input, OnInit } from "@angular/core"; +import { ActivatedRoute, Router } from "@angular/router"; +import { faEdit, faPen, faToolbox } from "@fortawesome/free-solid-svg-icons"; +import { SigfoxGroup } from "@shared/models/sigfox-group.model"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-sigfox-groups-list-item', - templateUrl: './sigfox-groups-list-item.component.html', - styleUrls: ['./sigfox-groups-list-item.component.scss'] + selector: "app-sigfox-groups-list-item", + templateUrl: "./sigfox-groups-list-item.component.html", + styleUrls: ["./sigfox-groups-list-item.component.scss"], }) export class SigfoxGroupsListItemComponent implements OnInit { faToolbox = faToolbox; @@ -16,18 +16,13 @@ export class SigfoxGroupsListItemComponent implements OnInit { @Input() sigfoxGroup: SigfoxGroup; public canEdit = false; - constructor( - private route: ActivatedRoute, - private router: Router, - private meService: MeService - ) { } + constructor(private route: ActivatedRoute, private router: Router, private meService: MeService) {} ngOnInit(): void { this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.ApplicationWrite); } onEditSigfoxGroup() { - this.router.navigate([this.sigfoxGroup.sigfoxGroupData.id, 'edit-group'], { relativeTo: this.route }); + this.router.navigate([this.sigfoxGroup.sigfoxGroupData.id, "edit-group"], { relativeTo: this.route }); } - } diff --git a/src/app/sigfox/sigfox-groups-list/sigfox-groups-list.component.html b/src/app/sigfox/sigfox-groups-list/sigfox-groups-list.component.html index 7628bfa09..cfdf976dc 100644 --- a/src/app/sigfox/sigfox-groups-list/sigfox-groups-list.component.html +++ b/src/app/sigfox/sigfox-groups-list/sigfox-groups-list.component.html @@ -1,19 +1,22 @@
    - - + + -
    -
    -
    -
    -

    {{'SIGFOX-GROUP.ADMINISTRATION.NAME' | translate}}

    - - -
    -
    +
    +
    +
    +
    +

    {{ "SIGFOX-GROUP.ADMINISTRATION.NAME" | translate }}

    + +
    +
    +
    diff --git a/src/app/sigfox/sigfox-groups-list/sigfox-groups-list.component.ts b/src/app/sigfox/sigfox-groups-list/sigfox-groups-list.component.ts index e1a6983b6..69384afef 100644 --- a/src/app/sigfox/sigfox-groups-list/sigfox-groups-list.component.ts +++ b/src/app/sigfox/sigfox-groups-list/sigfox-groups-list.component.ts @@ -1,18 +1,18 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { Title } from '@angular/platform-browser'; -import { faDatabase, faToolbox } from '@fortawesome/free-solid-svg-icons'; -import { TranslateService } from '@ngx-translate/core'; -import { SigfoxGroup } from '@shared/models/sigfox-group.model'; -import { SigfoxService } from '@shared/services/sigfox.service'; -import { SharedVariableService } from '@shared/shared-variable/shared-variable.service'; -import { Observable, Subscription } from 'rxjs'; -import { MeService } from '@shared/services/me.service'; -import { OrganizationAccessScope } from '@shared/enums/access-scopes'; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { Title } from "@angular/platform-browser"; +import { faDatabase, faToolbox } from "@fortawesome/free-solid-svg-icons"; +import { TranslateService } from "@ngx-translate/core"; +import { SigfoxGroup } from "@shared/models/sigfox-group.model"; +import { SigfoxService } from "@shared/services/sigfox.service"; +import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { Observable, Subscription } from "rxjs"; +import { MeService } from "@shared/services/me.service"; +import { OrganizationAccessScope } from "@shared/enums/access-scopes"; @Component({ - selector: 'app-sigfox-groups-list', - templateUrl: './sigfox-groups-list.component.html', - styleUrls: ['./sigfox-groups-list.component.scss'] + selector: "app-sigfox-groups-list", + templateUrl: "./sigfox-groups-list.component.html", + styleUrls: ["./sigfox-groups-list.component.scss"], }) export class SigfoxGroupsListComponent implements OnInit, OnDestroy { faDatabase = faDatabase; @@ -29,27 +29,26 @@ export class SigfoxGroupsListComponent implements OnInit, OnDestroy { private sigfoxService: SigfoxService, private meService: MeService ) { - translate.use('da'); + translate.use("da"); } ngOnInit(): void { this.getSigFoxGroups(); - this.translate.get(['TITLE.SIGFOX']) - .subscribe(translations => { - this.titleService.setTitle(translations['TITLE.SIGFOX']); + this.translate.get(["TITLE.SIGFOX"]).subscribe(translations => { + this.titleService.setTitle(translations["TITLE.SIGFOX"]); }); this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.ApplicationWrite); } getSigFoxGroups() { - this.sigfoxService.getGroups(this.getCurrentOrganisationId()) - .subscribe((response) => { + this.sigfoxService.getGroups(this.getCurrentOrganisationId()).subscribe( + response => { this.sigfoxGroups = response.data; }, - (error) => { - console.log(error); - } - ); + error => { + console.log(error); + } + ); } getCurrentOrganisationId(): number { diff --git a/src/app/sigfox/sigfox-routing.module.ts b/src/app/sigfox/sigfox-routing.module.ts index c93b2fd66..3d0de4568 100644 --- a/src/app/sigfox/sigfox-routing.module.ts +++ b/src/app/sigfox/sigfox-routing.module.ts @@ -1,31 +1,32 @@ -import { Routes, RouterModule } from '@angular/router'; -import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from "@angular/router"; +import { NgModule } from "@angular/core"; -import { SigfoxGroupsEditComponent } from './sigfox-groups-edit/sigfox-groups-edit.component'; -import { SigfoxGroupsDetailComponent } from './sigfox-groups-detail/sigfox-groups-detail.component'; -import { SigfoxDeviceTypesEditComponent } from './sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component'; -import { SigfoxGroupsListComponent } from './sigfox-groups-list/sigfox-groups-list.component'; +import { SigfoxGroupsEditComponent } from "./sigfox-groups-edit/sigfox-groups-edit.component"; +import { SigfoxGroupsDetailComponent } from "./sigfox-groups-detail/sigfox-groups-detail.component"; +import { SigfoxDeviceTypesEditComponent } from "./sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component"; +import { SigfoxGroupsListComponent } from "./sigfox-groups-list/sigfox-groups-list.component"; const routes: Routes = [ - { - path: '', + { + path: "", + children: [ + { path: "", component: SigfoxGroupsListComponent }, + { path: "new-group", component: SigfoxGroupsEditComponent }, + { path: ":groupId/edit-group", component: SigfoxGroupsEditComponent }, + { + path: ":groupId", children: [ - { path: '', component: SigfoxGroupsListComponent }, - { path: 'new-group', component: SigfoxGroupsEditComponent }, - { path: ':groupId/edit-group', component: SigfoxGroupsEditComponent }, - { - path: ':groupId', children: [ - { path: '', component: SigfoxGroupsDetailComponent }, - { path: ':deviceTypeId/edit-device-type', component: SigfoxDeviceTypesEditComponent }, - { path: 'new-device-type', component: SigfoxDeviceTypesEditComponent } - ] - } - ] - } + { path: "", component: SigfoxGroupsDetailComponent }, + { path: ":deviceTypeId/edit-device-type", component: SigfoxDeviceTypesEditComponent }, + { path: "new-device-type", component: SigfoxDeviceTypesEditComponent }, + ], + }, + ], + }, ]; @NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], }) -export class SigfoxRoutingModule { } +export class SigfoxRoutingModule {} diff --git a/src/app/sigfox/sigfox-settings.model.ts b/src/app/sigfox/sigfox-settings.model.ts index 90ea43b50..71124a753 100644 --- a/src/app/sigfox/sigfox-settings.model.ts +++ b/src/app/sigfox/sigfox-settings.model.ts @@ -1,27 +1,27 @@ export class SigfoxSettings { - deviceId?: string; - deviceTypeId?: string; - deviceTypeName?: string; - groupId: number; - groupName: string; - connectToExistingDeviceInBackend = false; - pac?: string; - endProductCertificate?: string; - prototype = false; - sigfoxGroupData: SigfoxGroupData; + deviceId?: string; + deviceTypeId?: string; + deviceTypeName?: string; + groupId: number; + groupName: string; + connectToExistingDeviceInBackend = false; + pac?: string; + endProductCertificate?: string; + prototype = false; + sigfoxGroupData: SigfoxGroupData; } export interface SigfoxGroupData { - id: string; - name: string; - description: string; - type: number; - timezone: string; - nameCI: string; - path: string[]; - currentPrototypeCount: number; - createdBy: string; - creationTime: number; - leaf: boolean; - actions: string[]; + id: string; + name: string; + description: string; + type: number; + timezone: string; + nameCI: string; + path: string[]; + currentPrototypeCount: number; + createdBy: string; + creationTime: number; + leaf: boolean; + actions: string[]; } diff --git a/src/app/sigfox/sigfox.module.ts b/src/app/sigfox/sigfox.module.ts index 640356395..b9804525b 100644 --- a/src/app/sigfox/sigfox.module.ts +++ b/src/app/sigfox/sigfox.module.ts @@ -1,20 +1,20 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { SigfoxRoutingModule } from './sigfox-routing.module'; -import { FormModule } from '@shared/components/forms/form.module'; -import { FormsModule } from '@angular/forms'; -import { NGMaterialModule } from '@shared/Modules/materiale.module'; -import { TranslateModule } from '@ngx-translate/core'; -import { SharedModule } from '@shared/shared.module'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { SigfoxRoutingModule } from "./sigfox-routing.module"; +import { FormModule } from "@shared/components/forms/form.module"; +import { FormsModule } from "@angular/forms"; +import { NGMaterialModule } from "@shared/Modules/materiale.module"; +import { TranslateModule } from "@ngx-translate/core"; +import { SharedModule } from "@shared/shared.module"; +import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"; -import { SigfoxGroupsEditComponent } from './sigfox-groups-edit/sigfox-groups-edit.component'; -import { SigfoxGroupsListComponent } from './sigfox-groups-list/sigfox-groups-list.component'; -import { SigfoxGroupsDetailComponent } from './sigfox-groups-detail/sigfox-groups-detail.component'; -import { SigfoxDeviceTypeTableComponent } from './sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component'; -import { SigfoxDeviceTypesEditComponent } from './sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component'; -import { SigfoxGroupsListItemComponent } from './sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component'; -import { PipesModule } from '@shared/pipes/pipes.module'; +import { SigfoxGroupsEditComponent } from "./sigfox-groups-edit/sigfox-groups-edit.component"; +import { SigfoxGroupsListComponent } from "./sigfox-groups-list/sigfox-groups-list.component"; +import { SigfoxGroupsDetailComponent } from "./sigfox-groups-detail/sigfox-groups-detail.component"; +import { SigfoxDeviceTypeTableComponent } from "./sigfox-groups-detail/sigfox-device-type-table/sigfox-device-type-table.component"; +import { SigfoxDeviceTypesEditComponent } from "./sigfox-groups-detail/sigfox-device-types-edit/sigfox-device-types-edit.component"; +import { SigfoxGroupsListItemComponent } from "./sigfox-groups-list/sigfox-groups-list-item/sigfox-groups-list-item.component"; +import { PipesModule } from "@shared/pipes/pipes.module"; @NgModule({ declarations: [ @@ -23,8 +23,7 @@ import { PipesModule } from '@shared/pipes/pipes.module'; SigfoxDeviceTypeTableComponent, SigfoxGroupsListComponent, SigfoxGroupsDetailComponent, - SigfoxGroupsListItemComponent - + SigfoxGroupsListItemComponent, ], imports: [ CommonModule, @@ -36,6 +35,6 @@ import { PipesModule } from '@shared/pipes/pipes.module'; SharedModule, FontAwesomeModule, PipesModule, - ] + ], }) -export class SigfoxModule { } +export class SigfoxModule {} diff --git a/src/assets/scss/components/_boxes.scss b/src/assets/scss/components/_boxes.scss index f292929b8..68718f65f 100644 --- a/src/assets/scss/components/_boxes.scss +++ b/src/assets/scss/components/_boxes.scss @@ -1,21 +1,20 @@ - -@import '../setup/variables'; +@import "../setup/variables"; .jumbotron { @extend .my-4; @extend .m-md-4; @extend .p-3; background-color: $color-bg-normal; - &--m-right{ + &--m-right { @extend .mr-md-2; } - &--m-left{ + &--m-left { @extend .ml-md-2; } - &--full-width{ + &--full-width { width: -webkit-fill-available; } - h3{ + h3 { @extend .pr-5; @extend .mb-4; display: block; @@ -25,18 +24,16 @@ border-bottom-color: $color-primary; width: fit-content; } - &--table{ + &--table { @extend .m-md-4; } } - - -.box{ +.box { width: 100%; @extend .p-3; - &--info{ + &--info { background-color: $color-bg-info; border: $info-border; border-radius: $border-radius-primary; @@ -44,10 +41,10 @@ } } -.sixty-height{ +.sixty-height { height: 60vh; } -.thirty-height{ - height: 30vh +.thirty-height { + height: 30vh; } diff --git a/src/assets/scss/components/_bulk-import.scss b/src/assets/scss/components/_bulk-import.scss index f9607fa19..af0f19e4f 100644 --- a/src/assets/scss/components/_bulk-import.scss +++ b/src/assets/scss/components/_bulk-import.scss @@ -1,11 +1,11 @@ -@import 'src/assets/scss/setup/utilities'; -@import 'src/assets/scss/setup/variables'; +@import "src/assets/scss/setup/utilities"; +@import "src/assets/scss/setup/variables"; -$fa-font-path : '~@fortawesome/fontawesome-free/webfonts'; -@import '@fortawesome/fontawesome-free/scss/fontawesome'; -@import '@fortawesome/fontawesome-free/scss/regular'; -@import '@fortawesome/fontawesome-free/scss/solid'; -@import '@fortawesome/fontawesome-free/scss/brands'; +$fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; +@import "@fortawesome/fontawesome-free/scss/fontawesome"; +@import "@fortawesome/fontawesome-free/scss/regular"; +@import "@fortawesome/fontawesome-free/scss/solid"; +@import "@fortawesome/fontawesome-free/scss/brands"; .choose-file:before { content: attr(data-content); @@ -42,7 +42,7 @@ $fa-font-path : '~@fortawesome/fontawesome-free/webfonts'; .choose-file:after { font-family: "Font Awesome 5 Free"; font-weight: 900; - content: '\f093'; + content: "\f093"; position: absolute; font-size: $icon-size-big; left: 50%; diff --git a/src/assets/scss/components/_forms.scss b/src/assets/scss/components/_forms.scss index e95ad5ccf..64e94eaa8 100644 --- a/src/assets/scss/components/_forms.scss +++ b/src/assets/scss/components/_forms.scss @@ -1,16 +1,13 @@ -@import '../setup/variables'; +@import "../setup/variables"; .os2-form { width: 100%; padding-left: 1rem; padding-right: 1rem; background-color: $white; - box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); - -webkit-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); - -moz-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + -webkit-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); @include media-breakpoint-up(md) { width: 510px; @@ -57,7 +54,6 @@ &:hover { border: $border-input-hover; cursor: pointer; - } } @@ -75,7 +71,6 @@ &:hover { border: $border-input-hover; cursor: pointer; - } } @@ -103,12 +98,9 @@ textarea { background-repeat: no-repeat; background-position: calc(100% - 10px); background-size: 12px; - box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); - -webkit-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); - -moz-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + -webkit-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); } .select-box-sm { @@ -193,14 +185,14 @@ textarea { margin: 1rem auto 0rem; } - .form-check-input:checked+.image-container { + .form-check-input:checked + .image-container { border: solid 1px $color-primary; box-shadow: 0 0 0 0.2rem $color-primary; } } .error-messages { - border-radius: .25rem; + border-radius: 0.25rem; border: solid 1px $red; background-color: $red-light; } diff --git a/src/assets/scss/components/_list.scss b/src/assets/scss/components/_list.scss index e77e23028..263d50940 100644 --- a/src/assets/scss/components/_list.scss +++ b/src/assets/scss/components/_list.scss @@ -1,4 +1,4 @@ -@import '../setup/utilities'; +@import "../setup/utilities"; ul { padding-left: 0; @@ -12,7 +12,6 @@ ul { //padding-left: 37px; line-height: $body-text-line-height; outline: none; - } } @@ -29,12 +28,10 @@ ol { &:before { font-weight: $font-weight-bold; position: absolute; - } } } - .unstyled-list { @include unstyled-list; @@ -50,7 +47,6 @@ ol { @include inline-list; } - .list-group-item { padding: 0 !important; @include add-shadow; diff --git a/src/assets/scss/components/_loading-spinner.scss b/src/assets/scss/components/_loading-spinner.scss index a12a84450..6ddda5671 100644 --- a/src/assets/scss/components/_loading-spinner.scss +++ b/src/assets/scss/components/_loading-spinner.scss @@ -1,112 +1,112 @@ -@import '../setup/variables'; -.loading-wrapper{ +@import "../setup/variables"; +.loading-wrapper { @extend .my-5; display: flex; justify-content: center; - width: 100%; + width: 100%; -.lds-roller { - display: inline-block; - position: relative; - width: 80px; - height: 80px; -} - -.lds-roller div { - animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; - transform-origin: 40px 40px; -} + .lds-roller { + display: inline-block; + position: relative; + width: 80px; + height: 80px; + } -.lds-roller div:after { - content: " "; - display: block; - position: absolute; - width: 7px; - height: 7px; - border-radius: 50%; - background: $color-primary; - margin: -4px 0 0 -4px; -} + .lds-roller div { + animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; + transform-origin: 40px 40px; + } -.lds-roller div:nth-child(1) { - animation-delay: -0.036s; -} + .lds-roller div:after { + content: " "; + display: block; + position: absolute; + width: 7px; + height: 7px; + border-radius: 50%; + background: $color-primary; + margin: -4px 0 0 -4px; + } -.lds-roller div:nth-child(1):after { - top: 63px; - left: 63px; -} + .lds-roller div:nth-child(1) { + animation-delay: -0.036s; + } -.lds-roller div:nth-child(2) { - animation-delay: -0.072s; -} + .lds-roller div:nth-child(1):after { + top: 63px; + left: 63px; + } -.lds-roller div:nth-child(2):after { - top: 68px; - left: 56px; -} + .lds-roller div:nth-child(2) { + animation-delay: -0.072s; + } -.lds-roller div:nth-child(3) { - animation-delay: -0.108s; -} + .lds-roller div:nth-child(2):after { + top: 68px; + left: 56px; + } -.lds-roller div:nth-child(3):after { - top: 71px; - left: 48px; -} + .lds-roller div:nth-child(3) { + animation-delay: -0.108s; + } -.lds-roller div:nth-child(4) { - animation-delay: -0.144s; -} + .lds-roller div:nth-child(3):after { + top: 71px; + left: 48px; + } -.lds-roller div:nth-child(4):after { - top: 72px; - left: 40px; -} + .lds-roller div:nth-child(4) { + animation-delay: -0.144s; + } -.lds-roller div:nth-child(5) { - animation-delay: -0.18s; -} + .lds-roller div:nth-child(4):after { + top: 72px; + left: 40px; + } -.lds-roller div:nth-child(5):after { - top: 71px; - left: 32px; -} + .lds-roller div:nth-child(5) { + animation-delay: -0.18s; + } -.lds-roller div:nth-child(6) { - animation-delay: -0.216s; -} + .lds-roller div:nth-child(5):after { + top: 71px; + left: 32px; + } -.lds-roller div:nth-child(6):after { - top: 68px; - left: 24px; -} + .lds-roller div:nth-child(6) { + animation-delay: -0.216s; + } -.lds-roller div:nth-child(7) { - animation-delay: -0.252s; -} + .lds-roller div:nth-child(6):after { + top: 68px; + left: 24px; + } -.lds-roller div:nth-child(7):after { - top: 63px; - left: 17px; -} + .lds-roller div:nth-child(7) { + animation-delay: -0.252s; + } -.lds-roller div:nth-child(8) { - animation-delay: -0.288s; -} + .lds-roller div:nth-child(7):after { + top: 63px; + left: 17px; + } -.lds-roller div:nth-child(8):after { - top: 56px; - left: 12px; -} + .lds-roller div:nth-child(8) { + animation-delay: -0.288s; + } -@keyframes lds-roller { - 0% { - transform: rotate(0deg); + .lds-roller div:nth-child(8):after { + top: 56px; + left: 12px; } - 100% { - transform: rotate(360deg); + @keyframes lds-roller { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } } } -} \ No newline at end of file diff --git a/src/assets/scss/components/_monaco-editor.scss b/src/assets/scss/components/_monaco-editor.scss index 1c9da4406..33d13830c 100644 --- a/src/assets/scss/components/_monaco-editor.scss +++ b/src/assets/scss/components/_monaco-editor.scss @@ -1,14 +1,14 @@ ngx-monaco-editor { - width: 100%; - padding: 15px; - //border: $border-input-hover; - @include add-shadow; - } - - .big-editor { - height: 100vh !important; - } - - .middle-editor{ - height: 40vh !important; - } \ No newline at end of file + width: 100%; + padding: 15px; + //border: $border-input-hover; + @include add-shadow; +} + +.big-editor { + height: 100vh !important; +} + +.middle-editor { + height: 40vh !important; +} diff --git a/src/assets/scss/components/_navbar.scss b/src/assets/scss/components/_navbar.scss index eb9c9e7c3..a1179a86f 100644 --- a/src/assets/scss/components/_navbar.scss +++ b/src/assets/scss/components/_navbar.scss @@ -1,6 +1,6 @@ -@import 'src/assets/scss/setup/breakpoints'; -@import 'src/assets/scss/setup/variables'; -@import 'src/assets/scss/setup/utilities'; +@import "src/assets/scss/setup/breakpoints"; +@import "src/assets/scss/setup/variables"; +@import "src/assets/scss/setup/utilities"; .navbar { top: 0; @@ -9,7 +9,7 @@ border-bottom: $outer-border; @include add-shadow; - @media(min-width: $screen-md-min) { + @media (min-width: $screen-md-min) { border-bottom: none; border-right: $outer-border; width: $navWidth; @@ -19,7 +19,7 @@ .navbar-nav { width: 100%; - .nav-link+fa-icon { + .nav-link + fa-icon { color: $black; line-height: 19px; float: left; @@ -46,7 +46,6 @@ } } - select.input-lg { -webkit-appearance: none; -moz-appearance: none; @@ -54,7 +53,7 @@ select.input-lg { border: none; } -select+fa-icon { +select + fa-icon { float: right; margin-top: -30px; margin-right: 5px; diff --git a/src/assets/scss/components/_tables.scss b/src/assets/scss/components/_tables.scss index d9f44d21d..9eac60f6b 100644 --- a/src/assets/scss/components/_tables.scss +++ b/src/assets/scss/components/_tables.scss @@ -1,4 +1,4 @@ -@import '../setup/variables'; +@import "../setup/variables"; .table, table { @@ -7,12 +7,10 @@ table { // -webkit-border-radius: .25rem; // -moz-border-radius: .25rem; // border-radius: .25rem; - box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.14), 0px 1px 13px rgba(0, 0, 0, 0.03), + box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.14), 0px 1px 13px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); + -webkit-box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.14), 0px 1px 13px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); - -webkit-box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.14), - 0px 1px 13px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); - -moz-box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.14), - 0px 1px 13px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); + -moz-box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.14), 0px 1px 13px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); // border: $grey-border solid 1px; * { diff --git a/src/assets/scss/components/_topbar.scss b/src/assets/scss/components/_topbar.scss index 854908003..ca1a57fa2 100644 --- a/src/assets/scss/components/_topbar.scss +++ b/src/assets/scss/components/_topbar.scss @@ -1,7 +1,7 @@ -@import 'src/assets/scss/setup/breakpoints'; -@import 'src/assets/scss/setup/variables'; -@import 'bootstrap/scss/variables'; -@import '../setup/utilities'; +@import "src/assets/scss/setup/breakpoints"; +@import "src/assets/scss/setup/variables"; +@import "bootstrap/scss/variables"; +@import "../setup/utilities"; .top-bar-wrapper { margin: 0; @@ -72,7 +72,6 @@ @extend .mx-2; } } - } .no-margin { diff --git a/src/assets/scss/elements/_buttons.scss b/src/assets/scss/elements/_buttons.scss index 203b6ea73..7b72e7b25 100644 --- a/src/assets/scss/elements/_buttons.scss +++ b/src/assets/scss/elements/_buttons.scss @@ -1,4 +1,4 @@ -@import '../setup/variables'; +@import "../setup/variables"; // Buttons button, @@ -17,11 +17,7 @@ a { @extend .btn; color: $color-text-white; border: solid calculateRem(1) $button-primary-border-color; - background: linear-gradient( - 180deg, - $button-primary-bg 0%, - $button-primary-bg 100% - ); + background: linear-gradient(180deg, $button-primary-bg 0%, $button-primary-bg 100%); box-shadow: none; &:hover, @@ -120,12 +116,9 @@ a { } .btn { - box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), - 0px 0px 1px rgba(0, 0, 0, 0.24); - -webkit-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); - -moz-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + -webkit-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.12), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.24); padding: 0.4rem; white-space: normal; diff --git a/src/assets/scss/elements/_icons.scss b/src/assets/scss/elements/_icons.scss index 260247323..6fadf2f84 100644 --- a/src/assets/scss/elements/_icons.scss +++ b/src/assets/scss/elements/_icons.scss @@ -1,5 +1,5 @@ -@import '../setup/variables'; -@import '../setup/typography'; +@import "../setup/variables"; +@import "../setup/typography"; .icon { &--primary { diff --git a/src/assets/scss/elements/_labels.scss b/src/assets/scss/elements/_labels.scss index 1e82a9b0c..e1b6b7f65 100644 --- a/src/assets/scss/elements/_labels.scss +++ b/src/assets/scss/elements/_labels.scss @@ -1,5 +1,5 @@ -@import '../setup/typography'; -@import '../setup/variables'; +@import "../setup/typography"; +@import "../setup/variables"; .label { @include body-text-small; diff --git a/src/assets/scss/elements/_links.scss b/src/assets/scss/elements/_links.scss index c5cca092f..18a2e6d2a 100644 --- a/src/assets/scss/elements/_links.scss +++ b/src/assets/scss/elements/_links.scss @@ -1,6 +1,4 @@ -@import '../setup//variables'; - - +@import "../setup//variables"; // Links @@ -23,7 +21,6 @@ a { color: $color-link-hover; border-bottom: 5px solid $color-link-hover-bg; - &:disabled, .disabled { background-color: transparent !important; diff --git a/src/assets/scss/setup/_base.scss b/src/assets/scss/setup/_base.scss index b7b6ad3dc..fa448c3eb 100644 --- a/src/assets/scss/setup/_base.scss +++ b/src/assets/scss/setup/_base.scss @@ -1,14 +1,13 @@ @use "sass:math"; -@import 'variables'; -@import 'breakpoints'; -@import 'fonts'; +@import "variables"; +@import "breakpoints"; +@import "fonts"; // Bootstrap -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; - +@import "bootstrap/scss/functions"; +@import "bootstrap/scss/variables"; @function strip-unit($value) { @return math.div($value, ($value * 0 + 1)); @@ -25,7 +24,10 @@ font-size: $min-font-size; @media screen and (min-width: $min-vw) { - font-size: calc(#{$min-font-size} + #{strip-unit($max-font-size - $min-font-size)} * ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})); + font-size: calc( + #{$min-font-size} + #{strip-unit($max-font-size - $min-font-size)} * + ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)}) + ); } @media screen and (min-width: $max-vw) { @@ -35,8 +37,6 @@ } } - - html { font-family: $font-name, system; font-size: $body-text; @@ -58,6 +58,8 @@ body { } // Bootstrap overrides -$theme-colors: ('primary': $color-primary, - 'success': $color-success, - 'dark': $color-secondary) !default; +$theme-colors: ( + "primary": $color-primary, + "success": $color-success, + "dark": $color-secondary, +) !default; diff --git a/src/assets/scss/setup/_breakpoints.scss b/src/assets/scss/setup/_breakpoints.scss index ca430e436..252d25782 100644 --- a/src/assets/scss/setup/_breakpoints.scss +++ b/src/assets/scss/setup/_breakpoints.scss @@ -2,18 +2,27 @@ //########################################################################### //Bootstrap -@import 'bootstrap/scss/mixins'; -@import 'variables'; - - -$breakpoints: ('small': (max-width: $screen-sm-min), - 'medium': (max-width: $screen-md-min), - 'large': (max-width: $screen-lg-min), - 'x-large': (max-width: $screen-xl-min)) !default; - +@import "bootstrap/scss/mixins"; +@import "variables"; + +$breakpoints: ( + "small": ( + max-width: $screen-sm-min, + ), + "medium": ( + max-width: $screen-md-min, + ), + "large": ( + max-width: $screen-lg-min, + ), + "x-large": ( + max-width: $screen-xl-min, + ), +) !default; //breakpoints -$grid-breakpoints: (xs: 0, +$grid-breakpoints: ( + xs: 0, sm: $screen-sm-min, md: $screen-md-min, lg: $screen-lg-min, @@ -21,15 +30,12 @@ $grid-breakpoints: (xs: 0, xxl: $screen-xxl-min, ); - /// Mixin to manage responsive breakpoints /// @param {String} $breakpoint - Breakpoint name /// @require $breakpoints @mixin respond-to($breakpoint) { - // If the key exists in the map @if map-has-key($breakpoints, $breakpoint) { - // Prints a media query based on the value @media #{inspect(map-get($breakpoints, $breakpoint))} { @content; diff --git a/src/assets/scss/setup/_fonts.scss b/src/assets/scss/setup/_fonts.scss index 634c97935..1e4e8276a 100644 --- a/src/assets/scss/setup/_fonts.scss +++ b/src/assets/scss/setup/_fonts.scss @@ -1,4 +1,4 @@ -$font-name: 'Roboto' !default; //'Roboto'!default; +$font-name: "Roboto" !default; //'Roboto'!default; // $font-text-regular: 'IBMPlexSans-Text' !default; // $font-regular: 'IBMPlexSans-Regular' !default; // $font-medium: 'IBMPlexSans-Medium' !default; @@ -7,7 +7,6 @@ $font-name: 'Roboto' !default; //'Roboto'!default; // $font-italic: 'IBMPlexSans-Italic' !default; // $font-system: 'system' !default; - // @font-face { // font-family: $font-name; // src: url($font-path + $font-regular+'.eot'); __<>__ @@ -20,7 +19,6 @@ $font-name: 'Roboto' !default; //'Roboto'!default; // font-weight: $font-weight-normal; // } - // // Fonts // @font-face { // font-family: 'roboto-light'; diff --git a/src/assets/scss/setup/_material-theme.scss b/src/assets/scss/setup/_material-theme.scss index 18558d316..ec7444543 100644 --- a/src/assets/scss/setup/_material-theme.scss +++ b/src/assets/scss/setup/_material-theme.scss @@ -1,6 +1,6 @@ -@use '@angular/material' as mat; -@import '@angular/material/theming'; -@import 'variables'; +@use "@angular/material" as mat; +@import "@angular/material/theming"; +@import "variables"; @include mat.core(); /* ======== angular material custom theme ======== */ @@ -19,7 +19,7 @@ $OS2IoT-theme: mat.define-dark-theme($OS2IoT-primary, $OS2IoT-accent, $OS2IoT-wa // Custom Theming for Angular Material // For more information: https://material.angular.io/guide/theming -@import '@angular/material/theming'; +@import "@angular/material/theming"; // Plus imports for other components in your app. // Include the common styles for Angular Material. We include this here so that you only @@ -55,7 +55,7 @@ $OS2IoT-frontend-theme: mat.define-light-theme( white-space: normal !important; } ////////////////////////////// EXPANSION PANELS /////////////////////////////////////////// -.mat-expansion-panel:not([class*='mat-elevation-z']) { +.mat-expansion-panel:not([class*="mat-elevation-z"]) { box-shadow: none; } @@ -150,4 +150,3 @@ tr.mat-row { .mat-sort-header-content { text-align: left !important; } - diff --git a/src/assets/scss/setup/_typography.scss b/src/assets/scss/setup/_typography.scss index 01ec2cb01..3cd53c228 100644 --- a/src/assets/scss/setup/_typography.scss +++ b/src/assets/scss/setup/_typography.scss @@ -1,6 +1,6 @@ -@import 'utilities'; -@import 'breakpoints'; -@import 'base'; +@import "utilities"; +@import "breakpoints"; +@import "base"; $mod_1: 1.1; // mobile $mod_2: 1.4; // desktop @@ -12,7 +12,7 @@ h4, h5, p, a { - font-family: 'Roboto'; + font-family: "Roboto"; } /*####################### HEADLINE #########################*/ @@ -61,12 +61,7 @@ a { line-height: $h3-line-height; font-weight: $font-weight-normal; color: $color-text; - @include fluid-type( - $min_width, - $max_width, - $mod_1 * $mod_1 * $min_font, - $mod_2 * $mod_2 * $min_font - ); + @include fluid-type($min_width, $max_width, $mod_1 * $mod_1 * $min_font, $mod_2 * $mod_2 * $min_font); strong { font-weight: $font-weight-bold; @@ -80,12 +75,7 @@ a { line-height: $h4-line-height; font-weight: $font-weight-normal; color: $color-text; - @include fluid-type( - $min_width, - $max_width, - $mod_1 * $mod_1 * $min_font, - $mod_2 * $mod_2 * $min_font - ); + @include fluid-type($min_width, $max_width, $mod_1 * $mod_1 * $min_font, $mod_2 * $mod_2 * $min_font); strong { font-weight: $font-weight-bold; @@ -267,7 +257,7 @@ footer { br { display: block; @extend .mb-3; - content: ' '; + content: " "; } } diff --git a/src/assets/scss/setup/_utilities.scss b/src/assets/scss/setup/_utilities.scss index 4fdf058ad..c00c12634 100644 --- a/src/assets/scss/setup/_utilities.scss +++ b/src/assets/scss/setup/_utilities.scss @@ -1,11 +1,11 @@ -@import './variables'; +@import "./variables"; // Unstyled list helper @mixin unstyled-list() { list-style-type: none; padding-left: 0; - >li { + > li { margin-bottom: 0; margin-top: 0; padding-left: 0; @@ -18,7 +18,7 @@ } @mixin inline-list() { - >li { + > li { display: inline-block; padding-left: 0; } @@ -26,7 +26,6 @@ // Vertical align helper - .vertical-align { display: -webkit-box; display: -moz-box; @@ -56,7 +55,6 @@ content: " *"; } - .Deactive, .Deaktiveret { color: $color-error; @@ -67,14 +65,11 @@ color: $color-success; } - @mixin add-shadow { border-bottom: $grey-border solid 1px; - box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.11), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); - -webkit-box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.11), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); - -moz-box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.11), - 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); + box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.11), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); + -webkit-box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.11), 0px 1px 16px rgba(0, 0, 0, 0.03), + 0px 0px 1px rgba(0, 0, 0, 0.22); + -moz-box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.11), 0px 1px 16px rgba(0, 0, 0, 0.03), 0px 0px 1px rgba(0, 0, 0, 0.22); line-height: 36px; } diff --git a/src/assets/scss/setup/_variables.scss b/src/assets/scss/setup/_variables.scss index efa578e3a..fff9ba45b 100644 --- a/src/assets/scss/setup/_variables.scss +++ b/src/assets/scss/setup/_variables.scss @@ -23,7 +23,7 @@ $screen-xxl-min: 1400px; //############################### Font and Font sizes #################### //########################################################################### -$font-name: 'Roboto' !default; +$font-name: "Roboto" !default; //---------------- // -to-rem @@ -58,10 +58,10 @@ Removes the unit (e.g. px, em, rem) from a value, returning the number only. // Paths // Relative font and image file paths -$font-path: '../fonts/Roboto/' !default; -$image-path: '../images/' !default; -$node-modules-path: '../../../node_modules'; -$icons-folder-path: '../img/svg-icons/' !default; +$font-path: "../fonts/Roboto/" !default; +$image-path: "../images/" !default; +$node-modules-path: "../../../node_modules"; +$icons-folder-path: "../img/svg-icons/" !default; //headline sizes $h1: 30 !default; @@ -123,7 +123,7 @@ $font-style-normal: normal !default; $font-style-italic: italic !default; //fontname -$font-family: 'Lato' !default; +$font-family: "Lato" !default; //#######################Coloring #################### //#################################################### diff --git a/src/environments/environment.ts b/src/environments/environment.ts index c954e49f6..ac7022c54 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,10 +1,10 @@ // "env" is defined in env.js and facilitates dynamic configurations using environment variables export const environment = { - production: window["env"].PRODUCTION === "true", - baseUrl: window["env"].BASE_URL || "http://localhost:3000/api/v1/", - tablePageSize: parseInt(window["env"].TABLE_PAGE_SIZE) || 25, - dafusername: window["env"].DAF_USERNAME || "", - dafpassword: window["env"].DAF_PASSWORD || "", + production: window["env"].PRODUCTION === "true", + baseUrl: window["env"].BASE_URL || "http://localhost:3000/api/v1/", + tablePageSize: parseInt(window["env"].TABLE_PAGE_SIZE) || 25, + dafusername: window["env"].DAF_USERNAME || "", + dafpassword: window["env"].DAF_PASSWORD || "", }; /* diff --git a/src/index.html b/src/index.html index c984af8c7..52254e443 100644 --- a/src/index.html +++ b/src/index.html @@ -1,25 +1,23 @@ + + + OS2IoT + + + + + + + + + + + + + - - - OS2IoT - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + diff --git a/src/main.ts b/src/main.ts index 207c6dde9..6907e593c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,13 +1,13 @@ -import { enableProdMode } from '@angular/core'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { enableProdMode } from "@angular/core"; +import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; -import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; +import { AppModule } from "./app/app.module"; +import { environment } from "./environments/environment"; if (environment.production) { - enableProdMode(); + enableProdMode(); } platformBrowserDynamic() - .bootstrapModule(AppModule) - .catch((err) => console.error(err)); + .bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/src/polyfills.ts b/src/polyfills.ts index a1a22c59c..faaada4f0 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -1,7 +1,7 @@ /*************************************************************************************************** * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates. */ -import '@angular/localize/init'; +import "@angular/localize/init"; /** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. @@ -49,7 +49,7 @@ import '@angular/localize/init'; /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js'; // Included with Angular CLI. +import "zone.js"; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS diff --git a/src/styles.scss b/src/styles.scss index 7680a06d6..026e52522 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1,66 +1,65 @@ //Animate.css -@import 'animate.css/animate.min'; +@import "animate.css/animate.min"; // Bootstrap -@import 'bootstrap/scss/bootstrap.scss'; +@import "bootstrap/scss/bootstrap.scss"; //Animations -@import 'assets/scss/animation/jumping-dots'; +@import "assets/scss/animation/jumping-dots"; //Components -@import 'assets/scss/components/boxes'; -@import 'assets/scss/components/bulk-import'; -@import 'assets/scss/components/date-picker'; -@import 'assets/scss/components/forms'; -@import 'assets/scss/components/list'; -@import 'assets/scss/components/loading-spinner'; -@import 'assets/scss/components/map'; -@import 'assets/scss/components/monaco-editor'; -@import 'assets/scss/components/navbar'; -@import 'assets/scss/components/tables'; -@import 'assets/scss/components/topbar'; +@import "assets/scss/components/boxes"; +@import "assets/scss/components/bulk-import"; +@import "assets/scss/components/date-picker"; +@import "assets/scss/components/forms"; +@import "assets/scss/components/list"; +@import "assets/scss/components/loading-spinner"; +@import "assets/scss/components/map"; +@import "assets/scss/components/monaco-editor"; +@import "assets/scss/components/navbar"; +@import "assets/scss/components/tables"; +@import "assets/scss/components/topbar"; //Elements -@import 'assets/scss/elements/links'; -@import 'assets/scss/elements/buttons'; -@import 'assets/scss/elements/icons'; -@import 'assets/scss/elements/img'; -@import 'assets/scss/elements/textfield'; -@import 'assets/scss/elements/labels'; +@import "assets/scss/elements/links"; +@import "assets/scss/elements/buttons"; +@import "assets/scss/elements/icons"; +@import "assets/scss/elements/img"; +@import "assets/scss/elements/textfield"; +@import "assets/scss/elements/labels"; //Setup -@import 'assets/scss/setup/base'; -@import 'assets/scss/setup/breakpoints'; +@import "assets/scss/setup/base"; +@import "assets/scss/setup/breakpoints"; -@import 'assets/scss/setup/typography'; -@import 'assets/scss/setup/utilities'; -@import 'assets/scss/setup/variables'; -@import 'assets/scss/setup/material-theme'; +@import "assets/scss/setup/typography"; +@import "assets/scss/setup/utilities"; +@import "assets/scss/setup/variables"; +@import "assets/scss/setup/material-theme"; @import "~leaflet/dist/leaflet.css"; @import "./app/shared/styles/leaflet-styles.scss"; - @font-face { - font-family: 'roboto-light'; - src: url('./assets/fonts/Roboto-Light.ttf') format('truetype'); + font-family: "roboto-light"; + src: url("./assets/fonts/Roboto-Light.ttf") format("truetype"); } @font-face { - font-family: 'roboto'; - src: url('./assets/fonts/Roboto-Regular.ttf') format('truetype'); + font-family: "roboto"; + src: url("./assets/fonts/Roboto-Regular.ttf") format("truetype"); } @font-face { - font-family: 'roboto-bold'; - src: url('./assets/fonts/Roboto-Bold.ttf') format('truetype'); + font-family: "roboto-bold"; + src: url("./assets/fonts/Roboto-Bold.ttf") format("truetype"); } body { // For Google Chrome &::-webkit-scrollbar { - width: 5px; + width: 5px; height: 5px; } @@ -82,7 +81,7 @@ body { } } -.snackBar.mat-snack-bar-container{ +.snackBar.mat-snack-bar-container { background: #f4f4f4; color: #000; } @@ -92,7 +91,7 @@ body { } .status-tooltip { - background: rgba(97, 97, 97, 1.0); + background: rgba(97, 97, 97, 1); white-space: pre-line; } diff --git a/src/test.ts b/src/test.ts index 0ea830710..620ca3812 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,31 +1,25 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; +import "zone.js/testing"; +import { getTestBed } from "@angular/core/testing"; +import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from "@angular/platform-browser-dynamic/testing"; declare const require: { - context( - path: string, - deep?: boolean, - filter?: RegExp - ): { - keys(): string[]; - (id: string): T; - }; + context( + path: string, + deep?: boolean, + filter?: RegExp + ): { + keys(): string[]; + (id: string): T; + }; }; // First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting(), { - teardown: { destroyAfterEach: false } -} -); +getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false }, +}); // Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); +const context = require.context("./", true, /\.spec\.ts$/); // And load the modules. context.keys().map(context);