diff --git a/docs/3rd-party-licenses/backend-full.csv b/docs/3rd-party-licenses/backend-full.csv index 689f089..5ca4073 100644 --- a/docs/3rd-party-licenses/backend-full.csv +++ b/docs/3rd-party-licenses/backend-full.csv @@ -184,7 +184,7 @@ "braces@3.0.2","MIT","https://github.com/micromatch/braces" "browser-process-hrtime@1.0.0","BSD-2-Clause","https://github.com/kumavis/browser-process-hrtime" "browser-resolve@1.11.3","MIT","https://github.com/shtylman/node-browser-resolve" -"browserslist@4.15.0","MIT","https://github.com/browserslist/browserslist" +"browserslist@4.16.6","MIT","https://github.com/browserslist/browserslist" "bs-logger@0.2.6","MIT","https://github.com/huafu/bs-logger" "bser@2.1.1","Apache-2.0","https://github.com/facebook/watchman" "buffer-from@1.1.1","MIT","https://github.com/LinusU/buffer-from" @@ -194,7 +194,7 @@ "call-bind@1.0.0","MIT","https://github.com/ljharb/call-bind" "callsites@3.1.0","MIT","https://github.com/sindresorhus/callsites" "camelcase@5.3.1","MIT","https://github.com/sindresorhus/camelcase" -"caniuse-lite@1.0.30001165","CC-BY-4.0","https://github.com/ben-eb/caniuse-lite" +"caniuse-lite@1.0.30001230","CC-BY-4.0","https://github.com/browserslist/caniuse-lite" "capture-exit@2.0.0","ISC","https://github.com/stefanpenner/capture-exit" "caseless@0.12.0","Apache-2.0","https://github.com/mikeal/caseless" "chalk@2.4.2","MIT","https://github.com/chalk/chalk" @@ -220,7 +220,7 @@ "color-convert@2.0.1","MIT","https://github.com/Qix-/color-convert" "color-name@1.1.3","MIT","https://github.com/dfcreative/color-name" "color-name@1.1.4","MIT","https://github.com/colorjs/color-name" -"colorette@1.2.1","MIT","https://github.com/jorgebucaran/colorette" +"colorette@1.2.2","MIT","https://github.com/jorgebucaran/colorette" "colors@1.4.0","MIT","https://github.com/Marak/colors.js" "combined-stream@1.0.8","MIT","https://github.com/felixge/node-combined-stream" "commander@2.20.3","MIT","https://github.com/tj/commander.js" @@ -276,7 +276,7 @@ "dotenv@8.2.0","BSD-2-Clause","https://github.com/motdotla/dotenv" "ecc-jsbn@0.1.2","MIT","https://github.com/quartzjer/ecc-jsbn" "ee-first@1.1.1","MIT","https://github.com/jonathanong/ee-first" -"electron-to-chromium@1.3.621","ISC","https://github.com/kilian/electron-to-chromium" +"electron-to-chromium@1.3.739","ISC","https://github.com/kilian/electron-to-chromium" "emoji-regex@7.0.3","MIT","https://github.com/mathiasbynens/emoji-regex" "emoji-regex@8.0.0","MIT","https://github.com/mathiasbynens/emoji-regex" "emojis-list@3.0.0","MIT","https://github.com/kikobeats/emojis-list" @@ -367,7 +367,7 @@ "get-stream@5.2.0","MIT","https://github.com/sindresorhus/get-stream" "get-value@2.0.6","MIT","https://github.com/jonschlinkert/get-value" "getpass@0.1.7","MIT","https://github.com/arekinath/node-getpass" -"glob-parent@5.1.1","ISC","https://github.com/gulpjs/glob-parent" +"glob-parent@5.1.2","ISC","https://github.com/gulpjs/glob-parent" "glob-to-regexp@0.4.1","BSD-2-Clause","https://github.com/fitzgen/glob-to-regexp" "glob@7.1.6","ISC","https://github.com/isaacs/node-glob" "globals@11.12.0","MIT","https://github.com/sindresorhus/globals" @@ -384,7 +384,7 @@ "has-values@0.1.4","MIT","https://github.com/jonschlinkert/has-values" "has-values@1.0.0","MIT","https://github.com/jonschlinkert/has-values" "has@1.0.3","MIT","https://github.com/tarruda/has" -"hosted-git-info@2.8.8","ISC","https://github.com/npm/hosted-git-info" +"hosted-git-info@2.8.9","ISC","https://github.com/npm/hosted-git-info" "html-encoding-sniffer@1.0.2","MIT","https://github.com/jsdom/html-encoding-sniffer" "html-escaper@2.0.2","MIT","https://github.com/WebReflection/html-escaper" "http-errors@1.7.2","MIT","https://github.com/jshttp/http-errors" @@ -517,7 +517,7 @@ "lodash.memoize@4.1.2","MIT","https://github.com/lodash/lodash" "lodash.sortby@4.7.0","MIT","https://github.com/lodash/lodash" "lodash.toarray@4.4.0","MIT","https://github.com/lodash/lodash" -"lodash@4.17.20","MIT","https://github.com/lodash/lodash" +"lodash@4.17.21","MIT","https://github.com/lodash/lodash" "log-symbols@4.0.0","MIT","https://github.com/sindresorhus/log-symbols" "lolex@5.1.2","BSD-3-Clause","https://github.com/sinonjs/lolex" "lru-cache@6.0.0","ISC","https://github.com/isaacs/node-lru-cache" @@ -564,7 +564,7 @@ "node-int64@0.4.0","MIT","https://github.com/broofa/node-int64" "node-modules-regexp@1.0.0","MIT","https://github.com/jamestalmage/node-modules-regexp" "node-notifier@6.0.0","MIT","https://github.com/mikaelbr/node-notifier" -"node-releases@1.1.67","MIT","https://github.com/chicoxyzzy/node-releases" +"node-releases@1.1.72","MIT","https://github.com/chicoxyzzy/node-releases" "nopt@4.0.3","ISC","https://github.com/npm/nopt" "normalize-package-data@2.5.0","BSD-2-Clause","https://github.com/npm/normalize-package-data" "normalize-path@2.1.1","MIT","https://github.com/jonschlinkert/normalize-path" @@ -619,7 +619,7 @@ "path-is-absolute@1.0.1","MIT","https://github.com/sindresorhus/path-is-absolute" "path-key@2.0.1","MIT","https://github.com/sindresorhus/path-key" "path-key@3.1.1","MIT","https://github.com/sindresorhus/path-key" -"path-parse@1.0.6","MIT","https://github.com/jbgutierrez/path-parse" +"path-parse@1.0.7","MIT","https://github.com/jbgutierrez/path-parse" "path-to-regexp@0.1.7","MIT","https://github.com/component/path-to-regexp" "path-to-regexp@3.2.0","MIT","https://github.com/pillarjs/path-to-regexp" "path-type@2.0.0","MIT","https://github.com/sindresorhus/path-type" @@ -841,7 +841,7 @@ "webpack-sources@2.2.0","MIT","https://github.com/webpack/webpack-sources" "webpack@5.4.0","MIT","https://github.com/webpack/webpack" "whatwg-encoding@1.0.5","MIT","https://github.com/jsdom/whatwg-encoding" -"whatwg-fetch@3.6.2","MIT","https://github.com/github/fetch" +"whatwg-fetch@3.6.19","MIT","https://github.com/github/fetch" "whatwg-mimetype@2.3.0","MIT","https://github.com/jsdom/whatwg-mimetype" "whatwg-url@7.1.0","MIT","https://github.com/jsdom/whatwg-url" "which-module@2.0.0","ISC","https://github.com/nexdrew/which-module" @@ -854,7 +854,7 @@ "wrappy@1.0.2","ISC","https://github.com/npm/wrappy" "write-file-atomic@3.0.3","ISC","https://github.com/npm/write-file-atomic" "write@1.0.3","MIT","https://github.com/jonschlinkert/write" -"ws@7.4.1","MIT","https://github.com/websockets/ws" +"ws@7.5.4","MIT","https://github.com/websockets/ws" "xml-name-validator@3.0.0","Apache-2.0","https://github.com/jsdom/xml-name-validator" "xmlchars@2.2.0","MIT","https://github.com/lddubeau/xmlchars" "xtend@4.0.2","MIT","https://github.com/Raynos/xtend" @@ -867,4 +867,4 @@ "yargs@12.0.5","MIT","https://github.com/yargs/yargs" "yargs@15.4.1","MIT","https://github.com/yargs/yargs" "yn@3.1.1","MIT","https://github.com/sindresorhus/yn" -"yocto-queue@0.1.0","MIT","https://github.com/sindresorhus/yocto-queue" \ No newline at end of file +"yocto-queue@0.1.0","MIT","https://github.com/sindresorhus/yocto-queue" diff --git a/docs/3rd-party-licenses/frontend-full.csv b/docs/3rd-party-licenses/frontend-full.csv index 085f0b5..6fb7b81 100644 --- a/docs/3rd-party-licenses/frontend-full.csv +++ b/docs/3rd-party-licenses/frontend-full.csv @@ -313,7 +313,7 @@ "color-convert@2.0.1","MIT","https://github.com/Qix-/color-convert" "color-name@1.1.3","MIT","https://github.com/dfcreative/color-name" "color-name@1.1.4","MIT","https://github.com/colorjs/color-name" -"color-string@1.5.4","MIT","https://github.com/Qix-/color-string" +"color-string@1.6.0","MIT","https://github.com/Qix-/color-string" "color@3.1.3","MIT","https://github.com/Qix-/color" "colorette@1.2.1","MIT","https://github.com/jorgebucaran/colorette" "colors@1.4.0","MIT","https://github.com/Marak/colors.js" @@ -854,7 +854,7 @@ "path-is-absolute@1.0.1","MIT","https://github.com/sindresorhus/path-is-absolute" "path-is-inside@1.0.2","(WTFPL OR MIT)","https://github.com/domenic/path-is-inside" "path-key@2.0.1","MIT","https://github.com/sindresorhus/path-key" -"path-parse@1.0.6","MIT","https://github.com/jbgutierrez/path-parse" +"path-parse@1.0.7","MIT","https://github.com/jbgutierrez/path-parse" "path-to-regexp@0.1.7","MIT","https://github.com/component/path-to-regexp" "path-type@4.0.0","MIT","https://github.com/sindresorhus/path-type" "pbf@3.2.1","BSD-3-Clause","https://github.com/mapbox/pbf" @@ -1105,8 +1105,8 @@ "svgo@1.3.2","MIT","https://github.com/svg/svgo" "symbol-observable@1.2.0","MIT","https://github.com/blesh/symbol-observable" "tapable@1.1.3","MIT","https://github.com/webpack/tapable" -"tar@4.4.13","ISC","https://github.com/npm/node-tar" -"tar@6.0.5","ISC","https://github.com/npm/node-tar" +"tar@4.4.19","ISC","https://github.com/npm/node-tar" +"tar@6.1.11","ISC","https://github.com/npm/node-tar" "terser-webpack-plugin@1.4.5","MIT","https://github.com/webpack-contrib/terser-webpack-plugin" "terser-webpack-plugin@4.1.0","MIT","https://github.com/webpack-contrib/terser-webpack-plugin" "terser@4.8.0","BSD-2-Clause","https://github.com/terser/terser" @@ -1230,4 +1230,4 @@ "yeast@0.1.2","MIT","https://github.com/unshiftio/yeast" "yn@3.1.1","MIT","https://github.com/sindresorhus/yn" "yocto-queue@0.1.0","MIT","https://github.com/sindresorhus/yocto-queue" -"zone.js@0.10.3","MIT","https://github.com/angular/angular" \ No newline at end of file +"zone.js@0.10.3","MIT","https://github.com/angular/angular" diff --git a/workbench/backend/.nvmrc b/workbench/backend/.nvmrc new file mode 100644 index 0000000..91e8eef --- /dev/null +++ b/workbench/backend/.nvmrc @@ -0,0 +1 @@ +v14.18 diff --git a/workbench/backend/manifest.yaml b/workbench/backend/manifest.yaml new file mode 100644 index 0000000..01183ca --- /dev/null +++ b/workbench/backend/manifest.yaml @@ -0,0 +1,9 @@ +applications: + - name: scheduling-backend + path: . + buildpacks: + - https://github.com/cloudfoundry/nodejs-buildpack#v1.7.55 + memory: 512M + command: npm run start:prod + random-route: false + stack: cflinuxfs3 diff --git a/workbench/backend/package.json b/workbench/backend/package.json index dc30c0a..809f459 100644 --- a/workbench/backend/package.json +++ b/workbench/backend/package.json @@ -1,9 +1,8 @@ { "name": "backend", - "license": "see LICENSES-folder in repository", "version": "0.0.0", "scripts": { - "prebuild": "rimraf dist && npm run license-checker", + "prebuild": "rimraf dist", "build": "nest build", "postbuild": "npm run build:copy:static", "build:copy:static": "cp-cli src/static dist/static", @@ -17,9 +16,12 @@ "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json", - "postinstall": "npm run license-checker", "license-checker": "license-checker --csv --out ../../docs/3rd-party-licenses/backend-full.csv" }, + "engines": { + "node": "14.x", + "npm": "6.x" + }, "dependencies": { "@nestjs/common": "^7.0.0", "@nestjs/core": "^7.0.0", @@ -29,7 +31,8 @@ "moment": "^2.29.1", "reflect-metadata": "^0.1.13", "rimraf": "^3.0.2", - "rxjs": "^6.5.4" + "rxjs": "^6.5.4", + "license-checker": "^25.0.1" }, "devDependencies": { "@nestjs/cli": "^7.0.0", diff --git a/workbench/frontend/manifest.yaml b/workbench/frontend/manifest.yaml new file mode 100644 index 0000000..485cbf3 --- /dev/null +++ b/workbench/frontend/manifest.yaml @@ -0,0 +1,10 @@ +applications: + - name: scheduling + path: ./dist/frontend + memory: 64M + buildpack: staticfile_buildpack + routes: + - route: scheduling.cfapps.eu12.hana.ondemand.com + - route: scheduling.cfapps.eu12.hana.ondemand.com/api + destination: scheduling-backend.cfapps.eu12.hana.ondemand.com/api + diff --git a/workbench/frontend/src/app/app.component.ts b/workbench/frontend/src/app/app.component.ts index 61147c8..e2b4b67 100644 --- a/workbench/frontend/src/app/app.component.ts +++ b/workbench/frontend/src/app/app.component.ts @@ -1,15 +1,16 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Renderer2, Inject, AfterViewInit } from '@angular/core'; import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { Observable } from 'rxjs'; import { map, shareReplay } from 'rxjs/operators'; import { GlobalContext, AuthService } from './common/services/auth.service'; +import { DOCUMENT } from '@angular/common'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) -export class AppComponent implements OnInit { +export class AppComponent implements OnInit, AfterViewInit { title = 'FSM AI'; ctx$: Observable; @@ -23,22 +24,34 @@ export class AppComponent implements OnInit { constructor( private breakpointObserver: BreakpointObserver, - private auth: AuthService + private auth: AuthService, + private _renderer2: Renderer2, + @Inject(DOCUMENT) private _document: Document ) { } - public ngOnInit() { + public ngOnInit(): void { this.ctx$ = this.auth.globalContext$; this.isLoggedIn$ = this.auth.isLoggedIn$; this.auth.tryRestoreSession(); } - public async logout() { + public ngAfterViewInit(): void { + const script = this._renderer2.createElement('script'); + script.src = 'https://main-11lv1sn8.eu12.sapdas-staging.cloud.sap/resources/public/webclient/bootstrap.js'; + script.setAttribute('data-bot-name', 'plugins'); + script.setAttribute('data-expander-type', 'DEFAULT'); + script.setAttribute('data-expander-preferences', 'JTdCJTIyYWNjZW50Q29sb3IlMjIlM0ElMjIlMjNFMDVBNDclMjIlMkMlMjJiYWNrZ3JvdW5kQ29sb3IlMjIlM0ElMjIlMjNGRkZGRkYlMjIlMkMlMjJjb21wbGVtZW50YXJ5Q29sb3IlMjIlM0ElMjIlMjNGRkZGRkYlMjIlMkMlMjJvbmJvYXJkaW5nTWVzc2FnZSUyMiUzQSUyMkNvbWUlMjBzcGVhayUyMHRvJTIwbWUhJTIyJTJDJTIyZXhwYW5kZXJUaXRsZSUyMiUzQSUyMiUyMiUyQyUyMmV4cGFuZGVyTG9nbyUyMiUzQSUyMkNVWF9BdmF0YXIuc3ZnJTIyJTJDJTIydGhlbWUlMjIlM0ElMjJzYXBfaG9yaXpvbiUyMiU3RA=='); + + this._renderer2.appendChild(this._document.head, script); + } + + public async logout(): Promise { this.auth.logout(); } - public async login() { + public async login(): Promise { this.auth.openLoginDialog(); } -} \ No newline at end of file +} diff --git a/workbench/frontend/src/app/common/components/login-dialog/login-dialog.component.ts b/workbench/frontend/src/app/common/components/login-dialog/login-dialog.component.ts index ff3abda..50d3794 100644 --- a/workbench/frontend/src/app/common/components/login-dialog/login-dialog.component.ts +++ b/workbench/frontend/src/app/common/components/login-dialog/login-dialog.component.ts @@ -52,12 +52,12 @@ export class LoginDialogComponent implements OnInit { public loginForm: FormGroup; public cloudHosts = [ - { text: 'production', value: 'ds.coresuite.com' }, - { text: 'sandbox', value: 'sb.dev.coresuite.com' }, - { text: 'ET development', value: 'et.dev.coresuite.com' }, - { text: 'QT development', value: 'qt.dev.coresuite.com' }, - { text: 'DT development', value: 'dt.dev.coresuite.com' }, - ].map(({ text, value }) => ({ value, text: `${text}` })) + { text: 'production', value: 'ds.fsm-dev.cloud.sap' }, + { text: 'sandbox', value: 'sb.fsm-dev.cloud.sap' }, + { text: 'ET development', value: 'et.fsm-dev.cloud.sap' }, + { text: 'QT development', value: 'qt.fsm-dev.cloud.sap' }, + { text: 'DT development', value: 'dt.fsm-dev.cloud.sap' }, + ].map(({ text, value }) => ({ value, text: `${text}` })); constructor( private http: HttpClient, @@ -159,4 +159,4 @@ export class LoginDialogComponent implements OnInit { ); } -} \ No newline at end of file +} diff --git a/workbench/frontend/src/app/common/services/config.service.ts b/workbench/frontend/src/app/common/services/config.service.ts index 8f6a342..d9880d1 100644 --- a/workbench/frontend/src/app/common/services/config.service.ts +++ b/workbench/frontend/src/app/common/services/config.service.ts @@ -5,10 +5,10 @@ import { Injectable } from '@angular/core'; export class ConfigService { constructor() { } - private getHost(): 'http://localhost:8000' | '' { + private getHost(): string { return location.origin === 'http://localhost:4200' ? 'http://localhost:8000' - : ''; + : 'https://scheduling-backend.cfapps.eu12.hana.ondemand.com'; } public getApiUri(): string { diff --git a/workbench/frontend/src/index.html b/workbench/frontend/src/index.html index f33d174..8e773b5 100644 --- a/workbench/frontend/src/index.html +++ b/workbench/frontend/src/index.html @@ -6,6 +6,17 @@ SAP FSM AI + + @@ -16,4 +27,4 @@ - \ No newline at end of file +