Revize e4bc63c3
Přidáno uživatelem Lukas Cerny před téměř 6 roky(ů)
.gitignore | ||
---|---|---|
27 | 27 |
server/*.iml |
28 | 28 |
|
29 | 29 |
server/target/* |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
# See http://help.github.com/ignore-files/ for more about ignoring files. |
|
35 |
|
|
36 |
# compiled output |
|
37 |
/dist |
|
38 |
/tmp |
|
39 |
/out-tsc |
|
40 |
# Only exists if Bazel was run |
|
41 |
/bazel-out |
|
42 |
|
|
43 |
webapp/yarn.lock |
|
44 |
webapp/package-lock.json |
|
45 |
# dependencies |
|
46 |
webapp/node_modules |
|
47 |
|
|
48 |
# profiling files |
|
49 |
chrome-profiler-events.json |
|
50 |
speed-measure-plugin.json |
|
51 |
|
|
52 |
# IDEs and editors |
|
53 |
/.idea |
|
54 |
.project |
|
55 |
.classpath |
|
56 |
.c9/ |
|
57 |
*.launch |
|
58 |
.settings/ |
|
59 |
*.sublime-workspace |
|
60 |
|
|
61 |
# IDE - VSCode |
|
62 |
webapp/.vscode/* |
|
63 |
!.vscode/settings.json |
|
64 |
!.vscode/tasks.json |
|
65 |
!.vscode/launch.json |
|
66 |
!.vscode/extensions.json |
|
67 |
.history/* |
|
68 |
|
|
69 |
# misc |
|
70 |
/.sass-cache |
|
71 |
/connect.lock |
|
72 |
/coverage |
|
73 |
/libpeerconnection.log |
|
74 |
npm-debug.log |
|
75 |
yarn-error.log |
|
76 |
testem.log |
|
77 |
/typings |
|
78 |
|
|
79 |
# System Files |
|
80 |
.DS_Store |
|
81 |
Thumbs.db |
build.sh | ||
---|---|---|
1 |
mvn -f ./server/pom.xml clean package; docker restart yamanager_app |
build_server.sh | ||
---|---|---|
1 |
mvn -f ./server/pom.xml clean package; docker restart yamanager_app |
install.sh | ||
---|---|---|
1 |
mvn -f ./server/pom.xml clean package; docker-compose up |
install_server.sh | ||
---|---|---|
1 |
mvn -f ./server/pom.xml clean package; docker-compose up |
webapp/.editorconfig | ||
---|---|---|
1 |
# Editor configuration, see https://editorconfig.org |
|
2 |
root = true |
|
3 |
|
|
4 |
[*] |
|
5 |
charset = utf-8 |
|
6 |
indent_style = space |
|
7 |
indent_size = 2 |
|
8 |
insert_final_newline = true |
|
9 |
trim_trailing_whitespace = true |
|
10 |
|
|
11 |
[*.md] |
|
12 |
max_line_length = off |
|
13 |
trim_trailing_whitespace = false |
webapp/angular.json | ||
---|---|---|
1 |
{ |
|
2 |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", |
|
3 |
"version": 1, |
|
4 |
"newProjectRoot": "projects", |
|
5 |
"projects": { |
|
6 |
"ymanager-frontend": { |
|
7 |
"root": "", |
|
8 |
"sourceRoot": "src", |
|
9 |
"projectType": "application", |
|
10 |
"prefix": "app", |
|
11 |
"schematics": { |
|
12 |
"@schematics/angular:component": { |
|
13 |
"style": "sass" |
|
14 |
} |
|
15 |
}, |
|
16 |
"architect": { |
|
17 |
"build": { |
|
18 |
"builder": "@angular-devkit/build-angular:browser", |
|
19 |
"options": { |
|
20 |
"outputPath": "dist/ymanager-frontend", |
|
21 |
"index": "src/index.html", |
|
22 |
"main": "src/main.ts", |
|
23 |
"polyfills": "src/polyfills.ts", |
|
24 |
"tsConfig": "src/tsconfig.app.json", |
|
25 |
"assets": [ |
|
26 |
"src/favicon.ico", |
|
27 |
"src/assets" |
|
28 |
], |
|
29 |
"styles": [ |
|
30 |
"src/styles.sass" |
|
31 |
], |
|
32 |
"scripts": [], |
|
33 |
"es5BrowserSupport": true |
|
34 |
}, |
|
35 |
"configurations": { |
|
36 |
"production": { |
|
37 |
"fileReplacements": [ |
|
38 |
{ |
|
39 |
"replace": "src/environments/environment.ts", |
|
40 |
"with": "src/environments/environment.prod.ts" |
|
41 |
} |
|
42 |
], |
|
43 |
"optimization": true, |
|
44 |
"outputHashing": "all", |
|
45 |
"sourceMap": false, |
|
46 |
"extractCss": true, |
|
47 |
"namedChunks": false, |
|
48 |
"aot": true, |
|
49 |
"extractLicenses": true, |
|
50 |
"vendorChunk": false, |
|
51 |
"buildOptimizer": true, |
|
52 |
"budgets": [ |
|
53 |
{ |
|
54 |
"type": "initial", |
|
55 |
"maximumWarning": "2mb", |
|
56 |
"maximumError": "5mb" |
|
57 |
} |
|
58 |
] |
|
59 |
} |
|
60 |
} |
|
61 |
}, |
|
62 |
"serve": { |
|
63 |
"builder": "@angular-devkit/build-angular:dev-server", |
|
64 |
"options": { |
|
65 |
"browserTarget": "ymanager-frontend:build" |
|
66 |
}, |
|
67 |
"configurations": { |
|
68 |
"production": { |
|
69 |
"browserTarget": "ymanager-frontend:build:production" |
|
70 |
} |
|
71 |
} |
|
72 |
}, |
|
73 |
"extract-i18n": { |
|
74 |
"builder": "@angular-devkit/build-angular:extract-i18n", |
|
75 |
"options": { |
|
76 |
"browserTarget": "ymanager-frontend:build" |
|
77 |
} |
|
78 |
}, |
|
79 |
"test": { |
|
80 |
"builder": "@angular-devkit/build-angular:karma", |
|
81 |
"options": { |
|
82 |
"main": "src/test.ts", |
|
83 |
"polyfills": "src/polyfills.ts", |
|
84 |
"tsConfig": "src/tsconfig.spec.json", |
|
85 |
"karmaConfig": "src/karma.conf.js", |
|
86 |
"styles": [ |
|
87 |
"src/styles.sass" |
|
88 |
], |
|
89 |
"scripts": [], |
|
90 |
"assets": [ |
|
91 |
"src/favicon.ico", |
|
92 |
"src/assets" |
|
93 |
] |
|
94 |
} |
|
95 |
}, |
|
96 |
"lint": { |
|
97 |
"builder": "@angular-devkit/build-angular:tslint", |
|
98 |
"options": { |
|
99 |
"tsConfig": [ |
|
100 |
"src/tsconfig.app.json", |
|
101 |
"src/tsconfig.spec.json" |
|
102 |
], |
|
103 |
"exclude": [ |
|
104 |
"**/node_modules/**" |
|
105 |
] |
|
106 |
} |
|
107 |
} |
|
108 |
} |
|
109 |
}, |
|
110 |
"ymanager-frontend-e2e": { |
|
111 |
"root": "e2e/", |
|
112 |
"projectType": "application", |
|
113 |
"prefix": "", |
|
114 |
"architect": { |
|
115 |
"e2e": { |
|
116 |
"builder": "@angular-devkit/build-angular:protractor", |
|
117 |
"options": { |
|
118 |
"protractorConfig": "e2e/protractor.conf.js", |
|
119 |
"devServerTarget": "ymanager-frontend:serve" |
|
120 |
}, |
|
121 |
"configurations": { |
|
122 |
"production": { |
|
123 |
"devServerTarget": "ymanager-frontend:serve:production" |
|
124 |
} |
|
125 |
} |
|
126 |
}, |
|
127 |
"lint": { |
|
128 |
"builder": "@angular-devkit/build-angular:tslint", |
|
129 |
"options": { |
|
130 |
"tsConfig": "e2e/tsconfig.e2e.json", |
|
131 |
"exclude": [ |
|
132 |
"**/node_modules/**" |
|
133 |
] |
|
134 |
} |
|
135 |
} |
|
136 |
} |
|
137 |
} |
|
138 |
}, |
|
139 |
"defaultProject": "ymanager-frontend" |
|
140 |
} |
webapp/e2e/protractor.conf.js | ||
---|---|---|
1 |
// Protractor configuration file, see link for more information |
|
2 |
// https://github.com/angular/protractor/blob/master/lib/config.ts |
|
3 |
|
|
4 |
const { SpecReporter } = require('jasmine-spec-reporter'); |
|
5 |
|
|
6 |
exports.config = { |
|
7 |
allScriptsTimeout: 11000, |
|
8 |
specs: [ |
|
9 |
'./src/**/*.e2e-spec.ts' |
|
10 |
], |
|
11 |
capabilities: { |
|
12 |
'browserName': 'chrome' |
|
13 |
}, |
|
14 |
directConnect: true, |
|
15 |
baseUrl: 'http://localhost:4200/', |
|
16 |
framework: 'jasmine', |
|
17 |
jasmineNodeOpts: { |
|
18 |
showColors: true, |
|
19 |
defaultTimeoutInterval: 30000, |
|
20 |
print: function() {} |
|
21 |
}, |
|
22 |
onPrepare() { |
|
23 |
require('ts-node').register({ |
|
24 |
project: require('path').join(__dirname, './tsconfig.e2e.json') |
|
25 |
}); |
|
26 |
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); |
|
27 |
} |
|
28 |
}; |
webapp/e2e/src/app.e2e-spec.ts | ||
---|---|---|
1 |
import { AppPage } from './app.po'; |
|
2 |
import { browser, logging } from 'protractor'; |
|
3 |
|
|
4 |
describe('workspace-project App', () => { |
|
5 |
let page: AppPage; |
|
6 |
|
|
7 |
beforeEach(() => { |
|
8 |
page = new AppPage(); |
|
9 |
}); |
|
10 |
|
|
11 |
it('should display welcome message', () => { |
|
12 |
page.navigateTo(); |
|
13 |
expect(page.getTitleText()).toEqual('Welcome to ymanager-frontend!'); |
|
14 |
}); |
|
15 |
|
|
16 |
afterEach(async () => { |
|
17 |
// Assert that there are no errors emitted from the browser |
|
18 |
const logs = await browser.manage().logs().get(logging.Type.BROWSER); |
|
19 |
expect(logs).not.toContain(jasmine.objectContaining({ |
|
20 |
level: logging.Level.SEVERE, |
|
21 |
} as logging.Entry)); |
|
22 |
}); |
|
23 |
}); |
webapp/e2e/src/app.po.ts | ||
---|---|---|
1 |
import { browser, by, element } from 'protractor'; |
|
2 |
|
|
3 |
export class AppPage { |
|
4 |
navigateTo() { |
|
5 |
return browser.get(browser.baseUrl) as Promise<any>; |
|
6 |
} |
|
7 |
|
|
8 |
getTitleText() { |
|
9 |
return element(by.css('app-root h1')).getText() as Promise<string>; |
|
10 |
} |
|
11 |
} |
webapp/e2e/tsconfig.e2e.json | ||
---|---|---|
1 |
{ |
|
2 |
"extends": "../tsconfig.json", |
|
3 |
"compilerOptions": { |
|
4 |
"outDir": "../out-tsc/app", |
|
5 |
"module": "commonjs", |
|
6 |
"target": "es5", |
|
7 |
"types": [ |
|
8 |
"jasmine", |
|
9 |
"jasminewd2", |
|
10 |
"node" |
|
11 |
] |
|
12 |
} |
|
13 |
} |
webapp/install.sh | ||
---|---|---|
1 |
yarn install |
webapp/package.json | ||
---|---|---|
1 |
{ |
|
2 |
"name": "ymanager-frontend", |
|
3 |
"version": "0.0.0", |
|
4 |
"scripts": { |
|
5 |
"ng": "ng", |
|
6 |
"start": "ng serve", |
|
7 |
"build": "ng build", |
|
8 |
"test": "ng test", |
|
9 |
"lint": "ng lint", |
|
10 |
"e2e": "ng e2e" |
|
11 |
}, |
|
12 |
"private": true, |
|
13 |
"dependencies": { |
|
14 |
"@angular/animations": "~7.2.0", |
|
15 |
"@angular/common": "~7.2.0", |
|
16 |
"@angular/compiler": "~7.2.0", |
|
17 |
"@angular/core": "~7.2.0", |
|
18 |
"@angular/forms": "~7.2.0", |
|
19 |
"@angular/platform-browser": "~7.2.0", |
|
20 |
"@angular/platform-browser-dynamic": "~7.2.0", |
|
21 |
"@angular/router": "~7.2.0", |
|
22 |
"core-js": "^2.5.4", |
|
23 |
"rxjs": "~6.3.3", |
|
24 |
"tslib": "^1.9.0", |
|
25 |
"zone.js": "~0.8.26", |
|
26 |
"@angular/http": "latest" |
|
27 |
}, |
|
28 |
"devDependencies": { |
|
29 |
"@angular-devkit/build-angular": "~0.13.0", |
|
30 |
"@angular/cli": "~7.3.8", |
|
31 |
"@angular/compiler-cli": "~7.2.0", |
|
32 |
"@angular/language-service": "~7.2.0", |
|
33 |
"@types/node": "~8.9.4", |
|
34 |
"@types/jasmine": "~2.8.8", |
|
35 |
"@types/jasminewd2": "~2.0.3", |
|
36 |
"codelyzer": "~4.5.0", |
|
37 |
"jasmine-core": "~2.99.1", |
|
38 |
"jasmine-spec-reporter": "~4.2.1", |
|
39 |
"karma": "~4.0.0", |
|
40 |
"karma-chrome-launcher": "~2.2.0", |
|
41 |
"karma-coverage-istanbul-reporter": "~2.0.1", |
|
42 |
"karma-jasmine": "~1.1.2", |
|
43 |
"karma-jasmine-html-reporter": "^0.2.2", |
|
44 |
"protractor": "~5.4.0", |
|
45 |
"ts-node": "~7.0.0", |
|
46 |
"tslint": "~5.11.0", |
|
47 |
"typescript": "~3.2.2" |
|
48 |
} |
|
49 |
} |
webapp/run.sh | ||
---|---|---|
1 |
ng serve |
webapp/src/app/app-routing.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { Routes, RouterModule } from '@angular/router'; |
|
3 |
|
|
4 |
const routes: Routes = []; |
|
5 |
|
|
6 |
@NgModule({ |
|
7 |
imports: [RouterModule.forRoot(routes)], |
|
8 |
exports: [RouterModule] |
|
9 |
}) |
|
10 |
export class AppRoutingModule { } |
webapp/src/app/app.component.html | ||
---|---|---|
1 |
<b>Post test: </b> {{ postTestResponse }} <br> |
|
2 |
<b>Get test: </b> {{ getTestResponse }} <br> |
|
3 |
<b>EN Hello world test: </b> {{ enHelloWorldResponse }} <br> |
|
4 |
<b>CZ Hello world test: </b> {{ czHelloWorldResponse }} <br> |
|
5 |
<b>Database test: </b> {{ databaseResponse }} <br> |
|
6 |
<router-outlet></router-outlet> |
webapp/src/app/app.component.spec.ts | ||
---|---|---|
1 |
import { TestBed, async } from '@angular/core/testing'; |
|
2 |
import { RouterTestingModule } from '@angular/router/testing'; |
|
3 |
import { AppComponent } from './app.component'; |
|
4 |
|
|
5 |
describe('AppComponent', () => { |
|
6 |
beforeEach(async(() => { |
|
7 |
TestBed.configureTestingModule({ |
|
8 |
imports: [ |
|
9 |
RouterTestingModule |
|
10 |
], |
|
11 |
declarations: [ |
|
12 |
AppComponent |
|
13 |
], |
|
14 |
}).compileComponents(); |
|
15 |
})); |
|
16 |
|
|
17 |
it('should create the app', () => { |
|
18 |
const fixture = TestBed.createComponent(AppComponent); |
|
19 |
const app = fixture.debugElement.componentInstance; |
|
20 |
expect(app).toBeTruthy(); |
|
21 |
}); |
|
22 |
|
|
23 |
it(`should have as title 'ymanager-frontend'`, () => { |
|
24 |
const fixture = TestBed.createComponent(AppComponent); |
|
25 |
const app = fixture.debugElement.componentInstance; |
|
26 |
expect(app.title).toEqual('ymanager-frontend'); |
|
27 |
}); |
|
28 |
|
|
29 |
it('should render title in a h1 tag', () => { |
|
30 |
const fixture = TestBed.createComponent(AppComponent); |
|
31 |
fixture.detectChanges(); |
|
32 |
const compiled = fixture.debugElement.nativeElement; |
|
33 |
expect(compiled.querySelector('h1').textContent).toContain('Welcome to ymanager-frontend!'); |
|
34 |
}); |
|
35 |
}); |
webapp/src/app/app.component.ts | ||
---|---|---|
1 |
import { Component, OnInit } from '@angular/core'; |
|
2 |
import { HttpClient } from '@angular/common/http'; |
|
3 |
import { environment } from '../environments/environment'; |
|
4 |
|
|
5 |
@Component({ |
|
6 |
selector: 'app-root', |
|
7 |
templateUrl: './app.component.html', |
|
8 |
styleUrls: ['./app.component.sass'] |
|
9 |
}) |
|
10 |
export class AppComponent implements OnInit { |
|
11 |
getTestResponse; |
|
12 |
postTestResponse; |
|
13 |
enHelloWorldResponse; |
|
14 |
czHelloWorldResponse; |
|
15 |
databaseResponse; |
|
16 |
constructor(private httpClient: HttpClient) {} |
|
17 |
|
|
18 |
ngOnInit() { |
|
19 |
this.httpClient.get(environment.apiUrl + 'test', { responseType: 'text' }) |
|
20 |
.subscribe(data => this.getTestResponse = data); |
|
21 |
|
|
22 |
this.httpClient.post(environment.apiUrl + 'test', {}, { responseType: 'text' }) |
|
23 |
.subscribe(data => this.postTestResponse = data); |
|
24 |
|
|
25 |
this.httpClient.get(environment.apiUrl + 'hello', { responseType: 'text' }) |
|
26 |
.subscribe(data => this.enHelloWorldResponse = data); |
|
27 |
|
|
28 |
this.httpClient.get(environment.apiUrl + 'hello?lang=cz', { responseType: 'text' }) |
|
29 |
.subscribe(data => this.czHelloWorldResponse = data); |
|
30 |
|
|
31 |
this.httpClient.get(environment.apiUrl + 'database', { responseType: 'text' }) |
|
32 |
.subscribe(data => this.databaseResponse = data); |
|
33 |
} |
|
34 |
} |
webapp/src/app/app.module.ts | ||
---|---|---|
1 |
import { BrowserModule } from '@angular/platform-browser'; |
|
2 |
import { NgModule } from '@angular/core'; |
|
3 |
|
|
4 |
import { AppRoutingModule } from './app-routing.module'; |
|
5 |
import { AppComponent } from './app.component'; |
|
6 |
import {HttpClientModule} from '@angular/common/http'; |
|
7 |
|
|
8 |
@NgModule({ |
|
9 |
declarations: [ |
|
10 |
AppComponent |
|
11 |
], |
|
12 |
imports: [ |
|
13 |
BrowserModule, |
|
14 |
AppRoutingModule, |
|
15 |
HttpClientModule |
|
16 |
], |
|
17 |
providers: [], |
|
18 |
bootstrap: [AppComponent] |
|
19 |
}) |
|
20 |
export class AppModule { } |
webapp/src/browserslist | ||
---|---|---|
1 |
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers |
|
2 |
# For additional information regarding the format and rule options, please see: |
|
3 |
# https://github.com/browserslist/browserslist#queries |
|
4 |
# |
|
5 |
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed |
|
6 |
|
|
7 |
> 0.5% |
|
8 |
last 2 versions |
|
9 |
Firefox ESR |
|
10 |
not dead |
|
11 |
not IE 9-11 |
webapp/src/environments/environment.prod.ts | ||
---|---|---|
1 |
export const environment = { |
|
2 |
production: true, |
|
3 |
apiUrl: 'http://localhost:9080/' // TODO Change to production url |
|
4 |
}; |
webapp/src/environments/environment.ts | ||
---|---|---|
1 |
export const environment = { |
|
2 |
production: false, |
|
3 |
apiUrl: 'http://localhost:9080/' |
|
4 |
}; |
webapp/src/index.html | ||
---|---|---|
1 |
<!doctype html> |
|
2 |
<html lang="en"> |
|
3 |
<head> |
|
4 |
<meta charset="utf-8"> |
|
5 |
<title>YmanagerFrontend</title> |
|
6 |
<base href="/"> |
|
7 |
|
|
8 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
9 |
<link rel="icon" type="image/x-icon" href="favicon.ico"> |
|
10 |
</head> |
|
11 |
<body> |
|
12 |
<app-root></app-root> |
|
13 |
</body> |
|
14 |
</html> |
webapp/src/karma.conf.js | ||
---|---|---|
1 |
// Karma configuration file, see link for more information |
|
2 |
// https://karma-runner.github.io/1.0/config/configuration-file.html |
|
3 |
|
|
4 |
module.exports = function (config) { |
|
5 |
config.set({ |
|
6 |
basePath: '', |
|
7 |
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
8 |
plugins: [ |
|
9 |
require('karma-jasmine'), |
|
10 |
require('karma-chrome-launcher'), |
|
11 |
require('karma-jasmine-html-reporter'), |
|
12 |
require('karma-coverage-istanbul-reporter'), |
|
13 |
require('@angular-devkit/build-angular/plugins/karma') |
|
14 |
], |
|
15 |
client: { |
|
16 |
clearContext: false // leave Jasmine Spec Runner output visible in browser |
|
17 |
}, |
|
18 |
coverageIstanbulReporter: { |
|
19 |
dir: require('path').join(__dirname, '../coverage/ymanager-frontend'), |
|
20 |
reports: ['html', 'lcovonly', 'text-summary'], |
|
21 |
fixWebpackSourcePaths: true |
|
22 |
}, |
|
23 |
reporters: ['progress', 'kjhtml'], |
|
24 |
port: 9876, |
|
25 |
colors: true, |
|
26 |
logLevel: config.LOG_INFO, |
|
27 |
autoWatch: true, |
|
28 |
browsers: ['Chrome'], |
|
29 |
singleRun: false, |
|
30 |
restartOnFileChange: true |
|
31 |
}); |
|
32 |
}; |
webapp/src/main.ts | ||
---|---|---|
1 |
import { enableProdMode } from '@angular/core'; |
|
2 |
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; |
|
3 |
|
|
4 |
import { AppModule } from './app/app.module'; |
|
5 |
import { environment } from './environments/environment'; |
|
6 |
|
|
7 |
if (environment.production) { |
|
8 |
enableProdMode(); |
|
9 |
} |
|
10 |
|
|
11 |
platformBrowserDynamic().bootstrapModule(AppModule) |
|
12 |
.catch(err => console.error(err)); |
webapp/src/polyfills.ts | ||
---|---|---|
1 |
/** |
|
2 |
* This file includes polyfills needed by Angular and is loaded before the app. |
|
3 |
* You can add your own extra polyfills to this file. |
|
4 |
* |
|
5 |
* This file is divided into 2 sections: |
|
6 |
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. |
|
7 |
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main |
|
8 |
* file. |
|
9 |
* |
|
10 |
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that |
|
11 |
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), |
|
12 |
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. |
|
13 |
* |
|
14 |
* Learn more in https://angular.io/guide/browser-support |
|
15 |
*/ |
|
16 |
|
|
17 |
/*************************************************************************************************** |
|
18 |
* BROWSER POLYFILLS |
|
19 |
*/ |
|
20 |
|
|
21 |
/** IE10 and IE11 requires the following for NgClass support on SVG elements */ |
|
22 |
// import 'classlist.js'; // Run `npm install --save classlist.js`. |
|
23 |
|
|
24 |
/** |
|
25 |
* Web Animations `@angular/platform-browser/animations` |
|
26 |
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. |
|
27 |
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). |
|
28 |
*/ |
|
29 |
// import 'web-animations-js'; // Run `npm install --save web-animations-js`. |
|
30 |
|
|
31 |
/** |
|
32 |
* By default, zone.js will patch all possible macroTask and DomEvents |
|
33 |
* user can disable parts of macroTask/DomEvents patch by setting following flags |
|
34 |
* because those flags need to be set before `zone.js` being loaded, and webpack |
|
35 |
* will put import in the top of bundle, so user need to create a separate file |
|
36 |
* in this directory (for example: zone-flags.ts), and put the following flags |
|
37 |
* into that file, and then add the following code before importing zone.js. |
|
38 |
* import './zone-flags.ts'; |
|
39 |
* |
|
40 |
* The flags allowed in zone-flags.ts are listed here. |
|
41 |
* |
|
42 |
* The following flags will work for all browsers. |
|
43 |
* |
|
44 |
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame |
|
45 |
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick |
|
46 |
* (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames |
|
47 |
* |
|
48 |
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js |
|
49 |
* with the following flag, it will bypass `zone.js` patch for IE/Edge |
|
50 |
* |
|
51 |
* (window as any).__Zone_enable_cross_context_check = true; |
|
52 |
* |
|
53 |
*/ |
|
54 |
|
|
55 |
/*************************************************************************************************** |
|
56 |
* Zone JS is required by default for Angular itself. |
|
57 |
*/ |
|
58 |
import 'zone.js/dist/zone'; // Included with Angular CLI. |
|
59 |
|
|
60 |
|
|
61 |
/*************************************************************************************************** |
|
62 |
* APPLICATION IMPORTS |
|
63 |
*/ |
webapp/src/styles.sass | ||
---|---|---|
1 |
/* You can add global styles to this file, and also import other style files */ |
webapp/src/test.ts | ||
---|---|---|
1 |
// This file is required by karma.conf.js and loads recursively all the .spec and framework files |
|
2 |
|
|
3 |
import 'zone.js/dist/zone-testing'; |
|
4 |
import { getTestBed } from '@angular/core/testing'; |
|
5 |
import { |
|
6 |
BrowserDynamicTestingModule, |
|
7 |
platformBrowserDynamicTesting |
|
8 |
} from '@angular/platform-browser-dynamic/testing'; |
|
9 |
|
|
10 |
declare const require: any; |
|
11 |
|
|
12 |
// First, initialize the Angular testing environment. |
|
13 |
getTestBed().initTestEnvironment( |
|
14 |
BrowserDynamicTestingModule, |
|
15 |
platformBrowserDynamicTesting() |
|
16 |
); |
|
17 |
// Then we find all the tests. |
|
18 |
const context = require.context('./', true, /\.spec\.ts$/); |
|
19 |
// And load the modules. |
|
20 |
context.keys().map(context); |
webapp/src/tsconfig.app.json | ||
---|---|---|
1 |
{ |
|
2 |
"extends": "../tsconfig.json", |
|
3 |
"compilerOptions": { |
|
4 |
"outDir": "../out-tsc/app", |
|
5 |
"types": [] |
|
6 |
}, |
|
7 |
"exclude": [ |
|
8 |
"test.ts", |
|
9 |
"**/*.spec.ts" |
|
10 |
] |
|
11 |
} |
webapp/src/tsconfig.spec.json | ||
---|---|---|
1 |
{ |
|
2 |
"extends": "../tsconfig.json", |
|
3 |
"compilerOptions": { |
|
4 |
"outDir": "../out-tsc/spec", |
|
5 |
"types": [ |
|
6 |
"jasmine", |
|
7 |
"node" |
|
8 |
] |
|
9 |
}, |
|
10 |
"files": [ |
|
11 |
"test.ts", |
|
12 |
"polyfills.ts" |
|
13 |
], |
|
14 |
"include": [ |
|
15 |
"**/*.spec.ts", |
|
16 |
"**/*.d.ts" |
|
17 |
] |
|
18 |
} |
webapp/src/tslint.json | ||
---|---|---|
1 |
{ |
|
2 |
"extends": "../tslint.json", |
|
3 |
"rules": { |
|
4 |
"directive-selector": [ |
|
5 |
true, |
|
6 |
"attribute", |
|
7 |
"app", |
|
8 |
"camelCase" |
|
9 |
], |
|
10 |
"component-selector": [ |
|
11 |
true, |
|
12 |
"element", |
|
13 |
"app", |
|
14 |
"kebab-case" |
|
15 |
] |
|
16 |
} |
|
17 |
} |
webapp/tsconfig.json | ||
---|---|---|
1 |
{ |
|
2 |
"compileOnSave": false, |
|
3 |
"compilerOptions": { |
|
4 |
"baseUrl": "./", |
|
5 |
"outDir": "./dist/out-tsc", |
|
6 |
"sourceMap": true, |
|
7 |
"declaration": false, |
|
8 |
"module": "es2015", |
|
9 |
"moduleResolution": "node", |
|
10 |
"emitDecoratorMetadata": true, |
|
11 |
"experimentalDecorators": true, |
|
12 |
"importHelpers": true, |
|
13 |
"target": "es5", |
|
14 |
"typeRoots": [ |
|
15 |
"node_modules/@types" |
|
16 |
], |
|
17 |
"lib": [ |
|
18 |
"es2018", |
|
19 |
"dom" |
|
20 |
] |
|
21 |
} |
|
22 |
} |
webapp/tslint.json | ||
---|---|---|
1 |
{ |
|
2 |
"extends": "tslint:recommended", |
|
3 |
"rulesDirectory": [ |
|
4 |
"codelyzer" |
|
5 |
], |
|
6 |
"rules": { |
|
7 |
"array-type": false, |
|
8 |
"arrow-parens": false, |
|
9 |
"deprecation": { |
|
10 |
"severity": "warn" |
|
11 |
}, |
|
12 |
"import-blacklist": [ |
|
13 |
true, |
|
14 |
"rxjs/Rx" |
|
15 |
], |
|
16 |
"interface-name": false, |
|
17 |
"max-classes-per-file": false, |
|
18 |
"max-line-length": [ |
|
19 |
true, |
|
20 |
140 |
|
21 |
], |
|
22 |
"member-access": false, |
|
23 |
"member-ordering": [ |
|
24 |
true, |
|
25 |
{ |
|
26 |
"order": [ |
|
27 |
"static-field", |
|
28 |
"instance-field", |
|
29 |
"static-method", |
|
30 |
"instance-method" |
|
31 |
] |
|
32 |
} |
|
33 |
], |
|
34 |
"no-consecutive-blank-lines": false, |
|
35 |
"no-console": [ |
|
36 |
true, |
|
37 |
"debug", |
|
38 |
"info", |
|
39 |
"time", |
|
40 |
"timeEnd", |
|
41 |
"trace" |
|
42 |
], |
|
43 |
"no-empty": false, |
|
44 |
"no-inferrable-types": [ |
|
45 |
true, |
|
46 |
"ignore-params" |
|
47 |
], |
|
48 |
"no-non-null-assertion": true, |
|
49 |
"no-redundant-jsdoc": true, |
|
50 |
"no-switch-case-fall-through": true, |
|
51 |
"no-use-before-declare": true, |
|
52 |
"no-var-requires": false, |
|
53 |
"object-literal-key-quotes": [ |
|
54 |
true, |
|
55 |
"as-needed" |
|
56 |
], |
|
57 |
"object-literal-sort-keys": false, |
|
58 |
"ordered-imports": false, |
|
59 |
"quotemark": [ |
|
60 |
true, |
|
61 |
"single" |
|
62 |
], |
|
63 |
"trailing-comma": false, |
|
64 |
"no-output-on-prefix": true, |
|
65 |
"use-input-property-decorator": true, |
|
66 |
"use-output-property-decorator": true, |
|
67 |
"use-host-property-decorator": true, |
|
68 |
"no-input-rename": true, |
|
69 |
"no-output-rename": true, |
|
70 |
"use-life-cycle-interface": true, |
|
71 |
"use-pipe-transform-interface": true, |
|
72 |
"component-class-suffix": true, |
|
73 |
"directive-class-suffix": true |
|
74 |
} |
|
75 |
} |
Také k dispozici: Unified diff
Re #7264 Front end environment