Commit 3ccc53b2 authored by Alexander Philipp Nowosad's avatar Alexander Philipp Nowosad
Browse files

Fix company model expert knowledge can not be selected

parent 5faa35a3
......@@ -38,7 +38,7 @@ export class CompanyModelSelectExpertKnowledgeComponent
private router: Router
) {}
ngOnInit() {
ngOnInit(): void {
this.querySubscription = this.route.queryParamMap.subscribe((paramMap) => {
void this.loadBmProcess(paramMap.get('bmProcessId'));
});
......@@ -47,7 +47,7 @@ export class CompanyModelSelectExpertKnowledgeComponent
});
}
ngOnDestroy() {
ngOnDestroy(): void {
if (this.querySubscription) {
this.querySubscription.unsubscribe();
}
......@@ -56,12 +56,12 @@ export class CompanyModelSelectExpertKnowledgeComponent
}
}
async loadCompanyModel(companyModelId: string) {
async loadCompanyModel(companyModelId: string): Promise<void> {
this.companyModel = await this.companyModelService.get(companyModelId);
await this.loadExpertModels(companyModelId);
}
async loadBmProcess(bmProcessId: string) {
async loadBmProcess(bmProcessId: string): Promise<void> {
this.bmProcess = await this.bmProcessService.get(bmProcessId);
}
......@@ -73,7 +73,7 @@ export class CompanyModelSelectExpertKnowledgeComponent
]);
}
async selectExpertModel() {
async selectExpertModel(): Promise<void> {
await this.mergeService.selectExpertModel(
this.companyModel._id,
this.selectedExpertModelForm.value.expertModelId
......@@ -82,7 +82,7 @@ export class CompanyModelSelectExpertKnowledgeComponent
await this.loadExpertModels(this.companyModel._id);
}
async unselectExpertModel(expertModelId: string) {
async unselectExpertModel(expertModelId: string): Promise<void> {
await this.mergeService.unselectExpertModel(
this.companyModel._id,
expertModelId
......@@ -90,7 +90,7 @@ export class CompanyModelSelectExpertKnowledgeComponent
await this.loadExpertModels(this.companyModel._id);
}
private async loadExpertModels(companyModelId: string) {
private async loadExpertModels(companyModelId: string): Promise<void> {
await this.loadSelectedExpertModels(companyModelId);
await this.loadUnselectedExpertModels(companyModelId);
}
......@@ -112,7 +112,7 @@ export class CompanyModelSelectExpertKnowledgeComponent
this.unselectedExpertModelList = result.filter((model) =>
model.domains
? model.domains.some((domain) =>
this.bmProcess.domains.includes(domain)
this.bmProcess.domains.some((d) => d._id === domain._id)
)
: false
);
......
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