Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DON'T MERGE: joule integration #80

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions docs/3rd-party-licenses/backend-full.csv
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
"[email protected]","MIT","https://github.com/micromatch/braces"
"[email protected]","BSD-2-Clause","https://github.com/kumavis/browser-process-hrtime"
"[email protected]","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"
"[email protected]","MIT","https://github.com/huafu/bs-logger"
"[email protected]","Apache-2.0","https://github.com/facebook/watchman"
"[email protected]","MIT","https://github.com/LinusU/buffer-from"
Expand All @@ -194,7 +194,7 @@
"[email protected]","MIT","https://github.com/ljharb/call-bind"
"[email protected]","MIT","https://github.com/sindresorhus/callsites"
"[email protected]","MIT","https://github.com/sindresorhus/camelcase"
"[email protected].30001165","CC-BY-4.0","https://github.com/ben-eb/caniuse-lite"
"[email protected].30001230","CC-BY-4.0","https://github.com/browserslist/caniuse-lite"
"[email protected]","ISC","https://github.com/stefanpenner/capture-exit"
"[email protected]","Apache-2.0","https://github.com/mikeal/caseless"
"[email protected]","MIT","https://github.com/chalk/chalk"
Expand All @@ -220,7 +220,7 @@
"[email protected]","MIT","https://github.com/Qix-/color-convert"
"[email protected]","MIT","https://github.com/dfcreative/color-name"
"[email protected]","MIT","https://github.com/colorjs/color-name"
"[email protected].1","MIT","https://github.com/jorgebucaran/colorette"
"[email protected].2","MIT","https://github.com/jorgebucaran/colorette"
"[email protected]","MIT","https://github.com/Marak/colors.js"
"[email protected]","MIT","https://github.com/felixge/node-combined-stream"
"[email protected]","MIT","https://github.com/tj/commander.js"
Expand Down Expand Up @@ -276,7 +276,7 @@
"[email protected]","BSD-2-Clause","https://github.com/motdotla/dotenv"
"[email protected]","MIT","https://github.com/quartzjer/ecc-jsbn"
"[email protected]","MIT","https://github.com/jonathanong/ee-first"
"[email protected].621","ISC","https://github.com/kilian/electron-to-chromium"
"[email protected].739","ISC","https://github.com/kilian/electron-to-chromium"
"[email protected]","MIT","https://github.com/mathiasbynens/emoji-regex"
"[email protected]","MIT","https://github.com/mathiasbynens/emoji-regex"
"[email protected]","MIT","https://github.com/kikobeats/emojis-list"
Expand Down Expand Up @@ -367,7 +367,7 @@
"[email protected]","MIT","https://github.com/sindresorhus/get-stream"
"[email protected]","MIT","https://github.com/jonschlinkert/get-value"
"[email protected]","MIT","https://github.com/arekinath/node-getpass"
"[email protected].1","ISC","https://github.com/gulpjs/glob-parent"
"[email protected].2","ISC","https://github.com/gulpjs/glob-parent"
"[email protected]","BSD-2-Clause","https://github.com/fitzgen/glob-to-regexp"
"[email protected]","ISC","https://github.com/isaacs/node-glob"
"[email protected]","MIT","https://github.com/sindresorhus/globals"
Expand All @@ -384,7 +384,7 @@
"[email protected]","MIT","https://github.com/jonschlinkert/has-values"
"[email protected]","MIT","https://github.com/jonschlinkert/has-values"
"[email protected]","MIT","https://github.com/tarruda/has"
"[email protected].8","ISC","https://github.com/npm/hosted-git-info"
"[email protected].9","ISC","https://github.com/npm/hosted-git-info"
"[email protected]","MIT","https://github.com/jsdom/html-encoding-sniffer"
"[email protected]","MIT","https://github.com/WebReflection/html-escaper"
"[email protected]","MIT","https://github.com/jshttp/http-errors"
Expand Down Expand Up @@ -517,7 +517,7 @@
"[email protected]","MIT","https://github.com/lodash/lodash"
"[email protected]","MIT","https://github.com/lodash/lodash"
"[email protected]","MIT","https://github.com/lodash/lodash"
"[email protected].20","MIT","https://github.com/lodash/lodash"
"[email protected].21","MIT","https://github.com/lodash/lodash"
"[email protected]","MIT","https://github.com/sindresorhus/log-symbols"
"[email protected]","BSD-3-Clause","https://github.com/sinonjs/lolex"
"[email protected]","ISC","https://github.com/isaacs/node-lru-cache"
Expand Down Expand Up @@ -564,7 +564,7 @@
"[email protected]","MIT","https://github.com/broofa/node-int64"
"[email protected]","MIT","https://github.com/jamestalmage/node-modules-regexp"
"[email protected]","MIT","https://github.com/mikaelbr/node-notifier"
"[email protected].67","MIT","https://github.com/chicoxyzzy/node-releases"
"[email protected].72","MIT","https://github.com/chicoxyzzy/node-releases"
"[email protected]","ISC","https://github.com/npm/nopt"
"[email protected]","BSD-2-Clause","https://github.com/npm/normalize-package-data"
"[email protected]","MIT","https://github.com/jonschlinkert/normalize-path"
Expand Down Expand Up @@ -619,7 +619,7 @@
"[email protected]","MIT","https://github.com/sindresorhus/path-is-absolute"
"[email protected]","MIT","https://github.com/sindresorhus/path-key"
"[email protected]","MIT","https://github.com/sindresorhus/path-key"
"[email protected].6","MIT","https://github.com/jbgutierrez/path-parse"
"[email protected].7","MIT","https://github.com/jbgutierrez/path-parse"
"[email protected]","MIT","https://github.com/component/path-to-regexp"
"[email protected]","MIT","https://github.com/pillarjs/path-to-regexp"
"[email protected]","MIT","https://github.com/sindresorhus/path-type"
Expand Down Expand Up @@ -841,7 +841,7 @@
"[email protected]","MIT","https://github.com/webpack/webpack-sources"
"[email protected]","MIT","https://github.com/webpack/webpack"
"[email protected]","MIT","https://github.com/jsdom/whatwg-encoding"
"[email protected].2","MIT","https://github.com/github/fetch"
"[email protected].19","MIT","https://github.com/github/fetch"
"[email protected]","MIT","https://github.com/jsdom/whatwg-mimetype"
"[email protected]","MIT","https://github.com/jsdom/whatwg-url"
"[email protected]","ISC","https://github.com/nexdrew/which-module"
Expand All @@ -854,7 +854,7 @@
"[email protected]","ISC","https://github.com/npm/wrappy"
"[email protected]","ISC","https://github.com/npm/write-file-atomic"
"[email protected]","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"
"[email protected]","Apache-2.0","https://github.com/jsdom/xml-name-validator"
"[email protected]","MIT","https://github.com/lddubeau/xmlchars"
"[email protected]","MIT","https://github.com/Raynos/xtend"
Expand All @@ -867,4 +867,4 @@
"[email protected]","MIT","https://github.com/yargs/yargs"
"[email protected]","MIT","https://github.com/yargs/yargs"
"[email protected]","MIT","https://github.com/sindresorhus/yn"
"[email protected]","MIT","https://github.com/sindresorhus/yocto-queue"
"[email protected]","MIT","https://github.com/sindresorhus/yocto-queue"
10 changes: 5 additions & 5 deletions docs/3rd-party-licenses/frontend-full.csv
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
"[email protected]","MIT","https://github.com/Qix-/color-convert"
"[email protected]","MIT","https://github.com/dfcreative/color-name"
"[email protected]","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"
"[email protected]","MIT","https://github.com/Qix-/color"
"[email protected]","MIT","https://github.com/jorgebucaran/colorette"
"[email protected]","MIT","https://github.com/Marak/colors.js"
Expand Down Expand Up @@ -854,7 +854,7 @@
"[email protected]","MIT","https://github.com/sindresorhus/path-is-absolute"
"[email protected]","(WTFPL OR MIT)","https://github.com/domenic/path-is-inside"
"[email protected]","MIT","https://github.com/sindresorhus/path-key"
"[email protected].6","MIT","https://github.com/jbgutierrez/path-parse"
"[email protected].7","MIT","https://github.com/jbgutierrez/path-parse"
"[email protected]","MIT","https://github.com/component/path-to-regexp"
"[email protected]","MIT","https://github.com/sindresorhus/path-type"
"[email protected]","BSD-3-Clause","https://github.com/mapbox/pbf"
Expand Down Expand Up @@ -1105,8 +1105,8 @@
"[email protected]","MIT","https://github.com/svg/svgo"
"[email protected]","MIT","https://github.com/blesh/symbol-observable"
"[email protected]","MIT","https://github.com/webpack/tapable"
"[email protected].13","ISC","https://github.com/npm/node-tar"
"tar@6.0.5","ISC","https://github.com/npm/node-tar"
"[email protected].19","ISC","https://github.com/npm/node-tar"
"tar@6.1.11","ISC","https://github.com/npm/node-tar"
"[email protected]","MIT","https://github.com/webpack-contrib/terser-webpack-plugin"
"[email protected]","MIT","https://github.com/webpack-contrib/terser-webpack-plugin"
"[email protected]","BSD-2-Clause","https://github.com/terser/terser"
Expand Down Expand Up @@ -1230,4 +1230,4 @@
"[email protected]","MIT","https://github.com/unshiftio/yeast"
"[email protected]","MIT","https://github.com/sindresorhus/yn"
"[email protected]","MIT","https://github.com/sindresorhus/yocto-queue"
"[email protected]","MIT","https://github.com/angular/angular"
"[email protected]","MIT","https://github.com/angular/angular"
1 change: 1 addition & 0 deletions workbench/backend/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14.18
9 changes: 9 additions & 0 deletions workbench/backend/manifest.yaml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 7 additions & 4 deletions workbench/backend/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions workbench/frontend/manifest.yaml
Original file line number Diff line number Diff line change
@@ -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

27 changes: 20 additions & 7 deletions workbench/frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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<GlobalContext>;
Expand All @@ -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<void> {
this.auth.logout();
}

public async login() {
public async login(): Promise<void> {
this.auth.openLoginDialog();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -159,4 +159,4 @@ export class LoginDialogComponent implements OnInit {
);
}

}
}
4 changes: 2 additions & 2 deletions workbench/frontend/src/app/common/services/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 12 additions & 1 deletion workbench/frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
<title>SAP FSM AI</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Security-Policy" content="
default-src 'self' https://*.sap.corp https://*.tools.sap https://*.ondemand.com https://*.sapsf.eu https://*.sapsf.com https://*.successfactors.com https://*.successfactors.eu https://*.sapdemocloud.com https://*.cloud.sap https://*.int.sap https://*.sap.com https://*.net.sap https://*.sapanalytics.cloud https://*.sapbydesign.com https://*.for.sap https://*.enter.sap https://*.only.sap https://*.dev.sap http://localhost:8000;
script-src 'self' 'unsafe-inline' https://*.sap.corp https://*.tools.sap https://*.ondemand.com https://*.sapsf.eu https://*.sapsf.com https://*.successfactors.com https://*.successfactors.eu https://*.sapdemocloud.com https://*.cloud.sap https://*.int.sap https://*.sap.com https://*.net.sap https://*.sapanalytics.cloud https://*.sapbydesign.com https://*.for.sap https://*.enter.sap https://*.only.sap https://*.dev.sap http://localhost:8000;
style-src 'self' 'unsafe-inline' *;
img-src 'self' 'unsafe-inline' * data:;
font-src 'self' *;
connect-src 'self' https://*.sap.corp https://*.tools.sap https://*.ondemand.com https://*.sapsf.eu https://*.sapsf.com https://*.successfactors.com https://*.successfactors.eu https://*.sapdemocloud.com https://*.cloud.sap https://*.int.sap https://*.sap.com https://*.net.sap https://*.sapanalytics.cloud https://*.sapbydesign.com https://*.for.sap https://*.enter.sap https://*.only.sap https://*.dev.sap http://localhost:8000;
frame-ancestors 'self' https://*.sap.corp https://*.tools.sap https://*.ondemand.com https://*.sapsf.eu https://*.sapsf.com https://*.successfactors.com https://*.successfactors.eu https://*.sapdemocloud.com https://*.cloud.sap https://*.int.sap https://*.sap.com https://*.net.sap https://*.sapanalytics.cloud https://*.sapbydesign.com https://*.for.sap https://*.enter.sap https://*.only.sap https://*.dev.sap;
frame-src 'self' https://*.sap.corp https://*.ondemand.com https://*.sapsf.eu https://*.sapsf.com https://*.successfactors.com https://*.successfactors.eu https://*.sapdemocloud.com https://*.cloud.sap https://*.int.sap https://*.sap.com https://*.net.sap https://*.sapanalytics.cloud https://*.sapbydesign.com https://*.only.sap https://*.dev.sap;"
>
<meta http-equiv="X-Frame-Options" content="ALLOW-FROM https://*.ondemand.com">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Expand All @@ -16,4 +27,4 @@
<app-root></app-root>
</body>

</html>
</html>
Loading