added desired compatibility level plus minor fixes

This commit is contained in:
John Balasis 2023-01-16 15:15:06 +00:00
parent fb452386a1
commit 6621357091
3 changed files with 18 additions and 10 deletions

View File

@ -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}&registeredBy=${registeredBy}$desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${registeredBy}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
} else {
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${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<Repository> {
const url = `${this.apiUrl}addRepository?datatype=${datatype}`;
console.log(`knocking on: ${url}`);

View File

@ -29,7 +29,8 @@
<span *ngIf="showIdentifiedBaseUrl" class="help-block inline" style="margin-top: 8px; margin-bottom: 0px; padding-left: 10px; display: block;">
Identified
</span>
<input id="baseurl" type="text" class="md-input uk-disabled" formControlName="baseurl" (blur)="getInterfaceInfo()">
<input id="baseurl" type="text" class="md-input" [ngClass]="{'uk-disabled': this.repoInterfaceForm.get('compatibilityLevel').value}"
formControlName="baseurl" (blur)="getInterfaceInfo()">
<span class="md-input-bar"></span>
</div>

View File

@ -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();
}
}
);