finalizing update interfaces

This commit is contained in:
John Balasis 2023-01-17 15:30:31 +00:00
parent 6621357091
commit c3b14054b7
5 changed files with 413 additions and 17508 deletions

17878
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -207,10 +207,10 @@ export class RegisterExistingDatasourceComponent implements OnInit {
} else { } else {
this.repoInterfaces.push(repo_interface); 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; return invalidFormsCount;
} }
@ -328,7 +328,7 @@ export class RegisterExistingDatasourceComponent implements OnInit {
this.loadingMessage = 'Saving changes'; this.loadingMessage = 'Saving changes';
this.errorMessage = ''; this.errorMessage = '';
console.log('reg this.repo', this.repo); 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 => { response => {
console.log(`addRepository responded: ${response.id}, ${response.registeredby}`); console.log(`addRepository responded: ${response.id}, ${response.registeredby}`);
this.repo = response; this.repo = response;

View File

@ -33,13 +33,13 @@ export class RepositoryService {
constructor(private httpClient: HttpClient) { } 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; let url;
comment = newInterface.comments; // temp fix for emailing comment comment = newInterface.comments; // temp fix for emailing comment
if (comment == null || comment === '') { if (comment == null || comment === '') {
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}&registeredBy=${registeredBy}`; url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}&registeredBy=${registeredBy}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
} else { } else {
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}&registeredBy=${registeredBy}&comment=${comment}`; url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}&registeredBy=${registeredBy}&comment=${comment}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
} }
console.log(`knocking on: ${url}`); console.log(`knocking on: ${url}`);
console.log(`sending ${JSON.stringify(newInterface)}`); console.log(`sending ${JSON.stringify(newInterface)}`);
@ -52,7 +52,7 @@ export class RepositoryService {
if (comment == null || 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 { } else {
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${registeredBy}&comment=${comment}$desiredCompatibilityLevel=${desiredCompatibilityLevel}`; url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${registeredBy}&comment=${comment}&desiredCompatibilityLevel=${desiredCompatibilityLevel}`;
} }
console.log(`knocking on: ${url}`); console.log(`knocking on: ${url}`);
console.log(`sending ${JSON.stringify(interfaceInfo)}`); console.log(`sending ${JSON.stringify(interfaceInfo)}`);

View File

@ -29,7 +29,7 @@
<span *ngIf="showIdentifiedBaseUrl" class="help-block inline" style="margin-top: 8px; margin-bottom: 0px; padding-left: 10px; display: block;"> <span *ngIf="showIdentifiedBaseUrl" class="help-block inline" style="margin-top: 8px; margin-bottom: 0px; padding-left: 10px; display: block;">
Identified Identified
</span> </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()"> formControlName="baseurl" (blur)="getInterfaceInfo()">
<span class="md-input-bar"></span> <span class="md-input-bar"></span>
</div> </div>

View File

@ -75,6 +75,14 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
this.repoInterfaceForm.get('baseurl').setValue(this.currentInterface.baseurl); this.repoInterfaceForm.get('baseurl').setValue(this.currentInterface.baseurl);
this.repoInterfaceForm.get('compatibilityLevel').setValue(this.currentInterface.compatibility); this.repoInterfaceForm.get('compatibilityLevel').setValue(this.currentInterface.compatibility);
this.repoInterfaceForm.get('compatibilityLevelOverride').setValue(this.currentInterface.compatibilityOverride); 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.getInterfaceInfo();
this.getCompatibilityClasses(); this.getCompatibilityClasses();
@ -115,16 +123,10 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
if (this.currentInterface?.apiParams?.find(entry => entry.param === 'set')) { if (this.currentInterface?.apiParams?.find(entry => entry.param === 'set')) {
this.repoInterfaceForm.get('selectValidationSet').setValue(this.currentInterface.apiParams this.repoInterfaceForm.get('selectValidationSet').setValue(this.currentInterface.apiParams
.find(entry => entry.param === 'set').value); .find(entry => entry.param === 'set').value);
this.repoService.getInterfaceDesiredCompatibilityLevel(this.currentInterface.datasource, this.currentInterface.id).subscribe( this.repoInterfaceForm.updateValueAndValidity();
res => { this.checkIfValid();
console.log(res);
this.repoInterfaceForm.get('desiredCompatibilityLevel').setValue(res['desiredCompatibilityLevel']);
}
);
this.loadingMessage = '';
this.repoInterfaceForm.updateValueAndValidity();
this.checkIfValid();
} }
this.loadingMessage = '';
} }
); );
} }
@ -271,7 +273,8 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
addInterface(newInterface: RepositoryInterface) { addInterface(newInterface: RepositoryInterface) {
this.loadingMessage = formSubmitting; this.loadingMessage = formSubmitting;
this.repoService.addInterface(this.currentRepo.datasourceType, this.currentRepo.id, 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 => { addedInterface => {
console.log(`addInterface responded ${JSON.stringify(addedInterface)}`); console.log(`addInterface responded ${JSON.stringify(addedInterface)}`);
this.currentInterface = addedInterface; this.currentInterface = addedInterface;
@ -305,7 +308,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
this.currentInterface.comments = comment; this.currentInterface.comments = comment;
if (!this.inRegister) { if (!this.inRegister) {
this.updateInterface(desiredCompLvl); this.updateInterface();
} else { } else {
this.successMessage = 'The harvesting settings are valid!'; this.successMessage = 'The harvesting settings are valid!';
console.log('SAVED !'); console.log('SAVED !');
@ -313,7 +316,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
} }
} }
updateInterface(desiredCompatibilityLevel: string) { updateInterface() {
this.loadingMessage = formSubmitting; this.loadingMessage = formSubmitting;
this.repoService.updateInterface(this.currentRepo.id, this.currentRepo.registeredBy, this.currentRepo.comments, this.repoService.updateInterface(this.currentRepo.id, this.currentRepo.registeredBy, this.currentRepo.comments,
this.currentInterface, this.repoInterfaceForm.get('desiredCompatibilityLevel').value).subscribe( this.currentInterface, this.repoInterfaceForm.get('desiredCompatibilityLevel').value).subscribe(