From 66213570910a9f8442d761796e1fbbfc3c1418fe Mon Sep 17 00:00:00 2001 From: John Balasis <15860451+jBalasis@users.noreply.github.com> Date: Mon, 16 Jan 2023 15:15:06 +0000 Subject: [PATCH] added desired compatibility level plus minor fixes --- src/app/services/repository.service.ts | 6 +++++- ...tasource-new-interface-form.component.html | 3 ++- ...datasource-new-interface-form.component.ts | 19 +++++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/app/services/repository.service.ts b/src/app/services/repository.service.ts index 1d47aa8d6..e9e51fae1 100755 --- a/src/app/services/repository.service.ts +++ b/src/app/services/repository.service.ts @@ -50,7 +50,7 @@ export class RepositoryService { let url; comment = interfaceInfo.comments; // temp fix for emailing comment if (comment == null || comment === '') { - url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}$desiredCompatibilityLevel=${desiredCompatibilityLevel}`; + url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`; } else { url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}$desiredCompatibilityLevel=${desiredCompatibilityLevel}`; } @@ -66,6 +66,10 @@ export class RepositoryService { return this.httpClient.delete(url, {withCredentials: true, responseType: 'text'}); } + getInterfaceDesiredCompatibilityLevel(repoId: string, interfaceId: string) { + return this.httpClient.get(environment.API_ENDPOINT + `/compliance/${repoId}/${interfaceId}`); + } + addRepository(datatype: string, newRepository: Repository): Observable { const url = `${this.apiUrl}addRepository?datatype=${datatype}`; console.log(`knocking on: ${url}`); diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html b/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html index f19fd482c..2de86fbf5 100644 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html @@ -29,7 +29,8 @@ Identified - + diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts b/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts index 1bdd936fb..c4d7ff069 100644 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts @@ -113,14 +113,17 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { }, () => { if (this.currentInterface?.apiParams?.find(entry => entry.param === 'set')) { - // it will not work if set is not on valsetList - if (this.valsetList.some(x => x === this.currentInterface.apiParams['set'])) { - this.repoInterfaceForm.get('selectValidationSet').setValue(this.currentInterface.apiParams - .find(entry => entry.param === 'set').value); - } - this.loadingMessage = ''; - this.repoInterfaceForm.updateValueAndValidity(); - this.checkIfValid(); + this.repoInterfaceForm.get('selectValidationSet').setValue(this.currentInterface.apiParams + .find(entry => entry.param === 'set').value); + this.repoService.getInterfaceDesiredCompatibilityLevel(this.currentInterface.datasource, this.currentInterface.id).subscribe( + res => { + console.log(res); + this.repoInterfaceForm.get('desiredCompatibilityLevel').setValue(res['desiredCompatibilityLevel']); + } + ); + this.loadingMessage = ''; + this.repoInterfaceForm.updateValueAndValidity(); + this.checkIfValid(); } } );