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