finalizing update interfaces
This commit is contained in:
parent
6621357091
commit
c3b14054b7
File diff suppressed because it is too large
Load Diff
|
@ -207,10 +207,10 @@ export class RegisterExistingDatasourceComponent implements OnInit {
|
|||
} else {
|
||||
this.repoInterfaces.push(repo_interface);
|
||||
}
|
||||
console.log(JSON.stringify(repo_interface));
|
||||
// console.log(JSON.stringify(repo_interface));
|
||||
}
|
||||
}
|
||||
console.log('new interfaces is ', this.repoInterfaces);
|
||||
// console.log('new interfaces is ', this.repoInterfaces);
|
||||
return invalidFormsCount;
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,7 @@ export class RegisterExistingDatasourceComponent implements OnInit {
|
|||
this.loadingMessage = 'Saving changes';
|
||||
this.errorMessage = '';
|
||||
console.log('reg this.repo', this.repo);
|
||||
this.repoService.addRepository( this.repo.eoscDatasourceType, this.repo).subscribe( //this.repo.collectedfrom
|
||||
this.repoService.addRepository( this.repo.eoscDatasourceType, this.repo).subscribe( // this.repo.collectedfrom
|
||||
response => {
|
||||
console.log(`addRepository responded: ${response.id}, ${response.registeredby}`);
|
||||
this.repo = response;
|
||||
|
|
|
@ -33,13 +33,13 @@ export class RepositoryService {
|
|||
|
||||
constructor(private httpClient: HttpClient) { }
|
||||
|
||||
addInterface(datatype: string, repoId: string, registeredBy: string, comment: string, newInterface: RepositoryInterface): Observable<RepositoryInterface> {
|
||||
addInterface(datatype: string, repoId: string, registeredBy: string, comment: string, newInterface: RepositoryInterface, desiredCompatibilityLevel?: string): Observable<RepositoryInterface> {
|
||||
let url;
|
||||
comment = newInterface.comments; // temp fix for emailing comment
|
||||
if (comment == null || comment === '') {
|
||||
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}`;
|
||||
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
|
||||
} else {
|
||||
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`;
|
||||
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
|
||||
}
|
||||
console.log(`knocking on: ${url}`);
|
||||
console.log(`sending ${JSON.stringify(newInterface)}`);
|
||||
|
@ -52,7 +52,7 @@ export class RepositoryService {
|
|||
if (comment == null || comment === '') {
|
||||
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
|
||||
} else {
|
||||
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}$desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
|
||||
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
|
||||
}
|
||||
console.log(`knocking on: ${url}`);
|
||||
console.log(`sending ${JSON.stringify(interfaceInfo)}`);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<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" [ngClass]="{'uk-disabled': this.repoInterfaceForm.get('compatibilityLevel').value}"
|
||||
<input id="baseurl" type="text" class="md-input" [ngClass]="{'uk-disabled': showIdentifiedBaseUrl}"
|
||||
formControlName="baseurl" (blur)="getInterfaceInfo()">
|
||||
<span class="md-input-bar"></span>
|
||||
</div>
|
||||
|
|
|
@ -75,6 +75,14 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
|
|||
this.repoInterfaceForm.get('baseurl').setValue(this.currentInterface.baseurl);
|
||||
this.repoInterfaceForm.get('compatibilityLevel').setValue(this.currentInterface.compatibility);
|
||||
this.repoInterfaceForm.get('compatibilityLevelOverride').setValue(this.currentInterface.compatibilityOverride);
|
||||
this.repoService.getInterfaceDesiredCompatibilityLevel(this.currentInterface.datasource, this.currentInterface.id).subscribe(
|
||||
res => {
|
||||
console.log(res);
|
||||
if (res !== null) {
|
||||
this.repoInterfaceForm.get('desiredCompatibilityLevel').setValue(res['desiredCompatibilityLevel']);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
this.getInterfaceInfo();
|
||||
this.getCompatibilityClasses();
|
||||
|
@ -115,16 +123,10 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
|
|||
if (this.currentInterface?.apiParams?.find(entry => entry.param === 'set')) {
|
||||
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();
|
||||
this.repoInterfaceForm.updateValueAndValidity();
|
||||
this.checkIfValid();
|
||||
}
|
||||
this.loadingMessage = '';
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -271,7 +273,8 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
|
|||
addInterface(newInterface: RepositoryInterface) {
|
||||
this.loadingMessage = formSubmitting;
|
||||
this.repoService.addInterface(this.currentRepo.datasourceType, this.currentRepo.id,
|
||||
this.currentRepo.registeredBy, this.currentRepo.comments, newInterface).subscribe(
|
||||
this.currentRepo.registeredBy, this.currentRepo.comments, newInterface,
|
||||
this.repoInterfaceForm.get('desiredCompatibilityLevel').value).subscribe(
|
||||
addedInterface => {
|
||||
console.log(`addInterface responded ${JSON.stringify(addedInterface)}`);
|
||||
this.currentInterface = addedInterface;
|
||||
|
@ -305,7 +308,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
|
|||
this.currentInterface.comments = comment;
|
||||
|
||||
if (!this.inRegister) {
|
||||
this.updateInterface(desiredCompLvl);
|
||||
this.updateInterface();
|
||||
} else {
|
||||
this.successMessage = 'The harvesting settings are valid!';
|
||||
console.log('SAVED !');
|
||||
|
@ -313,7 +316,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
updateInterface(desiredCompatibilityLevel: string) {
|
||||
updateInterface() {
|
||||
this.loadingMessage = formSubmitting;
|
||||
this.repoService.updateInterface(this.currentRepo.id, this.currentRepo.registeredBy, this.currentRepo.comments,
|
||||
this.currentInterface, this.repoInterfaceForm.get('desiredCompatibilityLevel').value).subscribe(
|
||||
|
|
Loading…
Reference in New Issue