diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..acfcf04d --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,22 @@ +module.exports = { + "env": { + "browser": true, + "es2021": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 13, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "object-curly-spacing": ["error", "always"], + "quotes": ["error", "double", { "allowTemplateLiterals": true }] + } +}; diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 00000000..19c164d3 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,15 @@ +name: Static Analysis +on: pull_request +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Install modules + run: npm install + - name: Run ESLint + run: npm run lint + diff --git a/.travis.yml b/.travis.yml index 1104cd8f..c5976c98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ branches: install: npm install script: - - ng lint - npm run test:headless - node publish-pact.js diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts index 90cc531b..a46b1417 100644 --- a/e2e/src/app.e2e-spec.ts +++ b/e2e/src/app.e2e-spec.ts @@ -1,14 +1,14 @@ -import { AppPage } from './app.po'; +import { AppPage } from "./app.po"; -describe('workspace-project App', () => { +describe("workspace-project App", () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); - it('should display welcome message', () => { + it("should display welcome message", () => { page.navigateTo(); - expect(page.getTitleText()).toEqual('Welcome to app-aaa!'); + expect(page.getTitleText()).toEqual("Welcome to app-aaa!"); }); }); diff --git a/e2e/src/app.po.ts b/e2e/src/app.po.ts index 72e463a3..0505a304 100644 --- a/e2e/src/app.po.ts +++ b/e2e/src/app.po.ts @@ -1,11 +1,11 @@ -import { browser, by, element } from 'protractor'; +import { browser, by, element } from "protractor"; export class AppPage { navigateTo() { - return browser.get('/'); + return browser.get("/"); } getTitleText() { - return element(by.css('app-root h1')).getText(); + return element(by.css("app-root h1")).getText(); } } diff --git a/package-lock.json b/package-lock.json index f2d2f427..fbdc26e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2282,11 +2282,139 @@ "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz", "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==" }, + "@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, "@hapi/bourne": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-2.0.0.tgz", "integrity": "sha512-WEezM1FWztfbzqIUbsDzFRVMxSoLy3HugVcux6KDDtTqzPsLE8NDRHfXvev66aH1i2oOKKar3/XDjbvh/OUBdg==" }, + "@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@humanwhocodes/object-schema": { + "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==", + "dev": true + }, "@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -2901,6 +3029,250 @@ } } }, + "@typescript-eslint/eslint-plugin": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz", + "integrity": "sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.9.0", + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/type-utils": "5.9.0", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz", + "integrity": "sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/typescript-estree": "5.9.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.0.tgz", + "integrity": "sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/typescript-estree": "5.9.0", + "debug": "^4.3.2" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz", + "integrity": "sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/visitor-keys": "5.9.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz", + "integrity": "sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.9.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/types": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.0.tgz", + "integrity": "sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz", + "integrity": "sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/visitor-keys": "5.9.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz", + "integrity": "sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.0", + "eslint-visitor-keys": "^3.0.0" + } + }, "@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -3077,6 +3449,12 @@ "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==" }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, "adjust-sourcemap-loader": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-4.0.0.tgz", @@ -5047,6 +5425,12 @@ "regexp.prototype.flags": "^1.2.0" } }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -5266,6 +5650,15 @@ "buffer-indexof": "^1.0.0" } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "dom-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", @@ -5443,6 +5836,15 @@ } } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, "ent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", @@ -5466,171 +5868,499 @@ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", "dev": true }, - "errno": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", - "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-module-lexer": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz", + "integrity": "sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw==" + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3" + } + }, + "esbuild-android-arm64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.8.tgz", + "integrity": "sha512-AilbChndywpk7CdKkNSZ9klxl+9MboLctXd9LwLo3b0dawmOF/i/t2U5d8LM6SbT1Xw36F8yngSUPrd8yPs2RA==", + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.8.tgz", + "integrity": "sha512-b6sdiT84zV5LVaoF+UoMVGJzR/iE2vNUfUDfFQGrm4LBwM/PWXweKpuu6RD9mcyCq18cLxkP6w/LD/w9DtX3ng==", + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.8.tgz", + "integrity": "sha512-R8YuPiiJayuJJRUBG4H0VwkEKo6AvhJs2m7Tl0JaIer3u1FHHXwGhMxjJDmK+kXwTFPriSysPvcobXC/UrrZCQ==", + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.8.tgz", + "integrity": "sha512-zBn6urrn8FnKC+YSgDxdof9jhPCeU8kR/qaamlV4gI8R3KUaUK162WYM7UyFVAlj9N0MyD3AtB+hltzu4cysTw==", + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.8.tgz", + "integrity": "sha512-pWW2slN7lGlkx0MOEBoUGwRX5UgSCLq3dy2c8RIOpiHtA87xAUpDBvZK10MykbT+aMfXc0NI2lu1X+6kI34xng==", + "optional": true + }, + "esbuild-linux-32": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.8.tgz", + "integrity": "sha512-T0I0ueeKVO/Is0CAeSEOG9s2jeNNb8jrrMwG9QBIm3UU18MRB60ERgkS2uV3fZ1vP2F8i3Z2e3Zju4lg9dhVmw==", + "optional": true + }, + "esbuild-linux-64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.8.tgz", + "integrity": "sha512-Bm8SYmFtvfDCIu9sjKppFXzRXn2BVpuCinU1ChTuMtdKI/7aPpXIrkqBNOgPTOQO9AylJJc1Zw6EvtKORhn64w==", + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.8.tgz", + "integrity": "sha512-4/HfcC40LJ4GPyboHA+db0jpFarTB628D1ifU+/5bunIgY+t6mHkJWyxWxAAE8wl/ZIuRYB9RJFdYpu1AXGPdg==", + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.8.tgz", + "integrity": "sha512-X4pWZ+SL+FJ09chWFgRNO3F+YtvAQRcWh0uxKqZSWKiWodAB20flsW/OWFYLXBKiVCTeoGMvENZS/GeVac7+tQ==", + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.8.tgz", + "integrity": "sha512-o7e0D+sqHKT31v+mwFircJFjwSKVd2nbkHEn4l9xQ1hLR+Bv8rnt3HqlblY3+sBdlrOTGSwz0ReROlKUMJyldA==", + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.8.tgz", + "integrity": "sha512-eZSQ0ERsWkukJp2px/UWJHVNuy0lMoz/HZcRWAbB6reoaBw7S9vMzYNUnflfL3XA6WDs+dZn3ekHE4Y2uWLGig==", + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.8.tgz", + "integrity": "sha512-gZX4kP7gVvOrvX0ZwgHmbuHczQUwqYppxqtoyC7VNd80t5nBHOFXVhWo2Ad/Lms0E8b+wwgI/WjZFTCpUHOg9Q==", + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.8.tgz", + "integrity": "sha512-afzza308X4WmcebexbTzAgfEWt9MUkdTvwIa8xOu4CM2qGbl2LanqEl8/LUs8jh6Gqw6WsicEK52GPrS9wvkcw==", + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.8.tgz", + "integrity": "sha512-mWPZibmBbuMKD+LDN23LGcOZ2EawMYBONMXXHmbuxeT0XxCNwadbCVwUQ/2p5Dp5Kvf6mhrlIffcnWOiCBpiVw==", + "optional": true + }, + "esbuild-wasm": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.13.8.tgz", + "integrity": "sha512-UbD+3nloiSpJWXTCInZQrqPe8Y+RLfDkY/5kEHiXsw/lmaEvibe69qTzQu16m5R9je/0bF7VYQ5jaEOq0z9lLA==" + }, + "esbuild-windows-32": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.8.tgz", + "integrity": "sha512-QsZ1HnWIcnIEApETZWw8HlOhDSWqdZX2SylU7IzGxOYyVcX7QI06ety/aDcn437mwyO7Ph4RrbhB+2ntM8kX8A==", + "optional": true + }, + "esbuild-windows-64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.8.tgz", + "integrity": "sha512-76Fb57B9eE/JmJi1QmUW0tRLQZfGo0it+JeYoCDTSlbTn7LV44ecOHIMJSSgZADUtRMWT9z0Kz186bnaB3amSg==", + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.13.8", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.8.tgz", + "integrity": "sha512-HW6Mtq5eTudllxY2YgT62MrVcn7oq2o8TAoAvDUhyiEmRmDY8tPwAhb1vxw5/cdkbukM3KdMYtksnUhF/ekWeg==", + "optional": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "eslint": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", + "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", + "dev": true, + "requires": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.3.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "requires": { - "prr": "~1.0.1" + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, "requires": { - "is-arrayish": "^0.2.1" + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } } }, - "es-module-lexer": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz", - "integrity": "sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw==" - }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", "dev": true }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "espree": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", "dev": true, "requires": { - "es6-promise": "^4.0.3" + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" } }, - "esbuild-android-arm64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.8.tgz", - "integrity": "sha512-AilbChndywpk7CdKkNSZ9klxl+9MboLctXd9LwLo3b0dawmOF/i/t2U5d8LM6SbT1Xw36F8yngSUPrd8yPs2RA==", - "optional": true - }, - "esbuild-darwin-64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.8.tgz", - "integrity": "sha512-b6sdiT84zV5LVaoF+UoMVGJzR/iE2vNUfUDfFQGrm4LBwM/PWXweKpuu6RD9mcyCq18cLxkP6w/LD/w9DtX3ng==", - "optional": true - }, - "esbuild-darwin-arm64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.8.tgz", - "integrity": "sha512-R8YuPiiJayuJJRUBG4H0VwkEKo6AvhJs2m7Tl0JaIer3u1FHHXwGhMxjJDmK+kXwTFPriSysPvcobXC/UrrZCQ==", - "optional": true - }, - "esbuild-freebsd-64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.8.tgz", - "integrity": "sha512-zBn6urrn8FnKC+YSgDxdof9jhPCeU8kR/qaamlV4gI8R3KUaUK162WYM7UyFVAlj9N0MyD3AtB+hltzu4cysTw==", - "optional": true - }, - "esbuild-freebsd-arm64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.8.tgz", - "integrity": "sha512-pWW2slN7lGlkx0MOEBoUGwRX5UgSCLq3dy2c8RIOpiHtA87xAUpDBvZK10MykbT+aMfXc0NI2lu1X+6kI34xng==", - "optional": true - }, - "esbuild-linux-32": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.8.tgz", - "integrity": "sha512-T0I0ueeKVO/Is0CAeSEOG9s2jeNNb8jrrMwG9QBIm3UU18MRB60ERgkS2uV3fZ1vP2F8i3Z2e3Zju4lg9dhVmw==", - "optional": true - }, - "esbuild-linux-64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.8.tgz", - "integrity": "sha512-Bm8SYmFtvfDCIu9sjKppFXzRXn2BVpuCinU1ChTuMtdKI/7aPpXIrkqBNOgPTOQO9AylJJc1Zw6EvtKORhn64w==", - "optional": true - }, - "esbuild-linux-arm": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.8.tgz", - "integrity": "sha512-4/HfcC40LJ4GPyboHA+db0jpFarTB628D1ifU+/5bunIgY+t6mHkJWyxWxAAE8wl/ZIuRYB9RJFdYpu1AXGPdg==", - "optional": true - }, - "esbuild-linux-arm64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.8.tgz", - "integrity": "sha512-X4pWZ+SL+FJ09chWFgRNO3F+YtvAQRcWh0uxKqZSWKiWodAB20flsW/OWFYLXBKiVCTeoGMvENZS/GeVac7+tQ==", - "optional": true - }, - "esbuild-linux-mips64le": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.8.tgz", - "integrity": "sha512-o7e0D+sqHKT31v+mwFircJFjwSKVd2nbkHEn4l9xQ1hLR+Bv8rnt3HqlblY3+sBdlrOTGSwz0ReROlKUMJyldA==", - "optional": true - }, - "esbuild-linux-ppc64le": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.8.tgz", - "integrity": "sha512-eZSQ0ERsWkukJp2px/UWJHVNuy0lMoz/HZcRWAbB6reoaBw7S9vMzYNUnflfL3XA6WDs+dZn3ekHE4Y2uWLGig==", - "optional": true - }, - "esbuild-netbsd-64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.8.tgz", - "integrity": "sha512-gZX4kP7gVvOrvX0ZwgHmbuHczQUwqYppxqtoyC7VNd80t5nBHOFXVhWo2Ad/Lms0E8b+wwgI/WjZFTCpUHOg9Q==", - "optional": true - }, - "esbuild-openbsd-64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.8.tgz", - "integrity": "sha512-afzza308X4WmcebexbTzAgfEWt9MUkdTvwIa8xOu4CM2qGbl2LanqEl8/LUs8jh6Gqw6WsicEK52GPrS9wvkcw==", - "optional": true - }, - "esbuild-sunos-64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.8.tgz", - "integrity": "sha512-mWPZibmBbuMKD+LDN23LGcOZ2EawMYBONMXXHmbuxeT0XxCNwadbCVwUQ/2p5Dp5Kvf6mhrlIffcnWOiCBpiVw==", - "optional": true - }, - "esbuild-wasm": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.13.8.tgz", - "integrity": "sha512-UbD+3nloiSpJWXTCInZQrqPe8Y+RLfDkY/5kEHiXsw/lmaEvibe69qTzQu16m5R9je/0bF7VYQ5jaEOq0z9lLA==" - }, - "esbuild-windows-32": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.8.tgz", - "integrity": "sha512-QsZ1HnWIcnIEApETZWw8HlOhDSWqdZX2SylU7IzGxOYyVcX7QI06ety/aDcn437mwyO7Ph4RrbhB+2ntM8kX8A==", - "optional": true - }, - "esbuild-windows-64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.8.tgz", - "integrity": "sha512-76Fb57B9eE/JmJi1QmUW0tRLQZfGo0it+JeYoCDTSlbTn7LV44ecOHIMJSSgZADUtRMWT9z0Kz186bnaB3amSg==", - "optional": true - }, - "esbuild-windows-arm64": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.8.tgz", - "integrity": "sha512-HW6Mtq5eTudllxY2YgT62MrVcn7oq2o8TAoAvDUhyiEmRmDY8tPwAhb1vxw5/cdkbukM3KdMYtksnUhF/ekWeg==", - "optional": true - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } } }, "esrecurse": { @@ -5912,6 +6642,12 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, "fast-redact": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.0.2.tgz", @@ -5957,6 +6693,15 @@ "escape-string-regexp": "^1.0.5" } }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -6018,6 +6763,33 @@ "locate-path": "^3.0.0" } }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "dependencies": { + "flatted": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "flatstr": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz", @@ -6117,6 +6889,12 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -7430,6 +8208,12 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -7805,6 +8589,16 @@ "klona": "^2.0.4" } }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "libnpmconfig": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", @@ -7909,6 +8703,12 @@ "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -8507,6 +9307,12 @@ "to-regex": "^3.0.1" } }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "needle": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", @@ -9138,6 +9944,20 @@ } } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, "ora": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/ora/-/ora-5.3.0.tgz", @@ -10980,6 +11800,12 @@ "uniq": "^1.0.1" } }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, "pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", @@ -10995,6 +11821,12 @@ "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-1.0.0.tgz", "integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -11582,6 +12414,12 @@ "define-properties": "^1.1.3" } }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, "regexpu-core": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", @@ -13266,6 +14104,15 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, "type-fest": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", @@ -13507,6 +14354,12 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -14131,6 +14984,12 @@ "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==" }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wrap-ansi": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", diff --git a/package.json b/package.json index beefef28..ed1859af 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "build:prod": "ng build --configuration production", "test": "ng test", "test:headless": "ng test --watch false --browsers ChromeHeadless", - "lint": "ng lint", - "lint:fix": "ng lint --fix" + "lint": "eslint -c .eslintrc.js --quiet --ext .ts .", + "lint:fix": "eslint -c .eslintrc.js --quiet --ext .ts . --fix" }, "private": true, "dependencies": { @@ -50,7 +50,10 @@ "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^10.12.10", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", "codelyzer": "^6.0.0", + "eslint": "^8.6.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~6.3.9", diff --git a/src/app/AppRoutingModule.ts b/src/app/AppRoutingModule.ts index 41f22072..3a9382d1 100644 --- a/src/app/AppRoutingModule.ts +++ b/src/app/AppRoutingModule.ts @@ -1,19 +1,19 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import {DashboardComponent} from './dashboard/dashboard.component'; -import {AuthGuard} from './auth.guard'; -import {LoginComponent} from './login/login.component'; -import {CommonModule} from '@angular/common'; -import {ReactiveFormsModule} from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; +import { DashboardComponent } from "./dashboard/dashboard.component"; +import { AuthGuard } from "./auth.guard"; +import { LoginComponent } from "./login/login.component"; +import { CommonModule } from "@angular/common"; +import { ReactiveFormsModule } from "@angular/forms"; const routes: Routes = [ - { path: 'dashboard', component: DashboardComponent, canActivate: [AuthGuard] }, + { path: "dashboard", component: DashboardComponent, canActivate: [AuthGuard] }, { - path: '', - redirectTo: '/dashboard', - pathMatch: 'full' + path: "", + redirectTo: "/dashboard", + pathMatch: "full" }, - { path: 'login', component: LoginComponent }, + { path: "login", component: LoginComponent }, ]; // configures NgModule imports and exports diff --git a/src/app/_interceptors/error-interceptor.ts b/src/app/_interceptors/error-interceptor.ts index 1c002d9d..02925e06 100644 --- a/src/app/_interceptors/error-interceptor.ts +++ b/src/app/_interceptors/error-interceptor.ts @@ -1,9 +1,9 @@ -import {Injectable} from '@angular/core'; -import {HttpRequest, HttpHandler, HttpEvent, HttpInterceptor} from '@angular/common/http'; -import {Observable, throwError, of} from 'rxjs'; -import {catchError} from 'rxjs/operators'; -import {AuthenticationService} from '../_services/authentication.service'; -import {Router} from '@angular/router'; +import { Injectable } from "@angular/core"; +import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http"; +import { Observable, throwError, of } from "rxjs"; +import { catchError } from "rxjs/operators"; +import { AuthenticationService } from "../_services/authentication.service"; +import { Router } from "@angular/router"; @Injectable() @@ -18,7 +18,7 @@ export class ErrorInterceptor implements HttpInterceptor { if (err.status === 401) { // auto logout if 401 response returned from api this.authenticationService.logout(); - this.router.navigate(['login']); + this.router.navigate(["login"]); } diff --git a/src/app/_interceptors/http-interceptor.ts b/src/app/_interceptors/http-interceptor.ts index 4e41b1e1..824a60a8 100644 --- a/src/app/_interceptors/http-interceptor.ts +++ b/src/app/_interceptors/http-interceptor.ts @@ -1,13 +1,13 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor -} from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { ProjectApiService } from '../project-api.service'; -import { environment } from 'src/environments/environment'; +} from "@angular/common/http"; +import { Observable } from "rxjs"; +import { ProjectApiService } from "../project-api.service"; +import { environment } from "src/environments/environment"; @Injectable() export class RequestHttpInterceptor implements HttpInterceptor { diff --git a/src/app/_interceptors/jwt-interceptor.ts b/src/app/_interceptors/jwt-interceptor.ts index bcd04f9c..8469579a 100644 --- a/src/app/_interceptors/jwt-interceptor.ts +++ b/src/app/_interceptors/jwt-interceptor.ts @@ -1,16 +1,16 @@ -import { Injectable } from '@angular/core'; -import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http'; -import { Observable } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http"; +import { Observable } from "rxjs"; @Injectable() export class JwtInterceptor implements HttpInterceptor { intercept(request: HttpRequest, next: HttpHandler): Observable> { // add authorization header with jwt token if available - const currentUser = JSON.parse(localStorage.getItem('currentUser')); + const currentUser = JSON.parse(localStorage.getItem("currentUser")); if (currentUser && currentUser.token) { request = request.clone({ setHeaders: { - 'x-access-token': `${currentUser.token}` + "x-access-token": `${currentUser.token}` } }); } diff --git a/src/app/_interceptors/mock-interceptior.ts b/src/app/_interceptors/mock-interceptior.ts index f3e81356..47e65a55 100644 --- a/src/app/_interceptors/mock-interceptior.ts +++ b/src/app/_interceptors/mock-interceptior.ts @@ -1,7 +1,7 @@ -import { Injectable, Injector } from '@angular/core'; -import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; +import { Injectable, Injector } from "@angular/core"; +import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from "@angular/common/http"; -import { Observable, of } from 'rxjs'; +import { Observable, of } from "rxjs"; @Injectable() @@ -15,15 +15,15 @@ export class HttpRequestInterceptorMock implements HttpInterceptor { return of(new HttpResponse({ status: 200, body: [] })); } if (request.url && - request.url.includes('projects/test-project/scenarios/test-scenario/items/test-item/share-tokens')) { + request.url.includes("projects/test-project/scenarios/test-scenario/items/test-item/share-tokens")) { return of(new HttpResponse({ status: 200, body: [] })); } if (request.url && - request.url.includes('api-tokens')) { + request.url.includes("api-tokens")) { return of(new HttpResponse({ status: 200, body: [] })); } if (request.url && - request.url.includes('projects/test-project/scenarios/test-scenario/items/test-item/custom-chart-settings')) { + request.url.includes("projects/test-project/scenarios/test-scenario/items/test-item/custom-chart-settings")) { return of(new HttpResponse({ status: 200 })); } diff --git a/src/app/_services/api-token.service.spec.ts b/src/app/_services/api-token.service.spec.ts index d43af8e6..78c6fe1c 100644 --- a/src/app/_services/api-token.service.spec.ts +++ b/src/app/_services/api-token.service.spec.ts @@ -1,14 +1,14 @@ -import { TestBed } from '@angular/core/testing'; -import { HttpClientModule } from '@angular/common/http'; +import { TestBed } from "@angular/core/testing"; +import { HttpClientModule } from "@angular/common/http"; -import { ApiTokenService } from './api-token.service'; +import { ApiTokenService } from "./api-token.service"; -describe('ApiTokenService', () => { +describe("ApiTokenService", () => { beforeEach(() => TestBed.configureTestingModule({ imports: [ HttpClientModule ] })); - it('should be created', () => { + it("should be created", () => { const service: ApiTokenService = TestBed.get(ApiTokenService); expect(service).toBeTruthy(); }); diff --git a/src/app/_services/api-token.service.ts b/src/app/_services/api-token.service.ts index 9a432792..7d6da8a6 100644 --- a/src/app/_services/api-token.service.ts +++ b/src/app/_services/api-token.service.ts @@ -1,10 +1,10 @@ -import { Injectable } from '@angular/core'; -import { BehaviorSubject, Observable } from 'rxjs'; -import { HttpClient } from '@angular/common/http'; -import { ApiKey, NewTokenReponse } from './api-token.model'; +import { Injectable } from "@angular/core"; +import { BehaviorSubject, Observable } from "rxjs"; +import { HttpClient } from "@angular/common/http"; +import { ApiKey, NewTokenReponse } from "./api-token.model"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class ApiTokenService { @@ -14,14 +14,14 @@ export class ApiTokenService { constructor(private http: HttpClient) { } fetchApiKeys(): Observable { - return this.http.get('api-tokens'); + return this.http.get("api-tokens"); } - createApiToken(body: { description: string; }): Observable { - return this.http.post('api-tokens', body, { observe: 'response' }); + createApiToken(body: { description: string; }): Observable { + return this.http.post("api-tokens", body, { observe: "response" }); } deleteApiToken(body: { id: string }): Observable { - return this.http.request('delete', 'api-tokens', { observe: 'response', body }); + return this.http.request("delete", "api-tokens", { observe: "response", body }); } loadApiKeys() { diff --git a/src/app/_services/authentication.service.spec.ts b/src/app/_services/authentication.service.spec.ts index 7b607024..3f69a9d3 100644 --- a/src/app/_services/authentication.service.spec.ts +++ b/src/app/_services/authentication.service.spec.ts @@ -1,14 +1,14 @@ -import { TestBed } from '@angular/core/testing'; -import { HttpClientModule } from '@angular/common/http'; +import { TestBed } from "@angular/core/testing"; +import { HttpClientModule } from "@angular/common/http"; -import { AuthenticationService } from './authentication.service'; +import { AuthenticationService } from "./authentication.service"; -describe('AuthenticationService', () => { +describe("AuthenticationService", () => { beforeEach(() => TestBed.configureTestingModule({ imports: [ HttpClientModule ] })); - it('should be created', () => { + it("should be created", () => { const service: AuthenticationService = TestBed.get(AuthenticationService); expect(service).toBeTruthy(); }); diff --git a/src/app/_services/authentication.service.ts b/src/app/_services/authentication.service.ts index 4d2511a1..9e6dbc95 100644 --- a/src/app/_services/authentication.service.ts +++ b/src/app/_services/authentication.service.ts @@ -1,11 +1,11 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { map } from 'rxjs/operators'; -import { BehaviorSubject, Observable } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { HttpClient } from "@angular/common/http"; +import { map } from "rxjs/operators"; +import { BehaviorSubject, Observable } from "rxjs"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class AuthenticationService { private loggedIn = new BehaviorSubject(false); // {1} @@ -19,7 +19,7 @@ export class AuthenticationService { // login successful if there's a jwt token in the response if (user && user.token) { // store user details and jwt token in local storage to keep user logged in between page refreshes - localStorage.setItem('currentUser', JSON.stringify(user)); + localStorage.setItem("currentUser", JSON.stringify(user)); } return user; @@ -28,15 +28,15 @@ export class AuthenticationService { logout() { this.setLogin(false); - localStorage.removeItem('currentUser'); + localStorage.removeItem("currentUser"); } changePassword(body): Observable { - return this.http.post('auth/change-password', body, { observe: 'response'}); + return this.http.post("auth/change-password", body, { observe: "response" }); } initUser(body) { - return this.http.post('auth/initialize-user', body); + return this.http.post("auth/initialize-user", body); } setLogin (value) { diff --git a/src/app/_services/init.service.spec.ts b/src/app/_services/init.service.spec.ts index ae16ccad..59be10fe 100644 --- a/src/app/_services/init.service.spec.ts +++ b/src/app/_services/init.service.spec.ts @@ -1,14 +1,14 @@ -import { HttpClientModule } from '@angular/common/http'; -import { TestBed } from '@angular/core/testing'; +import { HttpClientModule } from "@angular/common/http"; +import { TestBed } from "@angular/core/testing"; -import { InitService } from './init.service'; +import { InitService } from "./init.service"; -describe('InitService', () => { +describe("InitService", () => { beforeEach(() => TestBed.configureTestingModule({ imports: [ HttpClientModule ] })); - it('should be created', () => { + it("should be created", () => { const service: InitService = TestBed.get(InitService); expect(service).toBeTruthy(); }); diff --git a/src/app/_services/init.service.ts b/src/app/_services/init.service.ts index 520cb923..7c00b006 100644 --- a/src/app/_services/init.service.ts +++ b/src/app/_services/init.service.ts @@ -1,15 +1,15 @@ -import { HttpClient } from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; +import { HttpClient } from "@angular/common/http"; +import { Injectable } from "@angular/core"; +import { Observable } from "rxjs"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class InitService { constructor(private http: HttpClient) { } fetchInfo(): Observable<{ initialized: boolean }> { - return this.http.get<{ initialized: boolean }>('info'); + return this.http.get<{ initialized: boolean }>("info"); } } diff --git a/src/app/_services/notification.service.spec.ts b/src/app/_services/notification.service.spec.ts index 698c4215..009774a8 100644 --- a/src/app/_services/notification.service.spec.ts +++ b/src/app/_services/notification.service.spec.ts @@ -1,11 +1,11 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { NotificationService } from './notification.service'; +import { NotificationService } from "./notification.service"; -describe('NotificationService', () => { +describe("NotificationService", () => { beforeEach(() => TestBed.configureTestingModule({})); - it('should be created', () => { + it("should be created", () => { const service: NotificationService = TestBed.get(NotificationService); expect(service).toBeTruthy(); }); diff --git a/src/app/_services/notification.service.ts b/src/app/_services/notification.service.ts index 53a18ed2..0046e799 100644 --- a/src/app/_services/notification.service.ts +++ b/src/app/_services/notification.service.ts @@ -1,16 +1,14 @@ -import { Injectable } from '@angular/core'; -import { BehaviorSubject } from 'rxjs'; +import { Injectable } from "@angular/core"; +import { BehaviorSubject } from "rxjs"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class NotificationService { private notificationMessage = new BehaviorSubject({}); public notificationMessage$ = this.notificationMessage.asObservable(); - constructor() { } - public showNotification(message) { this.notificationMessage.next(message); } diff --git a/src/app/_services/user.service.ts b/src/app/_services/user.service.ts index 47195db2..bbff406f 100644 --- a/src/app/_services/user.service.ts +++ b/src/app/_services/user.service.ts @@ -1,10 +1,10 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable, BehaviorSubject } from 'rxjs'; -import { Users } from './users.model'; +import { Injectable } from "@angular/core"; +import { HttpClient } from "@angular/common/http"; +import { Observable, BehaviorSubject } from "rxjs"; +import { Users } from "./users.model"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class UserService { private users = new BehaviorSubject([]); @@ -13,7 +13,7 @@ export class UserService { constructor(private http: HttpClient) { } fetchUsers(): Observable { - return this.http.get('users'); + return this.http.get("users"); } loadUsers() { @@ -21,10 +21,10 @@ export class UserService { } createNewUser(body) { - return this.http.post('users', body, { observe: 'response' }); + return this.http.post("users", body, { observe: "response" }); } deleteUser(userId): Observable { - return this.http.request('delete', `users/${userId}`, { observe: 'response' }); + return this.http.request("delete", `users/${userId}`, { observe: "response" }); } } diff --git a/src/app/administration/administration.module.ts b/src/app/administration/administration.module.ts index ace2f208..821e7615 100644 --- a/src/app/administration/administration.module.ts +++ b/src/app/administration/administration.module.ts @@ -1,18 +1,18 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {MyProfileComponent} from './my-profile/my-profile.component'; -import {RouterModule, Routes} from '@angular/router'; -import {SharedModule} from '../shared/shared.module'; -import {ApiKeysModule} from './api-token/api-keys.module'; -import {AuthGuard} from '../auth.guard'; -import {ReactiveFormsModule} from '@angular/forms'; -import {NavigationModule} from './navigation/navigation.module'; -import {ProjectAdministrationModule} from './projects/project-administration.module'; -import {UsersModule} from './users/users.module'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { MyProfileComponent } from "./my-profile/my-profile.component"; +import { RouterModule, Routes } from "@angular/router"; +import { SharedModule } from "../shared/shared.module"; +import { ApiKeysModule } from "./api-token/api-keys.module"; +import { AuthGuard } from "../auth.guard"; +import { ReactiveFormsModule } from "@angular/forms"; +import { NavigationModule } from "./navigation/navigation.module"; +import { ProjectAdministrationModule } from "./projects/project-administration.module"; +import { UsersModule } from "./users/users.module"; const routes: Routes = [ - { path: 'administration/my-profile', component: MyProfileComponent, canActivate: [AuthGuard] }, + { path: "administration/my-profile", component: MyProfileComponent, canActivate: [AuthGuard] }, ]; @NgModule({ diff --git a/src/app/administration/api-token/add-token/add-token.component.spec.ts b/src/app/administration/api-token/add-token/add-token.component.spec.ts index 50419df3..a002e138 100644 --- a/src/app/administration/api-token/add-token/add-token.component.spec.ts +++ b/src/app/administration/api-token/add-token/add-token.component.spec.ts @@ -1,10 +1,10 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { AddTokenComponent } from './add-token.component'; -import { ReactiveFormsModule } from '@angular/forms'; -import { HttpClientModule } from '@angular/common/http'; +import { AddTokenComponent } from "./add-token.component"; +import { ReactiveFormsModule } from "@angular/forms"; +import { HttpClientModule } from "@angular/common/http"; -describe('AddTokenComponent', () => { +describe("AddTokenComponent", () => { let component: AddTokenComponent; let fixture: ComponentFixture; @@ -22,7 +22,7 @@ describe('AddTokenComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/administration/api-token/add-token/add-token.component.ts b/src/app/administration/api-token/add-token/add-token.component.ts index e0aba154..d66d492e 100644 --- a/src/app/administration/api-token/add-token/add-token.component.ts +++ b/src/app/administration/api-token/add-token/add-token.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { ApiTokenService } from 'src/app/_services/api-token.service'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { NotificationService } from 'src/app/_services/notification.service'; +import { Component, OnInit } from "@angular/core"; +import { FormControl, FormGroup, Validators } from "@angular/forms"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { ApiTokenService } from "src/app/_services/api-token.service"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { NotificationService } from "src/app/_services/notification.service"; @Component({ - selector: 'app-add-token', - templateUrl: './add-token.component.html', - styleUrls: ['./add-token.component.css'] + selector: "app-add-token", + templateUrl: "./add-token.component.html", + styleUrls: ["./add-token.component.css"] }) export class AddTokenComponent implements OnInit { myform: FormGroup; @@ -29,7 +29,7 @@ export class AddTokenComponent implements OnInit { } createFormControls() { - this.description = new FormControl('', [ + this.description = new FormControl("", [ Validators.required, Validators.minLength(3), Validators.maxLength(250) @@ -43,7 +43,7 @@ export class AddTokenComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/administration/api-token/api-keys.component.spec.ts b/src/app/administration/api-token/api-keys.component.spec.ts index fc031ed0..cfb806f9 100644 --- a/src/app/administration/api-token/api-keys.component.spec.ts +++ b/src/app/administration/api-token/api-keys.component.spec.ts @@ -1,17 +1,17 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { ApiKeysComponent } from './api-keys.component'; -import { NavigationComponent } from '../navigation/navigation.component'; -import { AddTokenComponent } from './add-token/add-token.component'; -import { ControlPanelComponent } from 'src/app/shared/control-panel/control-panel.component'; -import { DeleteTokenComponent } from './delete-token/delete-token.component'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; -import { HttpRequestInterceptorMock } from 'src/app/_interceptors/mock-interceptior'; +import { ApiKeysComponent } from "./api-keys.component"; +import { NavigationComponent } from "../navigation/navigation.component"; +import { AddTokenComponent } from "./add-token/add-token.component"; +import { ControlPanelComponent } from "src/app/shared/control-panel/control-panel.component"; +import { DeleteTokenComponent } from "./delete-token/delete-token.component"; +import { RouterTestingModule } from "@angular/router/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http"; +import { HttpRequestInterceptorMock } from "src/app/_interceptors/mock-interceptior"; -describe('ApiKeysComponent', () => { +describe("ApiKeysComponent", () => { let component: ApiKeysComponent; let fixture: ComponentFixture; @@ -34,7 +34,7 @@ describe('ApiKeysComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/administration/api-token/api-keys.component.ts b/src/app/administration/api-token/api-keys.component.ts index 5e3c3c96..e2627435 100644 --- a/src/app/administration/api-token/api-keys.component.ts +++ b/src/app/administration/api-token/api-keys.component.ts @@ -1,11 +1,11 @@ -import { Component, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; -import { ApiKey } from 'src/app/_services/api-token.model'; -import { ApiTokenService } from 'src/app/_services/api-token.service'; +import { Component, OnInit } from "@angular/core"; +import { Observable } from "rxjs"; +import { ApiKey } from "src/app/_services/api-token.model"; +import { ApiTokenService } from "src/app/_services/api-token.service"; @Component({ - selector: 'app-api-keys', - templateUrl: './api-keys.component.html', - styleUrls: ['./api-keys.component.css', '../administration.css', '../../shared-styles.css'] + selector: "app-api-keys", + templateUrl: "./api-keys.component.html", + styleUrls: ["./api-keys.component.css", "../administration.css", "../../shared-styles.css"] }) export class ApiKeysComponent implements OnInit { diff --git a/src/app/administration/api-token/api-keys.module.ts b/src/app/administration/api-token/api-keys.module.ts index 6a4ee89e..5b7e1b24 100644 --- a/src/app/administration/api-token/api-keys.module.ts +++ b/src/app/administration/api-token/api-keys.module.ts @@ -1,17 +1,17 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {RouterModule, Routes} from '@angular/router'; -import {AddTokenComponent} from './add-token/add-token.component'; -import {DeleteTokenComponent} from './delete-token/delete-token.component'; -import {SharedModule} from '../../shared/shared.module'; -import {AuthGuard} from '../../auth.guard'; -import {ApiKeysComponent} from './api-keys.component'; -import {NavigationModule} from '../navigation/navigation.module'; -import {FormControl, ReactiveFormsModule} from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule, Routes } from "@angular/router"; +import { AddTokenComponent } from "./add-token/add-token.component"; +import { DeleteTokenComponent } from "./delete-token/delete-token.component"; +import { SharedModule } from "../../shared/shared.module"; +import { AuthGuard } from "../../auth.guard"; +import { ApiKeysComponent } from "./api-keys.component"; +import { NavigationModule } from "../navigation/navigation.module"; +import { FormControl, ReactiveFormsModule } from "@angular/forms"; const routes: Routes = [ - { path: 'administration/api-keys', component: ApiKeysComponent, canActivate: [AuthGuard] }, + { path: "administration/api-keys", component: ApiKeysComponent, canActivate: [AuthGuard] }, ]; @NgModule({ diff --git a/src/app/administration/api-token/delete-token/delete-token.component.spec.ts b/src/app/administration/api-token/delete-token/delete-token.component.spec.ts index 5959e9dd..6c13b645 100644 --- a/src/app/administration/api-token/delete-token/delete-token.component.spec.ts +++ b/src/app/administration/api-token/delete-token/delete-token.component.spec.ts @@ -1,9 +1,9 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { DeleteTokenComponent } from './delete-token.component'; -import { HttpClientModule } from '@angular/common/http'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { DeleteTokenComponent } from "./delete-token.component"; +import { HttpClientModule } from "@angular/common/http"; -describe('DeleteTokenComponent', () => { +describe("DeleteTokenComponent", () => { let component: DeleteTokenComponent; let fixture: ComponentFixture; @@ -21,7 +21,7 @@ describe('DeleteTokenComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/administration/api-token/delete-token/delete-token.component.ts b/src/app/administration/api-token/delete-token/delete-token.component.ts index d69990c6..e3575410 100644 --- a/src/app/administration/api-token/delete-token/delete-token.component.ts +++ b/src/app/administration/api-token/delete-token/delete-token.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { ApiTokenService } from 'src/app/_services/api-token.service'; -import { NotificationService } from 'src/app/_services/notification.service'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; +import { Component, OnInit, Input } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormGroup, FormControl, Validators } from "@angular/forms"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { ApiTokenService } from "src/app/_services/api-token.service"; +import { NotificationService } from "src/app/_services/notification.service"; +import { NotificationMessage } from "src/app/notification/notification-messages"; @Component({ - selector: 'app-delete-token', - templateUrl: './delete-token.component.html', - styleUrls: ['./delete-token.component.css', '../../administration.css'] + selector: "app-delete-token", + templateUrl: "./delete-token.component.html", + styleUrls: ["./delete-token.component.css", "../../administration.css"] }) export class DeleteTokenComponent implements OnInit { @@ -31,7 +31,7 @@ export class DeleteTokenComponent implements OnInit { } createFormControls() { - this.deleteCheck = new FormControl('', [ + this.deleteCheck = new FormControl("", [ Validators.required, Validators.minLength(5) ]); @@ -44,7 +44,7 @@ export class DeleteTokenComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/administration/my-profile/my-profile.component.spec.ts b/src/app/administration/my-profile/my-profile.component.spec.ts index 2b8e3355..413c23e2 100644 --- a/src/app/administration/my-profile/my-profile.component.spec.ts +++ b/src/app/administration/my-profile/my-profile.component.spec.ts @@ -1,13 +1,13 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { MyProfileComponent } from './my-profile.component'; -import { NavigationComponent } from '../navigation/navigation.component'; -import { ControlPanelComponent } from 'src/app/shared/control-panel/control-panel.component'; -import { ReactiveFormsModule } from '@angular/forms'; -import { RouterTestingModule } from '@angular/router/testing'; -import { HttpClientModule } from '@angular/common/http'; +import { MyProfileComponent } from "./my-profile.component"; +import { NavigationComponent } from "../navigation/navigation.component"; +import { ControlPanelComponent } from "src/app/shared/control-panel/control-panel.component"; +import { ReactiveFormsModule } from "@angular/forms"; +import { RouterTestingModule } from "@angular/router/testing"; +import { HttpClientModule } from "@angular/common/http"; -describe('MyProfileComponent', () => { +describe("MyProfileComponent", () => { let component: MyProfileComponent; let fixture: ComponentFixture; @@ -25,7 +25,7 @@ describe('MyProfileComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/administration/my-profile/my-profile.component.ts b/src/app/administration/my-profile/my-profile.component.ts index b7b42c21..78d7ab02 100644 --- a/src/app/administration/my-profile/my-profile.component.ts +++ b/src/app/administration/my-profile/my-profile.component.ts @@ -1,15 +1,15 @@ -import { Component, OnInit } from '@angular/core'; -import { FormGroup, Validators, FormControl } from '@angular/forms'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { NotificationService } from 'src/app/_services/notification.service'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { AuthenticationService } from 'src/app/_services/authentication.service'; +import { Component, OnInit } from "@angular/core"; +import { FormGroup, Validators, FormControl } from "@angular/forms"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { NotificationService } from "src/app/_services/notification.service"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { AuthenticationService } from "src/app/_services/authentication.service"; @Component({ - selector: 'app-my-profile', - templateUrl: './my-profile.component.html', - styleUrls: ['./my-profile.component.css', '../administration.css', '../../shared-styles.css'] + selector: "app-my-profile", + templateUrl: "./my-profile.component.html", + styleUrls: ["./my-profile.component.css", "../administration.css", "../../shared-styles.css"] }) export class MyProfileComponent implements OnInit { myform: FormGroup; @@ -31,8 +31,8 @@ export class MyProfileComponent implements OnInit { } createFormControls() { - this.currentPassword = new FormControl('', [Validators.required]); - this.newPassword = new FormControl('', [Validators.required, Validators.minLength(8)]); + this.currentPassword = new FormControl("", [Validators.required]); + this.newPassword = new FormControl("", [Validators.required, Validators.minLength(8)]); } createForm() { diff --git a/src/app/administration/navigation/navigation.component.spec.ts b/src/app/administration/navigation/navigation.component.spec.ts index b483a1e1..1db8ec8a 100644 --- a/src/app/administration/navigation/navigation.component.spec.ts +++ b/src/app/administration/navigation/navigation.component.spec.ts @@ -1,10 +1,10 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { RouterTestingModule } from "@angular/router/testing"; -import { NavigationComponent } from './navigation.component'; +import { NavigationComponent } from "./navigation.component"; -describe('NavigationComponent', () => { +describe("NavigationComponent", () => { let component: NavigationComponent; let fixture: ComponentFixture; @@ -22,7 +22,7 @@ describe('NavigationComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/administration/navigation/navigation.component.ts b/src/app/administration/navigation/navigation.component.ts index 3bef923d..dc906aec 100644 --- a/src/app/administration/navigation/navigation.component.ts +++ b/src/app/administration/navigation/navigation.component.ts @@ -1,15 +1,10 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-administrate-navigation', - templateUrl: './navigation.component.html', - styleUrls: ['./navigation.component.css'] + selector: "app-administrate-navigation", + templateUrl: "./navigation.component.html", + styleUrls: ["./navigation.component.css"] }) -export class NavigationComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } +export class NavigationComponent { } diff --git a/src/app/administration/navigation/navigation.module.ts b/src/app/administration/navigation/navigation.module.ts index 5ea2b417..a6f29572 100644 --- a/src/app/administration/navigation/navigation.module.ts +++ b/src/app/administration/navigation/navigation.module.ts @@ -1,7 +1,7 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {NavigationComponent} from './navigation.component'; -import {RouterModule} from '@angular/router'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { NavigationComponent } from "./navigation.component"; +import { RouterModule } from "@angular/router"; @NgModule({ declarations: [NavigationComponent], diff --git a/src/app/administration/projects/add-project/add-project-modal.component.ts b/src/app/administration/projects/add-project/add-project-modal.component.ts index d00bcfc9..94fe5be0 100644 --- a/src/app/administration/projects/add-project/add-project-modal.component.ts +++ b/src/app/administration/projects/add-project/add-project-modal.component.ts @@ -1,16 +1,16 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { ProjectApiService } from '../../../project-api.service'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { NotificationMessage } from '../../../notification/notification-messages'; -import { ProjectService } from '../../../project.service'; +import { Component, Input, OnInit } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormGroup, FormControl, Validators } from "@angular/forms"; +import { ProjectApiService } from "../../../project-api.service"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { NotificationMessage } from "../../../notification/notification-messages"; +import { ProjectService } from "../../../project.service"; @Component({ - styleUrls: ['./add-project-modal.component.css'], - selector: 'app-add-project', - templateUrl: './add-project-modal.component.html', + styleUrls: ["./add-project-modal.component.css"], + selector: "app-add-project", + templateUrl: "./add-project-modal.component.html", }) export class AddNewProjectComponent implements OnInit { closeResult: string; @@ -32,7 +32,7 @@ export class AddNewProjectComponent implements OnInit { } createFormControls() { - this.projectName = new FormControl('', [ + this.projectName = new FormControl("", [ Validators.required, Validators.minLength(3), Validators.maxLength(50) @@ -46,7 +46,7 @@ export class AddNewProjectComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/administration/projects/administration.component.ts b/src/app/administration/projects/administration.component.ts index 5b2c1333..29cc9fe2 100644 --- a/src/app/administration/projects/administration.component.ts +++ b/src/app/administration/projects/administration.component.ts @@ -1,13 +1,13 @@ -import { Component, OnInit } from '@angular/core'; -import { ProjectsListing } from '../../project-api.service.model'; -import { Observable } from 'rxjs'; -import { ProjectService } from '../../project.service'; -import { SharedMainBarService } from '../../shared-main-bar.service'; +import { Component, OnInit } from "@angular/core"; +import { ProjectsListing } from "../../project-api.service.model"; +import { Observable } from "rxjs"; +import { ProjectService } from "../../project.service"; +import { SharedMainBarService } from "../../shared-main-bar.service"; @Component({ - selector: 'app-administration', - templateUrl: './administration.component.html', - styleUrls: ['../administration.css', '../../shared-styles.css'] + selector: "app-administration", + templateUrl: "./administration.component.html", + styleUrls: ["../administration.css", "../../shared-styles.css"] }) export class ProjectsAdministrationComponent implements OnInit { diff --git a/src/app/administration/projects/delete-project/delete-project.component.ts b/src/app/administration/projects/delete-project/delete-project.component.ts index 927f50ce..b6b9173c 100644 --- a/src/app/administration/projects/delete-project/delete-project.component.ts +++ b/src/app/administration/projects/delete-project/delete-project.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { ProjectApiService } from 'src/app/project-api.service'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ProjectService } from 'src/app/project.service'; +import { Component, OnInit, Input } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormGroup, FormControl, Validators } from "@angular/forms"; +import { ProjectApiService } from "src/app/project-api.service"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ProjectService } from "src/app/project.service"; @Component({ - selector: 'app-delete-project', - templateUrl: './delete-project.component.html', - styleUrls: ['./delete-project.component.css'] + selector: "app-delete-project", + templateUrl: "./delete-project.component.html", + styleUrls: ["./delete-project.component.css"] }) export class DeleteProjectComponent implements OnInit { @@ -33,7 +33,7 @@ export class DeleteProjectComponent implements OnInit { } createFormControls() { - this.deleteCheck = new FormControl('', [ + this.deleteCheck = new FormControl("", [ Validators.required, Validators.minLength(5) ]); @@ -46,7 +46,7 @@ export class DeleteProjectComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/administration/projects/project-administration.module.ts b/src/app/administration/projects/project-administration.module.ts index d5b082df..d0fdb02a 100644 --- a/src/app/administration/projects/project-administration.module.ts +++ b/src/app/administration/projects/project-administration.module.ts @@ -1,20 +1,20 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {RouterModule, Routes} from '@angular/router'; -import {AddNewProjectComponent} from './add-project/add-project-modal.component'; -import {DeleteProjectComponent} from './delete-project/delete-project.component'; -import {NavigationModule} from '../navigation/navigation.module'; -import {ProjectsAdministrationComponent} from './administration.component'; -import {AuthGuard} from '../../auth.guard'; -import {SharedModule} from '../../shared/shared.module'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {ReactiveFormsModule} from '@angular/forms'; -import {SharedProjectModule} from '../../shared/shared-project/shared-project.module'; -import {TimeagoModule} from 'ngx-timeago'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule, Routes } from "@angular/router"; +import { AddNewProjectComponent } from "./add-project/add-project-modal.component"; +import { DeleteProjectComponent } from "./delete-project/delete-project.component"; +import { NavigationModule } from "../navigation/navigation.module"; +import { ProjectsAdministrationComponent } from "./administration.component"; +import { AuthGuard } from "../../auth.guard"; +import { SharedModule } from "../../shared/shared.module"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { ReactiveFormsModule } from "@angular/forms"; +import { SharedProjectModule } from "../../shared/shared-project/shared-project.module"; +import { TimeagoModule } from "ngx-timeago"; const routes: Routes = [ - { path: 'administration/projects', component: ProjectsAdministrationComponent, canActivate: [AuthGuard] }, + { path: "administration/projects", component: ProjectsAdministrationComponent, canActivate: [AuthGuard] }, ]; @NgModule({ diff --git a/src/app/administration/users/add-user/add-user.component.spec.ts b/src/app/administration/users/add-user/add-user.component.spec.ts index d637587c..23952efb 100644 --- a/src/app/administration/users/add-user/add-user.component.spec.ts +++ b/src/app/administration/users/add-user/add-user.component.spec.ts @@ -1,9 +1,9 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { AddUserComponent } from './add-user.component'; -import { HttpClientModule } from '@angular/common/http'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { AddUserComponent } from "./add-user.component"; +import { HttpClientModule } from "@angular/common/http"; -describe('AddUserComponent', () => { +describe("AddUserComponent", () => { let component: AddUserComponent; let fixture: ComponentFixture; @@ -23,7 +23,7 @@ describe('AddUserComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/administration/users/add-user/add-user.component.ts b/src/app/administration/users/add-user/add-user.component.ts index 720729e0..fef2d8b2 100644 --- a/src/app/administration/users/add-user/add-user.component.ts +++ b/src/app/administration/users/add-user/add-user.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit } from '@angular/core'; -import { FormControl, Validators, FormGroup } from '@angular/forms'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { UserService } from 'src/app/_services/user.service'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { NotificationService } from 'src/app/_services/notification.service'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; +import { Component, OnInit } from "@angular/core"; +import { FormControl, Validators, FormGroup } from "@angular/forms"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { UserService } from "src/app/_services/user.service"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { NotificationService } from "src/app/_services/notification.service"; +import { NotificationMessage } from "src/app/notification/notification-messages"; @Component({ - selector: 'app-add-user', - templateUrl: './add-user.component.html', - styleUrls: ['./add-user.component.css'] + selector: "app-add-user", + templateUrl: "./add-user.component.html", + styleUrls: ["./add-user.component.css"] }) export class AddUserComponent implements OnInit { @@ -32,12 +32,12 @@ export class AddUserComponent implements OnInit { createFormControls() { - this.username = new FormControl('', [ + this.username = new FormControl("", [ Validators.required, Validators.minLength(3), - Validators.pattern('^[0-9a-zA-Z.]+$') + Validators.pattern("^[0-9a-zA-Z.]+$") ]); - this.password = new FormControl('', [ + this.password = new FormControl("", [ Validators.required, Validators.minLength(8), ]); @@ -51,7 +51,7 @@ export class AddUserComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/administration/users/delete-user/delete-user.component.spec.ts b/src/app/administration/users/delete-user/delete-user.component.spec.ts index 9c40d7a3..ab364c9a 100644 --- a/src/app/administration/users/delete-user/delete-user.component.spec.ts +++ b/src/app/administration/users/delete-user/delete-user.component.spec.ts @@ -1,10 +1,10 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { DeleteUserComponent } from './delete-user.component'; -import { ReactiveFormsModule } from '@angular/forms'; -import { HttpClientModule } from '@angular/common/http'; +import { DeleteUserComponent } from "./delete-user.component"; +import { ReactiveFormsModule } from "@angular/forms"; +import { HttpClientModule } from "@angular/common/http"; -describe('DeleteUserComponent', () => { +describe("DeleteUserComponent", () => { let component: DeleteUserComponent; let fixture: ComponentFixture; @@ -22,7 +22,7 @@ describe('DeleteUserComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/administration/users/delete-user/delete-user.component.ts b/src/app/administration/users/delete-user/delete-user.component.ts index 7f0ee60e..f4ce768c 100644 --- a/src/app/administration/users/delete-user/delete-user.component.ts +++ b/src/app/administration/users/delete-user/delete-user.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormControl, Validators, FormGroup } from '@angular/forms'; -import { UserService } from 'src/app/_services/user.service'; -import { of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { NotificationService } from 'src/app/_services/notification.service'; +import { Component, OnInit, Input } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormControl, Validators, FormGroup } from "@angular/forms"; +import { UserService } from "src/app/_services/user.service"; +import { of } from "rxjs"; +import { catchError } from "rxjs/operators"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { NotificationService } from "src/app/_services/notification.service"; @Component({ - selector: 'app-delete-user', - templateUrl: './delete-user.component.html', - styleUrls: ['./delete-user.component.css', '../../administration.css'] + selector: "app-delete-user", + templateUrl: "./delete-user.component.html", + styleUrls: ["./delete-user.component.css", "../../administration.css"] }) @@ -33,11 +33,11 @@ export class DeleteUserComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } createFormControls() { - this.deleteCheck = new FormControl('', [ + this.deleteCheck = new FormControl("", [ Validators.required, Validators.minLength(5) ]); diff --git a/src/app/administration/users/users.component.spec.ts b/src/app/administration/users/users.component.spec.ts index 50950659..ebd7ae62 100644 --- a/src/app/administration/users/users.component.spec.ts +++ b/src/app/administration/users/users.component.spec.ts @@ -1,19 +1,19 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { UsersComponent } from './users.component'; -import { NavigationComponent } from '../navigation/navigation.component'; -import { AddUserComponent } from './add-user/add-user.component'; -import { ControlPanelComponent } from 'src/app/shared/control-panel/control-panel.component'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; -import { DeleteUserComponent } from './delete-user/delete-user.component'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { HttpRequestInterceptorMock } from 'src/app/_interceptors/mock-interceptior'; +import { UsersComponent } from "./users.component"; +import { NavigationComponent } from "../navigation/navigation.component"; +import { AddUserComponent } from "./add-user/add-user.component"; +import { ControlPanelComponent } from "src/app/shared/control-panel/control-panel.component"; +import { RouterTestingModule } from "@angular/router/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http"; +import { DeleteUserComponent } from "./delete-user/delete-user.component"; +import { HttpClientTestingModule } from "@angular/common/http/testing"; +import { HttpRequestInterceptorMock } from "src/app/_interceptors/mock-interceptior"; -describe('UsersComponent', () => { +describe("UsersComponent", () => { let component: UsersComponent; let fixture: ComponentFixture; @@ -40,7 +40,7 @@ describe('UsersComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/administration/users/users.component.ts b/src/app/administration/users/users.component.ts index 8f5809f1..6384dec1 100644 --- a/src/app/administration/users/users.component.ts +++ b/src/app/administration/users/users.component.ts @@ -1,12 +1,12 @@ -import { Component, OnInit } from '@angular/core'; -import { UserService } from 'src/app/_services/user.service'; -import { Users } from 'src/app/_services/users.model'; -import { Observable } from 'rxjs'; +import { Component, OnInit } from "@angular/core"; +import { UserService } from "src/app/_services/user.service"; +import { Users } from "src/app/_services/users.model"; +import { Observable } from "rxjs"; @Component({ - selector: 'app-users', - templateUrl: './users.component.html', - styleUrls: ['./users.component.css', '../administration.css', '../../shared-styles.css'] + selector: "app-users", + templateUrl: "./users.component.html", + styleUrls: ["./users.component.css", "../administration.css", "../../shared-styles.css"] }) export class UsersComponent implements OnInit { diff --git a/src/app/administration/users/users.module.ts b/src/app/administration/users/users.module.ts index 094cf5a5..7c16f3e3 100644 --- a/src/app/administration/users/users.module.ts +++ b/src/app/administration/users/users.module.ts @@ -1,16 +1,16 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {RouterModule, Routes} from '@angular/router'; -import {AddUserComponent} from './add-user/add-user.component'; -import {DeleteUserComponent} from './delete-user/delete-user.component'; -import {NavigationModule} from '../navigation/navigation.module'; -import {SharedModule} from '../../shared/shared.module'; -import {UsersComponent} from './users.component'; -import {AuthGuard} from '../../auth.guard'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule, Routes } from "@angular/router"; +import { AddUserComponent } from "./add-user/add-user.component"; +import { DeleteUserComponent } from "./delete-user/delete-user.component"; +import { NavigationModule } from "../navigation/navigation.module"; +import { SharedModule } from "../../shared/shared.module"; +import { UsersComponent } from "./users.component"; +import { AuthGuard } from "../../auth.guard"; const routes: Routes = [ - { path: 'administration/users', component: UsersComponent, canActivate: [AuthGuard] } + { path: "administration/users", component: UsersComponent, canActivate: [AuthGuard] } ]; @NgModule({ diff --git a/src/app/analyze-chart.service.spec.ts b/src/app/analyze-chart.service.spec.ts index 7298a81c..9e6399fe 100644 --- a/src/app/analyze-chart.service.spec.ts +++ b/src/app/analyze-chart.service.spec.ts @@ -1,11 +1,11 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { AnalyzeChartService } from './analyze-chart.service'; +import { AnalyzeChartService } from "./analyze-chart.service"; -describe('AnalyzeChartService', () => { +describe("AnalyzeChartService", () => { beforeEach(() => TestBed.configureTestingModule({})); - it('should be created', () => { + it("should be created", () => { const service: AnalyzeChartService = TestBed.get(AnalyzeChartService); expect(service).toBeTruthy(); }); diff --git a/src/app/analyze-chart.service.ts b/src/app/analyze-chart.service.ts index bdf20039..eef57072 100644 --- a/src/app/analyze-chart.service.ts +++ b/src/app/analyze-chart.service.ts @@ -1,9 +1,9 @@ -import { Injectable } from '@angular/core'; -import {BehaviorSubject, Subject} from 'rxjs'; -import {Metrics} from './item-detail/metrics'; +import { Injectable } from "@angular/core"; +import { BehaviorSubject, Subject } from "rxjs"; +import { Metrics } from "./item-detail/metrics"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class AnalyzeChartService { @@ -11,8 +11,6 @@ export class AnalyzeChartService { private dataSource = new BehaviorSubject(null); currentData = this.dataSource.asObservable(); - constructor() { } - changeMessage(data: AnalyzeChartData) { this.dataSource.next(data); } diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index f3ce1eb5..3fbab160 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,16 +1,16 @@ -import { TestBed, waitForAsync } from '@angular/core/testing'; -import { AppComponent } from './app.component'; -import { TopPanelComponent } from './top-panel/top-panel.component'; -import { NotificationComponent } from './notification/notification.component'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NgxSpinnerModule } from 'ngx-spinner'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { HttpClientModule } from '@angular/common/http'; -import { ToastrModule } from 'ngx-toastr'; -import { AddNewProjectComponent } from './administration/projects/add-project/add-project-modal.component'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { TestBed, waitForAsync } from "@angular/core/testing"; +import { AppComponent } from "./app.component"; +import { TopPanelComponent } from "./top-panel/top-panel.component"; +import { NotificationComponent } from "./notification/notification.component"; +import { RouterTestingModule } from "@angular/router/testing"; +import { NgxSpinnerModule } from "ngx-spinner"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { HttpClientModule } from "@angular/common/http"; +import { ToastrModule } from "ngx-toastr"; +import { AddNewProjectComponent } from "./administration/projects/add-project/add-project-modal.component"; +import { ReactiveFormsModule, FormsModule } from "@angular/forms"; -describe('AppComponent', () => { +describe("AppComponent", () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [ @@ -30,7 +30,7 @@ describe('AppComponent', () => { ] }).compileComponents(); })); - it('should create the app', waitForAsync(() => { + it("should create the app", waitForAsync(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); @@ -38,6 +38,6 @@ describe('AppComponent', () => { it(`should have as title 'jtl-reporter'`, waitForAsync(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('jtl-reporter'); + expect(app.title).toEqual("jtl-reporter"); })); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2bad2efd..9b922f61 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + selector: "app-root", + templateUrl: "./app.component.html", + styleUrls: ["./app.component.css"] }) export class AppComponent { - title = 'jtl-reporter'; + title = "jtl-reporter"; } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9329a803..0b113038 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,26 +1,26 @@ -import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -import { AppComponent } from './app.component'; -import { RequestHttpInterceptor } from './_interceptors/http-interceptor'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgxSpinnerModule } from 'ngx-spinner'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ToastrModule } from 'ngx-toastr'; -import { ErrorInterceptor } from './_interceptors/error-interceptor'; -import { JwtInterceptor } from './_interceptors/jwt-interceptor'; -import { AppRoutingModule } from './AppRoutingModule'; -import { ScenarioModule } from './scenario/scenario.module'; -import { SharedModule } from './shared/shared.module'; -import { ItemDetailModule } from './item-detail/item-detail.module'; -import { InitUserModule } from './init-user/init-user.module'; -import { AdministrationModule } from './administration/administration.module'; -import { ProjectAdministrationModule } from './administration/projects/project-administration.module'; -import { ProjectModule } from './project/project.module'; -import { RouterModule } from '@angular/router'; -import { TopPanelComponent } from './top-panel/top-panel.component'; -import { NotificationComponent } from './notification/notification.component'; -import { TimeagoModule } from 'ngx-timeago'; +import { HTTP_INTERCEPTORS, HttpClientModule } from "@angular/common/http"; +import { NgModule } from "@angular/core"; +import { BrowserModule } from "@angular/platform-browser"; +import { AppComponent } from "./app.component"; +import { RequestHttpInterceptor } from "./_interceptors/http-interceptor"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { NgxSpinnerModule } from "ngx-spinner"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { ToastrModule } from "ngx-toastr"; +import { ErrorInterceptor } from "./_interceptors/error-interceptor"; +import { JwtInterceptor } from "./_interceptors/jwt-interceptor"; +import { AppRoutingModule } from "./AppRoutingModule"; +import { ScenarioModule } from "./scenario/scenario.module"; +import { SharedModule } from "./shared/shared.module"; +import { ItemDetailModule } from "./item-detail/item-detail.module"; +import { InitUserModule } from "./init-user/init-user.module"; +import { AdministrationModule } from "./administration/administration.module"; +import { ProjectAdministrationModule } from "./administration/projects/project-administration.module"; +import { ProjectModule } from "./project/project.module"; +import { RouterModule } from "@angular/router"; +import { TopPanelComponent } from "./top-panel/top-panel.component"; +import { NotificationComponent } from "./notification/notification.component"; +import { TimeagoModule } from "ngx-timeago"; @NgModule({ declarations: [ diff --git a/src/app/auth.guard.spec.ts b/src/app/auth.guard.spec.ts index ebc7d75b..723c5b0a 100644 --- a/src/app/auth.guard.spec.ts +++ b/src/app/auth.guard.spec.ts @@ -1,11 +1,11 @@ -import { TestBed, inject } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { HttpClientModule } from '@angular/common/http'; +import { TestBed, inject } from "@angular/core/testing"; +import { RouterTestingModule } from "@angular/router/testing"; +import { HttpClientModule } from "@angular/common/http"; -import { AuthGuard } from './auth.guard'; +import { AuthGuard } from "./auth.guard"; -describe('AuthGuard', () => { +describe("AuthGuard", () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [RouterTestingModule, HttpClientModule], @@ -13,7 +13,7 @@ describe('AuthGuard', () => { }); }); - it('should ...', inject([AuthGuard], (guard: AuthGuard) => { + it("should ...", inject([AuthGuard], (guard: AuthGuard) => { expect(guard).toBeTruthy(); })); }); diff --git a/src/app/auth.guard.ts b/src/app/auth.guard.ts index 5f45c2d1..920b5daa 100644 --- a/src/app/auth.guard.ts +++ b/src/app/auth.guard.ts @@ -1,8 +1,8 @@ -import { Injectable } from '@angular/core'; -import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; -import { AuthenticationService } from './_services/authentication.service'; +import { Injectable } from "@angular/core"; +import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from "@angular/router"; +import { AuthenticationService } from "./_services/authentication.service"; -@Injectable({ providedIn: 'root' }) +@Injectable({ providedIn: "root" }) export class AuthGuard implements CanActivate { constructor( @@ -16,14 +16,14 @@ export class AuthGuard implements CanActivate { if (token) { return true; } - if (localStorage.getItem('currentUser')) { + if (localStorage.getItem("currentUser")) { // logged in so return true this.authService.setLogin(true); return true; } // not logged in so redirect to login page with the return url - this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }}); + this.router.navigate(["/login"], { queryParams: { returnUrl: state.url } }); this.authService.setLogin(false); return false; } diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index adb1edb6..fdf4ee59 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -1,13 +1,13 @@ -import { Component, OnInit } from '@angular/core'; -import { ProjectApiService } from '../project-api.service'; -import { ItemsListing, ProjectsOverallStats } from '../items.service.model'; -import { Router } from '@angular/router'; -import { SharedMainBarService } from '../shared-main-bar.service'; +import { Component, OnInit } from "@angular/core"; +import { ProjectApiService } from "../project-api.service"; +import { ItemsListing, ProjectsOverallStats } from "../items.service.model"; +import { Router } from "@angular/router"; +import { SharedMainBarService } from "../shared-main-bar.service"; @Component({ - selector: 'app-dashboard', - templateUrl: './dashboard.component.html', - styleUrls: ['./dashboard.component.css', '../shared-styles.css'] + selector: "app-dashboard", + templateUrl: "./dashboard.component.html", + styleUrls: ["./dashboard.component.css", "../shared-styles.css"] }) export class DashboardComponent implements OnInit { latestItems: ItemsListing[]; diff --git a/src/app/graphs/colors.ts b/src/app/graphs/colors.ts index 0e33b675..f0251170 100644 --- a/src/app/graphs/colors.ts +++ b/src/app/graphs/colors.ts @@ -1,2 +1,2 @@ -export const colors = ['#9B59B6', '#be2edd', '#95afc0', '#0074D9', - '#7FDBFF', '#FF4136', '#85144b', '#FFDC00', '#2ECC40', '#01FF70', '#B10DC9']; +export const colors = ["#9B59B6", "#be2edd", "#95afc0", "#0074D9", + "#7FDBFF", "#FF4136", "#85144b", "#FFDC00", "#2ECC40", "#01FF70", "#B10DC9"]; diff --git a/src/app/graphs/item-detail.ts b/src/app/graphs/item-detail.ts index efb0fa97..f82ce049 100644 --- a/src/app/graphs/item-detail.ts +++ b/src/app/graphs/item-detail.ts @@ -1,10 +1,10 @@ export const commonGraphSettings: any = (text) => { return { chart: { - type: 'line', - zoomType: 'x', + type: "line", + zoomType: "x", marginTop: 50, - className: 'chart-sync', + className: "chart-sync", }, time: { getTimezoneOffset: function (timestamp) { @@ -21,10 +21,10 @@ export const commonGraphSettings: any = (text) => { } }, title: { - text: '' + text: "" }, - colors: ['#5DADE2', '#2ECC71', '#F4D03F', '#D98880', - '#707B7C', '#7DCEA0', '#21618C', '#873600', '#AF7AC5', '#B7950B'], + colors: ["#5DADE2", "#2ECC71", "#F4D03F", "#D98880", + "#707B7C", "#7DCEA0", "#21618C", "#873600", "#AF7AC5", "#B7950B"], tooltip: { split: true, crosshairs: [true] @@ -47,22 +47,22 @@ export const commonGraphSettings: any = (text) => { }, xAxis: { lineWidth: 0, - type: 'datetime', + type: "datetime", crosshair: true, }, yAxis: [{ - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, title: { text }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, title: { - text: 'virtual users' + text: "virtual users" } }, ], @@ -73,18 +73,18 @@ export const overallChartSettings = (text) => { const commonSettings = commonGraphSettings(text); const yAxis = [ { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, title: { - text: 'hits/s' + text: "hits/s" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, title: { - text: '%' + text: "%" }, }]; @@ -98,10 +98,10 @@ export const overallChartSettings = (text) => { export const customChartSettings = () => { return { chart: { - type: 'line', - zoomType: 'x', + type: "line", + zoomType: "x", marginTop: 50, - className: 'chart-sync', + className: "chart-sync", }, time: { getTimezoneOffset: function (timestamp) { @@ -118,10 +118,10 @@ export const customChartSettings = () => { } }, title: { - text: '' + text: "" }, - colors: ['#5DADE2', '#2ECC71', '#F4D03F', '#D98880', - '#707B7C', '#7DCEA0', '#21618C', '#873600', '#AF7AC5', '#B7950B'], + colors: ["#5DADE2", "#2ECC71", "#F4D03F", "#D98880", + "#707B7C", "#7DCEA0", "#21618C", "#873600", "#AF7AC5", "#B7950B"], tooltip: { split: true, crosshairs: [true] @@ -144,45 +144,45 @@ export const customChartSettings = () => { }, xAxis: { lineWidth: 0, - type: 'datetime', + type: "datetime", crosshair: true, }, yAxis: [{ - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, title: { - text: 'hits/s' + text: "hits/s" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, title: { - text: 'ms' + text: "ms" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, title: { - text: 'VU' + text: "VU" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, title: { - text: '%' + text: "%" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, title: { - text: 'mbps' + text: "mbps" }, } ], @@ -191,24 +191,24 @@ export const customChartSettings = () => { export const threadLineSettings: any = { - color: 'grey', + color: "grey", yAxis: 1 }; export const errorLineSettings: any = { - color: '#e74c3c', + color: "#e74c3c", yAxis: 3 }; export const throughputLineSettings: any = { - color: '#2ECC71', + color: "#2ECC71", yAxis: 2 }; export const networkLineSettings: any = { - color: 'grey', + color: "grey", yAxis: 3, - name: 'network' + name: "network" }; export const responseTimeLineSettings: any = { diff --git a/src/app/graphs/label-errors.ts b/src/app/graphs/label-errors.ts index dbd8f05b..98c3d496 100644 --- a/src/app/graphs/label-errors.ts +++ b/src/app/graphs/label-errors.ts @@ -1,4 +1,4 @@ -import { colors } from './colors'; +import { colors } from "./colors"; export const emptyResponseCodesChart = { chart: { @@ -8,33 +8,33 @@ export const emptyResponseCodesChart = { }, colors, title: { - text: 'Response codes', - align: 'center', - verticalAlign: 'middle', + text: "Response codes", + align: "center", + verticalAlign: "middle", y: 60 }, tooltip: { - pointFormat: '{series.name}: {point.percentage:.1f}%' + pointFormat: "{series.name}: {point.percentage:.1f}%" }, plotOptions: { pie: { dataLabels: { enabled: true, style: { - fontWeight: 'bold', - color: 'black' + fontWeight: "bold", + color: "black" } }, startAngle: -90, endAngle: 90, - center: ['50%', '75%'], - size: '110%' + center: ["50%", "75%"], + size: "110%" } }, series: [{ - type: 'pie', - name: 'Response codes', - innerSize: '50%', + type: "pie", + name: "Response codes", + innerSize: "50%", }], }; diff --git a/src/app/graphs/label-trend.ts b/src/app/graphs/label-trend.ts index 651338f9..26d85ecd 100644 --- a/src/app/graphs/label-trend.ts +++ b/src/app/graphs/label-trend.ts @@ -1,11 +1,11 @@ export const labelTrendChartOptions = (_) => { return { chart: { - type: 'spline', + type: "spline", }, - title: { text: '' }, + title: { text: "" }, subtitle: { - text: '' + text: "" }, exporting: { enabled: false @@ -19,30 +19,30 @@ export const labelTrendChartOptions = (_) => { }], yAxis: [{ // Primary yAxis labels: { - format: '{value} ms', + format: "{value} ms", }, - type: 'logarithmic', + type: "logarithmic", title: { - text: '', + text: "", }, gridLineWidth: 0 }, { title: { - text: '', + text: "", }, labels: { - format: '{value} hit/s', + format: "{value} hit/s", }, - type: 'logarithmic', + type: "logarithmic", gridLineWidth: 0, opposite: true }, { title: { - text: '', + text: "", }, labels: { - format: '{value} %', + format: "{value} %", style: { lineWidt: 1, }, @@ -52,12 +52,12 @@ export const labelTrendChartOptions = (_) => { }, { title: { - text: '', + text: "", }, labels: { - format: '{value} VU', + format: "{value} VU", }, - type: 'logarithmic', + type: "logarithmic", gridLineWidth: 0, opposite: false, } @@ -75,87 +75,87 @@ export const labelTrendChartOptions = (_) => { // } }, legend: { - layout: 'horizontal', - align: 'center', + layout: "horizontal", + align: "center", }, series: [{ - name: '90%', - type: 'areaspline', + name: "90%", + type: "areaspline", yAxis: 0, - stacking: 'normal', - data: _['n0'], + stacking: "normal", + data: _["n0"], // color: colors[0], - color: '#FFC400', + color: "#FFC400", lineWidth: 0, tooltip: { - valueSuffix: ' ms' + valueSuffix: " ms" }, marker: { enabled: false }, }, { - name: '95%', - type: 'areaspline', + name: "95%", + type: "areaspline", yAxis: 0, // color: colors[3], - color: '#36B37E', + color: "#36B37E", lineWidth: 0, - data: _['n5'], + data: _["n5"], tooltip: { - valueSuffix: ' ms' + valueSuffix: " ms" }, marker: { enabled: false }, - stacking: 'normal', + stacking: "normal", }, { - name: '99%', - type: 'areaspline', + name: "99%", + type: "areaspline", yAxis: 0, // color: colors[4], - color: '#008DA6', + color: "#008DA6", lineWidth: 0, - data: _['n9'], + data: _["n9"], tooltip: { - valueSuffix: ' ms' + valueSuffix: " ms" }, marker: { enabled: false }, - stacking: 'normal', + stacking: "normal", }, { - name: 'throughput', - type: 'spline', + name: "throughput", + type: "spline", data: _.throughput, visible: false, - color: '#CB59E8', + color: "#CB59E8", tooltip: { - valueSuffix: ' hits/s' + valueSuffix: " hits/s" }, yAxis: 1, - marker: { enabled: false, symbol: 'circle' } + marker: { enabled: false, symbol: "circle" } }, { - name: 'error rate', - type: 'spline', + name: "error rate", + type: "spline", data: _.errorRate, tooltip: { - valueSuffix: ' %' + valueSuffix: " %" }, - color: 'red', + color: "red", yAxis: 2, - dashStyle: 'ShortDot', - marker: { enabled: false, symbol: 'circle' } + dashStyle: "ShortDot", + marker: { enabled: false, symbol: "circle" } }, { - name: 'threads', - type: 'spline', + name: "threads", + type: "spline", steped: `center`, data: _.threads, tooltip: { - valueSuffix: ' VU' + valueSuffix: " VU" }, - color: 'black', - dashStyle: 'ShortDot', + color: "black", + dashStyle: "ShortDot", yAxis: 3, - marker: { enabled: false, symbol: 'circle' } + marker: { enabled: false, symbol: "circle" } }, ] }; @@ -164,11 +164,11 @@ export const labelTrendChartOptions = (_) => { export const emptyChart = () => { return { chart: { - type: 'spline' + type: "spline" }, - title: { text: 'No data' }, + title: { text: "No data" }, subtitle: { - text: 'there must be at least 2 records for given label' + text: "there must be at least 2 records for given label" }, }; }; diff --git a/src/app/graphs/log-scale-button.ts b/src/app/graphs/log-scale-button.ts index cfa033f3..85a78c67 100644 --- a/src/app/graphs/log-scale-button.ts +++ b/src/app/graphs/log-scale-button.ts @@ -5,25 +5,25 @@ export const logScaleButton = { enabled: false }, customButton2: { - text: 'Log scale ', + text: "Log scale ", theme: { - fill: '#C8C8C8', + fill: "#C8C8C8", states: { hover: { - fill: '#C8C8C8' + fill: "#C8C8C8" }, select: { - fill: '#a4edba' + fill: "#a4edba" } } }, onclick: function () { if (!this.logarithmic) { - this.yAxis[0].update({ type: 'logarithmic' }); + this.yAxis[0].update({ type: "logarithmic" }); this.exportSVGElements[0].setState(2); this.logarithmic = true; } else { - this.yAxis[0].update({ type: 'linear' }); + this.yAxis[0].update({ type: "linear" }); this.exportSVGElements[0].setState(0); this.logarithmic = false; } diff --git a/src/app/graphs/monitoring.ts b/src/app/graphs/monitoring.ts index 14e65a73..fbc6e47c 100644 --- a/src/app/graphs/monitoring.ts +++ b/src/app/graphs/monitoring.ts @@ -1,7 +1,7 @@ export const monitoringGraphSettings: any = () => { return { chart: { - type: 'line', + type: "line", }, time: { getTimezoneOffset: function (timestamp) { @@ -11,10 +11,10 @@ export const monitoringGraphSettings: any = () => { } }, title: { - text: '' + text: "" }, - colors: ['#5DADE2', '#2ECC71', '#F4D03F', '#D98880', - '#707B7C', '#7DCEA0', '#21618C', '#873600', '#AF7AC5', '#B7950B'], + colors: ["#5DADE2", "#2ECC71", "#F4D03F", "#D98880", + "#707B7C", "#7DCEA0", "#21618C", "#873600", "#AF7AC5", "#B7950B"], tooltip: { split: false, crosshairs: [true] @@ -35,19 +35,19 @@ export const monitoringGraphSettings: any = () => { }, xAxis: { lineWidth: 0, - type: 'datetime' + type: "datetime" }, yAxis: [{ gridLineWidth: 0.5, lineWidth: 0, title: { - text: '%' + text: "%" } }, { lineWidth: 0, opposite: true, title: { - text: '' + text: "" } }], }; diff --git a/src/app/graphs/scenario-trends.ts b/src/app/graphs/scenario-trends.ts index 890f0296..708d4505 100644 --- a/src/app/graphs/scenario-trends.ts +++ b/src/app/graphs/scenario-trends.ts @@ -1,17 +1,17 @@ -import { ScenarioTrendsData } from '../items.service.model'; -import * as moment from 'moment'; +import { ScenarioTrendsData } from "../items.service.model"; +import * as moment from "moment"; const options = ({ data, projectId, scenarioId }, yUnit) => { return { hover: { intersect: true, onHover: function (event, elements) { - event.target.style.cursor = elements[0] ? 'pointer' : 'default'; + event.target.style.cursor = elements[0] ? "pointer" : "default"; } }, legend: false, tooltips: { - mode: 'index', + mode: "index", intersect: false, callbacks: { label: function (t, d) { @@ -29,24 +29,24 @@ const options = ({ data, projectId, scenarioId }, yUnit) => { gridLines: { drawBorder: false, display: false, - type: 'time' + type: "time" }, }], yAxes: [ { - type: 'linear', - position: 'left', - id: 'A', + type: "linear", + position: "left", + id: "A", gridLines: { - color: '#b7b7b717', - zeroLineColor: '#b7b7b717', + color: "#b7b7b717", + zeroLineColor: "#b7b7b717", drawBorder: false }, scaleLabel: { display: true, labelString: yUnit, padding: -3, - fontColor: '#888888c7' + fontColor: "#888888c7" }, ticks: { beginAtZero: true, @@ -54,12 +54,12 @@ const options = ({ data, projectId, scenarioId }, yUnit) => { } }, { - id: 'B', - type: 'linear', - position: 'right', + id: "B", + type: "linear", + position: "right", gridLines: { - color: '#FFFFFF', - zeroLineColor: '#FFFFFF', + color: "#FFFFFF", + zeroLineColor: "#FFFFFF", drawBorder: false }, ticks: { @@ -68,9 +68,9 @@ const options = ({ data, projectId, scenarioId }, yUnit) => { }, scaleLabel: { display: false, - labelString: 'threads', + labelString: "threads", padding: -3, - fontColor: '#888888c7' + fontColor: "#888888c7" }, } ] @@ -89,10 +89,10 @@ const options = ({ data, projectId, scenarioId }, yUnit) => { export const customScenarioTrends = () => { return { chart: { - type: 'column', - zoomType: 'x', + type: "column", + zoomType: "x", marginTop: 30, - className: 'chart-sync', + className: "chart-sync", }, time: { getTimezoneOffset: function (timestamp) { @@ -109,10 +109,10 @@ export const customScenarioTrends = () => { } }, title: { - text: '' + text: "" }, - colors: ['#5DADE2', '#2ECC71', '#F4D03F', '#D98880', - '#707B7C', '#7DCEA0', '#21618C', '#873600', '#AF7AC5', '#B7950B'], + colors: ["#5DADE2", "#2ECC71", "#F4D03F", "#D98880", + "#707B7C", "#7DCEA0", "#21618C", "#873600", "#AF7AC5", "#B7950B"], tooltip: { split: false, crosshairs: [true], @@ -120,7 +120,7 @@ export const customScenarioTrends = () => { }, plotOptions: { series: { - cursor: 'pointer', + cursor: "pointer", pointWidth: 20, }, line: { @@ -139,7 +139,7 @@ export const customScenarioTrends = () => { min: 0, max: 15, lineWidth: 0, - type: 'datetime', + type: "datetime", crosshair: { snap: true }, @@ -149,46 +149,46 @@ export const customScenarioTrends = () => { }, yAxis: [ { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, showEmpty: false, title: { - text: 'ms' + text: "ms" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, showEmpty: false, title: { - text: 'VU' + text: "VU" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, showEmpty: false, title: { - text: 'hits/s' + text: "hits/s" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, showEmpty: false, title: { - text: '%' + text: "%" }, }, { - gridLineColor: '#f2f2f2', + gridLineColor: "#f2f2f2", lineWidth: 0, opposite: true, showEmpty: false, title: { - text: 'mbps' + text: "mbps" }, } ], @@ -197,19 +197,19 @@ export const customScenarioTrends = () => { export const scenarioHistoryGraphs = (historyData: ScenarioTrendsData[], projectId, scenarioId) => { - const dates = historyData.map(_ => moment(_.overview.startDate).format('DD. MM. YYYY HH:mm')); + const dates = historyData.map(_ => moment(_.overview.startDate).format("DD. MM. YYYY HH:mm")); const intervals = [ - { name: 'avgResponseTime', color: 'rgb(87,95,207, 0.8)', unit: 'ms' }, - { name: 'throughput', color: 'rgb(41,128,187, 0.8)', unit: 'hit/s' }, - { name: 'errorRate', color: 'rgb(231,76,60, 0.8)', unit: '%' }, - { name: 'percentil', color: 'rgb(17,122,139, 0.8)', unit: 'ms' }].map(({ name, color, unit }) => { + { name: "avgResponseTime", color: "rgb(87,95,207, 0.8)", unit: "ms" }, + { name: "throughput", color: "rgb(41,128,187, 0.8)", unit: "hit/s" }, + { name: "errorRate", color: "rgb(231,76,60, 0.8)", unit: "%" }, + { name: "percentil", color: "rgb(17,122,139, 0.8)", unit: "ms" }].map(({ name, color, unit }) => { // in case of no data create empty graph data to allow afterDraw hook to work if (historyData.length === 0) { return { name, data: { - type: 'bar', + type: "bar", data: { maxBarNumber: 15, labels: [], @@ -227,23 +227,23 @@ export const scenarioHistoryGraphs = (historyData: ScenarioTrendsData[], project backgroundColor: color, fill: true, borderWidth: 1, - yAxisID: 'A', + yAxisID: "A", }, { data: historyData.map((__) => __.overview.maxVu), - type: 'line', + type: "line", showLine: false, - yAxisID: 'B', + yAxisID: "B", fill: false, - borderColor: '#000000', + borderColor: "#000000", pointRadius: 5, - pointStyle: 'line', + pointStyle: "line", } ]; return { name, data: { - type: 'bar', + type: "bar", data: { maxBarNumber: 15, labels: dates, @@ -254,9 +254,9 @@ export const scenarioHistoryGraphs = (historyData: ScenarioTrendsData[], project }; }); return { - responseHistoryTimeChart: intervals.find(_ => _.name === 'avgResponseTime').data, - throughputHistoryChart: intervals.find(_ => _.name === 'throughput').data, - errorRateHistoryChart: intervals.find(_ => _.name === 'errorRate').data, - ninetyHistoryChart: intervals.find(_ => _.name === 'percentil').data, + responseHistoryTimeChart: intervals.find(_ => _.name === "avgResponseTime").data, + throughputHistoryChart: intervals.find(_ => _.name === "throughput").data, + errorRateHistoryChart: intervals.find(_ => _.name === "errorRate").data, + ninetyHistoryChart: intervals.find(_ => _.name === "percentil").data, }; }; diff --git a/src/app/graphs/scenarios.ts b/src/app/graphs/scenarios.ts index db83e733..8ecdaf7d 100644 --- a/src/app/graphs/scenarios.ts +++ b/src/app/graphs/scenarios.ts @@ -1,7 +1,7 @@ export const scenarioHistory = (inputData) => { if (inputData.length === 0) { return { - type: 'bar', + type: "bar", data: { maxBarNumber: 15, labels: [], @@ -14,14 +14,14 @@ export const scenarioHistory = (inputData) => { return { percentil: _.percentil, date: _.startDate }; }); return { - type: 'bar', + type: "bar", data: { maxBarNumber: 15, labels: dt.map(_ => _.date), datasets: [ { data: dt.map(_ => _.percentil), - backgroundColor: 'rgb(17,122,139, 0.8)', + backgroundColor: "rgb(17,122,139, 0.8)", fill: true, borderWidth: 1, } @@ -43,8 +43,8 @@ const options = { yAxes: [{ stacked: true, gridLines: { - color: '#b7b7b717', - zeroLineColor: '#b7b7b717', + color: "#b7b7b717", + zeroLineColor: "#b7b7b717", drawBorder: false } }] diff --git a/src/app/graphs/series.model.ts b/src/app/graphs/series.model.ts index 17acc8f0..93890a9c 100644 --- a/src/app/graphs/series.model.ts +++ b/src/app/graphs/series.model.ts @@ -1,9 +1,9 @@ export enum Series { - ResponseTimeAvg = 'Response Time [avg]', - ResponseTimeP90 = 'Response Time [P90]', - LatencyAvg = 'Latency [avg]', - ConnetcAvg = 'Connection [avg]', - Throughput = 'Throughput', - ErrorRate = 'Error Rate', - Network = 'Network' + ResponseTimeAvg = "Response Time [avg]", + ResponseTimeP90 = "Response Time [P90]", + LatencyAvg = "Latency [avg]", + ConnetcAvg = "Connection [avg]", + Throughput = "Throughput", + ErrorRate = "Error Rate", + Network = "Network" } diff --git a/src/app/graphs/status-codes.ts b/src/app/graphs/status-codes.ts index f5391c5c..fd5a3f99 100644 --- a/src/app/graphs/status-codes.ts +++ b/src/app/graphs/status-codes.ts @@ -1,5 +1,5 @@ -import { StatusCodes } from '../item-detail/request-stats/label-health/label-health.component'; -import { colors } from './colors'; +import { StatusCodes } from "../item-detail/request-stats/label-health/label-health.component"; +import { colors } from "./colors"; export const statusCodesChart = (data: StatusCodes[]) => { return { @@ -7,12 +7,12 @@ export const statusCodesChart = (data: StatusCodes[]) => { enabled: false, }, colorAxis: { - minColor: '#FFFFFF', - maxColor: '#FFF' + minColor: "#FFFFFF", + maxColor: "#FFF" }, series: [{ - type: 'treemap', - layoutAlgorithm: 'squarified', + type: "treemap", + layoutAlgorithm: "squarified", allowDrillToNode: false, animationLimit: 1000, dataLabels: { @@ -33,10 +33,10 @@ export const statusCodesChart = (data: StatusCodes[]) => { })) }], subtitle: { - text: '' + text: "" }, title: { - text: '' + text: "" } }; }; diff --git a/src/app/init-user/init-user.component.spec.ts b/src/app/init-user/init-user.component.spec.ts index 12dcbad0..a13ae7e4 100644 --- a/src/app/init-user/init-user.component.spec.ts +++ b/src/app/init-user/init-user.component.spec.ts @@ -1,11 +1,11 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { RouterTestingModule } from '@angular/router/testing'; +import { HttpClientModule } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { RouterTestingModule } from "@angular/router/testing"; -import { InitUserComponent } from './init-user.component'; +import { InitUserComponent } from "./init-user.component"; -describe('InitUserComponent', () => { +describe("InitUserComponent", () => { let component: InitUserComponent; let fixture: ComponentFixture; @@ -23,7 +23,7 @@ describe('InitUserComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/init-user/init-user.component.ts b/src/app/init-user/init-user.component.ts index 64f0f959..e841d440 100644 --- a/src/app/init-user/init-user.component.ts +++ b/src/app/init-user/init-user.component.ts @@ -1,13 +1,13 @@ -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { first } from 'rxjs/operators'; -import { AuthenticationService } from '../_services/authentication.service'; +import { Component, OnInit } from "@angular/core"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { Router } from "@angular/router"; +import { first } from "rxjs/operators"; +import { AuthenticationService } from "../_services/authentication.service"; @Component({ - selector: 'app-init-user', - templateUrl: './init-user.component.html', - styleUrls: ['./init-user.component.css'] + selector: "app-init-user", + templateUrl: "./init-user.component.html", + styleUrls: ["./init-user.component.css"] }) export class InitUserComponent implements OnInit { initUserForm: FormGroup; @@ -23,8 +23,8 @@ export class InitUserComponent implements OnInit { ngOnInit() { this.initUserForm = this.formBuilder.group({ - username: ['', Validators.required], - password: ['', [Validators.required, Validators.minLength(8)]], + username: ["", Validators.required], + password: ["", [Validators.required, Validators.minLength(8)]], }); } @@ -42,7 +42,7 @@ export class InitUserComponent implements OnInit { .pipe(first()) .subscribe( data => { - this.router.navigate(['/']); + this.router.navigate(["/"]); }, error => { this.error = error; diff --git a/src/app/init-user/init-user.module.ts b/src/app/init-user/init-user.module.ts index 98d48db0..cee72b41 100644 --- a/src/app/init-user/init-user.module.ts +++ b/src/app/init-user/init-user.module.ts @@ -1,10 +1,10 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {RouterModule, Routes} from '@angular/router'; -import {InitUserComponent} from './init-user.component'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule, Routes } from "@angular/router"; +import { InitUserComponent } from "./init-user.component"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -const routes: Routes = [{path: 'init', component: InitUserComponent}]; +const routes: Routes = [{ path: "init", component: InitUserComponent }]; @NgModule({ declarations: [InitUserComponent], diff --git a/src/app/item-detail/analyze-charts/add-metric/add-metric.component.spec.ts b/src/app/item-detail/analyze-charts/add-metric/add-metric.component.spec.ts index c53724e2..3cef36da 100644 --- a/src/app/item-detail/analyze-charts/add-metric/add-metric.component.spec.ts +++ b/src/app/item-detail/analyze-charts/add-metric/add-metric.component.spec.ts @@ -1,9 +1,9 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { FormsModule } from "@angular/forms"; -import { AddMetricComponent } from './add-metric.component'; +import { AddMetricComponent } from "./add-metric.component"; -describe('AddMetricComponent', () => { +describe("AddMetricComponent", () => { let component: AddMetricComponent; let fixture: ComponentFixture; @@ -20,13 +20,13 @@ describe('AddMetricComponent', () => { fixture = TestBed.createComponent(AddMetricComponent); component = fixture.componentInstance; component.chartLines = { - labels: new Map([['test', [{ name: 'test' }]]]), + labels: new Map([["test", [{ name: "test" }]]]), overall: new Map() }; fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/analyze-charts/add-metric/add-metric.component.ts b/src/app/item-detail/analyze-charts/add-metric/add-metric.component.ts index edd0fecf..381d9308 100644 --- a/src/app/item-detail/analyze-charts/add-metric/add-metric.component.ts +++ b/src/app/item-detail/analyze-charts/add-metric/add-metric.component.ts @@ -1,16 +1,16 @@ -import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; @Component({ - selector: 'app-add-metric', - templateUrl: './add-metric.component.html', - styleUrls: ['./add-metric.component.scss'] + selector: "app-add-metric", + templateUrl: "./add-metric.component.html", + styleUrls: ["./add-metric.component.scss"] }) export class AddMetricComponent implements OnInit, OnChanges { @Input() chartLines; @Input() preloadedSeries; - @Output() chartUpdate = new EventEmitter<{}>(); + @Output() chartUpdate = new EventEmitter(); overallChartLines; labelsChartLines; @@ -28,10 +28,11 @@ export class AddMetricComponent implements OnInit, OnChanges { const { value: firstItem } = this.chartLines.labels.values().next(); const labels = firstItem?.map(_ => ({ name: _.name, isChecked: false })); overallLines.forEach((_: string) => { - this.metrics[_] = [{ name: 'overall', isChecked: false }]; + this.metrics[_] = [{ name: "overall", isChecked: false }]; }); labelsLines.forEach((_: string) => { const labelsArray = [...JSON.parse(JSON.stringify(labels))]; + // eslint-disable-next-line no-prototype-builtins this.metrics.hasOwnProperty(_) ? this.metrics[_].push(...labelsArray) : this.metrics[_] = labelsArray; @@ -42,7 +43,7 @@ export class AddMetricComponent implements OnInit, OnChanges { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } submit() { diff --git a/src/app/item-detail/analyze-charts/analyze-charts.component.spec.ts b/src/app/item-detail/analyze-charts/analyze-charts.component.spec.ts index de188ca8..7f755823 100644 --- a/src/app/item-detail/analyze-charts/analyze-charts.component.spec.ts +++ b/src/app/item-detail/analyze-charts/analyze-charts.component.spec.ts @@ -1,14 +1,14 @@ -import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { HighchartsChartModule } from 'highcharts-angular'; -import { HttpRequestInterceptorMock } from 'src/app/_interceptors/mock-interceptior'; -import { AddMetricComponent } from './add-metric/add-metric.component'; +import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { FormsModule } from "@angular/forms"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { HighchartsChartModule } from "highcharts-angular"; +import { HttpRequestInterceptorMock } from "src/app/_interceptors/mock-interceptior"; +import { AddMetricComponent } from "./add-metric/add-metric.component"; -import { AnalyzeChartsComponent } from './analyze-charts.component'; +import { AnalyzeChartsComponent } from "./analyze-charts.component"; -describe('AnalyzeChartsComponent', () => { +describe("AnalyzeChartsComponent", () => { let component: AnalyzeChartsComponent; let fixture: ComponentFixture; @@ -33,12 +33,12 @@ describe('AnalyzeChartsComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(AnalyzeChartsComponent); component = fixture.componentInstance; - component.chartLines = { labels: new Map([['test', [{ name: 'test', data: []}]]]), overall: new Map() }; - component.params = { projectName: 'test-project', scenarioName: 'test-scenario', id: 'test-item' }; + component.chartLines = { labels: new Map([["test", [{ name: "test", data: [] }]]]), overall: new Map() }; + component.params = { projectName: "test-project", scenarioName: "test-scenario", id: "test-item" }; fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/analyze-charts/analyze-charts.component.ts b/src/app/item-detail/analyze-charts/analyze-charts.component.ts index 1f4fec2d..ccfce5ad 100644 --- a/src/app/item-detail/analyze-charts/analyze-charts.component.ts +++ b/src/app/item-detail/analyze-charts/analyze-charts.component.ts @@ -1,13 +1,13 @@ -import {Component, Input, OnInit } from '@angular/core'; -import { customChartSettings } from 'src/app/graphs/item-detail'; -import * as Highcharts from 'highcharts'; -import { ItemsApiService } from 'src/app/items-api.service'; -import {AnalyzeChartService} from '../../analyze-chart.service'; +import { Component, Input, OnInit } from "@angular/core"; +import { customChartSettings } from "src/app/graphs/item-detail"; +import * as Highcharts from "highcharts"; +import { ItemsApiService } from "src/app/items-api.service"; +import { AnalyzeChartService } from "../../analyze-chart.service"; @Component({ - selector: 'app-analyze-charts', - templateUrl: './analyze-charts.component.html', - styleUrls: ['./analyze-charts.component.css', '../item-detail.component.scss'] + selector: "app-analyze-charts", + templateUrl: "./analyze-charts.component.html", + styleUrls: ["./analyze-charts.component.css", "../item-detail.component.scss"] }) export class AnalyzeChartsComponent implements OnInit { @@ -22,11 +22,11 @@ export class AnalyzeChartsComponent implements OnInit { updateLabelChartFlag = false; labels: string[]; yAxisId = new Map([ - ['Throughput', 0], - ['Response Time', 1], - ['Threads', 2], - ['Error Rate', 3], - ['Network', 4] + ["Throughput", 0], + ["Response Time", 1], + ["Threads", 2], + ["Error Rate", 3], + ["Network", 4] ]); preloadedSeries; @@ -81,8 +81,8 @@ export class AnalyzeChartsComponent implements OnInit { } series.forEach(_ => { const { name, metric } = _; - const yAxis = this.yAxisId.get(metric.includes('Response Time') ? 'Response Time' : metric); - if (name === 'overall') { + const yAxis = this.yAxisId.get(metric.includes("Response Time") ? "Response Time" : metric); + if (name === "overall") { const metricLine = this.chartLines.overall.get(metric); const line: Line = { ...metricLine, diff --git a/src/app/item-detail/chart/item-chart.component.ts b/src/app/item-detail/chart/item-chart.component.ts index 64c79b00..8e5954c2 100644 --- a/src/app/item-detail/chart/item-chart.component.ts +++ b/src/app/item-detail/chart/item-chart.component.ts @@ -8,21 +8,21 @@ import { ViewChild, ViewEncapsulation, AfterViewInit, -} from '@angular/core'; -import { Chart } from 'chart.js'; +} from "@angular/core"; +import { Chart } from "chart.js"; @Component({ - selector: 'app-item-chart', - templateUrl: './item-chart.component.html', - styleUrls: ['./item-chart.component.scss'], + selector: "app-item-chart", + templateUrl: "./item-chart.component.html", + styleUrls: ["./item-chart.component.scss"], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None }) export class ItemChartComponent implements AfterViewInit, OnDestroy { @Input() chartData: any; - @ViewChild('chartCanvasRef', { static: true }) chartCanvas: ElementRef; - @HostBinding('class.chart') htmlCardClass = true; + @ViewChild("chartCanvasRef", { static: true }) chartCanvas: ElementRef; + @HostBinding("class.chart") htmlCardClass = true; private chart: Chart; diff --git a/src/app/item-detail/item-detail.component.spec.ts b/src/app/item-detail/item-detail.component.spec.ts index 8fe45f05..49603a1e 100644 --- a/src/app/item-detail/item-detail.component.spec.ts +++ b/src/app/item-detail/item-detail.component.spec.ts @@ -1,21 +1,21 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { ItemDetailComponent } from './item-detail.component'; -import { BreadcrumbComponent } from '../shared/breadcrumb/breadcrumb.component'; -import { EditItemComponent } from '../shared/shared-item/edit-item/edit-item.component'; -import { DeleteItemComponent } from '../shared/shared-item/delete-item/delete-item.component'; -import { ControlPanelComponent } from '../shared/control-panel/control-panel.component'; -import { StatsCompareComponent } from './stats-compare/stats-compare.component'; -import { HighchartsChartModule } from 'highcharts-angular'; -import { RouterTestingModule } from '@angular/router/testing'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { HttpClientModule } from '@angular/common/http'; -import { ToastrModule } from 'ngx-toastr'; -import { DataTableModule } from '@pascalhonegger/ng-datatable'; +import { ItemDetailComponent } from "./item-detail.component"; +import { BreadcrumbComponent } from "../shared/breadcrumb/breadcrumb.component"; +import { EditItemComponent } from "../shared/shared-item/edit-item/edit-item.component"; +import { DeleteItemComponent } from "../shared/shared-item/delete-item/delete-item.component"; +import { ControlPanelComponent } from "../shared/control-panel/control-panel.component"; +import { StatsCompareComponent } from "./stats-compare/stats-compare.component"; +import { HighchartsChartModule } from "highcharts-angular"; +import { RouterTestingModule } from "@angular/router/testing"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { HttpClientModule } from "@angular/common/http"; +import { ToastrModule } from "ngx-toastr"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; -describe('ItemDetailComponent', () => { +describe("ItemDetailComponent", () => { let component: ItemDetailComponent; let fixture: ComponentFixture; @@ -49,7 +49,7 @@ describe('ItemDetailComponent', () => { fixture.detectChanges(); }); - xit('should create', () => { + xit("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/item-detail.component.ts b/src/app/item-detail/item-detail.component.ts index d0405e43..4903444a 100644 --- a/src/app/item-detail/item-detail.component.ts +++ b/src/app/item-detail/item-detail.component.ts @@ -1,11 +1,11 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; -import {ItemsApiService} from '../items-api.service'; -import {ItemDetail} from '../items.service.model'; -import {NgxSpinnerService} from 'ngx-spinner'; -import {DecimalPipe} from '@angular/common'; -import * as Highcharts from 'highcharts'; -import exporting from 'highcharts/modules/exporting'; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { ActivatedRoute } from "@angular/router"; +import { ItemsApiService } from "../items-api.service"; +import { ItemDetail } from "../items.service.model"; +import { NgxSpinnerService } from "ngx-spinner"; +import { DecimalPipe } from "@angular/common"; +import * as Highcharts from "highcharts"; +import exporting from "highcharts/modules/exporting"; exporting(Highcharts); @@ -15,22 +15,22 @@ import { throughputLineSettings, networkLineSettings, commonGraphSettings, -} from '../graphs/item-detail'; -import {catchError, withLatestFrom} from 'rxjs/operators'; -import {of} from 'rxjs'; -import {SharedMainBarService} from '../shared-main-bar.service'; -import {ToastrService} from 'ngx-toastr'; -import {bytesToMbps} from './calculations'; -import {logScaleButton} from '../graphs/log-scale-button'; -import {ItemStatusValue} from './item-detail.model'; -import {Metrics} from './metrics'; -import {AnalyzeChartService} from '../analyze-chart.service'; -import {showZeroErrorWarning} from '../utils/showZeroErrorTolerance'; +} from "../graphs/item-detail"; +import { catchError, withLatestFrom } from "rxjs/operators"; +import { of } from "rxjs"; +import { SharedMainBarService } from "../shared-main-bar.service"; +import { ToastrService } from "ngx-toastr"; +import { bytesToMbps } from "./calculations"; +import { logScaleButton } from "../graphs/log-scale-button"; +import { ItemStatusValue } from "./item-detail.model"; +import { Metrics } from "./metrics"; +import { AnalyzeChartService } from "../analyze-chart.service"; +import { showZeroErrorWarning } from "../utils/showZeroErrorTolerance"; @Component({ - selector: 'app-item-detail', - templateUrl: './item-detail.component.html', - styleUrls: ['./item-detail.component.scss', '../shared-styles.css'], + selector: "app-item-detail", + templateUrl: "./item-detail.component.html", + styleUrls: ["./item-detail.component.scss", "../shared-styles.css"], providers: [DecimalPipe] }) export class ItemDetailComponent implements OnInit, OnDestroy { @@ -103,7 +103,7 @@ export class ItemDetailComponent implements OnInit, OnDestroy { this.itemParams.projectName, this.itemParams.scenarioName, this.itemParams.id, - {token: this.token} + { token: this.token } ) .pipe(catchError(r => { this.spinner.hide(); @@ -141,15 +141,15 @@ export class ItemDetailComponent implements OnInit, OnDestroy { percentile95, percentile99, } = this.itemData.plot; - const threadLine = {...threadLineSettings, name: 'virtual users', data: threads}; - const errorLine = {...errorLineSettings, ...overAllFailRate}; - const throughputLine = {...throughputLineSettings, ...overallThroughput}; + const threadLine = { ...threadLineSettings, name: "virtual users", data: threads }; + const errorLine = { ...errorLineSettings, ...overAllFailRate }; + const throughputLine = { ...throughputLineSettings, ...overallThroughput }; if (overAllNetworkV2) { const networkMbps = overAllNetworkV2.data.map((_) => { return [_[0], bytesToMbps(_[1])]; }); - const networkLine = {...networkLineSettings, data: networkMbps}; + const networkLine = { ...networkLineSettings, data: networkMbps }; this.chartLines.overall.set(Metrics.Network, networkLine); } @@ -164,7 +164,7 @@ export class ItemDetailComponent implements OnInit, OnDestroy { return _; }); const networkChartOptions = { - ...commonGraphSettings('mbps'), + ...commonGraphSettings("mbps"), series: [...networkMbps, threadLine], ...logScaleButton }; @@ -174,32 +174,32 @@ export class ItemDetailComponent implements OnInit, OnDestroy { if (minResponseTime) { this.chartLines.labels.set(Metrics.ResponseTimeMin, minResponseTime); - this.labelCharts.set(Metrics.ResponseTimeMin, {...commonGraphSettings('ms'), series: [...minResponseTime, threadLine]}); + this.labelCharts.set(Metrics.ResponseTimeMin, { ...commonGraphSettings("ms"), series: [...minResponseTime, threadLine] }); } if (maxResponseTime) { this.chartLines.labels.set(Metrics.ResponseTimeMax, maxResponseTime); - this.labelCharts.set(Metrics.ResponseTimeMax, {...commonGraphSettings('ms'), series: [...maxResponseTime, threadLine]}); + this.labelCharts.set(Metrics.ResponseTimeMax, { ...commonGraphSettings("ms"), series: [...maxResponseTime, threadLine] }); } if (percentile90) { this.chartLines.labels.set(Metrics.ResponseTimeP90, percentile90); - this.labelCharts.set(Metrics.ResponseTimeP90, {...commonGraphSettings('ms'), series: [...percentile90, threadLine]}); + this.labelCharts.set(Metrics.ResponseTimeP90, { ...commonGraphSettings("ms"), series: [...percentile90, threadLine] }); } if (percentile95) { this.chartLines.labels.set(Metrics.ResponseTimeP95, percentile95); - this.labelCharts.set(Metrics.ResponseTimeP95, {...commonGraphSettings('ms'), series: [...percentile95, threadLine]}); + this.labelCharts.set(Metrics.ResponseTimeP95, { ...commonGraphSettings("ms"), series: [...percentile95, threadLine] }); } if (percentile99) { this.chartLines.labels.set(Metrics.ResponseTimeP99, percentile99); - this.labelCharts.set(Metrics.ResponseTimeP99, {...commonGraphSettings('ms'), series: [...percentile99, threadLine]}); + this.labelCharts.set(Metrics.ResponseTimeP99, { ...commonGraphSettings("ms"), series: [...percentile99, threadLine] }); } this.chartLines.labels.set(Metrics.ResponseTimeAvg, responseTime); - this.labelCharts.set(Metrics.ResponseTimeAvg, {...commonGraphSettings('ms'), series: [...responseTime, threadLine]}); + this.labelCharts.set(Metrics.ResponseTimeAvg, { ...commonGraphSettings("ms"), series: [...responseTime, threadLine] }); this.chartLines.labels.set(Metrics.Throughput, throughput); - this.labelCharts.set(Metrics.Throughput, {...commonGraphSettings('hits/s'), series: [...throughput, threadLine]}); + this.labelCharts.set(Metrics.Throughput, { ...commonGraphSettings("hits/s"), series: [...throughput, threadLine] }); } @@ -208,11 +208,11 @@ export class ItemDetailComponent implements OnInit, OnDestroy { const oveallChartSeries = Array.from(this.chartLines.overall.values()); this.overallChartOptions = { - ...overallChartSettings('ms'), series: oveallChartSeries + ...overallChartSettings("ms"), series: oveallChartSeries }; } - itemDetailChanged({note, environment, hostname}) { + itemDetailChanged({ note, environment, hostname }) { this.itemData.note = note; this.itemData.environment = environment; this.itemData.hostname = hostname; @@ -220,13 +220,13 @@ export class ItemDetailComponent implements OnInit, OnDestroy { monitoringAlerts() { const alertMessages = []; - const {max: maxCpu} = this.itemData.monitoring.cpu; + const { max: maxCpu } = this.itemData.monitoring.cpu; if (maxCpu > 90) { alertMessages.push(`High CPU usage`); } if (alertMessages.length > 0) { - this.toastr.warning(alertMessages.join('
'), 'Monitoring Alert!', + this.toastr.warning(alertMessages.join("
"), "Monitoring Alert!", { closeButton: true, disableTimeOut: true, @@ -243,33 +243,33 @@ export class ItemDetailComponent implements OnInit, OnDestroy { } } - toggleThroughputBand({element, perfAnalysis}) { + toggleThroughputBand({ element, perfAnalysis }) { this.overallChartOptions.series.forEach(serie => { - if (['response time', 'errors'].includes(serie.name)) { + if (["response time", "errors"].includes(serie.name)) { serie.visible = this.toggleThroughputBandFlag; } - if (serie.name === 'throughput') { + if (serie.name === "throughput") { if (this.toggleThroughputBandFlag) { serie.zones = []; return; } serie.zones = [{ value: this.itemData.overview.throughput, - color: '#e74c3c' + color: "#e74c3c" }]; } }); if (!this.toggleThroughputBandFlag) { - element.textContent = 'Hide in chart'; + element.textContent = "Hide in chart"; this.overallChartOptions.xAxis.plotBands = { - color: '#e74c3c4f', + color: "#e74c3c4f", from: perfAnalysis.throughputVariability.bandValues[0], to: perfAnalysis.throughputVariability.bandValues[1] }; this.toggleThroughputBandFlag = true; } else { - element.textContent = 'Display in chart'; + element.textContent = "Display in chart"; this.overallChartOptions.xAxis.plotBands = null; this.toggleThroughputBandFlag = false; } diff --git a/src/app/item-detail/item-detail.model.ts b/src/app/item-detail/item-detail.model.ts index f005ba4f..086ed91f 100644 --- a/src/app/item-detail/item-detail.model.ts +++ b/src/app/item-detail/item-detail.model.ts @@ -1,7 +1,7 @@ export enum ItemStatusValue { - none = '10', - passed = '0', - error = '1', - terminated = '2', - failed = '3' + none = "10", + passed = "0", + error = "1", + terminated = "2", + failed = "3" } diff --git a/src/app/item-detail/item-detail.module.ts b/src/app/item-detail/item-detail.module.ts index ebb14a81..88902ace 100644 --- a/src/app/item-detail/item-detail.module.ts +++ b/src/app/item-detail/item-detail.module.ts @@ -1,33 +1,33 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { ItemDetailComponent } from './item-detail.component'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { RequestStatsCompareComponent } from './request-stats/request-stats-compare.component'; -import { ThresholdsAlertComponent } from './thresholds-alert/thresholds-alert.component'; -import { PerformanceAnalysisComponent } from './performance-analysis/performance-analysis.component'; -import { AuthGuard } from '../auth.guard'; -import { RouterModule, Routes } from '@angular/router'; -import { SharedItemModule } from '../shared/shared-item/shared-item.module'; -import { SharedModule } from '../shared/shared.module'; -import { ZeroErrorToleranceWarningComponent } from './zero-error-tolerance-warning/zero-error-tolerance-warning.component'; -import { HighchartsChartModule } from 'highcharts-angular'; -import { LabelChartComponent } from './label-chart/label-chart.component'; -import { AnalyzeChartsComponent } from './analyze-charts/analyze-charts.component'; -import { ReactiveFormsModule } from '@angular/forms'; -import { LabelHealthComponent } from './request-stats/label-health/label-health.component'; -import { LabelTrendComponent } from './label-trend/label-trend.component'; -import { StatsCompareComponent } from './stats-compare/stats-compare.component'; -import { AddMetricComponent } from './analyze-charts/add-metric/add-metric.component'; -import { ShareComponent } from './share/share.component'; -import { DeleteShareLinkComponent } from './share/delete-share-link/delete-share-link.component'; -import { CreateNewShareLinkComponent } from './share/create-new-share-link/create-new-share-link.component'; -import { MonitoringStatsComponent } from './monitoring-stats/monitoring-stats.component'; -import { DataTableModule } from '@pascalhonegger/ng-datatable'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { ItemDetailComponent } from "./item-detail.component"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { RequestStatsCompareComponent } from "./request-stats/request-stats-compare.component"; +import { ThresholdsAlertComponent } from "./thresholds-alert/thresholds-alert.component"; +import { PerformanceAnalysisComponent } from "./performance-analysis/performance-analysis.component"; +import { AuthGuard } from "../auth.guard"; +import { RouterModule, Routes } from "@angular/router"; +import { SharedItemModule } from "../shared/shared-item/shared-item.module"; +import { SharedModule } from "../shared/shared.module"; +import { ZeroErrorToleranceWarningComponent } from "./zero-error-tolerance-warning/zero-error-tolerance-warning.component"; +import { HighchartsChartModule } from "highcharts-angular"; +import { LabelChartComponent } from "./label-chart/label-chart.component"; +import { AnalyzeChartsComponent } from "./analyze-charts/analyze-charts.component"; +import { ReactiveFormsModule } from "@angular/forms"; +import { LabelHealthComponent } from "./request-stats/label-health/label-health.component"; +import { LabelTrendComponent } from "./label-trend/label-trend.component"; +import { StatsCompareComponent } from "./stats-compare/stats-compare.component"; +import { AddMetricComponent } from "./analyze-charts/add-metric/add-metric.component"; +import { ShareComponent } from "./share/share.component"; +import { DeleteShareLinkComponent } from "./share/delete-share-link/delete-share-link.component"; +import { CreateNewShareLinkComponent } from "./share/create-new-share-link/create-new-share-link.component"; +import { MonitoringStatsComponent } from "./monitoring-stats/monitoring-stats.component"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; const routes: Routes = [ { - path: 'project/:projectName/scenario/:scenarioName/item/:id', component: ItemDetailComponent, - runGuardsAndResolvers: 'always', canActivate: [AuthGuard], + path: "project/:projectName/scenario/:scenarioName/item/:id", component: ItemDetailComponent, + runGuardsAndResolvers: "always", canActivate: [AuthGuard], }]; diff --git a/src/app/item-detail/label-chart/label-chart.component.spec.ts b/src/app/item-detail/label-chart/label-chart.component.spec.ts index b12dd4bf..71542d0e 100644 --- a/src/app/item-detail/label-chart/label-chart.component.spec.ts +++ b/src/app/item-detail/label-chart/label-chart.component.spec.ts @@ -1,9 +1,9 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { HighchartsChartModule } from 'highcharts-angular'; -import { LabelChartComponent } from './label-chart.component'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { HighchartsChartModule } from "highcharts-angular"; +import { LabelChartComponent } from "./label-chart.component"; -describe('LabelChartComponent', () => { +describe("LabelChartComponent", () => { let component: LabelChartComponent; let fixture: ComponentFixture; @@ -21,11 +21,11 @@ describe('LabelChartComponent', () => { fixture = TestBed.createComponent(LabelChartComponent); component = fixture.componentInstance; component.labels = new Map([ - ['Throughput', {}]]); + ["Throughput", {}]]); fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/label-chart/label-chart.component.ts b/src/app/item-detail/label-chart/label-chart.component.ts index 538d753a..5fbaed04 100644 --- a/src/app/item-detail/label-chart/label-chart.component.ts +++ b/src/app/item-detail/label-chart/label-chart.component.ts @@ -1,30 +1,28 @@ -import { Component, Input, OnInit } from '@angular/core'; -import * as Highcharts from 'highcharts'; -import { commonGraphSettings } from 'src/app/graphs/item-detail'; -import * as deepmerge from 'deepmerge'; +import { Component, Input, OnInit } from "@angular/core"; +import * as Highcharts from "highcharts"; +import { commonGraphSettings } from "src/app/graphs/item-detail"; +import * as deepmerge from "deepmerge"; @Component({ - selector: 'app-label-chart', - templateUrl: './label-chart.component.html', - styleUrls: ['./label-chart.component.css', '../item-detail.component.scss'] + selector: "app-label-chart", + templateUrl: "./label-chart.component.html", + styleUrls: ["./label-chart.component.css", "../item-detail.component.scss"] }) export class LabelChartComponent implements OnInit { @Input() labels: Map; Highcharts: typeof Highcharts = Highcharts; - chartConstructor = 'chart'; - labelChartMetric = 'Throughput'; + chartConstructor = "chart"; + labelChartMetric = "Throughput"; labelCompareChartMetric; - labelChartOptions = commonGraphSettings('hits/s'); + labelChartOptions = commonGraphSettings("hits/s"); updateLabelChartFlag = false; chartKeys; seriesVisibilityToggle = true; - seriesVisibilityToggleText = 'Hide all'; + seriesVisibilityToggleText = "Hide all"; chartShouldExpand = false; chart; - constructor() { } - ngOnInit() { this.labelChartOptions = deepmerge(this.labels.get(this.labelChartMetric), {}); this.updateLabelChartFlag = true; @@ -45,7 +43,7 @@ export class LabelChartComponent implements OnInit { toggleSeriesVisibility() { this.labelChartOptions.series.map(_ => _.visible = !this.seriesVisibilityToggle); - this.seriesVisibilityToggleText = this.seriesVisibilityToggle ? 'Show all' : 'Hide all'; + this.seriesVisibilityToggleText = this.seriesVisibilityToggle ? "Show all" : "Hide all"; this.seriesVisibilityToggle = !this.seriesVisibilityToggle; this.updateLabelChartFlag = true; } diff --git a/src/app/item-detail/label-trend/label-trend.component.spec.ts b/src/app/item-detail/label-trend/label-trend.component.spec.ts index 1c504798..c6642db3 100644 --- a/src/app/item-detail/label-trend/label-trend.component.spec.ts +++ b/src/app/item-detail/label-trend/label-trend.component.spec.ts @@ -1,11 +1,11 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { HighchartsChartModule } from 'highcharts-angular'; -import { LabelTrendComponent } from '../label-trend/label-trend.component'; +import { HttpClientModule } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { HighchartsChartModule } from "highcharts-angular"; +import { LabelTrendComponent } from "../label-trend/label-trend.component"; -describe('RequestStatsCompareComponent', () => { +describe("RequestStatsCompareComponent", () => { let component: LabelTrendComponent; let fixture: ComponentFixture; @@ -29,7 +29,7 @@ describe('RequestStatsCompareComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/label-trend/label-trend.component.ts b/src/app/item-detail/label-trend/label-trend.component.ts index 2922b3aa..bf151fef 100644 --- a/src/app/item-detail/label-trend/label-trend.component.ts +++ b/src/app/item-detail/label-trend/label-trend.component.ts @@ -1,22 +1,22 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { labelTrendChartOptions, emptyChart } from 'src/app/graphs/label-trend'; -import { LabelApiService } from 'src/app/label-api.service'; -import * as Highcharts from 'highcharts'; -import { ItemParams } from 'src/app/scenario/item-controls/item-controls.model'; +import { Component, OnInit, Input } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { labelTrendChartOptions, emptyChart } from "src/app/graphs/label-trend"; +import { LabelApiService } from "src/app/label-api.service"; +import * as Highcharts from "highcharts"; +import { ItemParams } from "src/app/scenario/item-controls/item-controls.model"; @Component({ - selector: 'app-label-trend', - templateUrl: './label-trend.component.html', - styleUrls: ['./label-trend.component.css'] + selector: "app-label-trend", + templateUrl: "./label-trend.component.html", + styleUrls: ["./label-trend.component.css"] }) -export class LabelTrendComponent implements OnInit { +export class LabelTrendComponent { @Input() params: ItemParams; Highcharts: typeof Highcharts = Highcharts; chart; - chartConstructor = 'chart'; + chartConstructor = "chart"; chartCallback; updateFlag = false; labelChartOption; @@ -29,18 +29,15 @@ export class LabelTrendComponent implements OnInit { private labelApiService: LabelApiService, ) { + // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; this.chartCallback = chart => { self.chart = chart; }; } - ngOnInit() { - } - open(content) { - // @ts-ignore - this.modalService.open(content, { size: 'xl' }).result + this.modalService.open(content, { size: "xl" }).result .then((_) => { this.labelChartOption = null; }, () => { this.labelChartOption = null; }); this.fetchTrendData(); diff --git a/src/app/item-detail/metrics.ts b/src/app/item-detail/metrics.ts index 16dede5d..bf69392d 100644 --- a/src/app/item-detail/metrics.ts +++ b/src/app/item-detail/metrics.ts @@ -1,12 +1,12 @@ export enum Metrics { - Network = 'Network', - ErrorRate = 'Error Rate', - Threads = 'Threads', - Throughput = 'Throughput', - ResponseTimeAvg = 'Response Time [avg]', - ResponseTimeMin = 'Response Time [min]', - ResponseTimeMax = 'Response Time [max]', - ResponseTimeP90 = 'Response Time [P90]', - ResponseTimeP95 = 'Response Time [P95]', - ResponseTimeP99 = 'Response Time [P99]', + Network = "Network", + ErrorRate = "Error Rate", + Threads = "Threads", + Throughput = "Throughput", + ResponseTimeAvg = "Response Time [avg]", + ResponseTimeMin = "Response Time [min]", + ResponseTimeMax = "Response Time [max]", + ResponseTimeP90 = "Response Time [P90]", + ResponseTimeP95 = "Response Time [P95]", + ResponseTimeP99 = "Response Time [P99]", } diff --git a/src/app/item-detail/monitoring-stats/monitoring-stats.component.ts b/src/app/item-detail/monitoring-stats/monitoring-stats.component.ts index df39abfb..857f85b1 100644 --- a/src/app/item-detail/monitoring-stats/monitoring-stats.component.ts +++ b/src/app/item-detail/monitoring-stats/monitoring-stats.component.ts @@ -1,19 +1,19 @@ -import { Component, OnInit, Input, } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import * as Highcharts from 'highcharts'; -import { monitoringGraphSettings } from 'src/app/graphs/monitoring'; -import { from } from 'rxjs'; +import { Component, OnInit, Input, } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import * as Highcharts from "highcharts"; +import { monitoringGraphSettings } from "src/app/graphs/monitoring"; +import { from } from "rxjs"; @Component({ - selector: 'app-monitoring-stats', - templateUrl: './monitoring-stats.component.html', - styleUrls: ['./monitoring-stats.component.css'] + selector: "app-monitoring-stats", + templateUrl: "./monitoring-stats.component.html", + styleUrls: ["./monitoring-stats.component.css"] }) -export class MonitoringStatsComponent implements OnInit { +export class MonitoringStatsComponent { Highcharts: typeof Highcharts = Highcharts; monitoringChartOptions; - chartConstructor = 'chart'; + chartConstructor = "chart"; chartCallback; updateFlag = false; chart; @@ -28,12 +28,9 @@ export class MonitoringStatsComponent implements OnInit { @Input() data: [{ name: string, timestamp: Date, avgCpu: number, avgMem: number }]; - ngOnInit() { - } - open(content) { - this.modalService.open(content, { size: 'xl' }).result + this.modalService.open(content, { size: "xl" }).result .then((_) => { this.monitoringChartOptions = null; }, () => { this.monitoringChartOptions = null; }); const workers = Array.from(new Set(this.data.map(data => data.name))); @@ -45,7 +42,7 @@ export class MonitoringStatsComponent implements OnInit { acc.name = current.name; return acc; }, { data: { cpu: [], mem: [] }, name: null })) - .map((worker) => [{ data: worker.data.cpu, name: worker.name + ' - cpu' }, { data: worker.data.mem, name: worker.name + ' - mem' }]) + .map((worker) => [{ data: worker.data.cpu, name: worker.name + " - cpu" }, { data: worker.data.mem, name: worker.name + " - mem" }]) .flat(); from(new Promise(resolve => setTimeout(resolve, 50))).subscribe((val: any) => { diff --git a/src/app/item-detail/performance-analysis/performance-analysis.component.spec.ts b/src/app/item-detail/performance-analysis/performance-analysis.component.spec.ts index b52869c5..4aa99558 100644 --- a/src/app/item-detail/performance-analysis/performance-analysis.component.spec.ts +++ b/src/app/item-detail/performance-analysis/performance-analysis.component.spec.ts @@ -1,10 +1,10 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; -import { PerformanceAnalysisComponent } from './performance-analysis.component'; -import {DataTableModule} from '@pascalhonegger/ng-datatable'; +import { PerformanceAnalysisComponent } from "./performance-analysis.component"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; -describe('PerformanceAnalysisComponent', () => { +describe("PerformanceAnalysisComponent", () => { let component: PerformanceAnalysisComponent; let fixture: ComponentFixture; @@ -23,7 +23,7 @@ describe('PerformanceAnalysisComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/performance-analysis/performance-analysis.component.ts b/src/app/item-detail/performance-analysis/performance-analysis.component.ts index b6ccce8d..473d7636 100644 --- a/src/app/item-detail/performance-analysis/performance-analysis.component.ts +++ b/src/app/item-detail/performance-analysis/performance-analysis.component.ts @@ -1,17 +1,17 @@ -import {Component, EventEmitter, Inject, Input, OnInit, Output} from '@angular/core'; -import {animate, state, style, transition, trigger} from '@angular/animations'; -import {Metrics} from '../metrics'; -import {AnalyzeChartService} from '../../analyze-chart.service'; +import { Component, EventEmitter, Inject, Input, OnInit, Output } from "@angular/core"; +import { animate, state, style, transition, trigger } from "@angular/animations"; +import { Metrics } from "../metrics"; +import { AnalyzeChartService } from "../../analyze-chart.service"; @Component({ - selector: 'app-performance-analysis', - templateUrl: './performance-analysis.component.html', - styleUrls: ['./performance-analysis.component.css', '../item-detail.component.scss'], + selector: "app-performance-analysis", + templateUrl: "./performance-analysis.component.html", + styleUrls: ["./performance-analysis.component.css", "../item-detail.component.scss"], animations: [ - trigger('panelState', [ - state('closed', style({ height: 0, overflow: 'hidden' })), - state('open', style({ height: '*' })), - transition('closed <=> open', animate('300ms ease-in-out')), + trigger("panelState", [ + state("closed", style({ height: 0, overflow: "hidden" })), + state("open", style({ height: "*" })), + transition("closed <=> open", animate("300ms ease-in-out")), ]), ], }) @@ -19,7 +19,7 @@ export class PerformanceAnalysisComponent implements OnInit { @Input() itemData; @Input() labelsChartLines; - @Output() overallChartChange = new EventEmitter<{}>(); + @Output() overallChartChange = new EventEmitter<{ element, perfAnalysis}>(); perfAnalysis = { @@ -40,8 +40,8 @@ export class PerformanceAnalysisComponent implements OnInit { bandValues: null, } }; - folded = 'closed'; - foldedBottom = 'closed'; + folded = "closed"; + foldedBottom = "closed"; Math: any; constructor(private analyzeChartService: AnalyzeChartService) { @@ -133,23 +133,23 @@ export class PerformanceAnalysisComponent implements OnInit { } toggleFoldRT(element) { - if (this.folded === 'open') { - this.folded = 'closed'; - element.textContent = 'Show more'; + if (this.folded === "open") { + this.folded = "closed"; + element.textContent = "Show more"; return; } - this.folded = 'open'; - element.textContent = 'Show less'; + this.folded = "open"; + element.textContent = "Show less"; } toggleFoldBottom(element) { - if (this.foldedBottom === 'open') { - this.foldedBottom = 'closed'; - element.textContent = 'Show more'; + if (this.foldedBottom === "open") { + this.foldedBottom = "closed"; + element.textContent = "Show more"; return; } - this.foldedBottom = 'open'; - element.textContent = 'Show less'; + this.foldedBottom = "open"; + element.textContent = "Show less"; } toggleThroughputBand(element) { @@ -161,7 +161,7 @@ export class PerformanceAnalysisComponent implements OnInit { this.showLabelInChart([Metrics.ResponseTimeAvg, Metrics.ResponseTimeMin], label); const el = document.getElementById(anchorElement); setTimeout(() => { - el.scrollIntoView({behavior: 'smooth'}); + el.scrollIntoView({ behavior: "smooth" }); }); } @@ -169,7 +169,7 @@ export class PerformanceAnalysisComponent implements OnInit { this.showLabelInChart([Metrics.ResponseTimeAvg, Metrics.ResponseTimeP99], label); const el = document.getElementById(anchorElement); setTimeout(() => { - el.scrollIntoView({behavior: 'smooth'}); + el.scrollIntoView({ behavior: "smooth" }); }); } diff --git a/src/app/item-detail/request-stats/label-health/label-health.component.spec.ts b/src/app/item-detail/request-stats/label-health/label-health.component.spec.ts index 9d7ddd41..156e8ccc 100644 --- a/src/app/item-detail/request-stats/label-health/label-health.component.spec.ts +++ b/src/app/item-detail/request-stats/label-health/label-health.component.spec.ts @@ -1,9 +1,9 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import {DataTableModule} from '@pascalhonegger/ng-datatable'; -import { HighchartsChartModule } from 'highcharts-angular'; -import { LabelHealthComponent } from './label-health.component'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; +import { HighchartsChartModule } from "highcharts-angular"; +import { LabelHealthComponent } from "./label-health.component"; -describe('LabelHealthComponent', () => { +describe("LabelHealthComponent", () => { let component: LabelHealthComponent; let fixture: ComponentFixture; @@ -21,7 +21,7 @@ describe('LabelHealthComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/request-stats/label-health/label-health.component.ts b/src/app/item-detail/request-stats/label-health/label-health.component.ts index 9d683590..2458c344 100644 --- a/src/app/item-detail/request-stats/label-health/label-health.component.ts +++ b/src/app/item-detail/request-stats/label-health/label-health.component.ts @@ -1,14 +1,14 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import * as Highcharts from 'highcharts'; -import { statusCodesChart } from 'src/app/graphs/status-codes'; -import Tree from 'highcharts/modules/treemap'; +import { Component, Input, OnInit } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import * as Highcharts from "highcharts"; +import { statusCodesChart } from "src/app/graphs/status-codes"; +import Tree from "highcharts/modules/treemap"; Tree(Highcharts); @Component({ - selector: 'app-label-health', - templateUrl: './label-health.component.html', - styleUrls: ['./label-health.component.css'] + selector: "app-label-health", + templateUrl: "./label-health.component.html", + styleUrls: ["./label-health.component.css"] }) export class LabelHealthComponent implements OnInit { @@ -19,7 +19,7 @@ export class LabelHealthComponent implements OnInit { Highcharts: typeof Highcharts = Highcharts; labelChartOption; updateFlag = false; - chartConstructor = 'chart'; + chartConstructor = "chart"; showBelowPrecisionWarning = false; chartCallback: Highcharts.ChartCallbackFunction = function (chart): void { setTimeout(() => { @@ -37,8 +37,7 @@ export class LabelHealthComponent implements OnInit { } open(content) { - // @ts-ignore - this.modalService.open(content, { size: 'xl' }); + this.modalService.open(content, { size: "xl" }); this.labelChartOption = statusCodesChart(this.statusCodes); this.updateFlag = true; diff --git a/src/app/item-detail/request-stats/request-stats-compare.component.spec.ts b/src/app/item-detail/request-stats/request-stats-compare.component.spec.ts index 7b758e9c..e72f2117 100644 --- a/src/app/item-detail/request-stats/request-stats-compare.component.spec.ts +++ b/src/app/item-detail/request-stats/request-stats-compare.component.spec.ts @@ -1,17 +1,17 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import {DataTableModule} from '@pascalhonegger/ng-datatable'; -import { HighchartsChartModule } from 'highcharts-angular'; -import { ToastrModule } from 'ngx-toastr'; -import { LabelTrendComponent } from '../label-trend/label-trend.component'; -import { StatsCompareComponent } from '../stats-compare/stats-compare.component'; -import { LabelHealthComponent } from './label-health/label-health.component'; +import { HttpClientModule } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { RouterTestingModule } from "@angular/router/testing"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; +import { HighchartsChartModule } from "highcharts-angular"; +import { ToastrModule } from "ngx-toastr"; +import { LabelTrendComponent } from "../label-trend/label-trend.component"; +import { StatsCompareComponent } from "../stats-compare/stats-compare.component"; +import { LabelHealthComponent } from "./label-health/label-health.component"; -import { RequestStatsCompareComponent } from './request-stats-compare.component'; +import { RequestStatsCompareComponent } from "./request-stats-compare.component"; -describe('RequestStatsCompareComponent', () => { +describe("RequestStatsCompareComponent", () => { let component: RequestStatsCompareComponent; let fixture: ComponentFixture; @@ -47,7 +47,7 @@ describe('RequestStatsCompareComponent', () => { avgResponseTime: 10, bytes: 758, errorRate: 0, - label: '02 - Click_Log_In-22', + label: "02 - Click_Log_In-22", maxResponseTime: 38, minResponseTime: 8, n0: 33, @@ -56,7 +56,7 @@ describe('RequestStatsCompareComponent', () => { samples: 200, throughput: 0.17, responseMessageFailures: [ - { responseMessage: 'error', count: 1 } + { responseMessage: "error", count: 1 } ], statusCodes: [{ statusCode: 200, count: 1 @@ -65,7 +65,7 @@ describe('RequestStatsCompareComponent', () => { avgResponseTime: 10, bytes: 758, errorRate: 0, - label: '02 - Click_Log_In-21', + label: "02 - Click_Log_In-21", maxResponseTime: 38, minResponseTime: 8, n0: 33, @@ -74,7 +74,7 @@ describe('RequestStatsCompareComponent', () => { samples: 200, throughput: 0.17, responseMessageFailures: [ - { responseMessage: 'error', count: 1 } + { responseMessage: "error", count: 1 } ], statusCodes: [{ statusCode: 200, count: 1 @@ -84,7 +84,7 @@ describe('RequestStatsCompareComponent', () => { avgResponseTime: 10, bytes: 758, errorRate: 0, - label: '03 - Click_Log_In-20', + label: "03 - Click_Log_In-20", maxResponseTime: 38, minResponseTime: 8, n0: 33, @@ -93,7 +93,7 @@ describe('RequestStatsCompareComponent', () => { samples: 200, throughput: 0.17, responseMessageFailures: [ - { responseMessage: 'error', count: 1 } + { responseMessage: "error", count: 1 } ], statusCodes: [{ statusCode: 200, count: 1 @@ -103,19 +103,19 @@ describe('RequestStatsCompareComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); - it('should call resetStatsData when itemToCompare triggered', () => { - const spy = spyOn(component, 'resetStatsData').and.callThrough(); + it("should call resetStatsData when itemToCompare triggered", () => { + const spy = spyOn(component, "resetStatsData").and.callThrough(); component.itemToCompare({ maxVu: 100, - id: '123-123', + id: "123-123", statistics: [{ avgResponseTime: 109, bytes: 7587, errorRate: 0, - label: '02 - Click_Log_In-22', + label: "02 - Click_Log_In-22", maxResponseTime: 380, minResponseTime: 81, n0: 330, @@ -127,21 +127,21 @@ describe('RequestStatsCompareComponent', () => { }); expect(spy).toHaveBeenCalled(); }); - describe('label search', () => { - it('should search fulltext', () => { - component.search('02'); + describe("label search", () => { + it("should search fulltext", () => { + component.search("02"); expect(component.labelsData.length).toBe(2); }); - it('should correctly filter out labels if NOT keyword used', () => { - component.search('not "02 - Click_Log_In-22"'); + it("should correctly filter out labels if NOT keyword used", () => { + component.search("not \"02 - Click_Log_In-22\""); expect(component.labelsData.map(x => x.label)) - .toEqual(['02 - Click_Log_In-21', '03 - Click_Log_In-20']); + .toEqual(["02 - Click_Log_In-21", "03 - Click_Log_In-20"]); }); - it('should correctly filter out if OR keyword used', () => { - component.search('"02 - Click_Log_In-22" or "03 - Click_Log_In-20"'); + it("should correctly filter out if OR keyword used", () => { + component.search("\"02 - Click_Log_In-22\" or \"03 - Click_Log_In-20\""); expect(component.labelsData.length).toBe(2); expect(component.labelsData.map(x => x.label)) - .toEqual(['02 - Click_Log_In-22', '03 - Click_Log_In-20']); + .toEqual(["02 - Click_Log_In-22", "03 - Click_Log_In-20"]); }); }); diff --git a/src/app/item-detail/request-stats/request-stats-compare.component.ts b/src/app/item-detail/request-stats/request-stats-compare.component.ts index 29a6e54d..4727e27b 100644 --- a/src/app/item-detail/request-stats/request-stats-compare.component.ts +++ b/src/app/item-detail/request-stats/request-stats-compare.component.ts @@ -1,17 +1,17 @@ -import { Component, Input, OnInit, OnDestroy } from '@angular/core'; -import { ItemParams } from 'src/app/scenario/item-controls/item-controls.model'; -import { bytesToMbps, roundNumberTwoDecimals } from '../calculations'; -import { AnalyzeChartService } from '../../analyze-chart.service'; -import { ItemsApiService } from 'src/app/items-api.service'; -import { ToastrService } from 'ngx-toastr'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { Component, Input, OnInit, OnDestroy } from "@angular/core"; +import { ItemParams } from "src/app/scenario/item-controls/item-controls.model"; +import { bytesToMbps, roundNumberTwoDecimals } from "../calculations"; +import { AnalyzeChartService } from "../../analyze-chart.service"; +import { ItemsApiService } from "src/app/items-api.service"; +import { ToastrService } from "ngx-toastr"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; @Component({ - selector: 'app-request-stats-compare', - templateUrl: './request-stats-compare.component.html', - styleUrls: ['./request-stats-compare.component.css', '../item-detail.component.scss'] + selector: "app-request-stats-compare", + templateUrl: "./request-stats-compare.component.html", + styleUrls: ["./request-stats-compare.component.css", "../item-detail.component.scss"] }) export class RequestStatsCompareComponent implements OnInit, OnDestroy { @@ -26,7 +26,7 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { comparisonWarning = []; comparedMetadata; comparisonMs = true; - externalSearchTerm = ''; + externalSearchTerm = ""; constructor( private itemsService: ItemsApiService, @@ -64,14 +64,14 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { let orTerms = []; if (terms && terms.length > 0) { - if (terms[0] === 'not' && terms.length > 1) { + if (terms[0] === "not" && terms.length > 1) { notTerm = terms[1]; terms.splice(0, 1); } - if (terms.includes('or')) { + if (terms.includes("or")) { orTerms = terms.map((term, index, arr) => { - if (term.toLowerCase() === 'or') { + if (term.toLowerCase() === "or") { return this.trimTerm(arr[index + 1]); } else if (index === 0) { return this.trimTerm(term); @@ -106,7 +106,7 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { clearSearch() { const dataToFilter = this.comparedData || this.itemData.statistics; this.labelsData = dataToFilter; - this.externalSearchTerm = ''; + this.externalSearchTerm = ""; } itemToCompare(data) { @@ -125,7 +125,6 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { avgResponseTime: (_.avgResponseTime - labelToBeCompared.avgResponseTime), minResponseTime: (_.minResponseTime - labelToBeCompared.minResponseTime), maxResponseTime: (_.maxResponseTime - labelToBeCompared.maxResponseTime), - // @ts-ignore bytes: ((_.bytes - labelToBeCompared.bytes) / 1024).toFixed(2), n0: (_.n0 - labelToBeCompared.n0), n5: (_.n5 - labelToBeCompared.n5), @@ -150,7 +149,7 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { } }); if (data.environment !== this.itemData.environment) { - this.comparisonWarning.push('Environments do differ'); + this.comparisonWarning.push("Environments do differ"); } this.comparedData = this.comparedDataMs; this.labelsData = this.comparedData; @@ -173,12 +172,12 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { } showComparisonWarnings() { - this.toastr.warning(this.comparisonWarning.join('
'), 'Comparison Warning!', + this.toastr.warning(this.comparisonWarning.join("
"), "Comparison Warning!", { closeButton: true, enableHtml: true, timeOut: 15000, - positionClass: 'toast-bottom-right' + positionClass: "toast-bottom-right" }); this.comparisonWarning = []; } @@ -197,7 +196,6 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { avgResponseTime: this.calculatePercDifference(_.avgResponseTime, labelToBeCompared.avgResponseTime), minResponseTime: this.calculatePercDifference(_.minResponseTime, labelToBeCompared.minResponseTime), maxResponseTime: this.calculatePercDifference(_.maxResponseTime, labelToBeCompared.maxResponseTime), - // @ts-ignore bytes: this.calculatePercDifference(_.bytes, labelToBeCompared.bytes) / 1024, n0: this.calculatePercDifference(_.n0, labelToBeCompared.n0), n5: this.calculatePercDifference(_.n5, labelToBeCompared.n5), @@ -243,15 +241,15 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { } return term .trim() - .replace(/^"+|"+$/g, '') + .replace(/^"+|"+$/g, "") .toLowerCase(); } getUnit() { if (this.comparisonMs) { - return 'ms'; + return "ms"; } - return '%'; + return "%"; } focusLabel(label: string) { @@ -259,6 +257,6 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy { } openSearchHelp(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } } diff --git a/src/app/item-detail/share/create-new-share-link/create-new-share-link.component.spec.ts b/src/app/item-detail/share/create-new-share-link/create-new-share-link.component.spec.ts index d40b3ab0..d159dcb3 100644 --- a/src/app/item-detail/share/create-new-share-link/create-new-share-link.component.spec.ts +++ b/src/app/item-detail/share/create-new-share-link/create-new-share-link.component.spec.ts @@ -1,10 +1,10 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { HttpClientModule } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule, FormsModule } from "@angular/forms"; -import { CreateNewShareLinkComponent } from './create-new-share-link.component'; +import { CreateNewShareLinkComponent } from "./create-new-share-link.component"; -describe('CreateNewShareLinkComponent', () => { +describe("CreateNewShareLinkComponent", () => { let component: CreateNewShareLinkComponent; let fixture: ComponentFixture; @@ -26,7 +26,7 @@ describe('CreateNewShareLinkComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/share/create-new-share-link/create-new-share-link.component.ts b/src/app/item-detail/share/create-new-share-link/create-new-share-link.component.ts index adbf4647..b4c03e61 100644 --- a/src/app/item-detail/share/create-new-share-link/create-new-share-link.component.ts +++ b/src/app/item-detail/share/create-new-share-link/create-new-share-link.component.ts @@ -1,18 +1,18 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { FormControl, Validators, FormGroup } from '@angular/forms'; -import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { of } from 'rxjs'; -import { catchError } from 'rxjs/internal/operators/catchError'; -import { ItemsApiService } from 'src/app/items-api.service'; -import { ItemsService } from 'src/app/items.service'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ItemParams } from 'src/app/scenario/item-controls/item-controls.model'; +import { Component, Input, OnInit } from "@angular/core"; +import { FormControl, Validators, FormGroup } from "@angular/forms"; +import { NgbActiveModal, NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { of } from "rxjs"; +import { catchError } from "rxjs/internal/operators/catchError"; +import { ItemsApiService } from "src/app/items-api.service"; +import { ItemsService } from "src/app/items.service"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ItemParams } from "src/app/scenario/item-controls/item-controls.model"; @Component({ - selector: 'app-create-new-share-link', - templateUrl: './create-new-share-link.component.html', - styleUrls: ['./create-new-share-link.component.css'] + selector: "app-create-new-share-link", + templateUrl: "./create-new-share-link.component.html", + styleUrls: ["./create-new-share-link.component.css"] }) export class CreateNewShareLinkComponent implements OnInit { @@ -34,11 +34,11 @@ export class CreateNewShareLinkComponent implements OnInit { } open(content) { - this.modal = this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modal = this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } createFormControls() { - this.note = new FormControl('', [ + this.note = new FormControl("", [ Validators.maxLength(100), Validators.required ]); @@ -52,7 +52,7 @@ export class CreateNewShareLinkComponent implements OnInit { onSubmit() { const { note } = this.newShareLinkForm.value; - const { projectName, scenarioName, id } = this.params; + const { projectName, scenarioName, id } = this.params; this.itemApiService.createItemShareToken(projectName, scenarioName, id, { note }) .pipe(catchError(r => of(r))) diff --git a/src/app/item-detail/share/delete-share-link/delete-share-link.component.spec.ts b/src/app/item-detail/share/delete-share-link/delete-share-link.component.spec.ts index b355e48a..99caec22 100644 --- a/src/app/item-detail/share/delete-share-link/delete-share-link.component.spec.ts +++ b/src/app/item-detail/share/delete-share-link/delete-share-link.component.spec.ts @@ -1,10 +1,10 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { HttpClientModule } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule, FormsModule } from "@angular/forms"; -import { DeleteShareLinkComponent } from './delete-share-link.component'; +import { DeleteShareLinkComponent } from "./delete-share-link.component"; -describe('DeleteShareLinkComponent', () => { +describe("DeleteShareLinkComponent", () => { let component: DeleteShareLinkComponent; let fixture: ComponentFixture; @@ -26,7 +26,7 @@ describe('DeleteShareLinkComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/share/delete-share-link/delete-share-link.component.ts b/src/app/item-detail/share/delete-share-link/delete-share-link.component.ts index 65646433..56a848c6 100644 --- a/src/app/item-detail/share/delete-share-link/delete-share-link.component.ts +++ b/src/app/item-detail/share/delete-share-link/delete-share-link.component.ts @@ -1,17 +1,17 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { FormControl, Validators, FormGroup } from '@angular/forms'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; -import { ItemsApiService } from 'src/app/items-api.service'; -import { ItemsService } from 'src/app/items.service'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ItemParams } from 'src/app/scenario/item-controls/item-controls.model'; +import { Component, Input, OnInit } from "@angular/core"; +import { FormControl, Validators, FormGroup } from "@angular/forms"; +import { NgbModal, NgbModalRef } from "@ng-bootstrap/ng-bootstrap"; +import { of } from "rxjs"; +import { catchError } from "rxjs/operators"; +import { ItemsApiService } from "src/app/items-api.service"; +import { ItemsService } from "src/app/items.service"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ItemParams } from "src/app/scenario/item-controls/item-controls.model"; @Component({ - selector: 'app-delete-share-link', - templateUrl: './delete-share-link.component.html', - styleUrls: ['./delete-share-link.component.css'] + selector: "app-delete-share-link", + templateUrl: "./delete-share-link.component.html", + styleUrls: ["./delete-share-link.component.css"] }) export class DeleteShareLinkComponent implements OnInit { deleteCheck: FormControl; @@ -34,7 +34,7 @@ export class DeleteShareLinkComponent implements OnInit { } createFormControls() { - this.deleteCheck = new FormControl('', [ + this.deleteCheck = new FormControl("", [ Validators.required, Validators.minLength(5) ]); @@ -47,7 +47,7 @@ export class DeleteShareLinkComponent implements OnInit { } open(content) { - this.modal = this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modal = this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/item-detail/share/share.component.spec.ts b/src/app/item-detail/share/share.component.spec.ts index 989ae563..95b04164 100644 --- a/src/app/item-detail/share/share.component.spec.ts +++ b/src/app/item-detail/share/share.component.spec.ts @@ -1,15 +1,15 @@ -import { HTTP_INTERCEPTORS } from '@angular/common/http'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; -import {DataTableModule} from '@pascalhonegger/ng-datatable'; -import { HttpRequestInterceptorMock } from 'src/app/_interceptors/mock-interceptior'; -import { CreateNewShareLinkComponent } from './create-new-share-link/create-new-share-link.component'; -import { DeleteShareLinkComponent } from './delete-share-link/delete-share-link.component'; - -import { ShareComponent } from './share.component'; - -describe('ShareComponent', () => { +import { HTTP_INTERCEPTORS } from "@angular/common/http"; +import { HttpClientTestingModule } from "@angular/common/http/testing"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule, FormsModule } from "@angular/forms"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; +import { HttpRequestInterceptorMock } from "src/app/_interceptors/mock-interceptior"; +import { CreateNewShareLinkComponent } from "./create-new-share-link/create-new-share-link.component"; +import { DeleteShareLinkComponent } from "./delete-share-link/delete-share-link.component"; + +import { ShareComponent } from "./share.component"; + +describe("ShareComponent", () => { let component: ShareComponent; let fixture: ComponentFixture; @@ -37,11 +37,11 @@ describe('ShareComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(ShareComponent); component = fixture.componentInstance; - component.params = { projectName: 'test-project', scenarioName: 'test-scenario', 'id': 'test-item'}; + component.params = { projectName: "test-project", scenarioName: "test-scenario", "id": "test-item" }; fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/share/share.component.ts b/src/app/item-detail/share/share.component.ts index f21bd6a9..3eab939b 100644 --- a/src/app/item-detail/share/share.component.ts +++ b/src/app/item-detail/share/share.component.ts @@ -1,15 +1,15 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; -import { Router } from '@angular/router'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { Observable } from 'rxjs'; -import { ItemsService } from 'src/app/items.service'; -import { ItemParams } from 'src/app/scenario/item-controls/item-controls.model'; +import { Component, Input, OnInit } from "@angular/core"; +import { FormGroup } from "@angular/forms"; +import { Router } from "@angular/router"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { Observable } from "rxjs"; +import { ItemsService } from "src/app/items.service"; +import { ItemParams } from "src/app/scenario/item-controls/item-controls.model"; @Component({ - selector: 'app-share', - templateUrl: './share.component.html', - styleUrls: ['./share.component.css'] + selector: "app-share", + templateUrl: "./share.component.html", + styleUrls: ["./share.component.css"] }) export class ShareComponent implements OnInit { @@ -38,12 +38,12 @@ export class ShareComponent implements OnInit { open(content) { this.itemService.fetchItemShareTokens(this.params.projectName, this.params.scenarioName, this.params.id); - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title', size: 'xl' as any }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title", size: "xl" as any }); } copyInputMessage(inputElement) { inputElement.select(); - document.execCommand('copy'); + document.execCommand("copy"); inputElement.setSelectionRange(0, 0); } diff --git a/src/app/item-detail/stats-compare/stats-compare.component.spec.ts b/src/app/item-detail/stats-compare/stats-compare.component.spec.ts index a135b689..36013d7d 100644 --- a/src/app/item-detail/stats-compare/stats-compare.component.spec.ts +++ b/src/app/item-detail/stats-compare/stats-compare.component.spec.ts @@ -1,15 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { StatsCompareComponent } from './stats-compare.component'; -import { BreadcrumbComponent } from 'src/app/shared/breadcrumb/breadcrumb.component'; -import { AddNewItemComponent } from 'src/app/scenario/add-new-item/add-new-item.component'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { HttpClientModule } from '@angular/common/http'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; -import {DataTableModule} from '@pascalhonegger/ng-datatable'; +import { StatsCompareComponent } from "./stats-compare.component"; +import { BreadcrumbComponent } from "src/app/shared/breadcrumb/breadcrumb.component"; +import { AddNewItemComponent } from "src/app/scenario/add-new-item/add-new-item.component"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { HttpClientModule } from "@angular/common/http"; +import { RouterTestingModule } from "@angular/router/testing"; +import { ReactiveFormsModule, FormsModule } from "@angular/forms"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; -describe('StatsCompareComponent', () => { +describe("StatsCompareComponent", () => { let component: StatsCompareComponent; let fixture: ComponentFixture; @@ -34,7 +34,7 @@ describe('StatsCompareComponent', () => { fixture.detectChanges(); }); - xit('should create', () => { + xit("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/stats-compare/stats-compare.component.ts b/src/app/item-detail/stats-compare/stats-compare.component.ts index 496ea9d4..0c563eb6 100644 --- a/src/app/item-detail/stats-compare/stats-compare.component.ts +++ b/src/app/item-detail/stats-compare/stats-compare.component.ts @@ -1,19 +1,19 @@ -import { Component, OnInit, Output, EventEmitter } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { ItemsService } from 'src/app/items.service'; -import { ActivatedRoute } from '@angular/router'; -import { Observable } from 'rxjs'; -import { Items } from 'src/app/items.service.model'; -import { ItemsApiService } from 'src/app/items-api.service'; +import { Component, OnInit, Output, EventEmitter } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { ItemsService } from "src/app/items.service"; +import { ActivatedRoute } from "@angular/router"; +import { Observable } from "rxjs"; +import { Items } from "src/app/items.service.model"; +import { ItemsApiService } from "src/app/items-api.service"; const LIMIT = 15; const OFFSET = 15; @Component({ - selector: 'app-stats-compare', - templateUrl: './stats-compare.component.html', - styleUrls: ['./stats-compare.component.css'] + selector: "app-stats-compare", + templateUrl: "./stats-compare.component.html", + styleUrls: ["./stats-compare.component.css"] }) export class StatsCompareComponent implements OnInit { @@ -23,7 +23,7 @@ export class StatsCompareComponent implements OnInit { params; selectedTestItem; - @Output() itemDetailToCompare = new EventEmitter<{}>(); + @Output() itemDetailToCompare = new EventEmitter>(); constructor( private modalService: NgbModal, @@ -37,8 +37,7 @@ export class StatsCompareComponent implements OnInit { } open(content) { - // @ts-ignore - this.modalService.open(content, { size: 'xl' }); + this.modalService.open(content, { size: "xl" }); this.route.params.subscribe(_ => { this.params = _; this.itemsService.fetchItems(this.params.projectName, this.params.scenarioName, { limit: LIMIT, offset: 0 }); diff --git a/src/app/item-detail/thresholds-alert/thresholds-alert.component.spec.ts b/src/app/item-detail/thresholds-alert/thresholds-alert.component.spec.ts index aedfb834..ed39874b 100644 --- a/src/app/item-detail/thresholds-alert/thresholds-alert.component.spec.ts +++ b/src/app/item-detail/thresholds-alert/thresholds-alert.component.spec.ts @@ -1,9 +1,9 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; -import { ThresholdsAlertComponent } from './thresholds-alert.component'; +import { ThresholdsAlertComponent } from "./thresholds-alert.component"; -describe('ThresholdAlertComponent', () => { +describe("ThresholdAlertComponent", () => { let component: ThresholdsAlertComponent; let fixture: ComponentFixture; @@ -39,7 +39,7 @@ describe('ThresholdAlertComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/thresholds-alert/thresholds-alert.component.ts b/src/app/item-detail/thresholds-alert/thresholds-alert.component.ts index ee34be63..cca6ce60 100644 --- a/src/app/item-detail/thresholds-alert/thresholds-alert.component.ts +++ b/src/app/item-detail/thresholds-alert/thresholds-alert.component.ts @@ -1,11 +1,11 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from "@angular/core"; @Component({ - selector: 'app-regression-alert', - templateUrl: './thresholds-alert.component.html', - styleUrls: ['./thresholds-alert.component.css', '../item-detail.component.scss'] + selector: "app-regression-alert", + templateUrl: "./thresholds-alert.component.html", + styleUrls: ["./thresholds-alert.component.css", "../item-detail.component.scss"] }) -export class ThresholdsAlertComponent implements OnInit { +export class ThresholdsAlertComponent { @Input() itemData; Math: any; @@ -14,7 +14,4 @@ export class ThresholdsAlertComponent implements OnInit { this.Math = Math; } - ngOnInit() { - } - } diff --git a/src/app/item-detail/zero-error-tolerance-warning/zero-error-tolerance-warning.component.spec.ts b/src/app/item-detail/zero-error-tolerance-warning/zero-error-tolerance-warning.component.spec.ts index 0ae669e4..6485fcb3 100644 --- a/src/app/item-detail/zero-error-tolerance-warning/zero-error-tolerance-warning.component.spec.ts +++ b/src/app/item-detail/zero-error-tolerance-warning/zero-error-tolerance-warning.component.spec.ts @@ -1,8 +1,8 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { ZeroErrorToleranceWarningComponent } from './zero-error-tolerance-warning.component'; +import { ZeroErrorToleranceWarningComponent } from "./zero-error-tolerance-warning.component"; -describe('ZeroErrorToleranceWarningComponent', () => { +describe("ZeroErrorToleranceWarningComponent", () => { let component: ZeroErrorToleranceWarningComponent; let fixture: ComponentFixture; @@ -19,7 +19,7 @@ describe('ZeroErrorToleranceWarningComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/item-detail/zero-error-tolerance-warning/zero-error-tolerance-warning.component.ts b/src/app/item-detail/zero-error-tolerance-warning/zero-error-tolerance-warning.component.ts index 7f7770ed..43599072 100644 --- a/src/app/item-detail/zero-error-tolerance-warning/zero-error-tolerance-warning.component.ts +++ b/src/app/item-detail/zero-error-tolerance-warning/zero-error-tolerance-warning.component.ts @@ -1,15 +1,10 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-zero-error-tolerance-warning', - templateUrl: './zero-error-tolerance-warning.component.html', - styleUrls: ['./zero-error-tolerance-warning.component.css', '../item-detail.component.scss'] + selector: "app-zero-error-tolerance-warning", + templateUrl: "./zero-error-tolerance-warning.component.html", + styleUrls: ["./zero-error-tolerance-warning.component.css", "../item-detail.component.scss"] }) -export class ZeroErrorToleranceWarningComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } +export class ZeroErrorToleranceWarningComponent { } diff --git a/src/app/items-api.service.ts b/src/app/items-api.service.ts index fa77c7f3..16b581bd 100644 --- a/src/app/items-api.service.ts +++ b/src/app/items-api.service.ts @@ -1,10 +1,10 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable, BehaviorSubject } from 'rxjs'; -import { ItemDetail, Items, UpsertItemChartSettings } from './items.service.model'; +import { Injectable } from "@angular/core"; +import { HttpClient, HttpHeaders, HttpResponse } from "@angular/common/http"; +import { Observable, BehaviorSubject } from "rxjs"; +import { ItemDetail, Items, UpsertItemChartSettings } from "./items.service.model"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class ItemsApiService { @@ -21,41 +21,41 @@ export class ItemsApiService { { params }); } - updateItemInfo(itemId, projectName, scenarioName, body): Observable<{}> { + updateItemInfo(itemId, projectName, scenarioName, body): Observable> { return this.http.put( `projects/${projectName}/scenarios/${scenarioName}/items/${itemId}`, body, - { observe: 'response' } + { observe: "response" } ); } addNewTestItem(projectName: string, scenarioName: string, environment: string = null, note, hostname, status, kpiFile, errorFile?, monitoringFile?) { const headers = new HttpHeaders(); - headers.set('Content-Type', null); - headers.set('Accept', 'multipart/form-data'); + headers.set("Content-Type", null); + headers.set("Accept", "multipart/form-data"); const formData: FormData = new FormData(); - formData.append('kpi', kpiFile); - formData.append('environment', environment); - formData.append('note', note); - formData.append('hostname', hostname); - formData.append('status', status); + formData.append("kpi", kpiFile); + formData.append("environment", environment); + formData.append("note", note); + formData.append("hostname", hostname); + formData.append("status", status); if (errorFile) { - formData.append('errors', errorFile); + formData.append("errors", errorFile); } if (monitoringFile) { - formData.append('monitoring', monitoringFile); + formData.append("monitoring", monitoringFile); } return this.http.post( `projects/${projectName}/scenarios/${scenarioName}/items`, formData, { - headers, observe: 'response' + headers, observe: "response" } ); } deleteItem(itemId, scenarioName, projectName) { - return this.http.delete(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}`, { observe: 'response' }); + return this.http.delete(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}`, { observe: "response" }); } fetchItems(projectName: string, scenarioName, params): Observable { @@ -77,18 +77,18 @@ export class ItemsApiService { createItemShareToken(projectName, scenarioName, itemId, body: { note?: string }): Observable> { return this.http.post<{ token: string }>(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/share-tokens`, body, { - observe: 'response' + observe: "response" }); } - deleteItemShareToken(projectName, scenarioName, itemId, id): Observable> { - return this.http.delete<{}>(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/share-tokens/${id}`, - { observe: 'response' }); + deleteItemShareToken(projectName, scenarioName, itemId, id): Observable>> { + return this.http.delete(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/share-tokens/${id}`, + { observe: "response" }); } upsertItemChartSettings(projectName, scenarioName, itemId, body: UpsertItemChartSettings) { return this.http.post(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/custom-chart-settings`, - body, { observe: 'response' }); + body, { observe: "response" }); } fetchItemChartSettings(projectName, scenarioName, itemId) { diff --git a/src/app/items.service.model.ts b/src/app/items.service.model.ts index 262f7954..53731093 100644 --- a/src/app/items.service.model.ts +++ b/src/app/items.service.model.ts @@ -15,9 +15,9 @@ export interface Items { } export enum ReportStatus { - InProgress = 'in_progress', - Error = 'error', - Ready = 'ready' + InProgress = "in_progress", + Error = "error", + Ready = "ready" } export interface ItemDetail { @@ -130,11 +130,11 @@ interface ResponseMessageFailure { } interface MonitoringData { - 'bytes-recv'?: string; - 'bytes-sent'?: string; - 'conn-all'?: string; + "bytes-recv"?: string; + "bytes-sent"?: string; + "conn-all"?: string; cpu?: string; - 'diskSpace'?: string; + "diskSpace"?: string; mem?: string; ts?: string; } diff --git a/src/app/items.service.ts b/src/app/items.service.ts index ff30d044..d2ae7f9f 100644 --- a/src/app/items.service.ts +++ b/src/app/items.service.ts @@ -1,10 +1,10 @@ -import { Injectable } from '@angular/core'; -import { BehaviorSubject, interval } from 'rxjs'; -import { Items } from './items.service.model'; -import { ItemsApiService } from './items-api.service'; +import { Injectable } from "@angular/core"; +import { BehaviorSubject, interval } from "rxjs"; +import { Items } from "./items.service.model"; +import { ItemsApiService } from "./items-api.service"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class ItemsService { diff --git a/src/app/label-api.service.ts b/src/app/label-api.service.ts index 94d2ab64..79dc5ac8 100644 --- a/src/app/label-api.service.ts +++ b/src/app/label-api.service.ts @@ -1,10 +1,10 @@ -import { Injectable } from '@angular/core'; -import { LabelTrend, LabelMaxVu } from './items.service.model'; -import { HttpClient } from '@angular/common/http'; +import { Injectable } from "@angular/core"; +import { LabelTrend, LabelMaxVu } from "./items.service.model"; +import { HttpClient } from "@angular/common/http"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class LabelApiService { diff --git a/src/app/login/login.component.spec.ts b/src/app/login/login.component.spec.ts index 1a572f76..73aa2b92 100644 --- a/src/app/login/login.component.spec.ts +++ b/src/app/login/login.component.spec.ts @@ -1,17 +1,17 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { LoginComponent } from './login.component'; -import { RouterModule } from '@angular/router'; -import { HttpClientModule } from '@angular/common/http'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { LoginComponent } from "./login.component"; +import { RouterModule } from "@angular/router"; +import { HttpClientModule } from "@angular/common/http"; -describe('LoginComponent', () => { +describe("LoginComponent", () => { let component: LoginComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, RouterModule.forRoot([], { relativeLinkResolution: 'legacy' }), HttpClientModule], + imports: [ReactiveFormsModule, RouterModule.forRoot([], { relativeLinkResolution: "legacy" }), HttpClientModule], declarations: [ LoginComponent ] }) .compileComponents(); @@ -23,7 +23,7 @@ describe('LoginComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 978b0cef..c46cffe7 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -1,14 +1,14 @@ -import { Component, OnInit } from '@angular/core'; -import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { AuthenticationService } from '../_services/authentication.service'; -import { first } from 'rxjs/operators'; -import { InitService } from '../_services/init.service'; +import { Component, OnInit } from "@angular/core"; +import { FormGroup, FormBuilder, Validators } from "@angular/forms"; +import { ActivatedRoute, Router } from "@angular/router"; +import { AuthenticationService } from "../_services/authentication.service"; +import { first } from "rxjs/operators"; +import { InitService } from "../_services/init.service"; @Component({ - selector: 'app-login', - templateUrl: './login.component.html', - styleUrls: ['./login.component.css'] + selector: "app-login", + templateUrl: "./login.component.html", + styleUrls: ["./login.component.css"] }) export class LoginComponent implements OnInit { loginForm: FormGroup; @@ -34,19 +34,19 @@ export class LoginComponent implements OnInit { new Promise(resolve => setTimeout(resolve, 0)).then(); this.initService.fetchInfo().subscribe((res) => { if (res.initialized === false) { - this.router.navigate(['init']); + this.router.navigate(["init"]); } this.initLoaded = true; }); this.loginForm = this.formBuilder.group({ - username: ['', Validators.required], - password: ['', [Validators.required]] + username: ["", Validators.required], + password: ["", [Validators.required]] }); // get return url from route parameters or default to '/' - this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/'; + this.returnUrl = this.route.snapshot.queryParams["returnUrl"] || "/"; } onSubmit() { diff --git a/src/app/notification/notification-messages.ts b/src/app/notification/notification-messages.ts index 067cd253..0dc05c85 100644 --- a/src/app/notification/notification-messages.ts +++ b/src/app/notification/notification-messages.ts @@ -1,85 +1,85 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class NotificationMessage { newTestItemNotificationMessage(response) { - return this.statusCodeMessage(response, 'File uploaded and processing just started'); + return this.statusCodeMessage(response, "File uploaded and processing just started"); } newProjectNotificationMessage(response) { - return this.statusCodeMessage(response, 'New project has been saved'); + return this.statusCodeMessage(response, "New project has been saved"); } newScenarionNotificationMessage(response) { - return this.statusCodeMessage(response, 'New scenario has been created'); + return this.statusCodeMessage(response, "New scenario has been created"); } deleteProjectNotification(response) { - return this.statusCodeMessage(response, 'Project has been deleted'); + return this.statusCodeMessage(response, "Project has been deleted"); } itemUpdate(response) { - return this.statusCodeMessage(response, 'Item info has been updated'); + return this.statusCodeMessage(response, "Item info has been updated"); } scenarioUpdate(response) { - return this.statusCodeMessage(response, 'Scenario has been updated'); + return this.statusCodeMessage(response, "Scenario has been updated"); } projectUpdate(response) { - return this.statusCodeMessage(response, 'Project has been updated'); + return this.statusCodeMessage(response, "Project has been updated"); } itemDeleted(response) { - return this.statusCodeMessage(response, 'Test has been deleted'); + return this.statusCodeMessage(response, "Test has been deleted"); } deleteScenario(response) { - return this.statusCodeMessage(response, 'Scenario has been deleted'); + return this.statusCodeMessage(response, "Scenario has been deleted"); } newApitokenNotificationMessage(response) { - return this.statusCodeMessage(response, 'Api token has been created'); + return this.statusCodeMessage(response, "Api token has been created"); } deleteApitokenNotificationMessage(response) { - return this.statusCodeMessage(response, 'Api token has been deleted'); + return this.statusCodeMessage(response, "Api token has been deleted"); } passwordChangeNotificationMessage(response) { - return this.statusCodeMessage(response, 'Password has been changed'); + return this.statusCodeMessage(response, "Password has been changed"); } userCreatedNotificationMessage(response) { - return this.statusCodeMessage(response, 'User has been created'); + return this.statusCodeMessage(response, "User has been created"); } userDeletedNotificationMessage(response) { - return this.statusCodeMessage(response, 'User has been deleted'); + return this.statusCodeMessage(response, "User has been deleted"); } deleteScenarioNotification(response) { - return this.statusCodeMessage(response, 'Notification has been deleted'); + return this.statusCodeMessage(response, "Notification has been deleted"); } createScenarioNotification(response) { - return this.statusCodeMessage(response, 'Notification has been created'); + return this.statusCodeMessage(response, "Notification has been created"); } createItemShareLinkNotification(response) { - return this.statusCodeMessage(response, 'Link was created'); + return this.statusCodeMessage(response, "Link was created"); } deleteItemShareTokenNotification(response) { - return this.statusCodeMessage(response, 'Link was deleted'); + return this.statusCodeMessage(response, "Link was deleted"); } scenarioThresholdUpdate(response) { - return this.statusCodeMessage(response, 'Thresholds were updated'); + return this.statusCodeMessage(response, "Thresholds were updated"); } private statusCodeMessage(response, successMessage) { @@ -90,6 +90,7 @@ export class NotificationMessage { try { message = { success: false, message: response.message }; } catch (e) { + return } } return message; diff --git a/src/app/notification/notification.component.ts b/src/app/notification/notification.component.ts index 88954ae4..1bd0eff3 100644 --- a/src/app/notification/notification.component.ts +++ b/src/app/notification/notification.component.ts @@ -1,14 +1,14 @@ -import { Component, OnInit } from '@angular/core'; -import { Subject } from 'rxjs'; -import { ItemsApiService } from '../items-api.service'; -import { ProjectApiService } from '../project-api.service'; -import { ScenarioApiService } from '../scenario-api.service'; -import { ToastrService } from 'ngx-toastr'; -import { NotificationService } from '../_services/notification.service'; +import { Component, OnInit } from "@angular/core"; +import { Subject } from "rxjs"; +import { ItemsApiService } from "../items-api.service"; +import { ProjectApiService } from "../project-api.service"; +import { ScenarioApiService } from "../scenario-api.service"; +import { ToastrService } from "ngx-toastr"; +import { NotificationService } from "../_services/notification.service"; @Component({ - selector: 'app-alert', - templateUrl: './notification.component.html', + selector: "app-alert", + templateUrl: "./notification.component.html", }) export class NotificationComponent implements OnInit { private _success = new Subject<{ success: boolean, message: string }>(); @@ -32,7 +32,7 @@ export class NotificationComponent implements OnInit { this._success.subscribe((message) => { - const options = { positionClass: 'toast-bottom-right'}; + const options = { positionClass: "toast-bottom-right" }; if (message.success === true) { this.toastr.success(message.message, null, options); } else { diff --git a/src/app/project-api.service.pact.spec.ts b/src/app/project-api.service.pact.spec.ts index 8f76877e..c7d572e0 100644 --- a/src/app/project-api.service.pact.spec.ts +++ b/src/app/project-api.service.pact.spec.ts @@ -1,17 +1,17 @@ -import { TestBed, waitForAsync } from '@angular/core/testing'; -import { ProjectApiService } from './project-api.service'; -import { PactWeb, Matchers } from '@pact-foundation/pact-web'; -import { HttpClientModule } from '@angular/common/http'; -import * as moment from 'moment'; +import { TestBed, waitForAsync } from "@angular/core/testing"; +import { ProjectApiService } from "./project-api.service"; +import { PactWeb, Matchers } from "@pact-foundation/pact-web"; +import { HttpClientModule } from "@angular/common/http"; +import * as moment from "moment"; -describe('Projects', () => { +describe("Projects", () => { let provider; beforeAll((done) => { provider = new PactWeb({ port: 1234, - host: '127.0.0.1', + host: "127.0.0.1", }); // required for slower CI environments @@ -40,32 +40,32 @@ describe('Projects', () => { provider.verify().then(done, e => done.fail(e)); }); - describe('/projects', () => { - describe('GET /projects', () => { + describe("/projects", () => { + describe("GET /projects", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is at least one existing test item', - uponReceiving: 'a request for projects', + state: "there is at least one existing test item", + uponReceiving: "a request for projects", withRequest: { - method: 'GET', - path: '/projects' + method: "GET", + path: "/projects" }, willRespondWith: { status: 200, body: Matchers.eachLike({ - id: '0d74df6b-b728-4f45-9e2c-8537cd1c1b85', + id: "0d74df6b-b728-4f45-9e2c-8537cd1c1b85", itemCount: 10, - latestRun: '2019-09-22T18:20:23.265Z', - projectName: 'test-project', + latestRun: "2019-09-22T18:20:23.265Z", + projectName: "test-project", scenarioCount: 6 }) }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should return projects', (done) => { + it("should return projects", (done) => { const projectService: ProjectApiService = TestBed.get(ProjectApiService); projectService.fetchProjects().subscribe(response => { expect(response).toEqual(jasmine.any(Array)); @@ -82,32 +82,31 @@ describe('Projects', () => { }); }); }); - describe('POST /projects', () => { + describe("POST /projects", () => { beforeAll((done) => { provider.addInteraction({ - uponReceiving: 'a request for creating projects', + uponReceiving: "a request for creating projects", withRequest: { - method: 'POST', - path: '/projects', + method: "POST", + path: "/projects", body: { projectName: Matchers.somethingLike(`project-name`) }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" }, }, willRespondWith: { status: 201, }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should be able to create new project', (done) => { + it("should be able to create new project", (done) => { const projectService: ProjectApiService = TestBed.get(ProjectApiService); - projectService.createNewProject({ projectName: 'demo-project' }).subscribe(response => { - // @ts-ignore + projectService.createNewProject({ projectName: "demo-project" }).subscribe(response => { expect(response.status).toBe(201); done(); }); @@ -115,58 +114,58 @@ describe('Projects', () => { }); }); - describe('/projects/:projectName', () => { - describe('PUT /projects/:projectName', () => { + describe("/projects/:projectName", () => { + describe("PUT /projects/:projectName", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is existing project', - uponReceiving: 'a request for updating project', + state: "there is existing project", + uponReceiving: "a request for updating project", withRequest: { - method: 'PUT', - path: '/projects/test-project', + method: "PUT", + path: "/projects/test-project", body: { projectName: Matchers.somethingLike(`project-name`) }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }, willRespondWith: { status: 204, }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should be able to update project', (done) => { + it("should be able to update project", (done) => { const projectService: ProjectApiService = TestBed.get(ProjectApiService); - projectService.updateProject('test-project', { projectName: 'test-project-1' }).subscribe(response => { + projectService.updateProject("test-project", { projectName: "test-project-1" }).subscribe(response => { expect(response.status).toEqual(204); done(); }); }); }); - describe('DELETE /project/:projectName', () => { + describe("DELETE /project/:projectName", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is existing project', - uponReceiving: 'a request for deleting project', + state: "there is existing project", + uponReceiving: "a request for deleting project", withRequest: { - method: 'DELETE', - path: '/projects/test-project', + method: "DELETE", + path: "/projects/test-project", }, willRespondWith: { status: 204, }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should be able to delete project', (done) => { + it("should be able to delete project", (done) => { const projectService: ProjectApiService = TestBed.get(ProjectApiService); - projectService.deleteProject('test-project').subscribe(response => { + projectService.deleteProject("test-project").subscribe(response => { expect(response.status).toEqual(204); done(); }); @@ -174,14 +173,14 @@ describe('Projects', () => { }); }); - describe('/projects/overall-stats', () => { + describe("/projects/overall-stats", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is at least one existing test item', - uponReceiving: 'a request for overall-stats', + state: "there is at least one existing test item", + uponReceiving: "a request for overall-stats", withRequest: { - method: 'GET', - path: '/projects/overall-stats' + method: "GET", + path: "/projects/overall-stats" }, willRespondWith: { status: 200, @@ -193,11 +192,11 @@ describe('Projects', () => { }) }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should return overall stats', (done) => { + it("should return overall stats", (done) => { const projectService: ProjectApiService = TestBed.get(ProjectApiService); projectService.fetchOverallStats().subscribe(response => { expect(response.avgDuration).toEqual(jasmine.any(Number)); @@ -210,37 +209,36 @@ describe('Projects', () => { }); - describe('/project/latest-items', () => { + describe("/project/latest-items", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is at least one existing test item', - uponReceiving: 'a request for latest items', + state: "there is at least one existing test item", + uponReceiving: "a request for latest items", withRequest: { - method: 'GET', - path: '/projects/latest-items', + method: "GET", + path: "/projects/latest-items", }, willRespondWith: { status: 200, body: Matchers.eachLike({ - environment: 'test', - id: 'b13373a3-4d27-4752-977a-2f42a2606595', - name: 'test-scenario', - projectName: 'test-project', + environment: "test", + id: "b13373a3-4d27-4752-977a-2f42a2606595", + name: "test-scenario", + projectName: "test-project", // tslint:disable-next-line:max-line-length - startTime: Matchers.term({ generate: '2019-09-22T18:20:23.265Z', matcher: '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z' }), - status: '0' + startTime: Matchers.term({ generate: "2019-09-22T18:20:23.265Z", matcher: "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z" }), + status: "0" }, { min: 1 }), headers: { - 'Content-Type': 'application/json; charset=utf-8' + "Content-Type": "application/json; charset=utf-8" } } }).then(done, e => done.fail(e)); }); - it('should return latest items', (done) => { + it("should return latest items", (done) => { const projectService: ProjectApiService = TestBed.get(ProjectApiService); projectService.fetchLatestItems().subscribe(response => { - // @ts-ignore expect(response.length).toBeGreaterThan(0); response.forEach((_) => { expect(_.environment).toEqual(jasmine.any(String)); diff --git a/src/app/project-api.service.ts b/src/app/project-api.service.ts index 7ae6b9c8..4dcd6632 100644 --- a/src/app/project-api.service.ts +++ b/src/app/project-api.service.ts @@ -1,11 +1,11 @@ -import { Injectable } from '@angular/core'; -import {HttpClient, HttpResponse} from '@angular/common/http'; -import { Observable, BehaviorSubject } from 'rxjs'; -import { ProjectsListing, NewProjectBody } from './project-api.service.model'; -import { ItemsListing, IScenarios, ProjectsOverallStats } from './items.service.model'; +import { Injectable } from "@angular/core"; +import { HttpClient, HttpResponse } from "@angular/common/http"; +import { Observable, BehaviorSubject } from "rxjs"; +import { ProjectsListing, NewProjectBody } from "./project-api.service.model"; +import { ItemsListing, IScenarios, ProjectsOverallStats } from "./items.service.model"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class ProjectApiService { @@ -20,28 +20,28 @@ export class ProjectApiService { `projects`); } - createNewProject(body: NewProjectBody): Observable<{}> { - return this.http.post('projects', body, { observe: 'response' }); + createNewProject(body: NewProjectBody): Observable> { + return this.http.post("projects", body, { observe: "response" }); } fetchLatestItems(): Observable { - return this.http.get('projects/latest-items'); + return this.http.get("projects/latest-items"); } getProject(projectName): Observable { - return this.http.get(`projects/${projectName}`, { observe: 'response' }); + return this.http.get(`projects/${projectName}`, { observe: "response" }); } deleteProject(projectName): Observable { - return this.http.delete(`projects/${projectName}`, { observe: 'response' }); + return this.http.delete(`projects/${projectName}`, { observe: "response" }); } updateProject(projectName, body): Observable> { - return this.http.put(`projects/${projectName}`, body, { observe: 'response' }); + return this.http.put(`projects/${projectName}`, body, { observe: "response" }); } fetchOverallStats(): Observable { - return this.http.get('projects/overall-stats'); + return this.http.get("projects/overall-stats"); } setData(data) { diff --git a/src/app/project.service.ts b/src/app/project.service.ts index 02411b0b..e663b8cb 100644 --- a/src/app/project.service.ts +++ b/src/app/project.service.ts @@ -1,12 +1,12 @@ -import { Injectable } from '@angular/core'; -import { ProjectApiService } from './project-api.service'; -import { BehaviorSubject, interval } from 'rxjs'; -import { ProjectsListing } from './project-api.service.model'; -import { IScenarios, Items } from './items.service.model'; -import { ScenarioApiService } from './scenario-api.service'; +import { Injectable } from "@angular/core"; +import { ProjectApiService } from "./project-api.service"; +import { BehaviorSubject, interval } from "rxjs"; +import { ProjectsListing } from "./project-api.service.model"; +import { IScenarios, Items } from "./items.service.model"; +import { ScenarioApiService } from "./scenario-api.service"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class ProjectService { diff --git a/src/app/project/graph/scenarios-graph.component.ts b/src/app/project/graph/scenarios-graph.component.ts index c65328a4..227a10a8 100644 --- a/src/app/project/graph/scenarios-graph.component.ts +++ b/src/app/project/graph/scenarios-graph.component.ts @@ -8,22 +8,22 @@ import { ViewChild, ViewEncapsulation, AfterViewInit, -} from '@angular/core'; -import { Chart } from 'chart.js'; -import { scenarioHistory } from 'src/app/graphs/scenarios'; +} from "@angular/core"; +import { Chart } from "chart.js"; +import { scenarioHistory } from "src/app/graphs/scenarios"; @Component({ - selector: 'app-scenarios-graph', - templateUrl: './scenarios-graph.component.html', - styleUrls: ['./scenarios-graph.component.css'], + selector: "app-scenarios-graph", + templateUrl: "./scenarios-graph.component.html", + styleUrls: ["./scenarios-graph.component.css"], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None }) export class ScenariosGraphComponent implements AfterViewInit, OnDestroy { @Input() graphData: any; - @ViewChild('graphCanvasRef', { static: true }) chartCanvas: ElementRef; - @HostBinding('class.chart') htmlCardClass = true; + @ViewChild("graphCanvasRef", { static: true }) chartCanvas: ElementRef; + @HostBinding("class.chart") htmlCardClass = true; private chart: Chart; @@ -60,10 +60,10 @@ export class ScenariosGraphComponent implements AfterViewInit, OnDestroy { chart.clear(); ctx.save(); - ctx.textAlign = 'center'; - ctx.textBaseline = 'middle'; - ctx.font = '20px normal \'Helvetica Nueue\''; - ctx.fillText('No data to display', width / 2, height / 2); + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + ctx.font = "20px normal 'Helvetica Nueue'"; + ctx.fillText("No data to display", width / 2, height / 2); ctx.restore(); } } diff --git a/src/app/project/new-scenario/add-new.scenario.component.ts b/src/app/project/new-scenario/add-new.scenario.component.ts index 27ac4589..f891b97f 100644 --- a/src/app/project/new-scenario/add-new.scenario.component.ts +++ b/src/app/project/new-scenario/add-new.scenario.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; -import { ProjectService } from 'src/app/project.service'; -import { ScenarioApiService } from 'src/app/scenario-api.service'; +import { Component, OnInit, Input } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormControl, FormGroup, Validators } from "@angular/forms"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { of } from "rxjs"; +import { catchError } from "rxjs/operators"; +import { ProjectService } from "src/app/project.service"; +import { ScenarioApiService } from "src/app/scenario-api.service"; @Component({ - selector: 'app-add-new-scenario', - templateUrl: './add-new-scenario.component.html', - styleUrls: ['./add-new-scenario.component.css'] + selector: "app-add-new-scenario", + templateUrl: "./add-new-scenario.component.html", + styleUrls: ["./add-new-scenario.component.css"] }) export class AddNewScenarioComponent implements OnInit { @@ -31,7 +31,7 @@ export class AddNewScenarioComponent implements OnInit { } createFormControls() { - this.scenarioName = new FormControl('', [ + this.scenarioName = new FormControl("", [ Validators.required, Validators.minLength(3), Validators.maxLength(50) @@ -45,13 +45,13 @@ export class AddNewScenarioComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { if (this.myform.valid) { const { scenarioName } = this.myform.value; - this.scenarioApiService.createNewScenario(this.projectName, {scenarioName}) + this.scenarioApiService.createNewScenario(this.projectName, { scenarioName }) .pipe(catchError(r => of(r))) .subscribe(_ => { const message = this.notification.newProjectNotificationMessage(_); diff --git a/src/app/project/project.component.model.ts b/src/app/project/project.component.model.ts index 070143de..debccb8e 100644 --- a/src/app/project/project.component.model.ts +++ b/src/app/project/project.component.model.ts @@ -1,4 +1,4 @@ export enum ViewType { - List = 'list', - Cards = 'cards', + List = "list", + Cards = "cards", } diff --git a/src/app/project/project.component.ts b/src/app/project/project.component.ts index 82c82a7c..1e280a71 100644 --- a/src/app/project/project.component.ts +++ b/src/app/project/project.component.ts @@ -1,20 +1,20 @@ -import { Component, OnInit } from '@angular/core'; -import { ProjectService } from '../project.service'; -import { ActivatedRoute, Router } from '@angular/router'; -import { SharedMainBarService } from '../shared-main-bar.service'; -import { ViewType } from './project.component.model'; +import { Component, OnInit } from "@angular/core"; +import { ProjectService } from "../project.service"; +import { ActivatedRoute, Router } from "@angular/router"; +import { SharedMainBarService } from "../shared-main-bar.service"; +import { ViewType } from "./project.component.model"; @Component({ - selector: 'app-project', - templateUrl: './project.component.html', - styleUrls: ['./project.component.css', '../shared-styles.css'], + selector: "app-project", + templateUrl: "./project.component.html", + styleUrls: ["./project.component.css", "../shared-styles.css"], }) export class ProjectComponent implements OnInit { scenarios; filteredScenarios; projectName: string; - nrSelect = 'az'; + nrSelect = "az"; viewType = ViewType.Cards; constructor( @@ -48,13 +48,13 @@ export class ProjectComponent implements OnInit { changingValue(event) { const ordering = event.target.value; switch (ordering) { - case 'newest': + case "newest": this.filteredScenarios.sort(this.fromNewest); break; - case 'az': + case "az": this.filteredScenarios.sort(this.azSort); break; - case 'za': + case "za": this.filteredScenarios.sort(this.zaSort); break; } diff --git a/src/app/project/project.module.ts b/src/app/project/project.module.ts index 260aa95d..6c401671 100644 --- a/src/app/project/project.module.ts +++ b/src/app/project/project.module.ts @@ -1,20 +1,20 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {ProjectComponent} from './project.component'; -import {RouterModule, Routes} from '@angular/router'; -import {AuthGuard} from '../auth.guard'; -import {AddNewScenarioComponent} from './new-scenario/add-new.scenario.component'; -import {ScenariosGraphComponent} from './graph/scenarios-graph.component'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {SharedModule} from '../shared/shared.module'; -import {DataTableModule} from '@pascalhonegger/ng-datatable'; -import {TimeagoModule} from 'ngx-timeago'; -import {SharedProjectModule} from '../shared/shared-project/shared-project.module'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { ProjectComponent } from "./project.component"; +import { RouterModule, Routes } from "@angular/router"; +import { AuthGuard } from "../auth.guard"; +import { AddNewScenarioComponent } from "./new-scenario/add-new.scenario.component"; +import { ScenariosGraphComponent } from "./graph/scenarios-graph.component"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { SharedModule } from "../shared/shared.module"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; +import { TimeagoModule } from "ngx-timeago"; +import { SharedProjectModule } from "../shared/shared-project/shared-project.module"; const routes: Routes = [ { - path: 'project/:projectName/scenarios', component: ProjectComponent, - runGuardsAndResolvers: 'always', canActivate: [AuthGuard] + path: "project/:projectName/scenarios", component: ProjectComponent, + runGuardsAndResolvers: "always", canActivate: [AuthGuard] }]; @NgModule({ diff --git a/src/app/scenario-api.service.pact.spec.ts b/src/app/scenario-api.service.pact.spec.ts index 057c1208..56ace14c 100644 --- a/src/app/scenario-api.service.pact.spec.ts +++ b/src/app/scenario-api.service.pact.spec.ts @@ -1,17 +1,17 @@ -import { TestBed, waitForAsync } from '@angular/core/testing'; -import { PactWeb, Matchers } from '@pact-foundation/pact-web'; -import { HttpClientModule } from '@angular/common/http'; -import { ScenarioApiService } from './scenario-api.service'; -import * as moment from 'moment'; +import { TestBed, waitForAsync } from "@angular/core/testing"; +import { PactWeb, Matchers } from "@pact-foundation/pact-web"; +import { HttpClientModule } from "@angular/common/http"; +import { ScenarioApiService } from "./scenario-api.service"; +import * as moment from "moment"; -describe('Scenario', () => { +describe("Scenario", () => { let provider; beforeAll((done) => { provider = new PactWeb({ port: 1234, - host: '127.0.0.1', + host: "127.0.0.1", }); // required for slower CI environments @@ -40,44 +40,44 @@ describe('Scenario', () => { provider.verify().then(done, e => done.fail(e)); }); - describe('/projects/:projectName/scenarios', () => { - describe('GET /projects/:projectName/scenarios', () => { + describe("/projects/:projectName/scenarios", () => { + describe("GET /projects/:projectName/scenarios", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is at least one existing test item', - uponReceiving: 'a request for scenarios', + state: "there is at least one existing test item", + uponReceiving: "a request for scenarios", withRequest: { - method: 'GET', - path: '/projects/test-project/scenarios' + method: "GET", + path: "/projects/test-project/scenarios" }, willRespondWith: { status: 200, body: Matchers.eachLike({ - name: 'test-scenario', - id: 'e3d1cde2-6079-4b01-8592-4bde15ae6ed7', + name: "test-scenario", + id: "e3d1cde2-6079-4b01-8592-4bde15ae6ed7", data: Matchers.eachLike({ avgLatency: 372, avgResponseTime: 373, duration: 11.99, // tslint:disable-next-line:max-line-length - endDate: Matchers.term({ generate: '2019-07-24T13:12:20.807Z', matcher: '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z' }), + endDate: Matchers.term({ generate: "2019-07-24T13:12:20.807Z", matcher: "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z" }), errorRate: 0.48, maxVu: 10, percentil: 658, // tslint:disable-next-line:max-line-length - startDate: Matchers.term({ generate: '2019-07-24T12:00:21.156Z', matcher: '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z' }), + startDate: Matchers.term({ generate: "2019-07-24T12:00:21.156Z", matcher: "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z" }), throughput: 24.81, }) }) }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should return scenario lists', (done) => { + it("should return scenario lists", (done) => { const projectService: ScenarioApiService = TestBed.get(ScenarioApiService); - projectService.fetchScenarios('test-project').subscribe(response => { + projectService.fetchScenarios("test-project").subscribe(response => { expect(response).toEqual(jasmine.any(Array)); response.forEach((_) => { expect(_.id).toEqual(jasmine.any(String)); @@ -101,50 +101,49 @@ describe('Scenario', () => { }); }); }); - describe('POST /project/:projectName/scenarios', () => { + describe("POST /project/:projectName/scenarios", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is existing project', - uponReceiving: 'a request for creating new scenario', + state: "there is existing project", + uponReceiving: "a request for creating new scenario", withRequest: { - method: 'POST', - path: '/projects/test-project/scenarios', + method: "POST", + path: "/projects/test-project/scenarios", body: { scenarioName: Matchers.somethingLike(`new-test-scenario`) }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }, willRespondWith: { status: 201, }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should be able to create new scenario', (done) => { + it("should be able to create new scenario", (done) => { const scenarioService: ScenarioApiService = TestBed.get(ScenarioApiService); - scenarioService.createNewScenario('test-project', { scenarioName: 'new-scenario' }).subscribe(response => { - // @ts-ignore + scenarioService.createNewScenario("test-project", { scenarioName: "new-scenario" }).subscribe(response => { expect(response.status).toEqual(201); done(); }); }); }); }); - describe('/project/:projectName/scenarios/:scenarioName', () => { - describe('PUT /project/:projectName/scenarios/:scenarioName', () => { + describe("/project/:projectName/scenarios/:scenarioName", () => { + describe("PUT /project/:projectName/scenarios/:scenarioName", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is existing project with at least one scenario', - uponReceiving: 'a request for updating scenario', + state: "there is existing project with at least one scenario", + uponReceiving: "a request for updating scenario", withRequest: { - method: 'PUT', - path: '/projects/test-project/scenarios/test-scenario', + method: "PUT", + path: "/projects/test-project/scenarios/test-scenario", body: Matchers.somethingLike({ - scenarioName: 'new-scenario-name', + scenarioName: "new-scenario-name", analysisEnabled: true, zeroErrorToleranceEnabled: true, deleteSamples: false, @@ -156,22 +155,22 @@ describe('Scenario', () => { } }), headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }, willRespondWith: { status: 204, }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should be able to update scenario ', (done) => { + it("should be able to update scenario ", (done) => { const scenarioService: ScenarioApiService = TestBed.get(ScenarioApiService); - scenarioService.updateScenario('test-project', 'test-scenario', + scenarioService.updateScenario("test-project", "test-scenario", { - scenarioName: 'new-name', + scenarioName: "new-name", analysisEnabled: true, zeroErrorToleranceEnabled: true, deleteSamples: false, @@ -182,65 +181,63 @@ describe('Scenario', () => { enabled: false, } }).subscribe(response => { - // @ts-ignore expect(response.status).toEqual(204); done(); }); }); }); - describe('DELETE /project/:projectName/scenarios/:scenarioName', () => { + describe("DELETE /project/:projectName/scenarios/:scenarioName", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is existing project with at least one scenario', - uponReceiving: 'a request for deleting scenario', + state: "there is existing project with at least one scenario", + uponReceiving: "a request for deleting scenario", withRequest: { - method: 'DELETE', - path: '/projects/test-project/scenarios/test-scenario', + method: "DELETE", + path: "/projects/test-project/scenarios/test-scenario", }, willRespondWith: { status: 204, }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should be able to delete scenario', (done) => { + it("should be able to delete scenario", (done) => { const scenarioService: ScenarioApiService = TestBed.get(ScenarioApiService); - scenarioService.deleteScenario('test-project', 'test-scenario').subscribe(response => { - // @ts-ignore + scenarioService.deleteScenario("test-project", "test-scenario").subscribe(response => { expect(response.status).toEqual(204); done(); }); }); }); - describe('GET /project/:projectName/scenarios/:scenarioName/trends', () => { + describe("GET /project/:projectName/scenarios/:scenarioName/trends", () => { beforeAll((done) => { provider.addInteraction({ - state: 'there is at least one existing test item', - uponReceiving: 'a request for scenario trends', + state: "there is at least one existing test item", + uponReceiving: "a request for scenario trends", withRequest: { - method: 'GET', - path: '/projects/test-project/scenarios/test-scenario/trends', + method: "GET", + path: "/projects/test-project/scenarios/test-scenario/trends", }, willRespondWith: { status: 200, body: Matchers.eachLike({ - id: 'e3d1cde2-6079-4b01-8592-4bde15ae6ed7', + id: "e3d1cde2-6079-4b01-8592-4bde15ae6ed7", overview: Matchers.somethingLike({ avgLatency: 372, avgResponseTime: 373, duration: 11.99, endDate: Matchers.term({ - generate: '2019-07-24T13:12:20.807Z', - matcher: '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z' + generate: "2019-07-24T13:12:20.807Z", + matcher: "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z" }), errorRate: 0.48, maxVu: 10, percentil: 658, startDate: Matchers.term({ - generate: '2019-07-24T12:00:21.156Z', - matcher: '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z' + generate: "2019-07-24T12:00:21.156Z", + matcher: "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z" }), throughput: 24.81, avgConnect: 10, @@ -249,14 +246,13 @@ describe('Scenario', () => { }) }, headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json" } }).then(done, e => done.fail(e)); }); - it('should be able to fetch scenario trends', (done) => { + it("should be able to fetch scenario trends", (done) => { const scenarioService: ScenarioApiService = TestBed.get(ScenarioApiService); - scenarioService.fetchScenarioTrend('test-project', 'test-scenario').subscribe(response => { - // @ts-ignore + scenarioService.fetchScenarioTrend("test-project", "test-scenario").subscribe(response => { console.log(response); done(); }); diff --git a/src/app/scenario-api.service.ts b/src/app/scenario-api.service.ts index 5577f10b..888a81c3 100644 --- a/src/app/scenario-api.service.ts +++ b/src/app/scenario-api.service.ts @@ -1,11 +1,11 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { BehaviorSubject, Observable } from 'rxjs'; -import {IScenarios, ScenarioNotifications} from './items.service.model'; -import { Scenario } from './scenario.service.model'; +import { Injectable } from "@angular/core"; +import { HttpClient } from "@angular/common/http"; +import { BehaviorSubject, Observable } from "rxjs"; +import { IScenarios, ScenarioNotifications } from "./items.service.model"; +import { Scenario } from "./scenario.service.model"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class ScenarioApiService { @@ -17,12 +17,12 @@ export class ScenarioApiService { getScenario(projectName, scenarioName): Observable { return this.http.get(`projects/${projectName}/scenarios/${scenarioName}`); } - updateScenario(projectName, scenarioName, body): Observable<{}> { - return this.http.put(`projects/${projectName}/scenarios/${scenarioName}`, body, { observe: 'response'}); + updateScenario(projectName, scenarioName, body): Observable> { + return this.http.put(`projects/${projectName}/scenarios/${scenarioName}`, body, { observe: "response" }); } - deleteScenario(projectName, scenarioName): Observable<{}> { - return this.http.delete(`projects/${projectName}/scenarios/${scenarioName}`, { observe: 'response' }); + deleteScenario(projectName, scenarioName): Observable> { + return this.http.delete(`projects/${projectName}/scenarios/${scenarioName}`, { observe: "response" }); } fetchScenarios(projectName): Observable { @@ -34,20 +34,20 @@ export class ScenarioApiService { `projects/${projectName}/scenarios/${scenarioName}/trends`); } - createNewScenario(projectName, body): Observable<{}> { - return this.http.post(`projects/${projectName}/scenarios`, body, { observe: 'response'}); + createNewScenario(projectName, body): Observable> { + return this.http.post(`projects/${projectName}/scenarios`, body, { observe: "response" }); } fetchScenarioNotification(projectName, scenarioName): Observable { return this.http.get(`projects/${projectName}/scenarios/${scenarioName}/notifications`); } - deleteScenarioNotification(projectName, scenarioName, id): Observable<{}> { - return this.http.delete<{}>(`projects/${projectName}/scenarios/${scenarioName}/notifications/${id}`, { observe: 'response'}); + deleteScenarioNotification(projectName, scenarioName, id): Observable> { + return this.http.delete(`projects/${projectName}/scenarios/${scenarioName}/notifications/${id}`, { observe: "response" }); } - createNewScenarioNotification(projectName, scenarioName, body): Observable<{}> { - return this.http.post(`projects/${projectName}/scenarios/${scenarioName}/notifications`, body, { observe: 'response' }); + createNewScenarioNotification(projectName, scenarioName, body): Observable> { + return this.http.post(`projects/${projectName}/scenarios/${scenarioName}/notifications`, body, { observe: "response" }); } fetchThresholds(projectName, scenarioName) { @@ -55,7 +55,7 @@ export class ScenarioApiService { } updateThresholds(projectName, scenarioName, body) { - return this.http.put(`projects/${projectName}/scenarios/${scenarioName}/thresholds`, body, { observe: 'response'}); + return this.http.put(`projects/${projectName}/scenarios/${scenarioName}/thresholds`, body, { observe: "response" }); } setData(data) { diff --git a/src/app/scenario.service.spec.ts b/src/app/scenario.service.spec.ts index 2c57337a..027a7c10 100644 --- a/src/app/scenario.service.spec.ts +++ b/src/app/scenario.service.spec.ts @@ -1,16 +1,16 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { ScenarioService } from './scenario.service'; -import { HttpClientModule } from '@angular/common/http'; +import { ScenarioService } from "./scenario.service"; +import { HttpClientModule } from "@angular/common/http"; -describe('ScenarioService', () => { +describe("ScenarioService", () => { beforeEach(() => TestBed.configureTestingModule({ imports: [ HttpClientModule ], })); - it('should be created', () => { + it("should be created", () => { const service: ScenarioService = TestBed.get(ScenarioService); expect(service).toBeTruthy(); }); diff --git a/src/app/scenario.service.ts b/src/app/scenario.service.ts index 690c6d02..f8b0ef4b 100644 --- a/src/app/scenario.service.ts +++ b/src/app/scenario.service.ts @@ -1,16 +1,16 @@ -import { Injectable } from '@angular/core'; -import { BehaviorSubject, interval } from 'rxjs'; -import { scenarioHistoryGraphs } from './graphs/scenario-trends'; -import { ScenarioNotifications } from './items.service.model'; -import { ScenarioApiService } from './scenario-api.service'; +import { Injectable } from "@angular/core"; +import { BehaviorSubject, interval } from "rxjs"; +import { scenarioHistoryGraphs } from "./graphs/scenario-trends"; +import { ScenarioNotifications } from "./items.service.model"; +import { ScenarioApiService } from "./scenario-api.service"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class ScenarioService { - private trends = new BehaviorSubject<{}>({}); + private trends = new BehaviorSubject>({}); public trends$ = this.trends.asObservable(); private notifications = new BehaviorSubject([]); diff --git a/src/app/scenario/add-new-item/add-new-item.component.ts b/src/app/scenario/add-new-item/add-new-item.component.ts index 59142a00..94052222 100644 --- a/src/app/scenario/add-new-item/add-new-item.component.ts +++ b/src/app/scenario/add-new-item/add-new-item.component.ts @@ -1,21 +1,21 @@ -import { Component, OnInit } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { ItemsApiService } from '../../items-api.service'; -import { ActivatedRoute } from '@angular/router'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { NotificationMessage } from '../../notification/notification-messages'; -import { NgxSpinnerService } from 'ngx-spinner'; -import { ItemsService } from 'src/app/items.service'; -import { ItemStatus } from './add-new-item.model'; -import { ItemStatusValue } from 'src/app/item-detail/item-detail.model'; -import { ScenarioService } from 'src/app/scenario.service'; +import { Component, OnInit } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormGroup, FormControl, Validators } from "@angular/forms"; +import { ItemsApiService } from "../../items-api.service"; +import { ActivatedRoute } from "@angular/router"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { NotificationMessage } from "../../notification/notification-messages"; +import { NgxSpinnerService } from "ngx-spinner"; +import { ItemsService } from "src/app/items.service"; +import { ItemStatus } from "./add-new-item.model"; +import { ItemStatusValue } from "src/app/item-detail/item-detail.model"; +import { ScenarioService } from "src/app/scenario.service"; @Component({ - selector: 'app-add-new-item-modal', - templateUrl: './add-new-item.component.html', - styleUrls: ['./add-new-item.component.css'], + selector: "app-add-new-item-modal", + templateUrl: "./add-new-item.component.html", + styleUrls: ["./add-new-item.component.css"], }) export class AddNewItemComponent implements OnInit { @@ -47,18 +47,18 @@ export class AddNewItemComponent implements OnInit { } createFormControls() { - this.kpiFile = new FormControl('', [ + this.kpiFile = new FormControl("", [ Validators.required ]); - this.monitoringFile = new FormControl('', []); - this.environment = new FormControl('', [ + this.monitoringFile = new FormControl("", []); + this.environment = new FormControl("", [ Validators.required, Validators.maxLength(150) ]); - this.note = new FormControl('', [ + this.note = new FormControl("", [ Validators.maxLength(150) ]); - this.hostname = new FormControl('', [ + this.hostname = new FormControl("", [ Validators.maxLength(200) ]); this.status = new FormControl(this.DEFAULT_STATUS, [ @@ -77,7 +77,7 @@ export class AddNewItemComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onFileChange(event, fileType) { @@ -105,7 +105,7 @@ export class AddNewItemComponent implements OnInit { this.spinner.hide(); return this.itemsApiService.setData(message); }); - this.myform.reset({ environment: '', status: this.DEFAULT_STATUS, note: '', hostname: '' }); + this.myform.reset({ environment: "", status: this.DEFAULT_STATUS, note: "", hostname: "" }); this.modalService.dismissAll(); } } diff --git a/src/app/scenario/add-new-item/add-new-item.model.ts b/src/app/scenario/add-new-item/add-new-item.model.ts index 79d53c53..b0b11438 100644 --- a/src/app/scenario/add-new-item/add-new-item.model.ts +++ b/src/app/scenario/add-new-item/add-new-item.model.ts @@ -1,6 +1,6 @@ export enum ItemStatus { - Passed = 'passed', - Failed = 'failed', - Terminated = 'terminated', - None = 'none' + Passed = "passed", + Failed = "failed", + Terminated = "terminated", + None = "none" } diff --git a/src/app/scenario/delete-scenario/delete-scenario.component.spec.ts b/src/app/scenario/delete-scenario/delete-scenario.component.spec.ts index e8fca5d5..4d665c2b 100644 --- a/src/app/scenario/delete-scenario/delete-scenario.component.spec.ts +++ b/src/app/scenario/delete-scenario/delete-scenario.component.spec.ts @@ -1,18 +1,18 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { DeleteScenarioComponent } from './delete-scenario.component'; +import { HttpClientModule } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { RouterModule } from "@angular/router"; +import { DeleteScenarioComponent } from "./delete-scenario.component"; -describe('DeleteScenarioComponent', () => { +describe("DeleteScenarioComponent", () => { let component: DeleteScenarioComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [DeleteScenarioComponent], - imports: [FormsModule, ReactiveFormsModule, HttpClientModule, RouterModule.forRoot([], { relativeLinkResolution: 'legacy' })] + imports: [FormsModule, ReactiveFormsModule, HttpClientModule, RouterModule.forRoot([], { relativeLinkResolution: "legacy" })] }) .compileComponents(); })); @@ -23,7 +23,7 @@ describe('DeleteScenarioComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/scenario/delete-scenario/delete-scenario.component.ts b/src/app/scenario/delete-scenario/delete-scenario.component.ts index 3e2d4980..b1b0b87e 100644 --- a/src/app/scenario/delete-scenario/delete-scenario.component.ts +++ b/src/app/scenario/delete-scenario/delete-scenario.component.ts @@ -1,18 +1,18 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ProjectService } from 'src/app/project.service'; -import { ItemsApiService } from 'src/app/items-api.service'; -import { Router } from '@angular/router'; -import { ScenarioApiService } from 'src/app/scenario-api.service'; +import { Component, OnInit, Input } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormGroup, FormControl, Validators } from "@angular/forms"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ProjectService } from "src/app/project.service"; +import { ItemsApiService } from "src/app/items-api.service"; +import { Router } from "@angular/router"; +import { ScenarioApiService } from "src/app/scenario-api.service"; @Component({ - selector: 'app-delete-scenario', - templateUrl: './delete-scenario.component.html', - styleUrls: ['./delete-scenario.component.css'] + selector: "app-delete-scenario", + templateUrl: "./delete-scenario.component.html", + styleUrls: ["./delete-scenario.component.css"] }) export class DeleteScenarioComponent implements OnInit { @@ -36,7 +36,7 @@ export class DeleteScenarioComponent implements OnInit { } createFormControls() { - this.deleteCheck = new FormControl('', [ + this.deleteCheck = new FormControl("", [ Validators.required, Validators.minLength(5) ]); @@ -49,7 +49,7 @@ export class DeleteScenarioComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/scenario/external-notification/add-new-external-notification/add-new-external-notification.component.spec.ts b/src/app/scenario/external-notification/add-new-external-notification/add-new-external-notification.component.spec.ts index 469943bd..89ef39d9 100644 --- a/src/app/scenario/external-notification/add-new-external-notification/add-new-external-notification.component.spec.ts +++ b/src/app/scenario/external-notification/add-new-external-notification/add-new-external-notification.component.spec.ts @@ -1,11 +1,11 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { RouterTestingModule } from '@angular/router/testing'; +import { HttpClientModule } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { RouterTestingModule } from "@angular/router/testing"; -import { AddNewExternalNotificationComponent } from './add-new-external-notification.component'; +import { AddNewExternalNotificationComponent } from "./add-new-external-notification.component"; -describe('AddNewExternalNotificationComponent', () => { +describe("AddNewExternalNotificationComponent", () => { let component: AddNewExternalNotificationComponent; let fixture: ComponentFixture; @@ -23,7 +23,7 @@ describe('AddNewExternalNotificationComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/scenario/external-notification/add-new-external-notification/add-new-external-notification.component.ts b/src/app/scenario/external-notification/add-new-external-notification/add-new-external-notification.component.ts index ec563007..111d324f 100644 --- a/src/app/scenario/external-notification/add-new-external-notification/add-new-external-notification.component.ts +++ b/src/app/scenario/external-notification/add-new-external-notification/add-new-external-notification.component.ts @@ -1,16 +1,16 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { FormControl, Validators, FormGroup } from '@angular/forms'; -import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ScenarioApiService } from 'src/app/scenario-api.service'; -import { ScenarioService } from 'src/app/scenario.service'; +import { Component, Input, OnInit } from "@angular/core"; +import { FormControl, Validators, FormGroup } from "@angular/forms"; +import { NgbActiveModal, NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { of } from "rxjs"; +import { catchError } from "rxjs/operators"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ScenarioApiService } from "src/app/scenario-api.service"; +import { ScenarioService } from "src/app/scenario.service"; @Component({ - selector: 'app-add-new-external-notification', - templateUrl: './add-new-external-notification.component.html', - styleUrls: ['./add-new-external-notification.component.css'] + selector: "app-add-new-external-notification", + templateUrl: "./add-new-external-notification.component.html", + styleUrls: ["./add-new-external-notification.component.css"] }) export class AddNewExternalNotificationComponent implements OnInit { @@ -33,15 +33,15 @@ export class AddNewExternalNotificationComponent implements OnInit { } open(content) { - this.modal = this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modal = this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } createFormControls() { - this.url = new FormControl('', [ + this.url = new FormControl("", [ Validators.maxLength(400), Validators.required ]); - this.name = new FormControl('', [ + this.name = new FormControl("", [ Validators.maxLength(100), Validators.required ]); @@ -56,10 +56,10 @@ export class AddNewExternalNotificationComponent implements OnInit { onSubmit() { if (this.myform.valid) { - const { projectName, scenarioName } = this.params; + const { projectName, scenarioName } = this.params; const body = { ...this.myform.value, - type: 'ms-teams' + type: "ms-teams" }; this.scenarioApiService.createNewScenarioNotification(projectName, scenarioName, body) diff --git a/src/app/scenario/external-notification/delete-external-notification/delete-external-notification.component.spec.ts b/src/app/scenario/external-notification/delete-external-notification/delete-external-notification.component.spec.ts index 4aaa7b28..14affc43 100644 --- a/src/app/scenario/external-notification/delete-external-notification/delete-external-notification.component.spec.ts +++ b/src/app/scenario/external-notification/delete-external-notification/delete-external-notification.component.spec.ts @@ -1,11 +1,11 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { RouterTestingModule } from '@angular/router/testing'; +import { HttpClientModule } from "@angular/common/http"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { RouterTestingModule } from "@angular/router/testing"; -import { DeleteExternalNotificationComponent } from './delete-external-notification.component'; +import { DeleteExternalNotificationComponent } from "./delete-external-notification.component"; -describe('DeleteExternalNotificationComponent', () => { +describe("DeleteExternalNotificationComponent", () => { let component: DeleteExternalNotificationComponent; let fixture: ComponentFixture; @@ -23,7 +23,7 @@ describe('DeleteExternalNotificationComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/scenario/external-notification/delete-external-notification/delete-external-notification.component.ts b/src/app/scenario/external-notification/delete-external-notification/delete-external-notification.component.ts index 789087ee..42d1c8fb 100644 --- a/src/app/scenario/external-notification/delete-external-notification/delete-external-notification.component.ts +++ b/src/app/scenario/external-notification/delete-external-notification/delete-external-notification.component.ts @@ -1,16 +1,16 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; -import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ScenarioApiService } from 'src/app/scenario-api.service'; -import { ScenarioService } from 'src/app/scenario.service'; +import { Component, Input, OnInit } from "@angular/core"; +import { FormGroup } from "@angular/forms"; +import { NgbModal, NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { of } from "rxjs"; +import { catchError } from "rxjs/operators"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ScenarioApiService } from "src/app/scenario-api.service"; +import { ScenarioService } from "src/app/scenario.service"; @Component({ - selector: 'app-delete-external-notification', - templateUrl: './delete-external-notification.component.html', - styleUrls: ['./delete-external-notification.component.css'] + selector: "app-delete-external-notification", + templateUrl: "./delete-external-notification.component.html", + styleUrls: ["./delete-external-notification.component.css"] }) export class DeleteExternalNotificationComponent implements OnInit { @@ -36,12 +36,12 @@ export class DeleteExternalNotificationComponent implements OnInit { } open(content) { - this.modal = this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modal = this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { if (this.myform.valid) { - const { projectName, scenarioName } = this.params; + const { projectName, scenarioName } = this.params; this.scenarioApiService.deleteScenarioNotification(projectName, scenarioName, this.notificationInput.id) .pipe(catchError(r => of(r))) .subscribe(_ => { diff --git a/src/app/scenario/external-notification/external-notification.component.spec.ts b/src/app/scenario/external-notification/external-notification.component.spec.ts index fd8fb71d..4fb64654 100644 --- a/src/app/scenario/external-notification/external-notification.component.spec.ts +++ b/src/app/scenario/external-notification/external-notification.component.spec.ts @@ -1,16 +1,16 @@ -import { HTTP_INTERCEPTORS } from '@angular/common/http'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { RouterTestingModule } from '@angular/router/testing'; -import { DataTableModule } from '@pascalhonegger/ng-datatable'; -import { HttpRequestInterceptorMock } from 'src/app/_interceptors/mock-interceptior'; -import { AddNewExternalNotificationComponent } from './add-new-external-notification/add-new-external-notification.component'; -import { DeleteExternalNotificationComponent } from './delete-external-notification/delete-external-notification.component'; +import { HTTP_INTERCEPTORS } from "@angular/common/http"; +import { HttpClientTestingModule } from "@angular/common/http/testing"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule } from "@angular/forms"; +import { RouterTestingModule } from "@angular/router/testing"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; +import { HttpRequestInterceptorMock } from "src/app/_interceptors/mock-interceptior"; +import { AddNewExternalNotificationComponent } from "./add-new-external-notification/add-new-external-notification.component"; +import { DeleteExternalNotificationComponent } from "./delete-external-notification/delete-external-notification.component"; -import { ExternalNotificationComponent } from './external-notification.component'; +import { ExternalNotificationComponent } from "./external-notification.component"; -describe('ExternalNotificationComponent', () => { +describe("ExternalNotificationComponent", () => { let component: ExternalNotificationComponent; let fixture: ComponentFixture; @@ -33,11 +33,11 @@ describe('ExternalNotificationComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(ExternalNotificationComponent); component = fixture.componentInstance; - component.params = { projectName: 'test-project' }; + component.params = { projectName: "test-project" }; fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/scenario/external-notification/external-notification.component.ts b/src/app/scenario/external-notification/external-notification.component.ts index da049320..1cf46147 100644 --- a/src/app/scenario/external-notification/external-notification.component.ts +++ b/src/app/scenario/external-notification/external-notification.component.ts @@ -1,15 +1,15 @@ -import {Component, OnInit} from '@angular/core'; -import { FormGroup } from '@angular/forms'; -import {ActivatedRoute} from '@angular/router'; -import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; -import {ScenarioNotifications} from '../../items.service.model'; -import { ScenarioService } from 'src/app/scenario.service'; -import { Observable } from 'rxjs'; +import { Component, OnInit } from "@angular/core"; +import { FormGroup } from "@angular/forms"; +import { ActivatedRoute } from "@angular/router"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { ScenarioNotifications } from "../../items.service.model"; +import { ScenarioService } from "src/app/scenario.service"; +import { Observable } from "rxjs"; @Component({ - selector: 'app-external-notification', - templateUrl: './external-notification.component.html', - styleUrls: ['./external-notification.component.css'] + selector: "app-external-notification", + templateUrl: "./external-notification.component.html", + styleUrls: ["./external-notification.component.css"] }) export class ExternalNotificationComponent implements OnInit { @@ -39,7 +39,7 @@ export class ExternalNotificationComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title', size: 'lg' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title", size: "lg" }); } } diff --git a/src/app/scenario/item-controls/item-controls.component.ts b/src/app/scenario/item-controls/item-controls.component.ts index 6d0da795..dc705bc2 100644 --- a/src/app/scenario/item-controls/item-controls.component.ts +++ b/src/app/scenario/item-controls/item-controls.component.ts @@ -1,19 +1,13 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { ItemInput } from './item-controls.model'; +import { Component, Input, OnInit } from "@angular/core"; +import { ItemInput } from "./item-controls.model"; @Component({ - selector: 'app-item-controls', - templateUrl: './item-controls.component.html', - styleUrls: ['./item-controls.component.css'] + selector: "app-item-controls", + templateUrl: "./item-controls.component.html", + styleUrls: ["./item-controls.component.css"] }) -export class ItemControlsComponent implements OnInit { +export class ItemControlsComponent { @Input() item: ItemInput; - - constructor() { } - - ngOnInit() { - } - } diff --git a/src/app/scenario/scenario-settings/scenario-settings.component.spec.ts b/src/app/scenario/scenario-settings/scenario-settings.component.spec.ts index cf46bd32..13fc7da1 100644 --- a/src/app/scenario/scenario-settings/scenario-settings.component.spec.ts +++ b/src/app/scenario/scenario-settings/scenario-settings.component.spec.ts @@ -1,13 +1,13 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { HighchartsChartModule } from 'highcharts-angular'; +import { HttpClientTestingModule } from "@angular/common/http/testing"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { ReactiveFormsModule, FormsModule } from "@angular/forms"; +import { RouterTestingModule } from "@angular/router/testing"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { HighchartsChartModule } from "highcharts-angular"; -import { SettingsScenarioComponent } from './scenario-settings.component'; +import { SettingsScenarioComponent } from "./scenario-settings.component"; -describe('SettingsScenarioComponent', () => { +describe("SettingsScenarioComponent", () => { let component: SettingsScenarioComponent; let fixture: ComponentFixture; @@ -29,12 +29,12 @@ describe('SettingsScenarioComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(SettingsScenarioComponent); component = fixture.componentInstance; - component.params = { scenarioName: 'test', projectName: 'test' }; + component.params = { scenarioName: "test", projectName: "test" }; fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/scenario/scenario-settings/scenario-settings.component.ts b/src/app/scenario/scenario-settings/scenario-settings.component.ts index d8f5c925..e2d71ba2 100644 --- a/src/app/scenario/scenario-settings/scenario-settings.component.ts +++ b/src/app/scenario/scenario-settings/scenario-settings.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit, Input, EventEmitter, Output, ChangeDetectorRef } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { ActivatedRoute } from '@angular/router'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ScenarioApiService } from 'src/app/scenario-api.service'; +import { Component, OnInit, Input, EventEmitter, Output, ChangeDetectorRef } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormGroup, FormControl, Validators } from "@angular/forms"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { ActivatedRoute } from "@angular/router"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ScenarioApiService } from "src/app/scenario-api.service"; @Component({ - selector: 'app-scenario-settings', - templateUrl: './scenario-settings.component.html', - styleUrls: ['./scenario-settings.component.css'], + selector: "app-scenario-settings", + templateUrl: "./scenario-settings.component.html", + styleUrls: ["./scenario-settings.component.css"], }) export class SettingsScenarioComponent implements OnInit { @@ -94,7 +94,7 @@ export class SettingsScenarioComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title', size: 'lg' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title", size: "lg" }); } onSubmit() { diff --git a/src/app/scenario/scenario-trends/scenario-trends.component.spec.ts b/src/app/scenario/scenario-trends/scenario-trends.component.spec.ts index 2d4a6df7..ed818879 100644 --- a/src/app/scenario/scenario-trends/scenario-trends.component.spec.ts +++ b/src/app/scenario/scenario-trends/scenario-trends.component.spec.ts @@ -1,12 +1,12 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { HighchartsChartModule } from 'highcharts-angular'; +import { HttpClientTestingModule } from "@angular/common/http/testing"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { RouterTestingModule } from "@angular/router/testing"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { HighchartsChartModule } from "highcharts-angular"; -import { ScenarioTrendsComponent } from './scenario-trends.component'; +import { ScenarioTrendsComponent } from "./scenario-trends.component"; -describe('ScenarioTrendsComponent', () => { +describe("ScenarioTrendsComponent", () => { let component: ScenarioTrendsComponent; let fixture: ComponentFixture; @@ -26,12 +26,12 @@ describe('ScenarioTrendsComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(ScenarioTrendsComponent); component = fixture.componentInstance; - component.params = { scenarioName: 'test', projectName: 'test' }; + component.params = { scenarioName: "test", projectName: "test" }; fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/scenario/scenario-trends/scenario-trends.component.ts b/src/app/scenario/scenario-trends/scenario-trends.component.ts index 0569802b..381635b7 100644 --- a/src/app/scenario/scenario-trends/scenario-trends.component.ts +++ b/src/app/scenario/scenario-trends/scenario-trends.component.ts @@ -1,18 +1,18 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import * as Highcharts from 'highcharts'; -import * as moment from 'moment'; -import { customScenarioTrends } from 'src/app/graphs/scenario-trends'; -import { Series } from 'src/app/graphs/series.model'; -import { bytesToMbps } from 'src/app/item-detail/calculations'; -import { ScenarioTrendsData } from 'src/app/items.service.model'; -import { ScenarioApiService } from 'src/app/scenario-api.service'; -import { ScenarioService } from 'src/app/scenario.service'; +import { Component, Input, OnInit } from "@angular/core"; +import { Router } from "@angular/router"; +import * as Highcharts from "highcharts"; +import * as moment from "moment"; +import { customScenarioTrends } from "src/app/graphs/scenario-trends"; +import { Series } from "src/app/graphs/series.model"; +import { bytesToMbps } from "src/app/item-detail/calculations"; +import { ScenarioTrendsData } from "src/app/items.service.model"; +import { ScenarioApiService } from "src/app/scenario-api.service"; +import { ScenarioService } from "src/app/scenario.service"; @Component({ - selector: 'app-scenario-trends', - templateUrl: './scenario-trends.component.html', - styleUrls: ['./scenario-trends.component.scss'] + selector: "app-scenario-trends", + templateUrl: "./scenario-trends.component.html", + styleUrls: ["./scenario-trends.component.scss"] }) export class ScenarioTrendsComponent implements OnInit { @Input() params; @@ -27,14 +27,14 @@ export class ScenarioTrendsComponent implements OnInit { constructor(private scenarioService: ScenarioService, private router: Router, ) { this.chartDataMapping = new Map([ - ['percentil', { name: Series.ResponseTimeP90, onLoad: true, color: 'rgb(17,122,139, 0.8)' }], - ['avgResponseTime', { name: Series.ResponseTimeAvg, onLoad: false }], - ['avgLatency', { name: Series.LatencyAvg, onLoad: false }], - ['avgConnect', { name: Series.ConnetcAvg, onLoad: false }], - ['throughput', { name: Series.Throughput, yAxis: 2, onLoad: true, color: 'rgb(41,128,187, 0.8)' }], - ['maxVu', { name: 'vu', yAxis: 1, onLoad: true, type: 'spline', color: 'grey' }], - ['errorRate', { name: Series.ErrorRate, yAxis: 3, onLoad: true, color: 'rgb(231,76,60, 0.8)' }], - ['network', { name: Series.Network, yAxis: 4, onLoad: false, transform: this.networkTransform }], + ["percentil", { name: Series.ResponseTimeP90, onLoad: true, color: "rgb(17,122,139, 0.8)" }], + ["avgResponseTime", { name: Series.ResponseTimeAvg, onLoad: false }], + ["avgLatency", { name: Series.LatencyAvg, onLoad: false }], + ["avgConnect", { name: Series.ConnetcAvg, onLoad: false }], + ["throughput", { name: Series.Throughput, yAxis: 2, onLoad: true, color: "rgb(41,128,187, 0.8)" }], + ["maxVu", { name: "vu", yAxis: 1, onLoad: true, type: "spline", color: "grey" }], + ["errorRate", { name: Series.ErrorRate, yAxis: 3, onLoad: true, color: "rgb(231,76,60, 0.8)" }], + ["network", { name: Series.Network, yAxis: 4, onLoad: false, transform: this.networkTransform }], ]); } @@ -47,12 +47,12 @@ export class ScenarioTrendsComponent implements OnInit { return; } this.itemIds = data.map(_ => _.id); - const dates = data.map(_ => moment(_.overview.startDate).format('DD. MM. YYYY HH:mm:ss')); + const dates = data.map(_ => moment(_.overview.startDate).format("DD. MM. YYYY HH:mm:ss")); const series = []; const seriesData = data.reduce((acc, current) => { for (const key of Object.keys(current.overview)) { - if (!['startDate', 'endDate', 'duration'].includes(key)) { + if (!["startDate", "endDate", "duration"].includes(key)) { if (!acc[key]) { acc[key] = [[current.overview[key]]]; } else { @@ -78,7 +78,7 @@ export class ScenarioTrendsComponent implements OnInit { }); } this.customScenarioTimeChartOption.series = JSON.parse(JSON.stringify(series)); - this.customScenarioTimeChartOption.xAxis['categories'] = dates; + this.customScenarioTimeChartOption.xAxis["categories"] = dates; this.updateLabelChartFlag = true; } diff --git a/src/app/scenario/scenario.component.spec.ts b/src/app/scenario/scenario.component.spec.ts index efca663c..8e7ed502 100644 --- a/src/app/scenario/scenario.component.spec.ts +++ b/src/app/scenario/scenario.component.spec.ts @@ -1,23 +1,23 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { ScenarioComponent } from './scenario.component'; -import { BreadcrumbComponent } from '../shared/breadcrumb/breadcrumb.component'; -import { AddNewItemComponent } from './add-new-item/add-new-item.component'; -import { SettingsScenarioComponent } from './scenario-settings/scenario-settings.component'; -import { DeleteScenarioComponent } from './delete-scenario/delete-scenario.component'; -import { ControlPanelComponent } from '../shared/control-panel/control-panel.component'; -import { NgxSpinnerModule } from 'ngx-spinner'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { HTTP_INTERCEPTORS } from '@angular/common/http'; -import {DataTableModule} from '@pascalhonegger/ng-datatable'; -import { ExternalNotificationComponent } from './external-notification/external-notification.component'; -import { ScenarioTrendsComponent } from './scenario-trends/scenario-trends.component'; -import { HttpRequestInterceptorMock } from '../_interceptors/mock-interceptior'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { ScenarioComponent } from "./scenario.component"; +import { BreadcrumbComponent } from "../shared/breadcrumb/breadcrumb.component"; +import { AddNewItemComponent } from "./add-new-item/add-new-item.component"; +import { SettingsScenarioComponent } from "./scenario-settings/scenario-settings.component"; +import { DeleteScenarioComponent } from "./delete-scenario/delete-scenario.component"; +import { ControlPanelComponent } from "../shared/control-panel/control-panel.component"; +import { NgxSpinnerModule } from "ngx-spinner"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { RouterTestingModule } from "@angular/router/testing"; +import { ReactiveFormsModule, FormsModule } from "@angular/forms"; +import { HTTP_INTERCEPTORS } from "@angular/common/http"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; +import { ExternalNotificationComponent } from "./external-notification/external-notification.component"; +import { ScenarioTrendsComponent } from "./scenario-trends/scenario-trends.component"; +import { HttpRequestInterceptorMock } from "../_interceptors/mock-interceptior"; +import { HttpClientTestingModule } from "@angular/common/http/testing"; -describe('ScenarioComponent', () => { +describe("ScenarioComponent", () => { let component: ScenarioComponent; let fixture: ComponentFixture; @@ -57,7 +57,7 @@ describe('ScenarioComponent', () => { fixture.detectChanges(); }); - xit('should create', () => { + xit("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/scenario/scenario.component.ts b/src/app/scenario/scenario.component.ts index 10ef7123..a14e0abb 100644 --- a/src/app/scenario/scenario.component.ts +++ b/src/app/scenario/scenario.component.ts @@ -1,27 +1,27 @@ -import {Component, OnInit, OnDestroy, ChangeDetectorRef} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {of, Observable, Subscription} from 'rxjs'; -import {switchMap, catchError} from 'rxjs/operators'; -import {ProjectOverview, Items} from '../items.service.model'; -import {ItemsService} from '../items.service'; -import {SharedMainBarService} from '../shared-main-bar.service'; -import {ScenarioService} from '../scenario.service'; -import {ScenarioApiService} from '../scenario-api.service'; -import {showZeroErrorWarning} from '../utils/showZeroErrorTolerance'; +import { Component, OnInit, OnDestroy, ChangeDetectorRef } from "@angular/core"; +import { ActivatedRoute, Router } from "@angular/router"; +import { of, Observable, Subscription } from "rxjs"; +import { switchMap, catchError } from "rxjs/operators"; +import { ProjectOverview, Items } from "../items.service.model"; +import { ItemsService } from "../items.service"; +import { SharedMainBarService } from "../shared-main-bar.service"; +import { ScenarioService } from "../scenario.service"; +import { ScenarioApiService } from "../scenario-api.service"; +import { showZeroErrorWarning } from "../utils/showZeroErrorTolerance"; const LIMIT = 15; const OFFSET = 15; @Component({ - selector: 'app-items', - templateUrl: './scenario.component.html', - styleUrls: ['./scenario.component.scss', '../shared-styles.css'], + selector: "app-items", + templateUrl: "./scenario.component.html", + styleUrls: ["./scenario.component.scss", "../shared-styles.css"], }) export class ScenarioComponent implements OnInit, OnDestroy { overview$: Observable; items$: Observable; - trends$: Observable<{}>; - processingItems$: Observable<{}>; + trends$: Observable>; + processingItems$: Observable>; params; page = 1; pageSize = LIMIT; @@ -52,7 +52,7 @@ export class ScenarioComponent implements OnInit, OnDestroy { switchMap(routeParams => { this.params = routeParams; this.sharedMainBarService.setProjectName(this.params.projectName); - this.itemsService.fetchItems(this.params.projectName, this.params.scenarioName, {limit: LIMIT, offset: 0}); + this.itemsService.fetchItems(this.params.projectName, this.params.scenarioName, { limit: LIMIT, offset: 0 }); this.scenarioService.fetchScenarioTrends(this.params.projectName, this.params.scenarioName); this.scenarioApiService.getScenario(this.params.projectName, this.params.scenarioName).subscribe(_ => { this.zeroErrorToleranceEnabled = _.zeroErrorToleranceEnabled; @@ -60,16 +60,15 @@ export class ScenarioComponent implements OnInit, OnDestroy { this.itemsService.processingItemsInterval(this.params.projectName, this.params.scenarioName); return new Observable().pipe(catchError(err => of([]))); }) - ).subscribe(_ => { - }); + ).subscribe(_ => _); this.subscription = this.itemsService.processingItems$.subscribe((_) => { this.processingItems = _; - const {inprogress} = _ as any; + const { inprogress } = _ as any; if (Array.isArray(inprogress)) { const processingItems = inprogress.map((item) => item.id); const reloadItems = !this.currentProcessingItems.every((id) => processingItems.includes(id)); if (reloadItems) { - this.itemsService.fetchItems(this.params.projectName, this.params.scenarioName, {limit: LIMIT, offset: 0}); + this.itemsService.fetchItems(this.params.projectName, this.params.scenarioName, { limit: LIMIT, offset: 0 }); this.scenarioService.fetchScenarioTrends(this.params.projectName, this.params.scenarioName); } return this.currentProcessingItems = inprogress.map((item) => item.id); @@ -80,11 +79,11 @@ export class ScenarioComponent implements OnInit, OnDestroy { loadMore() { const offset = (this.page - 1) * OFFSET; - this.itemsService.fetchItems(this.params.projectName, this.params.scenarioName, {limit: LIMIT, offset}); + this.itemsService.fetchItems(this.params.projectName, this.params.scenarioName, { limit: LIMIT, offset }); } open(itemId) { - const {projectName, scenarioName} = this.params; + const { projectName, scenarioName } = this.params; this.router.navigate([`./project/${projectName}/scenario/${scenarioName}/item/${itemId}`]); } @@ -94,7 +93,7 @@ export class ScenarioComponent implements OnInit, OnDestroy { updateScenarioName(scenarioName: string) { this.router.navigate( - ['.', 'project', this.params.projectName, 'scenario', scenarioName, 'items']); + [".", "project", this.params.projectName, "scenario", scenarioName, "items"]); } showZeroErrorToleranceWarning(errorCount, errorRate) { diff --git a/src/app/scenario/scenario.module.ts b/src/app/scenario/scenario.module.ts index fcdd88ba..84432e5b 100644 --- a/src/app/scenario/scenario.module.ts +++ b/src/app/scenario/scenario.module.ts @@ -1,33 +1,33 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {ScenarioComponent} from './scenario.component'; -import {RouterModule, Routes} from '@angular/router'; -import {AuthGuard} from '../auth.guard'; -import {AddNewItemComponent} from './add-new-item/add-new-item.component'; -import {ScenarioTrendsComponent} from './scenario-trends/scenario-trends.component'; -import {SettingsScenarioComponent} from './scenario-settings/scenario-settings.component'; -import {DeleteScenarioComponent} from './delete-scenario/delete-scenario.component'; -import {ExternalNotificationComponent} from './external-notification/external-notification.component'; -import {NgxSpinnerModule} from 'ngx-spinner'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {SharedModule} from '../shared/shared.module'; -import {HighchartsChartModule} from 'highcharts-angular'; -import {ItemControlsComponent} from './item-controls/item-controls.component'; -import {SharedItemModule} from '../shared/shared-item/shared-item.module'; -import {ReactiveFormsModule} from '@angular/forms'; -import {DataTableModule} from '@pascalhonegger/ng-datatable'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { ScenarioComponent } from "./scenario.component"; +import { RouterModule, Routes } from "@angular/router"; +import { AuthGuard } from "../auth.guard"; +import { AddNewItemComponent } from "./add-new-item/add-new-item.component"; +import { ScenarioTrendsComponent } from "./scenario-trends/scenario-trends.component"; +import { SettingsScenarioComponent } from "./scenario-settings/scenario-settings.component"; +import { DeleteScenarioComponent } from "./delete-scenario/delete-scenario.component"; +import { ExternalNotificationComponent } from "./external-notification/external-notification.component"; +import { NgxSpinnerModule } from "ngx-spinner"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { SharedModule } from "../shared/shared.module"; +import { HighchartsChartModule } from "highcharts-angular"; +import { ItemControlsComponent } from "./item-controls/item-controls.component"; +import { SharedItemModule } from "../shared/shared-item/shared-item.module"; +import { ReactiveFormsModule } from "@angular/forms"; +import { DataTableModule } from "@pascalhonegger/ng-datatable"; import { AddNewExternalNotificationComponent -} from './external-notification/add-new-external-notification/add-new-external-notification.component'; +} from "./external-notification/add-new-external-notification/add-new-external-notification.component"; import { DeleteExternalNotificationComponent -} from './external-notification/delete-external-notification/delete-external-notification.component'; +} from "./external-notification/delete-external-notification/delete-external-notification.component"; const routes: Routes = [ { - path: 'project/:projectName/scenario/:scenarioName/items', component: ScenarioComponent, - runGuardsAndResolvers: 'always', canActivate: [AuthGuard] + path: "project/:projectName/scenario/:scenarioName/items", component: ScenarioComponent, + runGuardsAndResolvers: "always", canActivate: [AuthGuard] }, ]; diff --git a/src/app/shared-main-bar.service.ts b/src/app/shared-main-bar.service.ts index 6d593bb4..73e4cbd1 100644 --- a/src/app/shared-main-bar.service.ts +++ b/src/app/shared-main-bar.service.ts @@ -1,16 +1,14 @@ -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 SharedMainBarService { private project = new Subject(); public project$ = this.project.asObservable(); - constructor() { } - setProjectName(projectName) { this.project.next(projectName); } diff --git a/src/app/shared/breadcrumb/breadcrumb.component.spec.ts b/src/app/shared/breadcrumb/breadcrumb.component.spec.ts index 67323e81..6a60661a 100644 --- a/src/app/shared/breadcrumb/breadcrumb.component.spec.ts +++ b/src/app/shared/breadcrumb/breadcrumb.component.spec.ts @@ -1,9 +1,9 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { BreadcrumbComponent } from './breadcrumb.component'; -import { RouterTestingModule } from '@angular/router/testing'; +import { BreadcrumbComponent } from "./breadcrumb.component"; +import { RouterTestingModule } from "@angular/router/testing"; -describe('BreadcrumbComponent', () => { +describe("BreadcrumbComponent", () => { let component: BreadcrumbComponent; let fixture: ComponentFixture; @@ -21,7 +21,7 @@ describe('BreadcrumbComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/shared/breadcrumb/breadcrumb.component.ts b/src/app/shared/breadcrumb/breadcrumb.component.ts index 400015c0..7613db7e 100644 --- a/src/app/shared/breadcrumb/breadcrumb.component.ts +++ b/src/app/shared/breadcrumb/breadcrumb.component.ts @@ -1,10 +1,10 @@ -import {Component, OnInit, ViewEncapsulation} from '@angular/core'; -import {ActivatedRoute, NavigationEnd, Router} from '@angular/router'; +import { Component, OnInit, ViewEncapsulation } from "@angular/core"; +import { ActivatedRoute, NavigationEnd, Router } from "@angular/router"; @Component({ - selector: 'app-breadcrumb', - templateUrl: './breadcrumb.component.html', - styleUrls: ['./breadcrumb.component.css'], + selector: "app-breadcrumb", + templateUrl: "./breadcrumb.component.html", + styleUrls: ["./breadcrumb.component.css"], encapsulation: ViewEncapsulation.None }) export class BreadcrumbComponent implements OnInit { @@ -17,18 +17,18 @@ export class BreadcrumbComponent implements OnInit { ngOnInit() { this.route.params.subscribe(_ => { this.urls = []; - const { projectName = null, scenarioName = null, id = null} = _; + const { projectName = null, scenarioName = null, id = null } = _; const _length = Object.keys(_).length; if (projectName) { const projectUrlTemplate = `/project/${projectName}/scenarios`; - this.urls.push({ label: projectName, url: projectUrlTemplate, last: _length === 1}); + this.urls.push({ label: projectName, url: projectUrlTemplate, last: _length === 1 }); } if (scenarioName) { const projectUrlTemplate = `/project/${projectName}/scenario/${scenarioName}/items`; this.urls.push({ label: scenarioName, url: projectUrlTemplate, last: _length === 2 }); } if (id) { - this.urls.push({ label: 'test run', url: '', last: _length === 3}); + this.urls.push({ label: "test run", url: "", last: _length === 3 }); } }); } diff --git a/src/app/shared/control-panel/control-panel.component.ts b/src/app/shared/control-panel/control-panel.component.ts index 43692ad7..a4c1fef8 100644 --- a/src/app/shared/control-panel/control-panel.component.ts +++ b/src/app/shared/control-panel/control-panel.component.ts @@ -1,16 +1,14 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-control-panel', - templateUrl: './control-panel.component.html', - styleUrls: ['./control-panel.component.css', '../../shared-styles.css'] + selector: "app-control-panel", + templateUrl: "./control-panel.component.html", + styleUrls: ["./control-panel.component.css", "../../shared-styles.css"] }) export class ControlPanelComponent { navbarOpen = false; - constructor() { } - toggleNavbar() { this.navbarOpen = !this.navbarOpen; } diff --git a/src/app/shared/shared-item/delete-item/delete-item.component.ts b/src/app/shared/shared-item/delete-item/delete-item.component.ts index b690bb94..539cd303 100644 --- a/src/app/shared/shared-item/delete-item/delete-item.component.ts +++ b/src/app/shared/shared-item/delete-item/delete-item.component.ts @@ -1,20 +1,20 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { ProjectApiService } from 'src/app/project-api.service'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ProjectService } from 'src/app/project.service'; -import { ItemsApiService } from 'src/app/items-api.service'; -import { Router } from '@angular/router'; -import { ItemsService } from 'src/app/items.service'; -import { ScenarioService } from 'src/app/scenario.service'; +import { Component, OnInit, Input } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormGroup, FormControl, Validators } from "@angular/forms"; +import { ProjectApiService } from "src/app/project-api.service"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ProjectService } from "src/app/project.service"; +import { ItemsApiService } from "src/app/items-api.service"; +import { Router } from "@angular/router"; +import { ItemsService } from "src/app/items.service"; +import { ScenarioService } from "src/app/scenario.service"; @Component({ - selector: 'app-delete-item', - templateUrl: './delete-item.component.html', - styleUrls: ['./delete-item.component.css'] + selector: "app-delete-item", + templateUrl: "./delete-item.component.html", + styleUrls: ["./delete-item.component.css"] }) export class DeleteItemComponent implements OnInit { @@ -40,7 +40,7 @@ export class DeleteItemComponent implements OnInit { } createFormControls() { - this.deleteCheck = new FormControl('', [ + this.deleteCheck = new FormControl("", [ Validators.required, Validators.minLength(5) ]); @@ -53,7 +53,7 @@ export class DeleteItemComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/shared/shared-item/edit-item/edit-item.component.ts b/src/app/shared/shared-item/edit-item/edit-item.component.ts index cc019a3b..d52a061f 100644 --- a/src/app/shared/shared-item/edit-item/edit-item.component.ts +++ b/src/app/shared/shared-item/edit-item/edit-item.component.ts @@ -1,18 +1,17 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { ItemsApiService } from 'src/app/items-api.service'; -import { catchError } from 'rxjs/operators'; -import { of } from 'rxjs'; -import { ActivatedRoute } from '@angular/router'; -import { NotificationMessage } from 'src/app/notification/notification-messages'; -import { ItemInput } from 'src/app/scenario/item-controls/item-controls.model'; -import { ItemsService } from 'src/app/items.service'; +import { Component, OnInit, Input, Output, EventEmitter } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormGroup, FormControl, Validators } from "@angular/forms"; +import { ItemsApiService } from "src/app/items-api.service"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { NotificationMessage } from "src/app/notification/notification-messages"; +import { ItemInput } from "src/app/scenario/item-controls/item-controls.model"; +import { ItemsService } from "src/app/items.service"; @Component({ - selector: 'app-edit-item', - templateUrl: './edit-item.component.html', - styleUrls: ['./edit-item.component.css'], + selector: "app-edit-item", + templateUrl: "./edit-item.component.html", + styleUrls: ["./edit-item.component.css"], }) export class EditItemComponent implements OnInit { @@ -27,7 +26,8 @@ export class EditItemComponent implements OnInit { @Input() reloadItems: boolean; @Input() itemDetailData: ItemInput; - @Output() itemDetailChange = new EventEmitter<{}>(); + @Output() itemDetailChange = new EventEmitter<{ + note: string, environment: string, hostname: string}>(); constructor( private modalService: NgbModal, @@ -67,7 +67,7 @@ export class EditItemComponent implements OnInit { } open(content) { - this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title" }); } onSubmit() { diff --git a/src/app/shared/shared-item/shared-item.module.ts b/src/app/shared/shared-item/shared-item.module.ts index 2741da38..e7d44a67 100644 --- a/src/app/shared/shared-item/shared-item.module.ts +++ b/src/app/shared/shared-item/shared-item.module.ts @@ -1,8 +1,8 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {DeleteItemComponent} from './delete-item/delete-item.component'; -import {EditItemComponent} from './edit-item/edit-item.component'; -import {ReactiveFormsModule} from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { DeleteItemComponent } from "./delete-item/delete-item.component"; +import { EditItemComponent } from "./edit-item/edit-item.component"; +import { ReactiveFormsModule } from "@angular/forms"; @NgModule({ declarations: [DeleteItemComponent, EditItemComponent], diff --git a/src/app/shared/shared-project/project-settings/project-settings.component.spec.ts b/src/app/shared/shared-project/project-settings/project-settings.component.spec.ts index 4f4b6a1d..0632c4e0 100644 --- a/src/app/shared/shared-project/project-settings/project-settings.component.spec.ts +++ b/src/app/shared/shared-project/project-settings/project-settings.component.spec.ts @@ -1,10 +1,10 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { ProjectSettingsComponent } from './project-settings.component'; -import { ReactiveFormsModule } from '@angular/forms'; -import { HttpClientModule } from '@angular/common/http'; +import { ProjectSettingsComponent } from "./project-settings.component"; +import { ReactiveFormsModule } from "@angular/forms"; +import { HttpClientModule } from "@angular/common/http"; -describe('ProjectSettingsComponent', () => { +describe("ProjectSettingsComponent", () => { let component: ProjectSettingsComponent; let fixture: ComponentFixture; @@ -22,7 +22,7 @@ describe('ProjectSettingsComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/shared/shared-project/project-settings/project-settings.component.ts b/src/app/shared/shared-project/project-settings/project-settings.component.ts index 136a868f..8d8aeaec 100644 --- a/src/app/shared/shared-project/project-settings/project-settings.component.ts +++ b/src/app/shared/shared-project/project-settings/project-settings.component.ts @@ -1,16 +1,16 @@ -import {Component, Input, OnInit} from '@angular/core'; -import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; -import {FormControl, FormGroup, Validators} from '@angular/forms'; -import {catchError} from 'rxjs/operators'; -import {of} from 'rxjs'; -import {ProjectApiService} from '../../../project-api.service'; -import {NotificationMessage} from '../../../notification/notification-messages'; -import {ProjectService} from '../../../project.service'; +import { Component, Input, OnInit } from "@angular/core"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; +import { FormControl, FormGroup, Validators } from "@angular/forms"; +import { catchError } from "rxjs/operators"; +import { of } from "rxjs"; +import { ProjectApiService } from "../../../project-api.service"; +import { NotificationMessage } from "../../../notification/notification-messages"; +import { ProjectService } from "../../../project.service"; @Component({ - selector: 'app-project-settings', - templateUrl: './project-settings.component.html', - styleUrls: ['./project-settings.component.css'] + selector: "app-project-settings", + templateUrl: "./project-settings.component.html", + styleUrls: ["./project-settings.component.css"] }) export class ProjectSettingsComponent implements OnInit { @@ -77,7 +77,7 @@ export class ProjectSettingsComponent implements OnInit { } open(content) { - this.modalService.open(content, {ariaLabelledBy: 'modal-basic-title', size: 'lg'}); + this.modalService.open(content, { ariaLabelledBy: "modal-basic-title", size: "lg" }); } onSubmit() { diff --git a/src/app/shared/shared-project/shared-project.module.ts b/src/app/shared/shared-project/shared-project.module.ts index 860da355..6556e2b7 100644 --- a/src/app/shared/shared-project/shared-project.module.ts +++ b/src/app/shared/shared-project/shared-project.module.ts @@ -1,7 +1,7 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import {ReactiveFormsModule} from '@angular/forms'; -import {ProjectSettingsComponent} from './project-settings/project-settings.component'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { ReactiveFormsModule } from "@angular/forms"; +import { ProjectSettingsComponent } from "./project-settings/project-settings.component"; @NgModule({ declarations: [ProjectSettingsComponent], diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 7d7b6699..bba840ff 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -1,8 +1,8 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { ControlPanelComponent } from './control-panel/control-panel.component'; -import { BreadcrumbComponent } from './breadcrumb/breadcrumb.component'; -import {RouterModule} from '@angular/router'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { ControlPanelComponent } from "./control-panel/control-panel.component"; +import { BreadcrumbComponent } from "./breadcrumb/breadcrumb.component"; +import { RouterModule } from "@angular/router"; @NgModule({ declarations: [ControlPanelComponent, BreadcrumbComponent], diff --git a/src/app/top-panel/top-panel.component.ts b/src/app/top-panel/top-panel.component.ts index c602732a..88d9fed1 100644 --- a/src/app/top-panel/top-panel.component.ts +++ b/src/app/top-panel/top-panel.component.ts @@ -1,15 +1,15 @@ -import { Component, OnInit } from '@angular/core'; -import { ProjectService } from '../project.service'; -import { ProjectsListing } from '../project-api.service.model'; -import { Observable } from 'rxjs'; -import { SharedMainBarService } from '../shared-main-bar.service'; -import { AuthenticationService } from '../_services/authentication.service'; -import { ChangeDetectorRef } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; +import { ProjectService } from "../project.service"; +import { ProjectsListing } from "../project-api.service.model"; +import { Observable } from "rxjs"; +import { SharedMainBarService } from "../shared-main-bar.service"; +import { AuthenticationService } from "../_services/authentication.service"; +import { ChangeDetectorRef } from "@angular/core"; @Component({ - selector: 'app-top-panel', - templateUrl: './top-panel.component.html', - styleUrls: ['./top-panel.component.scss', '../shared-styles.css'], + selector: "app-top-panel", + templateUrl: "./top-panel.component.html", + styleUrls: ["./top-panel.component.scss", "../shared-styles.css"], }) export class TopPanelComponent implements OnInit { @@ -41,7 +41,7 @@ export class TopPanelComponent implements OnInit { this.authService.isLoggedIn.subscribe((_) => { if (_ === true) { this.projectService.loadProjects(); - const { username } = JSON.parse(localStorage.getItem('currentUser')); + const { username } = JSON.parse(localStorage.getItem("currentUser")); this.username = username; } }); diff --git a/src/app/utils/showZeroErrorTolerance.ts b/src/app/utils/showZeroErrorTolerance.ts index ed76e5d4..3a8ccf08 100644 --- a/src/app/utils/showZeroErrorTolerance.ts +++ b/src/app/utils/showZeroErrorTolerance.ts @@ -3,7 +3,7 @@ export const showZeroErrorWarning = (errorRate, errorCount) => { return true; } else { if (errorCount === null || errorCount === undefined) { - return 'unknown'; + return "unknown"; } return errorCount && errorCount > 0; } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 08fd5aae..af94e875 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,4 +1,4 @@ export const environment = { production: true, - baseUrl: '/api' + baseUrl: "/api" }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 9189d695..1a5893c2 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - baseUrl: 'http://localhost:5000/api' + baseUrl: "http://localhost:5000/api" }; /* diff --git a/src/main.ts b/src/main.ts index 91ec6da5..6373f498 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ -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(); diff --git a/src/polyfills.ts b/src/polyfills.ts index 36b46f59..6776aa66 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. @@ -75,7 +75,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. diff --git a/src/test.ts b/src/test.ts index a6f15af3..c147c09c 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,11 +1,11 @@ // 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 "zone.js/testing"; +import { getTestBed } from "@angular/core/testing"; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; +} from "@angular/platform-browser-dynamic/testing"; declare const require: any; @@ -15,6 +15,6 @@ getTestBed().initTestEnvironment( platformBrowserDynamicTesting() ); // 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); diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 8f644525..00000000 --- a/tslint.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "rulesDirectory": [ - "node_modules/codelyzer" - ], - "rules": { - "arrow-return-shorthand": true, - "callable-types": true, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "deprecation": { - "severity": "warn" - }, - "eofline": true, - "forin": true, - "import-blacklist": [ - true, - "rxjs/Rx" - ], - "import-spacing": true, - "indent": [ - true, - "spaces" - ], - "interface-over-type-literal": true, - "label-position": true, - "max-line-length": [ - true, - 140 - ], - "member-access": false, - "member-ordering": [ - true, - { - "order": [ - "static-field", - "instance-field", - "static-method", - "instance-method" - ] - } - ], - "no-arg": true, - "no-bitwise": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-super": true, - "no-empty": false, - "no-empty-interface": true, - "no-eval": true, - "no-inferrable-types": [ - true, - "ignore-params" - ], - "no-misused-new": true, - "no-non-null-assertion": true, - "no-shadowed-variable": true, - "no-string-literal": false, - "no-string-throw": true, - "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, - "no-unnecessary-initializer": true, - "no-unused-expression": true, - "no-var-keyword": true, - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "prefer-const": true, - "quotemark": [ - true, - "single" - ], - "radix": true, - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "unified-signatures": true, - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], - "no-output-on-prefix": true, - "use-input-property-decorator": true, - "use-output-property-decorator": true, - "use-host-property-decorator": true, - "no-input-rename": true, - "no-output-rename": true, - "use-life-cycle-interface": true, - "use-pipe-transform-interface": true, - "component-class-suffix": true, - "directive-class-suffix": true - } -}