Commit 8631fd13 authored by Alexander Philipp Nowosad's avatar Alexander Philipp Nowosad
Browse files

Fix example.component.ts return types

parent e3eee72d
...@@ -59,7 +59,7 @@ export class ExampleComponent implements OnInit { ...@@ -59,7 +59,7 @@ export class ExampleComponent implements OnInit {
private router: Router private router: Router
) {} ) {}
ngOnInit() { ngOnInit(): void {
this.routeSubscription = this.route.paramMap.subscribe((paramMap) => { this.routeSubscription = this.route.paramMap.subscribe((paramMap) => {
const expertModelId = paramMap.get('id'); const expertModelId = paramMap.get('id');
const exampleId = +paramMap.get('exampleId'); const exampleId = +paramMap.get('exampleId');
...@@ -73,7 +73,7 @@ export class ExampleComponent implements OnInit { ...@@ -73,7 +73,7 @@ export class ExampleComponent implements OnInit {
}); });
} }
async load(expertModelId, exampleId) { async load(expertModelId, exampleId): Promise<void> {
const expertModel = await this.expertModelService.get(expertModelId); const expertModel = await this.expertModelService.get(expertModelId);
this.expertModel = expertModel; this.expertModel = expertModel;
this.example = expertModel.getInstance(exampleId); this.example = expertModel.getInstance(exampleId);
...@@ -93,7 +93,7 @@ export class ExampleComponent implements OnInit { ...@@ -93,7 +93,7 @@ export class ExampleComponent implements OnInit {
} }
} }
async updateExpertModel() { async updateExpertModel(): Promise<void> {
await this.expertModelService.save(this.expertModel); await this.expertModelService.save(this.expertModel);
await this.load(this.expertModel._id, this.example.id); await this.load(this.expertModel._id, this.example.id);
} }
...@@ -101,7 +101,7 @@ export class ExampleComponent implements OnInit { ...@@ -101,7 +101,7 @@ export class ExampleComponent implements OnInit {
/** /**
* Create adaptation of the business model. * Create adaptation of the business model.
*/ */
async createAdaptation() { async createAdaptation(): Promise<void> {
const adaptationName = this.instanceService.getAdaptionName( const adaptationName = this.instanceService.getAdaptionName(
this.example.name this.example.name
); );
...@@ -117,12 +117,12 @@ export class ExampleComponent implements OnInit { ...@@ -117,12 +117,12 @@ export class ExampleComponent implements OnInit {
]); ]);
} }
switchView(event: NgbNavChangeEvent) { switchView(event: NgbNavChangeEvent): void {
this.clearView(); this.clearView();
this.initConformanceOptionsForm(event.nextId); this.initConformanceOptionsForm(event.nextId);
} }
private clearView() { private clearView(): void {
this.uncheckConformance(); this.uncheckConformance();
this.clearCompare(); this.clearCompare();
this.clearPattern(); this.clearPattern();
...@@ -132,7 +132,7 @@ export class ExampleComponent implements OnInit { ...@@ -132,7 +132,7 @@ export class ExampleComponent implements OnInit {
/** /**
* Uncheck the conformance. * Uncheck the conformance.
*/ */
uncheckConformance() { uncheckConformance(): void {
this.conformanceIsChecked = false; this.conformanceIsChecked = false;
this.conformance = new ConformanceReport(); this.conformance = new ConformanceReport();
} }
...@@ -140,7 +140,7 @@ export class ExampleComponent implements OnInit { ...@@ -140,7 +140,7 @@ export class ExampleComponent implements OnInit {
/** /**
* Check the conformance. * Check the conformance.
*/ */
checkConformance() { checkConformance(): void {
this.clearCompare(); this.clearCompare();
this.clearPattern(); this.clearPattern();
this.conformance = this.conformance =
...@@ -155,7 +155,7 @@ export class ExampleComponent implements OnInit { ...@@ -155,7 +155,7 @@ export class ExampleComponent implements OnInit {
/** /**
* Compare this instance with another instance and generate a heatmap * Compare this instance with another instance and generate a heatmap
*/ */
compare() { compare(): void {
this.uncheckConformance(); this.uncheckConformance();
this.clearPattern(); this.clearPattern();
const id = this.selectOtherInstanceForm.value.instance; const id = this.selectOtherInstanceForm.value.instance;
...@@ -171,7 +171,7 @@ export class ExampleComponent implements OnInit { ...@@ -171,7 +171,7 @@ export class ExampleComponent implements OnInit {
/** /**
* Clear comparison and remove heatmap * Clear comparison and remove heatmap
*/ */
clearCompare() { clearCompare(): void {
this.compareInstance = null; this.compareInstance = null;
this.percentages = null; this.percentages = null;
this.selectOtherInstanceForm.get('instance').enable(); this.selectOtherInstanceForm.get('instance').enable();
...@@ -180,7 +180,7 @@ export class ExampleComponent implements OnInit { ...@@ -180,7 +180,7 @@ export class ExampleComponent implements OnInit {
/** /**
* Show pattern in business model canvas * Show pattern in business model canvas
*/ */
showPattern() { showPattern(): void {
this.uncheckConformance(); this.uncheckConformance();
this.clearCompare(); this.clearCompare();
const id = this.selectPatternForm.value.pattern; const id = this.selectPatternForm.value.pattern;
...@@ -191,12 +191,12 @@ export class ExampleComponent implements OnInit { ...@@ -191,12 +191,12 @@ export class ExampleComponent implements OnInit {
/** /**
* Do not show pattern in business model canvas any longer * Do not show pattern in business model canvas any longer
*/ */
clearPattern() { clearPattern(): void {
this.patternInstance = null; this.patternInstance = null;
this.selectPatternForm.get('pattern').enable(); this.selectPatternForm.get('pattern').enable();
} }
showUsedPatterns() { showUsedPatterns(): void {
this.usedPatterns = this.canvasModelConsistencyService.getPatternHints( this.usedPatterns = this.canvasModelConsistencyService.getPatternHints(
this.expertModel, this.expertModel,
this.example, this.example,
...@@ -204,11 +204,11 @@ export class ExampleComponent implements OnInit { ...@@ -204,11 +204,11 @@ export class ExampleComponent implements OnInit {
).usedPatterns; ).usedPatterns;
} }
hideUsedPatterns() { hideUsedPatterns(): void {
this.usedPatterns = null; this.usedPatterns = null;
} }
private initConformanceOptionsForm(activeId: string) { private initConformanceOptionsForm(activeId: string): void {
if (activeId === 'stepHints') { if (activeId === 'stepHints') {
this.conformanceOptionsForm.setValue({ this.conformanceOptionsForm.setValue({
showWarnings: true, showWarnings: true,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment