From 36a31adbed64292238bf29d4a7078b49a91324db Mon Sep 17 00:00:00 2001 From: Josh Fischer Date: Fri, 4 Aug 2023 09:24:08 -0500 Subject: [PATCH] Prettier (#5) * add tenant logo preview * add prettier * lint --- .eslintrc.json | 12 +- .prettierrc.json | 11 + package-lock.json | 614 +++++++++++++++++- package.json | 6 +- .../iridium-ui/src/app/app-routing.module.ts | 17 +- .../iridium-ui/src/app/app.component.spec.ts | 12 +- projects/iridium-ui/src/app/app.component.ts | 14 +- projects/iridium-ui/src/app/app.module.ts | 42 +- .../src/app/autocomplete-off.directive.ts | 4 +- .../confirmation-dialog.component.html | 4 +- .../confirmation-dialog.component.spec.ts | 5 +- .../confirmation-dialog.component.ts | 13 +- .../api-overview/api-overview.component.html | 21 +- .../api-overview.component.spec.ts | 5 +- .../api-overview/api-overview.component.ts | 35 +- .../api-overview/create-api-dialog.html | 71 +- .../application-overview.component.html | 63 +- .../application-overview.component.spec.ts | 5 +- .../application-overview.component.ts | 157 +++-- .../create-application-dialog.html | 26 +- .../update-application-dialog.html | 34 +- .../content/dynamic-content-view-item.ts | 1 - .../content/dynamic-content-view.component.ts | 27 +- .../content/dynamic-content-view.directive.ts | 4 +- .../content/dynamic-content-view.service.ts | 53 +- .../dashboard/content/dynamic-content-view.ts | 6 +- ...ternal-provider-overview.component.spec.ts | 5 +- .../external-provider-overview.component.ts | 6 +- .../add-external-provider-dialog.html | 32 +- .../login-box-overview.component.html | 42 +- .../login-box-overview.component.spec.ts | 5 +- .../login-box-overview.component.ts | 170 +++-- .../update-external-provider-dialog.html | 31 +- .../roles-overview/create-role-dialog.html | 71 +- .../roles-overview.component.html | 21 +- .../roles-overview.component.spec.ts | 5 +- .../roles-overview.component.ts | 31 +- .../system-overview.component.html | 1 - .../system-overview.component.spec.ts | 5 +- .../system-overview.component.ts | 8 +- .../tenant-overview.component.spec.ts | 5 +- .../tenant-overview.component.ts | 7 +- .../user-overview.component.html | 12 +- .../user-overview.component.spec.ts | 5 +- .../user-overview/user-overview.component.ts | 26 +- .../create-tenant-prompt-dialog.html | 33 +- .../dashboard/dashboard.component.html | 60 +- .../dashboard/dashboard.component.spec.ts | 5 +- .../dashboard/dashboard.component.ts | 94 ++- ...eate-external-identity-provider-request.ts | 6 +- .../domain/external-provider-response.ts | 8 +- .../dashboard/domain/tenant-select-item.ts | 2 +- .../components/dashboard/domain/view-item.ts | 4 +- .../register/register.component.html | 48 +- .../register/register.component.spec.ts | 5 +- .../components/register/register.component.ts | 13 +- .../components/spinner/spinner.component.html | 14 +- .../spinner/spinner.component.spec.ts | 5 +- .../components/spinner/spinner.component.ts | 13 +- .../iridium-ui/src/app/guard/auth.guard.ts | 10 +- .../app/http-interceptors/http-interceptor.ts | 28 +- .../app/services/application-type.service.ts | 24 +- .../src/app/services/application.service.ts | 82 ++- .../src/app/services/auth.service.ts | 6 +- .../src/app/services/cookie.service.ts | 17 +- .../services/domain/authentication-request.ts | 2 +- .../domain/authentication-response.ts | 8 +- .../domain/create-identity-request.ts | 2 +- .../domain/create-identity-response.ts | 6 +- .../external-provider-update-request.ts | 4 +- .../src/app/services/domain/page-info.ts | 2 +- .../services/domain/paged-list-response.ts | 1 - .../services/domain/tenant-create-request.ts | 2 +- .../domain/tenant-logo-update-request.ts | 4 +- .../external-identity-provider.service.ts | 87 ++- .../external-provider-template.service.ts | 24 +- .../src/app/services/identity.service.ts | 26 +- .../app/services/login-descriptor.service.ts | 48 +- .../src/app/services/menu-item.service.ts | 19 +- .../src/app/services/register.service.ts | 53 +- .../src/app/services/tenant.service.ts | 57 +- .../environments/environment.development.ts | 4 +- .../src/environments/environment.ts | 6 +- projects/iridium-ui/src/index.html | 30 +- projects/iridium-ui/src/main.ts | 4 +- 85 files changed, 1727 insertions(+), 889 deletions(-) create mode 100644 .prettierrc.json diff --git a/.eslintrc.json b/.eslintrc.json index f7b5883..6c4756d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,7 +11,8 @@ "createDefaultProgram": true }, "extends": [ - "plugin:@angular-eslint/recommended" + "plugin:@angular-eslint/recommended", + "plugin:prettier/recommended" ], "rules": { "@angular-eslint/directive-selector": [ @@ -36,6 +37,15 @@ "files": ["*.html"], "extends": ["plugin:@angular-eslint/template/recommended"], "rules": {} + }, + { + "files": ["*.html"], + "excludedFiles": ["*inline-template-*.component.html"], + "extends": ["plugin:prettier/recommended"], + "rules": { + // NOTE: WE ARE OVERRIDING THE DEFAULT CONFIG TO ALWAYS SET THE PARSER TO ANGULAR (SEE BELOW) + "prettier/prettier": ["error", { "parser": "angular" }] + } } ] } diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..dd2d87b --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,11 @@ +{ + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "semi": true, + "bracketSpacing": true, + "arrowParens": "avoid", + "trailingComma": "es5", + "bracketSameLine": true, + "printWidth": 80 +} diff --git a/package-lock.json b/package-lock.json index bc46993..318ac25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,8 @@ "@typescript-eslint/eslint-plugin": "5.48.2", "@typescript-eslint/parser": "5.48.2", "eslint": "^8.33.0", + "eslint-config-prettier": "^8.10.0", + "eslint-plugin-prettier": "^5.0.0", "jasmine-core": "~4.5.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.1.0", @@ -43,6 +45,8 @@ "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.0.0", "ng-packagr": "^15.2.2", + "prettier": "^3.0.1", + "prettier-eslint": "^15.0.1", "typescript": "~4.9.4" } }, @@ -4884,6 +4888,56 @@ "node": ">=14" } }, + "node_modules/@pkgr/utils": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", + "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "fast-glob": "^3.3.0", + "is-glob": "^4.0.3", + "open": "^9.1.0", + "picocolors": "^1.0.0", + "tslib": "^2.6.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@pkgr/utils/node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@pkgr/utils/node_modules/open": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", + "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", + "dev": true, + "dependencies": { + "default-browser": "^4.0.0", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@rollup/plugin-json": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.0.tgz", @@ -5193,6 +5247,12 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "node_modules/@types/prettier": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", + "dev": true + }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -6117,6 +6177,15 @@ "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", "dev": true }, + "node_modules/big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -6203,6 +6272,18 @@ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "dev": true }, + "node_modules/bplist-parser": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", + "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "dev": true, + "dependencies": { + "big-integer": "^1.6.44" + }, + "engines": { + "node": ">= 5.10.0" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -6308,6 +6389,21 @@ "semver": "^7.0.0" } }, + "node_modules/bundle-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", + "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", + "dev": true, + "dependencies": { + "run-applescript": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -6629,6 +6725,15 @@ "node": ">=14" } }, + "node_modules/common-tags": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", + "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -7167,6 +7272,150 @@ "node": ">=0.10.0" } }, + "node_modules/default-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", + "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", + "dev": true, + "dependencies": { + "bundle-name": "^3.0.0", + "default-browser-id": "^3.0.0", + "execa": "^7.1.1", + "titleize": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", + "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", + "dev": true, + "dependencies": { + "bplist-parser": "^0.2.0", + "untildify": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/execa": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/default-browser/node_modules/human-signals": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "dev": true, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/default-browser/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/default-gateway": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", @@ -7274,6 +7523,12 @@ "node": ">=8" } }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true + }, "node_modules/dns-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", @@ -7699,6 +7954,47 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", + "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz", + "integrity": "sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.5" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-scope": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", @@ -8210,10 +8506,16 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -8732,6 +9034,27 @@ "node": ">= 0.4.0" } }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -9517,6 +9840,39 @@ "node": ">=0.10.0" } }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container/node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-interactive": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", @@ -10499,6 +10855,84 @@ "node": ">=8.0" } }, + "node_modules/loglevel": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.1.tgz", + "integrity": "sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, + "node_modules/loglevel-colored-level-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/loglevel-colored-level-prefix/-/loglevel-colored-level-prefix-1.0.0.tgz", + "integrity": "sha512-u45Wcxxc+SdAlh4yeF/uKlC1SPUPCy0gullSNKXod5I4bmifzk+Q4lSLExNEVn19tGaJipbZ4V4jbFn79/6mVA==", + "dev": true, + "dependencies": { + "chalk": "^1.1.3", + "loglevel": "^1.4.1" + } + }, + "node_modules/loglevel-colored-level-prefix/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loglevel-colored-level-prefix/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loglevel-colored-level-prefix/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loglevel-colored-level-prefix/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loglevel-colored-level-prefix/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -12247,6 +12681,73 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.1.tgz", + "integrity": "sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-eslint": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-15.0.1.tgz", + "integrity": "sha512-mGOWVHixSvpZWARqSDXbdtTL54mMBxc5oQYQ6RAqy8jecuNJBgN3t9E5a81G66F8x8fsKNiR1HWaBV66MJDOpg==", + "dev": true, + "dependencies": { + "@types/eslint": "^8.4.2", + "@types/prettier": "^2.6.0", + "@typescript-eslint/parser": "^5.10.0", + "common-tags": "^1.4.0", + "dlv": "^1.1.0", + "eslint": "^8.7.0", + "indent-string": "^4.0.0", + "lodash.merge": "^4.6.0", + "loglevel-colored-level-prefix": "^1.0.0", + "prettier": "^2.5.1", + "pretty-format": "^23.0.1", + "require-relative": "^0.8.7", + "typescript": "^4.5.4", + "vue-eslint-parser": "^8.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/prettier-eslint/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", @@ -12259,6 +12760,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pretty-format": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz", + "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0", + "ansi-styles": "^3.2.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/proc-log": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", @@ -12638,6 +13158,12 @@ "node": ">=0.10.0" } }, + "node_modules/require-relative": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", + "integrity": "sha512-AKGr4qvHiryxRb19m3PsLRGuKVAbJLUD7E6eOaHkfKhwc+vSgVOCY5xNvm9EkolBKTOf0GrQAZKLimOCz81Khg==", + "dev": true + }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -12778,6 +13304,21 @@ "fsevents": "~2.3.2" } }, + "node_modules/run-applescript": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", + "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -13622,6 +14163,22 @@ "node": ">=0.10" } }, + "node_modules/synckit": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", + "dev": true, + "dependencies": { + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -13853,6 +14410,18 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, + "node_modules/titleize": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", + "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", @@ -13905,9 +14474,9 @@ } }, "node_modules/tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", + "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -14101,6 +14670,15 @@ "node": ">= 0.8" } }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/update-browserslist-db": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", @@ -14204,6 +14782,30 @@ "node": ">=0.10.0" } }, + "node_modules/vue-eslint-parser": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.3.0.tgz", + "integrity": "sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==", + "dev": true, + "dependencies": { + "debug": "^4.3.2", + "eslint-scope": "^7.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.0.0", + "esquery": "^1.4.0", + "lodash": "^4.17.21", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", diff --git a/package.json b/package.json index 2761601..9242925 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,8 @@ "@typescript-eslint/eslint-plugin": "5.48.2", "@typescript-eslint/parser": "5.48.2", "eslint": "^8.33.0", + "eslint-config-prettier": "^8.10.0", + "eslint-plugin-prettier": "^5.0.0", "jasmine-core": "~4.5.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.1.0", @@ -47,6 +49,8 @@ "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.0.0", "ng-packagr": "^15.2.2", + "prettier": "^3.0.1", + "prettier-eslint": "^15.0.1", "typescript": "~4.9.4" } -} \ No newline at end of file +} diff --git a/projects/iridium-ui/src/app/app-routing.module.ts b/projects/iridium-ui/src/app/app-routing.module.ts index aa62522..c1efd6a 100644 --- a/projects/iridium-ui/src/app/app-routing.module.ts +++ b/projects/iridium-ui/src/app/app-routing.module.ts @@ -1,4 +1,3 @@ - import { RegisterComponent } from './components/register/register.component'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; @@ -6,16 +5,18 @@ import { DashboardComponent } from './components/dashboard/dashboard.component'; import { authGuard } from './guard/auth.guard'; import { NgxIridiumCallbackComponent } from '@iridiumidentity/ngx-iridium-client'; - - const routes: Routes = [ - { path: '', component: RegisterComponent}, - { path: 'dashboard', component: DashboardComponent, canActivate: [authGuard]}, + { path: '', component: RegisterComponent }, + { + path: 'dashboard', + component: DashboardComponent, + canActivate: [authGuard], + }, { path: 'callback', component: NgxIridiumCallbackComponent }, ]; @NgModule({ - imports: [RouterModule.forRoot(routes, {useHash: false})], - exports: [RouterModule] + imports: [RouterModule.forRoot(routes, { useHash: false })], + exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/projects/iridium-ui/src/app/app.component.spec.ts b/projects/iridium-ui/src/app/app.component.spec.ts index 220d723..a5d87c8 100644 --- a/projects/iridium-ui/src/app/app.component.spec.ts +++ b/projects/iridium-ui/src/app/app.component.spec.ts @@ -5,12 +5,8 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - RouterTestingModule - ], - declarations: [ - AppComponent - ], + imports: [RouterTestingModule], + declarations: [AppComponent], }).compileComponents(); }); @@ -24,6 +20,8 @@ describe('AppComponent', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('.content span')?.textContent).toContain('customer-dashboard app is running!'); + expect(compiled.querySelector('.content span')?.textContent).toContain( + 'customer-dashboard app is running!' + ); }); }); diff --git a/projects/iridium-ui/src/app/app.component.ts b/projects/iridium-ui/src/app/app.component.ts index c6bc7c8..cbf9335 100644 --- a/projects/iridium-ui/src/app/app.component.ts +++ b/projects/iridium-ui/src/app/app.component.ts @@ -1,23 +1,15 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; - @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], }) export class AppComponent implements OnInit { loggedIn = false; - constructor() { - - } - - ngOnInit(): void { - - } - + constructor() {} + ngOnInit(): void {} } - diff --git a/projects/iridium-ui/src/app/app.module.ts b/projects/iridium-ui/src/app/app.module.ts index 7dfcb86..217e294 100644 --- a/projects/iridium-ui/src/app/app.module.ts +++ b/projects/iridium-ui/src/app/app.module.ts @@ -5,7 +5,7 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatIconModule } from '@angular/material/icon'; +import { MatIconModule } from '@angular/material/icon'; import { MatButtonModule } from '@angular/material/button'; import { MatGridListModule } from '@angular/material/grid-list'; import { MatFormFieldModule } from '@angular/material/form-field'; @@ -20,29 +20,35 @@ import { MatListModule } from '@angular/material/list'; import { RegisterComponent } from './components/register/register.component'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { SpinnerComponent } from './components/spinner/spinner.component'; -import { HTTP_INTERCEPTORS, HttpClientModule, HttpClientXsrfModule } from '@angular/common/http'; +import { + HTTP_INTERCEPTORS, + HttpClientModule, + HttpClientXsrfModule, +} from '@angular/common/http'; import { MatDialogModule } from '@angular/material/dialog'; import { ConfirmationDialogComponent } from './components/confirmation-dialog/confirmation-dialog.component'; -import { CreateTenantPromptDialog, DashboardComponent } from './components/dashboard/dashboard.component'; +import { + CreateTenantPromptDialog, + DashboardComponent, +} from './components/dashboard/dashboard.component'; import { MatTreeModule } from '@angular/material/tree'; import { MatExpansionModule } from '@angular/material/expansion'; import { DynamicContentViewService } from './components/dashboard/content/dynamic-content-view.service'; import { DynamicContentViewDirective } from './components/dashboard/content/dynamic-content-view.directive'; -import { - UserOverviewComponent -} from './components/dashboard/content/user-overview/user-overview.component'; +import { UserOverviewComponent } from './components/dashboard/content/user-overview/user-overview.component'; import { CreateRoleDialog, - RolesOverviewComponent + RolesOverviewComponent, } from './components/dashboard/content/roles-overview/roles-overview.component'; import { ApplicationOverviewComponent, - CreateApplicationDialog, UpdateApplicationDialog + CreateApplicationDialog, + UpdateApplicationDialog, } from './components/dashboard/content/application-overview/application-overview.component'; import { ApiOverviewComponent, - CreateAPIDialog + CreateAPIDialog, } from './components/dashboard/content/api-overview/api-overview.component'; import { DynamicContentViewComponent } from './components/dashboard/content/dynamic-content-view.component'; import { MatTableModule } from '@angular/material/table'; @@ -54,7 +60,8 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; import { NoopInterceptor } from './http-interceptors/http-interceptor'; import { AddExternalProviderDialog, - LoginBoxOverviewComponent, UpdateExternalProviderDialog + LoginBoxOverviewComponent, + UpdateExternalProviderDialog, } from './components/dashboard/content/login-box-overview/login-box-overview.component'; import { NgxIridiumClientModule } from '@iridiumidentity/ngx-iridium-client'; @@ -80,7 +87,7 @@ import { NgxIridiumClientModule } from '@iridiumidentity/ngx-iridium-client'; CreateRoleDialog, LoginBoxOverviewComponent, AddExternalProviderDialog, - UpdateExternalProviderDialog + UpdateExternalProviderDialog, ], imports: [ BrowserModule, @@ -111,13 +118,16 @@ import { NgxIridiumClientModule } from '@iridiumidentity/ngx-iridium-client'; MatCheckboxModule, NgxIridiumClientModule, ], - providers: [DynamicContentViewService, {provide: 'config', useValue: environment}, + providers: [ + DynamicContentViewService, + { provide: 'config', useValue: environment }, { provide: HTTP_INTERCEPTORS, useClass: NoopInterceptor, - multi: true + multi: true, }, - {provide: 'environment', useValue: environment}], - bootstrap: [AppComponent] + { provide: 'environment', useValue: environment }, + ], + bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/projects/iridium-ui/src/app/autocomplete-off.directive.ts b/projects/iridium-ui/src/app/autocomplete-off.directive.ts index bef46a9..4936fa2 100644 --- a/projects/iridium-ui/src/app/autocomplete-off.directive.ts +++ b/projects/iridium-ui/src/app/autocomplete-off.directive.ts @@ -1,15 +1,13 @@ import { Directive, ElementRef } from '@angular/core'; @Directive({ - selector: '[appAutocompleteOff]' + selector: '[appAutocompleteOff]', }) export class AutocompleteOffDirective { - constructor(private _el: ElementRef) { this._el.nativeElement.setAttribute('autocomplete', 'off'); this._el.nativeElement.setAttribute('autocorrect', 'off'); this._el.nativeElement.setAttribute('autocapitalize', 'none'); this._el.nativeElement.setAttribute('spellcheck', 'false'); } - } diff --git a/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.html b/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.html index c32bb99..3b496ea 100644 --- a/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.html +++ b/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.html @@ -1,5 +1,5 @@ -

{{ data.title}}

+

{{ data.title }}

{{ data.content }}
-
\ No newline at end of file + diff --git a/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.spec.ts b/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.spec.ts index 80bb525..c25f488 100644 --- a/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.spec.ts +++ b/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ConfirmationDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ConfirmationDialogComponent ] - }) - .compileComponents(); + declarations: [ConfirmationDialogComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.ts b/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.ts index b2b6a2f..a4541cf 100644 --- a/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.ts +++ b/projects/iridium-ui/src/app/components/confirmation-dialog/confirmation-dialog.component.ts @@ -9,14 +9,13 @@ export interface DialogData { @Component({ selector: 'app-confirmation-dialog', templateUrl: './confirmation-dialog.component.html', - styleUrls: ['./confirmation-dialog.component.css'] + styleUrls: ['./confirmation-dialog.component.css'], }) export class ConfirmationDialogComponent implements OnInit { + public constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: DialogData + ) {} - public constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DialogData) { } - - ngOnInit(): void { - } - + ngOnInit(): void {} } diff --git a/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.html b/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.html index 901e661..d5075f5 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.html @@ -1,42 +1,39 @@
- +

Current APIs

- - Name - {{element.name}} + {{ element.name }} Client ID - {{element.clientId}} + {{ element.clientId }} - - - Type - {{element.type}} + {{ element.type }} - - +
-
diff --git a/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.spec.ts index b7bd76e..c154910 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('ApiOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ApiOverviewComponent ] - }) - .compileComponents(); + declarations: [ApiOverviewComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.ts index f50f00d..c27c853 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/api-overview/api-overview.component.ts @@ -1,17 +1,20 @@ import { Component, Input } from '@angular/core'; import { DynamicContentViewItem } from '../dynamic-content-view-item'; import { ApplicationSummary } from '../../domain/application-summary'; -import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; +import { + UntypedFormBuilder, + UntypedFormControl, + UntypedFormGroup, + Validators, +} from '@angular/forms'; import { CookieService } from '../../../../services/cookie.service'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; - - @Component({ selector: 'create-api-dialog', templateUrl: './create-api-dialog.html', - styleUrls: ['./create-api-dialog.css'] + styleUrls: ['./create-api-dialog.css'], }) export class CreateAPIDialog { fontStyleControl = new UntypedFormControl(''); @@ -19,7 +22,10 @@ export class CreateAPIDialog { createApiFormGroup: UntypedFormGroup; // @ts-ignore - constructor(public dialogRef: MatDialogRef, private _formBuilder: UntypedFormBuilder) { + constructor( + public dialogRef: MatDialogRef, + private _formBuilder: UntypedFormBuilder + ) { this.createApiFormGroup = this._formBuilder.group({ applicationName: ['', Validators.required], homepageURL: ['', Validators.required], @@ -29,24 +35,29 @@ export class CreateAPIDialog { } create() { - console.log('yes') + console.log('yes'); } } @Component({ selector: 'app-api-overview', templateUrl: './api-overview.component.html', - styleUrls: ['./api-overview.component.css'] + styleUrls: ['./api-overview.component.css'], }) export class ApiOverviewComponent implements DynamicContentViewItem { @Input() data: any; - displayedColumns: string[] = ['name', 'clientId', 'type']; dataSource: ApplicationSummary[] = []; createApiFormGroup: UntypedFormGroup; - constructor(private cookieService: CookieService, private route: ActivatedRoute, private _formBuilder: UntypedFormBuilder, private router: Router, private dialog: MatDialog) { + constructor( + private cookieService: CookieService, + private route: ActivatedRoute, + private _formBuilder: UntypedFormBuilder, + private router: Router, + private dialog: MatDialog + ) { this.createApiFormGroup = this._formBuilder.group({ applicationName: ['', Validators.required], homepageURL: ['', Validators.required], @@ -55,9 +66,8 @@ export class ApiOverviewComponent implements DynamicContentViewItem { }); this.route.paramMap.subscribe((params: ParamMap) => { if (params.get('tenantId')) { - } - }) + }); } create() { @@ -70,7 +80,6 @@ export class ApiOverviewComponent implements DynamicContentViewItem { }); } onRowClick(index: number) { - console.log('clicked on row: ', index) + console.log('clicked on row: ', index); } - } diff --git a/projects/iridium-ui/src/app/components/dashboard/content/api-overview/create-api-dialog.html b/projects/iridium-ui/src/app/components/dashboard/content/api-overview/create-api-dialog.html index a4f65f0..a7f77df 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/api-overview/create-api-dialog.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/api-overview/create-api-dialog.html @@ -1,42 +1,45 @@

Create API

-
+ +
+

Select Application Type

+ + Web App + Single Page App + +

Chosen value is {{ fontStyleControl.value }}

+
- -
-

Select Application Type

- - Web App - Single Page App - -

Chosen value is {{fontStyleControl.value}}

-
- - - Application Name - - -
- Homepage URL - + Application Name + -
- - Description - - -
+
+ + Homepage URL + + +
- Authorization Callback URL - + Description + - -
-
- -
-
+
+ + Authorization Callback URL + + +
+
+ +
+
diff --git a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.html b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.html index 1554665..7309ef5 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.html @@ -1,42 +1,39 @@
- +

Current Applications

- - - - - Name - - {{element.name}} - - - - - Client ID - - {{element.clientId}} - - - - - - - - Type - - {{element.type}} - - - - - - - + + + Name + + {{ element.name }} + + + + + Client ID + + {{ element.clientId }} + + + + + Type + + {{ element.type }} + + + + + +
-
diff --git a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.spec.ts index 5ece283..52e4d66 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('FrontEndClientOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ApplicationOverviewComponent ] - }) - .compileComponents(); + declarations: [ApplicationOverviewComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.ts index 069cc1a..cd02938 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/application-overview.component.ts @@ -1,10 +1,26 @@ -import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'; +import { + Component, + EventEmitter, + Inject, + Input, + OnInit, + Output, +} from '@angular/core'; import { DynamicContentViewItem } from '../dynamic-content-view-item'; import { ApplicationSummary } from '../../domain/application-summary'; -import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; +import { + UntypedFormBuilder, + UntypedFormControl, + UntypedFormGroup, + Validators, +} from '@angular/forms'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { CookieService } from '../../../../services/cookie.service'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { + MAT_DIALOG_DATA, + MatDialog, + MatDialogRef, +} from '@angular/material/dialog'; import { ApplicationTypeService } from '../../../../services/application-type.service'; import { ApplicationTypeSummary } from '../../domain/application-type-summary'; import { ApplicationService } from '../../../../services/application.service'; @@ -12,127 +28,149 @@ import { ApplicationService } from '../../../../services/application.service'; @Component({ selector: 'update-application-dialog', templateUrl: 'update-application-dialog.html', - styleUrls: ['/update-application-dialog.css'] + styleUrls: ['/update-application-dialog.css'], }) export class UpdateApplicationDialog { updateApplicationFormGroup: UntypedFormGroup; - constructor(public dialogRef: MatDialogRef, private _formBuilder: UntypedFormBuilder, @Inject(MAT_DIALOG_DATA) public data: any) { + constructor( + public dialogRef: MatDialogRef, + private _formBuilder: UntypedFormBuilder, + @Inject(MAT_DIALOG_DATA) public data: any + ) { this.updateApplicationFormGroup = this._formBuilder.group({ applicationName: [this.data.application.name, Validators.required], - clientId: [{value: this.data.application.clientId, disabled: true}], + clientId: [{ value: this.data.application.clientId, disabled: true }], homepageURL: [this.data.application.homepageURL, Validators.required], description: [this.data.application.description], - authorizationCallbackURL: [this.data.application.callbackURL, Validators.required], - applicationTypeId: [this.data.application.applicationTypeId, Validators.required], - privacyPolicyURL: [this.data.application.privacyPolicyUrl, ], - iconURL: [this.data.application.iconURL ] + authorizationCallbackURL: [ + this.data.application.callbackURL, + Validators.required, + ], + applicationTypeId: [ + this.data.application.applicationTypeId, + Validators.required, + ], + privacyPolicyURL: [this.data.application.privacyPolicyUrl], + iconURL: [this.data.application.iconURL], }); } - update() { - - this.dialogRef.close({formGroup: this.updateApplicationFormGroup }) + this.dialogRef.close({ formGroup: this.updateApplicationFormGroup }); } } @Component({ selector: 'create-application-dialog', templateUrl: 'create-application-dialog.html', - styleUrls: ['/create-application-dialog.css'] + styleUrls: ['/create-application-dialog.css'], }) export class CreateApplicationDialog { createApplicationFormGroup: UntypedFormGroup; - constructor(public dialogRef: MatDialogRef, private _formBuilder: UntypedFormBuilder, @Inject(MAT_DIALOG_DATA) public data: any) { + constructor( + public dialogRef: MatDialogRef, + private _formBuilder: UntypedFormBuilder, + @Inject(MAT_DIALOG_DATA) public data: any + ) { this.createApplicationFormGroup = this._formBuilder.group({ applicationName: ['', Validators.required], homepageURL: ['', Validators.required], description: [''], authorizationCallbackURL: ['', Validators.required], - applicationTypeId: ['', Validators.required] + applicationTypeId: ['', Validators.required], }); } - create() { - - this.dialogRef.close({formGroup: this.createApplicationFormGroup }) + this.dialogRef.close({ formGroup: this.createApplicationFormGroup }); } } type ApplicationTypeSummaryMapType = { [id: string]: ApplicationTypeSummary; -} +}; @Component({ selector: 'app-front-end-client-overview', templateUrl: './application-overview.component.html', - styleUrls: ['./application-overview.component.css'] + styleUrls: ['./application-overview.component.css'], }) -export class ApplicationOverviewComponent implements DynamicContentViewItem, OnInit { - +export class ApplicationOverviewComponent + implements DynamicContentViewItem, OnInit +{ @Input() data: any; - displayedColumns: string[] = ['name', 'clientId', 'type']; dataSource: ApplicationSummary[] = []; - applicationTypes: ApplicationTypeSummary[] = [] + applicationTypes: ApplicationTypeSummary[] = []; applicationTypeMap: ApplicationTypeSummaryMapType = {}; - - constructor(private cookieService: CookieService, private route: ActivatedRoute, private _formBuilder: UntypedFormBuilder, private router: Router, private dialog: MatDialog, private applicationTypeService: ApplicationTypeService, private applicationService: ApplicationService) { - } + constructor( + private cookieService: CookieService, + private route: ActivatedRoute, + private _formBuilder: UntypedFormBuilder, + private router: Router, + private dialog: MatDialog, + private applicationTypeService: ApplicationTypeService, + private applicationService: ApplicationService + ) {} create() { const dialogRef = this.dialog.open(CreateApplicationDialog, { - data: {applicationTypes: this.applicationTypes, tenantId: this.data.tenantId}, + data: { + applicationTypes: this.applicationTypes, + tenantId: this.data.tenantId, + }, }); dialogRef.afterClosed().subscribe(result => { - - this.applicationService.create(result.formGroup, this.data.tenantId) - .subscribe((response ) => { + this.applicationService + .create(result.formGroup, this.data.tenantId) + .subscribe(response => { this.refreshDataSource(); - }) - + }); }); } onRowClick(index: number) { - console.log(this.dataSource[index]) - this.applicationService.get(this.data.tenantId, this.dataSource[index].id) + console.log(this.dataSource[index]); + this.applicationService + .get(this.data.tenantId, this.dataSource[index].id) .subscribe(applicationResponse => { const dialogRef = this.dialog.open(UpdateApplicationDialog, { - data: {applicationTypes: this.applicationTypes, tenantId: this.data.tenantId, application: applicationResponse}, + data: { + applicationTypes: this.applicationTypes, + tenantId: this.data.tenantId, + application: applicationResponse, + }, }); dialogRef.afterClosed().subscribe(updateResult => { - - this.applicationService.update(updateResult.formGroup, this.data.tenantId, this.dataSource[index].id) + this.applicationService + .update( + updateResult.formGroup, + this.data.tenantId, + this.dataSource[index].id + ) .subscribe(result => { - console.log('update result is: ', result) + console.log('update result is: ', result); this.refreshDataSource(); - }) - + }); }); - }) - - - + }); } ngOnInit(): void { - this.applicationTypeService.get() - .subscribe(applicationTypes => { - this.applicationTypes = applicationTypes - - for (let i = 0; i < applicationTypes.length; i ++) { - this.applicationTypeMap[applicationTypes[i].id] = applicationTypes[i] - } - this.refreshDataSource(); - }) + this.applicationTypeService.get().subscribe(applicationTypes => { + this.applicationTypes = applicationTypes; + for (let i = 0; i < applicationTypes.length; i++) { + this.applicationTypeMap[applicationTypes[i].id] = applicationTypes[i]; + } + this.refreshDataSource(); + }); } private refreshDataSource() { this.dataSource = []; - this.applicationService.getPage(this.data.tenantId, 100) + this.applicationService + .getPage(this.data.tenantId, 100) .subscribe(applicationSummaries => { for (let i = 0; i < applicationSummaries.data.length; i++) { let summary = applicationSummaries.data[i]; @@ -140,11 +178,10 @@ export class ApplicationOverviewComponent implements DynamicContentViewItem, OnI id: summary.id, name: summary.name, clientId: summary.clientId, - type: this.applicationTypeMap[summary.applicationTypeId].name + type: this.applicationTypeMap[summary.applicationTypeId].name, }; - this.dataSource = [...this.dataSource, newRow] + this.dataSource = [...this.dataSource, newRow]; } - - }) + }); } } diff --git a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/create-application-dialog.html b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/create-application-dialog.html index 24db97f..4cb86c8 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/create-application-dialog.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/create-application-dialog.html @@ -5,23 +5,27 @@

Create Application

Select Application Type

- - {{item.name}} + + {{ item.name }}
- Application Name - +
Homepage URL - +
@@ -31,16 +35,18 @@

Select Application Type

Authorization Callback URL - + -
-
- diff --git a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/update-application-dialog.html b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/update-application-dialog.html index 5fb04fb..aa09fac 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/application-overview/update-application-dialog.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/application-overview/update-application-dialog.html @@ -5,27 +5,31 @@

Update Application

Select Application Type

- - {{item.name}} + + {{ item.name }}
- Application Name - + Client Id - +
Homepage URL - +
@@ -35,26 +39,28 @@

Select Application Type

Authorization Callback URL - + - Privacy Policy URL - + Privacy Policy URL + Icon URL - + -
-
- diff --git a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view-item.ts b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view-item.ts index 1c45c32..1676f21 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view-item.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view-item.ts @@ -2,7 +2,6 @@ export interface DynamicContentViewItem { data: any; } - /* Copyright Google LLC. All Rights Reserved. Use of this source code is governed by an MIT-style license that diff --git a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.component.ts index a6ce552..59ae720 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.component.ts @@ -1,17 +1,23 @@ -import { Component, Input, OnDestroy, OnInit, Type, ViewChild } from '@angular/core'; +import { + Component, + Input, + OnDestroy, + OnInit, + Type, + ViewChild, +} from '@angular/core'; import { DynamicContentViewDirective } from './dynamic-content-view.directive'; import { DynamicContentView } from './dynamic-content-view'; import { DynamicContentViewItem } from './dynamic-content-view-item'; - @Component({ selector: 'app-dynamic-content-view', templateUrl: './dynamic-content-view.component.html', - styleUrls: ['./dynamic-content-view.component.css'] + styleUrls: ['./dynamic-content-view.component.css'], }) export class DynamicContentViewComponent implements OnInit, OnDestroy { - @Input() views: { [id:string] : DynamicContentView } = {}; + @Input() views: { [id: string]: DynamicContentView } = {}; @Input() view!: DynamicContentView; @@ -19,7 +25,8 @@ export class DynamicContentViewComponent implements OnInit, OnDestroy { previousComponent!: Type; - @ViewChild(DynamicContentViewDirective, {static: true}) dynamicContentViewHost!: DynamicContentViewDirective; + @ViewChild(DynamicContentViewDirective, { static: true }) + dynamicContentViewHost!: DynamicContentViewDirective; private clearTimer: VoidFunction | undefined; @@ -37,21 +44,23 @@ export class DynamicContentViewComponent implements OnInit, OnDestroy { } const viewContainerRef = this.dynamicContentViewHost.viewContainerRef; viewContainerRef.clear(); - this.previousComponent = this.view.component - const componentRef = viewContainerRef.createComponent(this.view.component); + this.previousComponent = this.view.component; + const componentRef = + viewContainerRef.createComponent( + this.view.component + ); componentRef.instance.data = this.view.data; } getDynamicViews() { const interval = setInterval(() => { //this.loadDynamicComponent(); - this.loadSingleComponent() + this.loadSingleComponent(); }, 0); this.clearTimer = () => clearInterval(interval); } } - /* Copyright Google LLC. All Rights Reserved. Use of this source code is governed by an MIT-style license that diff --git a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.directive.ts b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.directive.ts index 83c8ab6..2075bc3 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.directive.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.directive.ts @@ -4,11 +4,9 @@ import { Directive, ViewContainerRef } from '@angular/core'; selector: '[dynamicContentViewHost]', }) export class DynamicContentViewDirective { - constructor(public viewContainerRef: ViewContainerRef) { } + constructor(public viewContainerRef: ViewContainerRef) {} } - - /* Copyright Google LLC. All Rights Reserved. Use of this source code is governed by an MIT-style license that diff --git a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.service.ts b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.service.ts index d673bb9..02412b1 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.service.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.service.ts @@ -11,59 +11,60 @@ import { LoginBoxOverviewComponent } from './login-box-overview/login-box-overvi @Injectable() export class DynamicContentViewService { - viewDictionary: { [id:string] : DynamicContentView } = {} + viewDictionary: { [id: string]: DynamicContentView } = {}; constructor() { - this.viewDictionary['applications'] = new DynamicContentView( - ApplicationOverviewComponent, {} - ) + ApplicationOverviewComponent, + {} + ); this.viewDictionary['apis'] = new DynamicContentView( - ApiOverviewComponent, {} - ) + ApiOverviewComponent, + {} + ); this.viewDictionary['users'] = new DynamicContentView( - UserOverviewComponent, {} - ) + UserOverviewComponent, + {} + ); this.viewDictionary['roles'] = new DynamicContentView( - RolesOverviewComponent, {} - ) + RolesOverviewComponent, + {} + ); this.viewDictionary['system overview'] = new DynamicContentView( - SystemOverviewComponent, {} - ) + SystemOverviewComponent, + {} + ); this.viewDictionary['tenant overview'] = new DynamicContentView( - TenantOverviewComponent, {} - ) + TenantOverviewComponent, + {} + ); this.viewDictionary['login box settings'] = new DynamicContentView( - LoginBoxOverviewComponent, {} - ) + LoginBoxOverviewComponent, + {} + ); } - - getViews() { - return this.viewDictionary + return this.viewDictionary; } getViewsForTenant(tenantId: string) { - for(let key in this.viewDictionary) { - this.viewDictionary[key].data.tenantId = tenantId + for (let key in this.viewDictionary) { + this.viewDictionary[key].data.tenantId = tenantId; } - return this.viewDictionary + return this.viewDictionary; } getView(key: string) { - return this.viewDictionary[key] + return this.viewDictionary[key]; } - - } - /* Copyright Google LLC. All Rights Reserved. Use of this source code is governed by an MIT-style license that diff --git a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.ts b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.ts index 4b734fd..a7da55a 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/dynamic-content-view.ts @@ -1,10 +1,12 @@ import { Type } from '@angular/core'; export class DynamicContentView { - constructor(public component: Type, public data: any) {} + constructor( + public component: Type, + public data: any + ) {} } - /* Copyright Google LLC. All Rights Reserved. Use of this source code is governed by an MIT-style license that diff --git a/projects/iridium-ui/src/app/components/dashboard/content/external-provider-overview/external-provider-overview.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/content/external-provider-overview/external-provider-overview.component.spec.ts index 742b2c4..819967e 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/external-provider-overview/external-provider-overview.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/external-provider-overview/external-provider-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('ExternalProviderOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ExternalProviderOverviewComponent ] - }) - .compileComponents(); + declarations: [ExternalProviderOverviewComponent], + }).compileComponents(); fixture = TestBed.createComponent(ExternalProviderOverviewComponent); component = fixture.componentInstance; diff --git a/projects/iridium-ui/src/app/components/dashboard/content/external-provider-overview/external-provider-overview.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/external-provider-overview/external-provider-overview.component.ts index aea81bf..58a4bf6 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/external-provider-overview/external-provider-overview.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/external-provider-overview/external-provider-overview.component.ts @@ -3,8 +3,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-external-provider-overview', templateUrl: './external-provider-overview.component.html', - styleUrls: ['./external-provider-overview.component.css'] + styleUrls: ['./external-provider-overview.component.css'], }) -export class ExternalProviderOverviewComponent { - -} +export class ExternalProviderOverviewComponent {} diff --git a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/add-external-provider-dialog.html b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/add-external-provider-dialog.html index 7ee5eef..853d1ed 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/add-external-provider-dialog.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/add-external-provider-dialog.html @@ -1,37 +1,53 @@

Add Identity Provider

- -
+

Select Provider Type

Choose an option - {{item.name}} + {{ item.name }}
- Client ID - +
Client Secret - +
-
- diff --git a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.html b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.html index 01c28cd..fb5ae46 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.html @@ -1,52 +1,58 @@

Login Box Settings

- -
- - - tenant logo - - + + + tenant logo - + Logo URL - +
- +
-
- +

Integrated Social Providers

- - ID - {{element.id}} + {{ element.id }} Provider Name - {{element.name}} + {{ element.name }} - +
-
diff --git a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.spec.ts index 57a317a..9e91a4d 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('LoginBoxOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoginBoxOverviewComponent ] - }) - .compileComponents(); + declarations: [LoginBoxOverviewComponent], + }).compileComponents(); fixture = TestBed.createComponent(LoginBoxOverviewComponent); component = fixture.componentInstance; diff --git a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.ts index 74626d5..0af9375 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/login-box-overview.component.ts @@ -1,12 +1,18 @@ import { Component, Inject, Input, OnInit } from '@angular/core'; import { DynamicContentViewItem } from '../dynamic-content-view-item'; import { ExternalProviderResponse } from '../../domain/external-provider-response'; -import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { ExternalProviderTemplateService } from '../../../../services/external-provider-template.service'; import { - ExternalProviderTemplateSummaryResponse -} from '../../../../services/domain/external-provider-template-summary-response'; + UntypedFormBuilder, + UntypedFormGroup, + Validators, +} from '@angular/forms'; +import { + MAT_DIALOG_DATA, + MatDialog, + MatDialogRef, +} from '@angular/material/dialog'; +import { ExternalProviderTemplateService } from '../../../../services/external-provider-template.service'; +import { ExternalProviderTemplateSummaryResponse } from '../../../../services/domain/external-provider-template-summary-response'; import { ExternalIdentityProviderService } from '../../../../services/external-identity-provider.service'; import { LoginDescriptorService } from '../../../../services/login-descriptor.service'; @@ -14,132 +20,159 @@ import { LoginDescriptorService } from '../../../../services/login-descriptor.se @Component({ selector: 'update-external-provider-dialog', templateUrl: 'update-external-provider-dialog.html', - styleUrls: ['update-external-provider-dialog.css'] + styleUrls: ['update-external-provider-dialog.css'], }) export class UpdateExternalProviderDialog { updateExternalProviderForm: UntypedFormGroup; - constructor(public dialogRef: MatDialogRef, private _formBuilder: UntypedFormBuilder, @Inject(MAT_DIALOG_DATA) public data: any) { + constructor( + public dialogRef: MatDialogRef, + private _formBuilder: UntypedFormBuilder, + @Inject(MAT_DIALOG_DATA) public data: any + ) { this.updateExternalProviderForm = this._formBuilder.group({ - name: [{value: this.data.externalProvider.name, disabled: true}, Validators.required], + name: [ + { value: this.data.externalProvider.name, disabled: true }, + Validators.required, + ], clientId: [this.data.externalProvider.clientId, Validators.required], - clientSecret: [this.data.externalProvider.clientSecret, Validators.required], + clientSecret: [ + this.data.externalProvider.clientSecret, + Validators.required, + ], }); } - update() { - - this.dialogRef.close({formGroup: this.updateExternalProviderForm }) + this.dialogRef.close({ formGroup: this.updateExternalProviderForm }); } } @Component({ selector: 'add-external-provider-dialog', templateUrl: 'add-external-provider-dialog.html', - styleUrls: ['add-external-provider-dialog.css'] + styleUrls: ['add-external-provider-dialog.css'], }) export class AddExternalProviderDialog { addProviderDialogFormGroup: UntypedFormGroup; - constructor(public dialogRef: MatDialogRef, private _formBuilder: UntypedFormBuilder, @Inject(MAT_DIALOG_DATA) public data: any) { + constructor( + public dialogRef: MatDialogRef, + private _formBuilder: UntypedFormBuilder, + @Inject(MAT_DIALOG_DATA) public data: any + ) { this.addProviderDialogFormGroup = this._formBuilder.group({ externalProviderTemplateId: ['', Validators.required], clientId: ['', Validators.required], clientSecret: ['', Validators.required], }); - } - - create() { - - this.dialogRef.close({formGroup: this.addProviderDialogFormGroup }) + this.dialogRef.close({ formGroup: this.addProviderDialogFormGroup }); } } type ExternalProviderTemplateSummaryMapType = { [id: string]: ExternalProviderTemplateSummaryResponse; -} +}; @Component({ selector: 'app-login-box-overview', templateUrl: './login-box-overview.component.html', - styleUrls: ['./login-box-overview.component.css'] + styleUrls: ['./login-box-overview.component.css'], }) -export class LoginBoxOverviewComponent implements DynamicContentViewItem, OnInit { +export class LoginBoxOverviewComponent + implements DynamicContentViewItem, OnInit +{ @Input() data: any; displayedColumns: string[] = ['id', 'providerName']; dataSource: ExternalProviderResponse[] = []; - externalProviderTemplateSummaries: ExternalProviderTemplateSummaryResponse[] = []; + externalProviderTemplateSummaries: ExternalProviderTemplateSummaryResponse[] = + []; externalTemplateMapType: ExternalProviderTemplateSummaryMapType = {}; updateTenantLogoFormGroup: UntypedFormGroup; currentLogoUrl = ''; - constructor(private externalProviderTemplateService: ExternalProviderTemplateService, private _formBuilder: UntypedFormBuilder, private loginDescriptorService: LoginDescriptorService, private dialog: MatDialog, private externalProviderService: ExternalIdentityProviderService) { + constructor( + private externalProviderTemplateService: ExternalProviderTemplateService, + private _formBuilder: UntypedFormBuilder, + private loginDescriptorService: LoginDescriptorService, + private dialog: MatDialog, + private externalProviderService: ExternalIdentityProviderService + ) { this.updateTenantLogoFormGroup = this._formBuilder.group({ tenantLogoUrl: ['', Validators.required], - }) + }); } onRowClick(index: number) { - console.log('clicked on row: ', index) - this.externalProviderService.get(this.data.tenantId, this.dataSource[index].id) + console.log('clicked on row: ', index); + this.externalProviderService + .get(this.data.tenantId, this.dataSource[index].id) .subscribe(externalProviderResponse => { console.log('provider', externalProviderResponse); const dialogRef = this.dialog.open(UpdateExternalProviderDialog, { - - data: {externalProviderTemplates: this.externalProviderTemplateSummaries, tenantId: this.data.tenantId, externalProvider: externalProviderResponse}, + data: { + externalProviderTemplates: this.externalProviderTemplateSummaries, + tenantId: this.data.tenantId, + externalProvider: externalProviderResponse, + }, }); dialogRef.afterClosed().subscribe(updateResult => { - - this.externalProviderService.update(updateResult.formGroup, this.data.tenantId, this.dataSource[index].id) + this.externalProviderService + .update( + updateResult.formGroup, + this.data.tenantId, + this.dataSource[index].id + ) .subscribe(result => { - console.log('update result is: ', result) + console.log('update result is: ', result); this.refreshDataSource(); - }) - + }); }); - }) + }); } - addProvider() { const dialogRef = this.dialog.open(AddExternalProviderDialog, { - data: {externalProviderTemplates: this.externalProviderTemplateSummaries, tenantId: this.data.tenantId, currentProviders: this.dataSource}, + data: { + externalProviderTemplates: this.externalProviderTemplateSummaries, + tenantId: this.data.tenantId, + currentProviders: this.dataSource, + }, }); dialogRef.afterClosed().subscribe(result => { - - if (result) { - this.externalProviderService.create(result.formGroup, this.data.tenantId) - .subscribe(result => { - this.refreshDataSource(); - }) - } + if (result) { + this.externalProviderService + .create(result.formGroup, this.data.tenantId) + .subscribe(result => { + this.refreshDataSource(); + }); + } }); } updateLogo() { - this.loginDescriptorService.updateTenantLogo(this.updateTenantLogoFormGroup, this.data.tenantId) - .subscribe((result) => { - console.log('update log response ', result) + this.loginDescriptorService + .updateTenantLogo(this.updateTenantLogoFormGroup, this.data.tenantId) + .subscribe(result => { + console.log('update log response ', result); this.describeDescriptor(); - }) + }); } describeDescriptor() { - this.loginDescriptorService.get(this.data.tenantId) - .subscribe(response => { - this.currentLogoUrl = response.tenantLogoUrl; - this.updateTenantLogoFormGroup.patchValue({ - tenantLogoUrl: response.tenantLogoUrl - }) - }) - + this.loginDescriptorService.get(this.data.tenantId).subscribe(response => { + this.currentLogoUrl = response.tenantLogoUrl; + this.updateTenantLogoFormGroup.patchValue({ + tenantLogoUrl: response.tenantLogoUrl, + }); + }); } private refreshDataSource() { this.dataSource = []; - this.externalProviderService.getAll(this.data.tenantId) + this.externalProviderService + .getAll(this.data.tenantId) .subscribe(providerSummaries => { for (let i = 0; i < providerSummaries.length; i++) { let summary = providerSummaries[i]; @@ -148,26 +181,31 @@ export class LoginBoxOverviewComponent implements DynamicContentViewItem, OnInit name: summary.name, iconPath: summary.iconPath, clientSecret: '', - clientId: '' + clientId: '', }; - this.dataSource = [...this.dataSource, newRow] + this.dataSource = [...this.dataSource, newRow]; } - - }) + }); } ngOnInit(): void { - this.describeDescriptor(); - this.externalProviderTemplateService.getSummaries() + this.externalProviderTemplateService + .getSummaries() .subscribe(externalTemplates => { this.externalProviderTemplateSummaries = externalTemplates; - for (let i = 0; i < this.externalProviderTemplateSummaries.length; i++) { - this.externalTemplateMapType[this.externalProviderTemplateSummaries[i].id] = this.externalProviderTemplateSummaries[i] + for ( + let i = 0; + i < this.externalProviderTemplateSummaries.length; + i++ + ) { + this.externalTemplateMapType[ + this.externalProviderTemplateSummaries[i].id + ] = this.externalProviderTemplateSummaries[i]; } this.refreshDataSource(); - }) + }); } } diff --git a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/update-external-provider-dialog.html b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/update-external-provider-dialog.html index b94d3c8..e383b90 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/update-external-provider-dialog.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/login-box-overview/update-external-provider-dialog.html @@ -3,32 +3,35 @@

Update External Provider

Update details for your third party provider
-
- Application Name - + Client Id - +
Client Secret - +
- - -
-
- -
+ +
+ +
- diff --git a/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/create-role-dialog.html b/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/create-role-dialog.html index 7280ff0..202dd5f 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/create-role-dialog.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/create-role-dialog.html @@ -1,42 +1,47 @@

Create Role

-
-

Create New Role

+ +

Create New Role

-
-

Select Application Type

- - Web App - Single Page App - -

Chosen value is {{fontStyleControl.value}}

-
+
+

Select Application Type

+ + Web App + Single Page App + +

Chosen value is {{ fontStyleControl.value }}

+
- - Application Name - - -
- Homepage URL - + Application Name + -
- - Description - - -
+
+ + Homepage URL + + +
- Authorization Callback URL - + Description + - -
-
- -
-
+
+ + Authorization Callback URL + + +
+
+ +
+
diff --git a/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.html b/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.html index 8c3cc6a..18affcd 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.html @@ -1,42 +1,39 @@
- +

Current Roles

- - Name - {{element.name}} + {{ element.name }} Client ID - {{element.clientId}} + {{ element.clientId }} - - - Type - {{element.type}} + {{ element.type }} - - +
-
diff --git a/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.spec.ts index 9e88393..a205cf2 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('RolesOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ RolesOverviewComponent ] - }) - .compileComponents(); + declarations: [RolesOverviewComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.ts index a544d7e..103ad74 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/roles-overview/roles-overview.component.ts @@ -1,16 +1,20 @@ import { Component, Input } from '@angular/core'; import { DynamicContentViewItem } from '../dynamic-content-view-item'; -import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; +import { + UntypedFormBuilder, + UntypedFormControl, + UntypedFormGroup, + Validators, +} from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { CookieService } from '../../../../services/cookie.service'; import { ActivatedRoute, Router } from '@angular/router'; import { ApplicationSummary } from '../../domain/application-summary'; - @Component({ selector: 'create-role-dialog', templateUrl: './create-role-dialog.html', - styleUrls: ['./create-role-dialog.css'] + styleUrls: ['./create-role-dialog.css'], }) export class CreateRoleDialog { fontStyleControl = new UntypedFormControl(''); @@ -18,7 +22,10 @@ export class CreateRoleDialog { createRoleFormGroup: UntypedFormGroup; // @ts-ignore - constructor(public dialogRef: MatDialogRef, private _formBuilder: UntypedFormBuilder) { + constructor( + public dialogRef: MatDialogRef, + private _formBuilder: UntypedFormBuilder + ) { this.createRoleFormGroup = this._formBuilder.group({ applicationName: ['', Validators.required], homepageURL: ['', Validators.required], @@ -28,20 +35,25 @@ export class CreateRoleDialog { } create() { - console.log('yes') + console.log('yes'); } } @Component({ selector: 'app-roles-overview', templateUrl: './roles-overview.component.html', - styleUrls: ['./roles-overview.component.css'] + styleUrls: ['./roles-overview.component.css'], }) export class RolesOverviewComponent implements DynamicContentViewItem { - @Input() data: any; displayedColumns: string[] = ['name', 'clientId', 'type']; dataSource: ApplicationSummary[] = []; - constructor(private cookieService: CookieService, private route: ActivatedRoute, private _formBuilder: UntypedFormBuilder, private router: Router, private dialog: MatDialog) { } + constructor( + private cookieService: CookieService, + private route: ActivatedRoute, + private _formBuilder: UntypedFormBuilder, + private router: Router, + private dialog: MatDialog + ) {} create() { const dialogRef = this.dialog.open(CreateRoleDialog, { @@ -53,7 +65,6 @@ export class RolesOverviewComponent implements DynamicContentViewItem { }); } onRowClick(index: number) { - console.log('clicked on row: ', index) + console.log('clicked on row: ', index); } - } diff --git a/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.html b/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.html index 8b13789..e69de29 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.html @@ -1 +0,0 @@ - diff --git a/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.spec.ts index 82b37c8..1cc81db 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('SystemOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ SystemOverviewComponent ] - }) - .compileComponents(); + declarations: [SystemOverviewComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.ts index 3ef4a45..e0356fd 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/system-overview/system-overview.component.ts @@ -4,13 +4,9 @@ import { DynamicContentViewItem } from '../dynamic-content-view-item'; @Component({ selector: 'app-system-overview', templateUrl: './system-overview.component.html', - styleUrls: ['./system-overview.component.css'] + styleUrls: ['./system-overview.component.css'], }) export class SystemOverviewComponent implements DynamicContentViewItem { - @Input() data: any; - constructor() { - } - - + constructor() {} } diff --git a/projects/iridium-ui/src/app/components/dashboard/content/tenant-overview/tenant-overview.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/content/tenant-overview/tenant-overview.component.spec.ts index eded0dd..2d8245d 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/tenant-overview/tenant-overview.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/tenant-overview/tenant-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('TenantOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ TenantOverviewComponent ] - }) - .compileComponents(); + declarations: [TenantOverviewComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/dashboard/content/tenant-overview/tenant-overview.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/tenant-overview/tenant-overview.component.ts index 17ec7f5..9bcad09 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/tenant-overview/tenant-overview.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/tenant-overview/tenant-overview.component.ts @@ -4,12 +4,9 @@ import { DynamicContentViewItem } from '../dynamic-content-view-item'; @Component({ selector: 'app-tenant-overview', templateUrl: './tenant-overview.component.html', - styleUrls: ['./tenant-overview.component.css'] + styleUrls: ['./tenant-overview.component.css'], }) export class TenantOverviewComponent implements DynamicContentViewItem { @Input() data: any; - constructor() { } - - - + constructor() {} } diff --git a/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.html b/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.html index 60506e6..fbacad8 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.html +++ b/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.html @@ -1,29 +1,27 @@
-

Current Users

- - ID - {{element.id}} + {{ element.id }} Email Address - {{element.emailAddress}} + {{ element.emailAddress }} - +
-
diff --git a/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.spec.ts index e6c7fa3..4012764 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('UserOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ UserOverviewComponent ] - }) - .compileComponents(); + declarations: [UserOverviewComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.ts b/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.ts index 52a9378..baf17f2 100644 --- a/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/content/user-overview/user-overview.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit, } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { DynamicContentViewItem } from '../dynamic-content-view-item'; import { UntypedFormBuilder } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; @@ -9,31 +9,38 @@ import { IdentitySummaryResponse } from '../../domain/identity-summary-response' type IdentitySummaryMapType = { [id: string]: IdentitySummaryResponse; -} +}; @Component({ selector: 'app-user-overview', templateUrl: './user-overview.component.html', - styleUrls: ['./user-overview.component.css'] + styleUrls: ['./user-overview.component.css'], }) export class UserOverviewComponent implements DynamicContentViewItem, OnInit { @Input() data: any; displayedColumns: string[] = ['id', 'emailAddress']; dataSource: IdentitySummaryResponse[] = []; - constructor(private identityServie: IdentityService, private cookieService: CookieService, private route: ActivatedRoute, private _formBuilder: UntypedFormBuilder, private router: Router, private dialog: MatDialog) { } + constructor( + private identityServie: IdentityService, + private cookieService: CookieService, + private route: ActivatedRoute, + private _formBuilder: UntypedFormBuilder, + private router: Router, + private dialog: MatDialog + ) {} onRowClick(index: number) { - console.log('clicked on row: ', index) + console.log('clicked on row: ', index); } ngOnInit(): void { this.refreshDataSource(); - } private refreshDataSource() { this.dataSource = []; - this.identityServie.getSummariesByParentTenant(this.data.tenantId, 100) + this.identityServie + .getSummariesByParentTenant(this.data.tenantId, 100) .subscribe(identitySummaries => { for (let i = 0; i < identitySummaries.data.length; i++) { let summary = identitySummaries.data[i]; @@ -41,9 +48,8 @@ export class UserOverviewComponent implements DynamicContentViewItem, OnInit { id: summary.id, emailAddress: summary.emailAddress, }; - this.dataSource = [...this.dataSource, newRow] + this.dataSource = [...this.dataSource, newRow]; } - - }) + }); } } diff --git a/projects/iridium-ui/src/app/components/dashboard/create-tenant-prompt-dialog.html b/projects/iridium-ui/src/app/components/dashboard/create-tenant-prompt-dialog.html index d1c9031..4f47be1 100644 --- a/projects/iridium-ui/src/app/components/dashboard/create-tenant-prompt-dialog.html +++ b/projects/iridium-ui/src/app/components/dashboard/create-tenant-prompt-dialog.html @@ -1,25 +1,32 @@

Create Tenant

- Enter a name for you tenant. Tenant names need to be unique and url safe. + Enter a name for you tenant. Tenant names need to be unique and url safe.
- - - + + +
Select the appropriate environment for the tenant you are creating.
- - sandbox - development - staging - production - + + sandbox + development + staging + production +
-
- - + +
diff --git a/projects/iridium-ui/src/app/components/dashboard/dashboard.component.html b/projects/iridium-ui/src/app/components/dashboard/dashboard.component.html index d6d6524..c3d7a11 100644 --- a/projects/iridium-ui/src/app/components/dashboard/dashboard.component.html +++ b/projects/iridium-ui/src/app/components/dashboard/dashboard.component.html @@ -1,11 +1,12 @@ - - - + - @@ -15,48 +16,49 @@ Logout - - - -
- - Select Tenant - - - {{tenant.viewValue}} - - - + +
+ + Select Tenant + + + {{ tenant.viewValue }} + + +
- +
- - - - + - {{menuItem.name}} + {{ menuItem.name }} - - -
- + diff --git a/projects/iridium-ui/src/app/components/dashboard/dashboard.component.spec.ts b/projects/iridium-ui/src/app/components/dashboard/dashboard.component.spec.ts index 5ec4ff8..22eabfa 100644 --- a/projects/iridium-ui/src/app/components/dashboard/dashboard.component.spec.ts +++ b/projects/iridium-ui/src/app/components/dashboard/dashboard.component.spec.ts @@ -8,9 +8,8 @@ describe('DashboardComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DashboardComponent ] - }) - .compileComponents(); + declarations: [DashboardComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/dashboard/dashboard.component.ts b/projects/iridium-ui/src/app/components/dashboard/dashboard.component.ts index 60ca8b6..72131eb 100644 --- a/projects/iridium-ui/src/app/components/dashboard/dashboard.component.ts +++ b/projects/iridium-ui/src/app/components/dashboard/dashboard.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { DynamicContentViewService } from './content/dynamic-content-view.service'; import { DynamicContentView } from './content/dynamic-content-view'; -import {MatDialog, MatDialogRef} from '@angular/material/dialog'; +import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { TenantSelectItem } from './domain/tenant-select-item'; import { TenantService } from '../../services/tenant.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; @@ -11,10 +11,6 @@ import { MenuItemService } from '../../services/menu-item.service'; import { Router } from '@angular/router'; import { NgxIridiumClientService } from '@iridiumidentity/ngx-iridium-client'; - - - - @Component({ selector: 'create-tenant-prompt-dialog', templateUrl: 'create-tenant-prompt-dialog.html', @@ -26,89 +22,92 @@ export class CreateTenantPromptDialog { private tenantService: TenantService, private formBuilder: FormBuilder ) { - console.log("dashboard constructed") + console.log('dashboard constructed'); this.createTenantFormGroup = this.formBuilder.group({ tenantName: ['', Validators.required], environment: ['', Validators.required], }); - } - onDialogYes() { const dialogRef = this.dialogRef; - this.tenantService.create(this.createTenantFormGroup) - .subscribe({ - next(v) { - console.log('success creating tenant') - console.log(v) - dialogRef.close({}) - - }, - error(e) { - console.log('error creating tenant') - console.log(e) - }, - complete() { - console.log('complete') - } - }) + this.tenantService.create(this.createTenantFormGroup).subscribe({ + next(v) { + console.log('success creating tenant'); + console.log(v); + dialogRef.close({}); + }, + error(e) { + console.log('error creating tenant'); + console.log(e); + }, + complete() { + console.log('complete'); + }, + }); } } @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', - styleUrls: ['./dashboard.component.css'] + styleUrls: ['./dashboard.component.css'], }) export class DashboardComponent implements OnInit, OnDestroy { panelOpenState = false; menuItemNodes: MenuItemNode[]; - interval: number|undefined; - @Input() views: { [id:string] : DynamicContentView } = {} + interval: number | undefined; + @Input() views: { [id: string]: DynamicContentView } = {}; @Input() view!: DynamicContentView; tenants: TenantSelectItem[] = []; selectedTenant!: string; - constructor(private router: Router, private contentViewService: DynamicContentViewService, private dialog: MatDialog, private iridiumClient: NgxIridiumClientService, private tenantService: TenantService, private menuItemService: MenuItemService) { + constructor( + private router: Router, + private contentViewService: DynamicContentViewService, + private dialog: MatDialog, + private iridiumClient: NgxIridiumClientService, + private tenantService: TenantService, + private menuItemService: MenuItemService + ) { this.menuItemNodes = this.menuItemService.getMenuItems(); } ngOnInit(): void { this.views = this.contentViewService.getViews(); - this.view = this.views['system overview'] + this.view = this.views['system overview']; this.getTenantSummaries(); - } getTenantSummaries() { this.tenants = []; - this.tenantService.getTenantSummaries() - .subscribe(summaries => { - console.log('summaries', summaries) - for (let i = 0; i < summaries.length; i++) { - this.tenants.push({ value: summaries[i].id, viewValue: summaries[i].subdomain}) - } - - - }) + this.tenantService.getTenantSummaries().subscribe(summaries => { + console.log('summaries', summaries); + for (let i = 0; i < summaries.length; i++) { + this.tenants.push({ + value: summaries[i].id, + viewValue: summaries[i].subdomain, + }); + } + }); } onTenantChange(event: MatSelectChange) { this.selectedTenant = event.value; - for(let key in this.views) { - this.views = this.contentViewService.getViewsForTenant(this.selectedTenant) - this.view = this.contentViewService.getView('system overview') + for (let key in this.views) { + this.views = this.contentViewService.getViewsForTenant( + this.selectedTenant + ); + this.view = this.contentViewService.getView('system overview'); } } ngOnDestroy() { - clearInterval(this.interval); } subItemClick(event: string) { - this.view = this.views[event.toLowerCase()] + this.view = this.views[event.toLowerCase()]; } openDialog(): void { @@ -117,15 +116,13 @@ export class DashboardComponent implements OnInit, OnDestroy { }); dialogRef.afterClosed().subscribe(result => { - console.log('get tenant summaries') - this.getTenantSummaries() + console.log('get tenant summaries'); + this.getTenantSummaries(); }); - } login() { this.iridiumClient.authenticateWithExternalRedirect(); - } register() { @@ -136,4 +133,3 @@ export class DashboardComponent implements OnInit, OnDestroy { this.router.navigateByUrl('/'); } } - diff --git a/projects/iridium-ui/src/app/components/dashboard/domain/create-external-identity-provider-request.ts b/projects/iridium-ui/src/app/components/dashboard/domain/create-external-identity-provider-request.ts index 97811fb..92d8d93 100644 --- a/projects/iridium-ui/src/app/components/dashboard/domain/create-external-identity-provider-request.ts +++ b/projects/iridium-ui/src/app/components/dashboard/domain/create-external-identity-provider-request.ts @@ -1,7 +1,7 @@ export class CreateExternalIdentityProviderRequest { - externalProviderTemplateId = ""; + externalProviderTemplateId = ''; - clientId = ""; + clientId = ''; - clientSecret = ""; + clientSecret = ''; } diff --git a/projects/iridium-ui/src/app/components/dashboard/domain/external-provider-response.ts b/projects/iridium-ui/src/app/components/dashboard/domain/external-provider-response.ts index 34d8360..028bbe0 100644 --- a/projects/iridium-ui/src/app/components/dashboard/domain/external-provider-response.ts +++ b/projects/iridium-ui/src/app/components/dashboard/domain/external-provider-response.ts @@ -1,6 +1,6 @@ export class ExternalProviderResponse { - id: string = ""; - name: string = ""; - clientId: string = ""; - clientSecret: string = ""; + id: string = ''; + name: string = ''; + clientId: string = ''; + clientSecret: string = ''; } diff --git a/projects/iridium-ui/src/app/components/dashboard/domain/tenant-select-item.ts b/projects/iridium-ui/src/app/components/dashboard/domain/tenant-select-item.ts index 975acef..c51aede 100644 --- a/projects/iridium-ui/src/app/components/dashboard/domain/tenant-select-item.ts +++ b/projects/iridium-ui/src/app/components/dashboard/domain/tenant-select-item.ts @@ -1,4 +1,4 @@ -export interface TenantSelectItem{ +export interface TenantSelectItem { value: string; viewValue: string; } diff --git a/projects/iridium-ui/src/app/components/dashboard/domain/view-item.ts b/projects/iridium-ui/src/app/components/dashboard/domain/view-item.ts index bc7f15c..eb9f405 100644 --- a/projects/iridium-ui/src/app/components/dashboard/domain/view-item.ts +++ b/projects/iridium-ui/src/app/components/dashboard/domain/view-item.ts @@ -1,6 +1,6 @@ import { DynamicContentView } from '../content/dynamic-content-view'; export interface ViewItem { - key: string, - value: DynamicContentView + key: string; + value: DynamicContentView; } diff --git a/projects/iridium-ui/src/app/components/register/register.component.html b/projects/iridium-ui/src/app/components/register/register.component.html index e219f34..ca98ae0 100644 --- a/projects/iridium-ui/src/app/components/register/register.component.html +++ b/projects/iridium-ui/src/app/components/register/register.component.html @@ -1,29 +1,27 @@
- iridium-home - + iridium-home +
+
+ + + + + OR + +
+ +
+
+
-
- - - - - - - OR - -
- -
- -
-
- - - - - -
diff --git a/projects/iridium-ui/src/app/components/register/register.component.spec.ts b/projects/iridium-ui/src/app/components/register/register.component.spec.ts index f6db869..39e3e8e 100644 --- a/projects/iridium-ui/src/app/components/register/register.component.spec.ts +++ b/projects/iridium-ui/src/app/components/register/register.component.spec.ts @@ -8,9 +8,8 @@ describe('RegisterComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ RegisterComponent ] - }) - .compileComponents(); + declarations: [RegisterComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/register/register.component.ts b/projects/iridium-ui/src/app/components/register/register.component.ts index f5538e9..226f3a7 100644 --- a/projects/iridium-ui/src/app/components/register/register.component.ts +++ b/projects/iridium-ui/src/app/components/register/register.component.ts @@ -4,16 +4,15 @@ import { NgxIridiumClientService } from '@iridiumidentity/ngx-iridium-client'; @Component({ selector: 'app-register', templateUrl: './register.component.html', - styleUrls: ['./register.component.css'] + styleUrls: ['./register.component.css'], }) export class RegisterComponent implements OnInit { + constructor( + private iridiumClient: NgxIridiumClientService, + public dialog: MatDialog + ) {} - - - constructor(private iridiumClient: NgxIridiumClientService, public dialog: MatDialog) { } - - ngOnInit(): void { - } + ngOnInit(): void {} public signIn() { this.iridiumClient.authenticateWithExternalRedirect(); diff --git a/projects/iridium-ui/src/app/components/spinner/spinner.component.html b/projects/iridium-ui/src/app/components/spinner/spinner.component.html index b9ee57c..f3b1612 100644 --- a/projects/iridium-ui/src/app/components/spinner/spinner.component.html +++ b/projects/iridium-ui/src/app/components/spinner/spinner.component.html @@ -1,8 +1,8 @@
- - -
\ No newline at end of file + + +
diff --git a/projects/iridium-ui/src/app/components/spinner/spinner.component.spec.ts b/projects/iridium-ui/src/app/components/spinner/spinner.component.spec.ts index 061f78d..ee463eb 100644 --- a/projects/iridium-ui/src/app/components/spinner/spinner.component.spec.ts +++ b/projects/iridium-ui/src/app/components/spinner/spinner.component.spec.ts @@ -8,9 +8,8 @@ describe('SpinnerComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ SpinnerComponent ] - }) - .compileComponents(); + declarations: [SpinnerComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/projects/iridium-ui/src/app/components/spinner/spinner.component.ts b/projects/iridium-ui/src/app/components/spinner/spinner.component.ts index 16a66a6..569653f 100644 --- a/projects/iridium-ui/src/app/components/spinner/spinner.component.ts +++ b/projects/iridium-ui/src/app/components/spinner/spinner.component.ts @@ -1,20 +1,17 @@ import { Component, OnInit } from '@angular/core'; -import {ThemePalette} from '@angular/material/core'; -import {ProgressSpinnerMode} from '@angular/material/progress-spinner'; +import { ThemePalette } from '@angular/material/core'; +import { ProgressSpinnerMode } from '@angular/material/progress-spinner'; @Component({ selector: 'app-spinner', templateUrl: './spinner.component.html', - styleUrls: ['./spinner.component.css'] + styleUrls: ['./spinner.component.css'], }) export class SpinnerComponent implements OnInit { - color: ThemePalette = 'accent'; mode: ProgressSpinnerMode = 'indeterminate'; - constructor() { } - - ngOnInit(): void { - } + constructor() {} + ngOnInit(): void {} } diff --git a/projects/iridium-ui/src/app/guard/auth.guard.ts b/projects/iridium-ui/src/app/guard/auth.guard.ts index 0c0b85f..d098c57 100644 --- a/projects/iridium-ui/src/app/guard/auth.guard.ts +++ b/projects/iridium-ui/src/app/guard/auth.guard.ts @@ -6,16 +6,16 @@ import { NgxIridiumClientService } from '@iridiumidentity/ngx-iridium-client'; export const authGuard = async () => { const router = inject(Router); const authService = inject(NgxIridiumClientService); - console.log('in auth guard') + console.log('in auth guard'); // @ts-ignore authService.isAuthenticated().subscribe({ next: (value: any) => { - console.log('next', value) + console.log('next', value); return true; }, error: (error: any) => { - console.error('error', error) - router.navigateByUrl('/') + console.error('error', error); + router.navigateByUrl('/'); }, - }) + }); }; diff --git a/projects/iridium-ui/src/app/http-interceptors/http-interceptor.ts b/projects/iridium-ui/src/app/http-interceptors/http-interceptor.ts index dc7236a..37d88f8 100644 --- a/projects/iridium-ui/src/app/http-interceptors/http-interceptor.ts +++ b/projects/iridium-ui/src/app/http-interceptors/http-interceptor.ts @@ -1,28 +1,30 @@ import { Injectable } from '@angular/core'; import { - HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HttpResponse + HttpEvent, + HttpInterceptor, + HttpHandler, + HttpRequest, + HttpResponse, } from '@angular/common/http'; import { map, Observable } from 'rxjs'; @Injectable() export class NoopInterceptor implements HttpInterceptor { - - intercept(req: HttpRequest, next: HttpHandler) { - - return next.handle(req).pipe(map((event: HttpEvent) => { - + intercept(req: HttpRequest, next: HttpHandler) { + return next.handle(req).pipe( + map((event: HttpEvent) => { if (event instanceof HttpResponse) { - event = event.clone({body: this.modifyBody(event.body)}); + event = event.clone({ body: this.modifyBody(event.body) }); } return event; - })); - } + }) + ); + } private modifyBody(body: any) { - return body; + return body; /* - * write your logic to modify the body - * */ + * write your logic to modify the body + * */ } - } diff --git a/projects/iridium-ui/src/app/services/application-type.service.ts b/projects/iridium-ui/src/app/services/application-type.service.ts index abd3d8c..0204123 100644 --- a/projects/iridium-ui/src/app/services/application-type.service.ts +++ b/projects/iridium-ui/src/app/services/application-type.service.ts @@ -5,20 +5,24 @@ import { environment } from '../../environments/environment'; import { ApplicationTypeSummary } from '../components/dashboard/domain/application-type-summary'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class ApplicationTypeService { - - constructor(private http: HttpClient, private cookieService: CookieService) { - } + constructor( + private http: HttpClient, + private cookieService: CookieService + ) {} get() { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - Accept: 'application/vnd.iridium.id.application-type-summary-list.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.get(environment.iridium.domain + 'application-types', options) + Accept: 'application/vnd.iridium.id.application-type-summary-list.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http.get( + environment.iridium.domain + 'application-types', + options + ); } } diff --git a/projects/iridium-ui/src/app/services/application.service.ts b/projects/iridium-ui/src/app/services/application.service.ts index ccbf706..227f764 100644 --- a/projects/iridium-ui/src/app/services/application.service.ts +++ b/projects/iridium-ui/src/app/services/application.service.ts @@ -12,58 +12,74 @@ import { ApplicationUpdateRequest } from '../components/dashboard/domain/applica import { ApplicationUpdateResponse } from '../components/dashboard/domain/application-update-response'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class ApplicationService { - - constructor(private http: HttpClient, private cookieService: CookieService) { } + constructor( + private http: HttpClient, + private cookieService: CookieService + ) {} create(formGroup: FormGroup, tenantId: string) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - 'Content-Type': 'application/vnd.iridium.id.application-create-request.1+json', - 'Accept': 'application/vnd.iridium.id.application-create-response.1+json', - 'Authorization': 'Bearer ' + token - }) + 'Content-Type': + 'application/vnd.iridium.id.application-create-request.1+json', + Accept: 'application/vnd.iridium.id.application-create-response.1+json', + Authorization: 'Bearer ' + token, + }); const request = new ApplicationCreateRequest(); request.name = formGroup.controls['applicationName'].value; request.applicationTypeId = formGroup.controls['applicationTypeId'].value; request.callbackURL = formGroup.controls['authorizationCallbackURL'].value; request.description = formGroup.controls['description'].value; request.homepageURL = formGroup.controls['homepageURL'].value; - const options = { headers: headers } - return this.http.post(environment.iridium.domain + `tenants/${tenantId}/applications`, request, options) + const options = { headers: headers }; + return this.http.post( + environment.iridium.domain + `tenants/${tenantId}/applications`, + request, + options + ); } getPage(tenantId: string, count: number) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - 'Accept': 'application/vnd.iridium.id.application-summary-list.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.get>(environment.iridium.domain + `tenants/${tenantId}/applications?page=0&size=${count}`, options) + Accept: 'application/vnd.iridium.id.application-summary-list.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http.get>( + environment.iridium.domain + + `tenants/${tenantId}/applications?page=0&size=${count}`, + options + ); } get(tenantId: string, applicationId: string) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - 'Accept': 'application/vnd.iridium.id.application-response.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.get(environment.iridium.domain + `tenants/${tenantId}/applications/${applicationId}`, options) + Accept: 'application/vnd.iridium.id.application-response.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http.get( + environment.iridium.domain + + `tenants/${tenantId}/applications/${applicationId}`, + options + ); } update(formGroup: FormGroup, tenantId: string, applicationId: string) { - console.log('update controls are', formGroup.controls) - const token = this.cookieService.getCookie('iridium-token') + console.log('update controls are', formGroup.controls); + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - 'Accept': 'application/vnd.iridium.id.application-update-response.1+json', - 'Content-Type': 'application/vnd.iridium.id.application-update-request.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } + Accept: 'application/vnd.iridium.id.application-update-response.1+json', + 'Content-Type': + 'application/vnd.iridium.id.application-update-request.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; const request = new ApplicationUpdateRequest(); request.applicationTypeId = formGroup.controls['applicationTypeId'].value; request.name = formGroup.controls['applicationName'].value; @@ -72,7 +88,11 @@ export class ApplicationService { request.privacyPolicyUrl = formGroup.controls['privacyPolicyURL'].value; request.redirectUri = formGroup.controls['authorizationCallbackURL'].value; request.iconUrl = formGroup.controls['iconURL'].value; - return this.http.put(environment.iridium.domain + `tenants/${tenantId}/applications/${applicationId}`, request, options) - + return this.http.put( + environment.iridium.domain + + `tenants/${tenantId}/applications/${applicationId}`, + request, + options + ); } } diff --git a/projects/iridium-ui/src/app/services/auth.service.ts b/projects/iridium-ui/src/app/services/auth.service.ts index 3ebcba8..211ba7d 100644 --- a/projects/iridium-ui/src/app/services/auth.service.ts +++ b/projects/iridium-ui/src/app/services/auth.service.ts @@ -2,12 +2,10 @@ import { Injectable } from '@angular/core'; import { CookieService } from './cookie.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class AuthService { - - constructor(private cookieService: CookieService) { } - + constructor(private cookieService: CookieService) {} getCurrentUserToken(): string { return this.cookieService.getCookie('iridium-token'); diff --git a/projects/iridium-ui/src/app/services/cookie.service.ts b/projects/iridium-ui/src/app/services/cookie.service.ts index 886e5b6..0b5fc8d 100644 --- a/projects/iridium-ui/src/app/services/cookie.service.ts +++ b/projects/iridium-ui/src/app/services/cookie.service.ts @@ -1,10 +1,9 @@ import { Injectable } from '@angular/core'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class CookieService { - constructor() {} public getCookie(name: string) { @@ -26,12 +25,16 @@ export class CookieService { this.setCookie(name, '', -1); } - public setCookie(name: string, value: string, expireDays: number, path: string = '') { - let d:Date = new Date(); + public setCookie( + name: string, + value: string, + expireDays: number, + path: string = '' + ) { + let d: Date = new Date(); d.setTime(d.getTime() + expireDays * 24 * 60 * 60 * 1000); - let expires:string = `expires=${d.toUTCString()}`; - let cpath:string = path ? `; path=${path}` : ''; + let expires: string = `expires=${d.toUTCString()}`; + let cpath: string = path ? `; path=${path}` : ''; document.cookie = `${name}=${value}; ${expires}${cpath}`; } - } diff --git a/projects/iridium-ui/src/app/services/domain/authentication-request.ts b/projects/iridium-ui/src/app/services/domain/authentication-request.ts index d46c6b7..78841d1 100644 --- a/projects/iridium-ui/src/app/services/domain/authentication-request.ts +++ b/projects/iridium-ui/src/app/services/domain/authentication-request.ts @@ -1,3 +1,3 @@ export interface AuthenticationRequest { - username: string; + username: string; } diff --git a/projects/iridium-ui/src/app/services/domain/authentication-response.ts b/projects/iridium-ui/src/app/services/domain/authentication-response.ts index 310914b..48b47a1 100644 --- a/projects/iridium-ui/src/app/services/domain/authentication-response.ts +++ b/projects/iridium-ui/src/app/services/domain/authentication-response.ts @@ -1,6 +1,6 @@ export interface AuthenticationResponse { - data: { - userToken: string; - userRefreshToken: string; - } + data: { + userToken: string; + userRefreshToken: string; + }; } diff --git a/projects/iridium-ui/src/app/services/domain/create-identity-request.ts b/projects/iridium-ui/src/app/services/domain/create-identity-request.ts index 8932a3d..7bd4eb0 100644 --- a/projects/iridium-ui/src/app/services/domain/create-identity-request.ts +++ b/projects/iridium-ui/src/app/services/domain/create-identity-request.ts @@ -1,3 +1,3 @@ export interface CreateIdentityRequest { - emailAddress: string; + emailAddress: string; } diff --git a/projects/iridium-ui/src/app/services/domain/create-identity-response.ts b/projects/iridium-ui/src/app/services/domain/create-identity-response.ts index 4d583be..2ed42ac 100644 --- a/projects/iridium-ui/src/app/services/domain/create-identity-response.ts +++ b/projects/iridium-ui/src/app/services/domain/create-identity-response.ts @@ -1,4 +1,4 @@ export interface CreateIdentityResponse { - id: string; - username: string; -} \ No newline at end of file + id: string; + username: string; +} diff --git a/projects/iridium-ui/src/app/services/domain/external-provider-update-request.ts b/projects/iridium-ui/src/app/services/domain/external-provider-update-request.ts index 6af0b71..e92159c 100644 --- a/projects/iridium-ui/src/app/services/domain/external-provider-update-request.ts +++ b/projects/iridium-ui/src/app/services/domain/external-provider-update-request.ts @@ -1,4 +1,4 @@ export class ExternalProviderUpdateRequest { - clientId: string = ""; - clientSecret: string = ""; + clientId: string = ''; + clientSecret: string = ''; } diff --git a/projects/iridium-ui/src/app/services/domain/page-info.ts b/projects/iridium-ui/src/app/services/domain/page-info.ts index 839d88b..5128228 100644 --- a/projects/iridium-ui/src/app/services/domain/page-info.ts +++ b/projects/iridium-ui/src/app/services/domain/page-info.ts @@ -1,5 +1,5 @@ export class PageInfo { page: number = 0; pageSize: number = 0; - count: number = 0 + count: number = 0; } diff --git a/projects/iridium-ui/src/app/services/domain/paged-list-response.ts b/projects/iridium-ui/src/app/services/domain/paged-list-response.ts index 822e236..277b80b 100644 --- a/projects/iridium-ui/src/app/services/domain/paged-list-response.ts +++ b/projects/iridium-ui/src/app/services/domain/paged-list-response.ts @@ -1,7 +1,6 @@ import { PageInfo } from './page-info'; export class PagedListResponse { - pageInfo!: PageInfo; data: T[] = []; diff --git a/projects/iridium-ui/src/app/services/domain/tenant-create-request.ts b/projects/iridium-ui/src/app/services/domain/tenant-create-request.ts index 960cd9d..06c5486 100644 --- a/projects/iridium-ui/src/app/services/domain/tenant-create-request.ts +++ b/projects/iridium-ui/src/app/services/domain/tenant-create-request.ts @@ -1,4 +1,4 @@ export class TenantCreateRequest { - subdomain = '' + subdomain = ''; environment = ''; } diff --git a/projects/iridium-ui/src/app/services/domain/tenant-logo-update-request.ts b/projects/iridium-ui/src/app/services/domain/tenant-logo-update-request.ts index e0d585b..9c77e24 100644 --- a/projects/iridium-ui/src/app/services/domain/tenant-logo-update-request.ts +++ b/projects/iridium-ui/src/app/services/domain/tenant-logo-update-request.ts @@ -1,5 +1,3 @@ export class TenantLogoUpdateRequest { - - logoUrl: string = '' - + logoUrl: string = ''; } diff --git a/projects/iridium-ui/src/app/services/external-identity-provider.service.ts b/projects/iridium-ui/src/app/services/external-identity-provider.service.ts index 1d22db7..886d9fa 100644 --- a/projects/iridium-ui/src/app/services/external-identity-provider.service.ts +++ b/projects/iridium-ui/src/app/services/external-identity-provider.service.ts @@ -4,9 +4,7 @@ import { CookieService } from './cookie.service'; import { environment } from '../../environments/environment'; import { FormGroup } from '@angular/forms'; import { ApplicationCreateResponse } from '../components/dashboard/domain/application-create-response'; -import { - CreateExternalIdentityProviderRequest -} from '../components/dashboard/domain/create-external-identity-provider-request'; +import { CreateExternalIdentityProviderRequest } from '../components/dashboard/domain/create-external-identity-provider-request'; import { ExternalIdentityProviderSummary } from './external-identity-provider-summary'; import { ApplicationUpdateRequest } from '../components/dashboard/domain/application-update-request'; import { ApplicationUpdateResponse } from '../components/dashboard/domain/application-update-response'; @@ -14,59 +12,82 @@ import { ExternalProviderResponse } from '../components/dashboard/domain/externa import { ExternalProviderUpdateRequest } from './domain/external-provider-update-request'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class ExternalIdentityProviderService { - - constructor(private http: HttpClient, private cookieService: CookieService) { } + constructor( + private http: HttpClient, + private cookieService: CookieService + ) {} create(formGroup: FormGroup, tenantId: string) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - 'Content-Type': 'application/vnd.iridium.id.external-identity-provider-create-request.1+json', - 'Accept': 'application/vnd.iridium.id.external-identity-provider-create-response.1+json', - 'Authorization': 'Bearer ' + token - }) + 'Content-Type': + 'application/vnd.iridium.id.external-identity-provider-create-request.1+json', + Accept: + 'application/vnd.iridium.id.external-identity-provider-create-response.1+json', + Authorization: 'Bearer ' + token, + }); const request = new CreateExternalIdentityProviderRequest(); - request.externalProviderTemplateId = formGroup.controls['externalProviderTemplateId'].value; + request.externalProviderTemplateId = + formGroup.controls['externalProviderTemplateId'].value; request.clientId = formGroup.controls['clientId'].value; request.clientSecret = formGroup.controls['clientSecret'].value; - const options = { headers: headers } - return this.http.post(environment.iridium.domain + `tenants/${tenantId}/external-providers`, request, options) + const options = { headers: headers }; + return this.http.post( + environment.iridium.domain + `tenants/${tenantId}/external-providers`, + request, + options + ); } getAll(tenantId: string) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - Accept: 'application/vnd.iridium.id.external-identity-provider-summary-list.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.get(environment.iridium.domain + `tenants/${tenantId}/external-providers`, options) + Accept: + 'application/vnd.iridium.id.external-identity-provider-summary-list.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http.get( + environment.iridium.domain + `tenants/${tenantId}/external-providers`, + options + ); } get(tenantId: string, externalProviderId: string) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ Accept: 'application/vnd.iridium.id.external-provider-response.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.get(environment.iridium.domain + `tenants/${tenantId}/external-providers/${externalProviderId}`, options) + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http.get( + environment.iridium.domain + + `tenants/${tenantId}/external-providers/${externalProviderId}`, + options + ); } update(formGroup: FormGroup, tenantId: string, externalProviderId: string) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - 'Accept': 'application/vnd.iridium.id.external-provider-update-response.1+json', - 'Content-Type': 'application/vnd.iridium.id.external-provider-update-request.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } + Accept: + 'application/vnd.iridium.id.external-provider-update-response.1+json', + 'Content-Type': + 'application/vnd.iridium.id.external-provider-update-request.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; const request = new ExternalProviderUpdateRequest(); request.clientId = formGroup.controls['clientId'].value; request.clientSecret = formGroup.controls['clientSecret'].value; - return this.http.put(environment.iridium.domain + `tenants/${tenantId}/external-providers/${externalProviderId}`, request, options) - + return this.http.put( + environment.iridium.domain + + `tenants/${tenantId}/external-providers/${externalProviderId}`, + request, + options + ); } } diff --git a/projects/iridium-ui/src/app/services/external-provider-template.service.ts b/projects/iridium-ui/src/app/services/external-provider-template.service.ts index 07bf7dd..a44deae 100644 --- a/projects/iridium-ui/src/app/services/external-provider-template.service.ts +++ b/projects/iridium-ui/src/app/services/external-provider-template.service.ts @@ -5,19 +5,25 @@ import { CookieService } from './cookie.service'; import { ExternalProviderTemplateSummaryResponse } from './domain/external-provider-template-summary-response'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class ExternalProviderTemplateService { - - constructor(private http: HttpClient, private cookieService: CookieService) { } + constructor( + private http: HttpClient, + private cookieService: CookieService + ) {} getSummaries() { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - Accept: 'application/vnd.iridium.id.external-provider-template-summary-list.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.get(environment.iridium.domain + 'external-provider-templates', options) + Accept: + 'application/vnd.iridium.id.external-provider-template-summary-list.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http.get( + environment.iridium.domain + 'external-provider-templates', + options + ); } } diff --git a/projects/iridium-ui/src/app/services/identity.service.ts b/projects/iridium-ui/src/app/services/identity.service.ts index 3e3930e..cad2eab 100644 --- a/projects/iridium-ui/src/app/services/identity.service.ts +++ b/projects/iridium-ui/src/app/services/identity.service.ts @@ -9,20 +9,26 @@ import { PagedListResponse } from './domain/paged-list-response'; import { IdentitySummaryResponse } from '../components/dashboard/domain/identity-summary-response'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class IdentityService { - - constructor(private http: HttpClient, private cookieService: CookieService) { } - + constructor( + private http: HttpClient, + private cookieService: CookieService + ) {} getSummariesByParentTenant(tenantId: string, count: number) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - 'Accept': 'application/vnd.iridium.id.identity-summary-response-list.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.get>(environment.iridium.domain + `tenants/${tenantId}/identities?page=0&size=${count}`, options) + Accept: + 'application/vnd.iridium.id.identity-summary-response-list.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http.get>( + environment.iridium.domain + + `tenants/${tenantId}/identities?page=0&size=${count}`, + options + ); } } diff --git a/projects/iridium-ui/src/app/services/login-descriptor.service.ts b/projects/iridium-ui/src/app/services/login-descriptor.service.ts index a5fe952..0f8187a 100644 --- a/projects/iridium-ui/src/app/services/login-descriptor.service.ts +++ b/projects/iridium-ui/src/app/services/login-descriptor.service.ts @@ -9,33 +9,47 @@ import { ApplicationResponse } from './domain/application-response'; import { LoginDescriptorResponse } from './domain/login-descriptor-response'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class LoginDescriptorService { - - constructor(private http: HttpClient, private cookieService: CookieService) { } + constructor( + private http: HttpClient, + private cookieService: CookieService + ) {} updateTenantLogo(formGroup: FormGroup, tenantId: string) { - console.log('update ' + tenantId + 'with ' + formGroup.controls['tenantLogoUrl'].value) + console.log( + 'update ' + tenantId + 'with ' + formGroup.controls['tenantLogoUrl'].value + ); const request = new TenantLogoUpdateRequest(); request.logoUrl = formGroup.controls['tenantLogoUrl'].value; - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - Accept: 'application/vnd.iridium.id.tenant-logo-update-response.1+json', - 'Content-Type': 'application/vnd.iridium.id.tenant-logo-update-request.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.put(environment.iridium.domain + `tenants/${tenantId}/login-descriptors`, request, options).pipe() + Accept: 'application/vnd.iridium.id.tenant-logo-update-response.1+json', + 'Content-Type': + 'application/vnd.iridium.id.tenant-logo-update-request.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http + .put( + environment.iridium.domain + `tenants/${tenantId}/login-descriptors`, + request, + options + ) + .pipe(); } get(tenantId: string) { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - 'Accept': 'application/json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.get(environment.iridium.domain + `tenants/${tenantId}/login-descriptors`, options) + Accept: 'application/json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http.get( + environment.iridium.domain + `tenants/${tenantId}/login-descriptors`, + options + ); } } diff --git a/projects/iridium-ui/src/app/services/menu-item.service.ts b/projects/iridium-ui/src/app/services/menu-item.service.ts index da63b36..11cf726 100644 --- a/projects/iridium-ui/src/app/services/menu-item.service.ts +++ b/projects/iridium-ui/src/app/services/menu-item.service.ts @@ -2,37 +2,36 @@ import { Injectable } from '@angular/core'; import { MenuItemNode } from '../components/dashboard/domain/menu-item-node'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class MenuItemService { - - private readonly menuItems: MenuItemNode[] + private readonly menuItems: MenuItemNode[]; constructor() { this.menuItems = [ { name: 'Login Box', children: [ { - name: 'Login Box Settings' - } + name: 'Login Box Settings', + }, ], }, { name: 'Application Management', children: [ { - name: 'Applications' - } + name: 'Applications', + }, ], }, { name: 'User Management', children: [ { - name: 'Users' - } + name: 'Users', + }, ], - } + }, ]; } diff --git a/projects/iridium-ui/src/app/services/register.service.ts b/projects/iridium-ui/src/app/services/register.service.ts index 51830fa..9e59418 100644 --- a/projects/iridium-ui/src/app/services/register.service.ts +++ b/projects/iridium-ui/src/app/services/register.service.ts @@ -1,44 +1,47 @@ import { CreateIdentityResponse } from './domain/create-identity-response'; import { CreateIdentityRequest } from './domain/create-identity-request'; import { Injectable } from '@angular/core'; -import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http'; +import { + HttpClient, + HttpErrorResponse, + HttpHeaders, +} from '@angular/common/http'; import { catchError, throwError } from 'rxjs'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class RegisterService { - static CONTENT_TYPE = "application/vnd.carbonid.create-identity-request.1+json" - static ACCEPT = "application/vnd.carbonid.identity-response.1+json" - + static CONTENT_TYPE = + 'application/vnd.carbonid.create-identity-request.1+json'; + static ACCEPT = 'application/vnd.carbonid.identity-response.1+json'; register(emailAddress: string) { var request: CreateIdentityRequest = { - emailAddress: emailAddress - } + emailAddress: emailAddress, + }; - console.log('request:', request) + console.log('request:', request); const httpOptions = { headers: new HttpHeaders({ - 'Content-Type': RegisterService.CONTENT_TYPE, - 'Accept': RegisterService.ACCEPT - }) + 'Content-Type': RegisterService.CONTENT_TYPE, + Accept: RegisterService.ACCEPT, + }), }; - - console.log("email address: " + request); - return this.http.post("http://localhost:8381/identities", request, httpOptions) - .pipe( - catchError(this.handleError) - ); - } + console.log('email address: ' + request); + return this.http + .post( + 'http://localhost:8381/identities', + request, + httpOptions + ) + .pipe(catchError(this.handleError)); + } + constructor(private http: HttpClient) {} - constructor(private http: HttpClient) { - - } - - private handleError(error: HttpErrorResponse) { + private handleError(error: HttpErrorResponse) { if (error.status === 0) { // A client-side or network error occurred. Handle it accordingly. console.error('An error occurred:', error.error); @@ -46,7 +49,9 @@ export class RegisterService { // The backend returned an unsuccessful response code. // The response body may contain clues as to what went wrong. console.error( - `Backend returned code ${error.status}, body was: `, error.error); + `Backend returned code ${error.status}, body was: `, + error.error + ); } // Return an observable with a user-facing error message. return throwError(error.error); diff --git a/projects/iridium-ui/src/app/services/tenant.service.ts b/projects/iridium-ui/src/app/services/tenant.service.ts index f95e38b..68506c6 100644 --- a/projects/iridium-ui/src/app/services/tenant.service.ts +++ b/projects/iridium-ui/src/app/services/tenant.service.ts @@ -1,5 +1,10 @@ import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpRequest, HttpResponse } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, + HttpRequest, + HttpResponse, +} from '@angular/common/http'; import { CookieService } from './cookie.service'; import { TenantSummaryResponse } from './domain/tenant-summary-response'; import { environment } from '../../environments/environment'; @@ -9,38 +14,48 @@ import { TenantCreateRequest } from './domain/tenant-create-request'; import { TenantCreateResponse } from './domain/tenant-create-response'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class TenantService { - - constructor(private http: HttpClient, private cookieService: CookieService) { - } + constructor( + private http: HttpClient, + private cookieService: CookieService + ) {} public getTenantSummaries(): Observable { - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - Accept: 'application/vnd.iridium.id.tenant-summary-list.1+json', - 'Authorization': 'Bearer ' + token - }) + Accept: 'application/vnd.iridium.id.tenant-summary-list.1+json', + Authorization: 'Bearer ' + token, + }); - const options = { headers: headers } - return this.http.get(environment.iridium.domain + 'tenants', options) + const options = { headers: headers }; + return this.http.get( + environment.iridium.domain + 'tenants', + options + ); } public create(formGroup: FormGroup) { - console.log(formGroup.controls['tenantName'].value) - console.log(formGroup.controls['environment'].value) + console.log(formGroup.controls['tenantName'].value); + console.log(formGroup.controls['environment'].value); const request = new TenantCreateRequest(); request.environment = formGroup.controls['environment'].value; request.subdomain = formGroup.controls['tenantName'].value; - const token = this.cookieService.getCookie('iridium-token') + const token = this.cookieService.getCookie('iridium-token'); const headers = new HttpHeaders({ - Accept: 'application/vnd.iridium.id.authn.tenant-create-response1+json', - 'Content-Type': 'application/vnd.iridium.id.authn.tenant-create-request.1+json', - 'Authorization': 'Bearer ' + token - }) - const options = { headers: headers } - return this.http.post(environment.iridium.domain + 'tenants', request, options).pipe() - + Accept: 'application/vnd.iridium.id.authn.tenant-create-response1+json', + 'Content-Type': + 'application/vnd.iridium.id.authn.tenant-create-request.1+json', + Authorization: 'Bearer ' + token, + }); + const options = { headers: headers }; + return this.http + .post( + environment.iridium.domain + 'tenants', + request, + options + ) + .pipe(); } } diff --git a/projects/iridium-ui/src/environments/environment.development.ts b/projects/iridium-ui/src/environments/environment.development.ts index 36f1c35..06b9a5a 100644 --- a/projects/iridium-ui/src/environments/environment.development.ts +++ b/projects/iridium-ui/src/environments/environment.development.ts @@ -5,6 +5,6 @@ export const environment = { redirectUri: 'http://localhost:4200/callback', successfulAuthDestination: '/dashboard', clientId: 'localRunIdChangeForProduction', - errorPath: '/error' - } + errorPath: '/error', + }, }; diff --git a/projects/iridium-ui/src/environments/environment.ts b/projects/iridium-ui/src/environments/environment.ts index 64a01fd..0f3e7cf 100644 --- a/projects/iridium-ui/src/environments/environment.ts +++ b/projects/iridium-ui/src/environments/environment.ts @@ -1,5 +1,3 @@ - - export const environment = { production: true, iridium: { @@ -7,6 +5,6 @@ export const environment = { redirectUri: 'REDIRECT_URI_GOES_HERE', successfulAuthDestination: '/dashboard', clientId: 'CLIENT_ID_GOES_HERE', - errorPath: '/error' - } + errorPath: '/error', + }, }; diff --git a/projects/iridium-ui/src/index.html b/projects/iridium-ui/src/index.html index a7742ad..e7bfe2d 100644 --- a/projects/iridium-ui/src/index.html +++ b/projects/iridium-ui/src/index.html @@ -1,16 +1,20 @@ - - - Iridium Management UI - - - - - - - - - - + + + Iridium Management UI + + + + + + + + + + diff --git a/projects/iridium-ui/src/main.ts b/projects/iridium-ui/src/main.ts index c58dc05..75a0de0 100644 --- a/projects/iridium-ui/src/main.ts +++ b/projects/iridium-ui/src/main.ts @@ -2,6 +2,6 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; - -platformBrowserDynamic().bootstrapModule(AppModule) +platformBrowserDynamic() + .bootstrapModule(AppModule) .catch(err => console.error(err));