diff --git a/src/app/services/repository.service.ts b/src/app/services/repository.service.ts index 99b1a031b..7ec4cd2e6 100755 --- a/src/app/services/repository.service.ts +++ b/src/app/services/repository.service.ts @@ -35,6 +35,7 @@ export class RepositoryService { addInterface(datatype: string, repoId: string, registeredBy: string, comment: string, newInterface: RepositoryInterface): Observable { let url; + comment = newInterface.comments; // temp fix for emailing comment if (comment == null || comment === '') { url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}`; } else { @@ -47,7 +48,7 @@ export class RepositoryService { updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable { let url; - console.log(comment); + comment = interfaceInfo.comments; // temp fix for emailing comment if (comment == null || comment === '') { url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}`; } else { diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts b/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts index 07a8ce6d4..f452f86d5 100755 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts @@ -41,7 +41,6 @@ export class DatasourceCreateFormComponent implements OnInit { countries: Country[] = []; datasourceClasses: Map = new Map(); classCodes: string[] = []; - // classCodes: string[] = []; @Input() mode: string; @@ -52,8 +51,6 @@ export class DatasourceCreateFormComponent implements OnInit { formSubmitted = false; group: FormGroup; - // old issn regex - // issn : ['', [Validators.pattern('^\\d\\d\\d\\d[-]\\d\\d\\d\\d$')] ], readonly groupDefinition = { softwarePlatform : ['', Validators.required], platformName : '', @@ -63,8 +60,8 @@ export class DatasourceCreateFormComponent implements OnInit { lissn : ['', Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$') ], repoDescription : ['', Validators.required], country : ['', Validators.required], - longtitude : ['', [Validators.required, Validators.min(-180), Validators.max(180)] ], - latitude : ['', [Validators.required, Validators.min(-90), Validators.max(90)] ], + longtitude : ['', [Validators.min(-180), Validators.max(180)] ], + latitude : ['', [Validators.min(-90), Validators.max(90)] ], websiteUrl : ['', [Validators.required, Validators.pattern('^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$')] ], institutionName : ['', Validators.required], englishName: ['', Validators.required], @@ -143,7 +140,7 @@ export class DatasourceCreateFormComponent implements OnInit { englishName: this.selectedRepo.englishname, logoUrl: this.selectedRepo.logourl, timezone: this.selectedRepo.timezone, - datasourceType: this.selectedRepo.eoscDatasourceType, // TODO: still needed? + datasourceType: this.selectedRepo.eoscDatasourceType, // TODO: still needed? should it be typology? typology exists on that stage? adminEmail: this.selectedRepo.contactemail }); @@ -247,15 +244,11 @@ export class DatasourceCreateFormComponent implements OnInit { newRepo.longitude = this.group.get('longtitude').value; newRepo.timezone = this.group.get('timezone').value; if (this.group.get('softwarePlatform').value !== '') { - console.log('1//', this.group.get('softwarePlatform').value); newRepo.platform = this.group.get('softwarePlatform').value; } else if (this.group.get('platformName').value) { newRepo.platform = this.group.get('platformName').value; - console.log('2//', this.group.get('platformName').value); } newRepo.typology = this.group.get('datasourceType').value; - // newRepo.eoscDatasourceType = this.datasourceClasses.get(this.group.get('datasourceType').value); - // console.warn(newRepo.eoscDatasourceType); newRepo.description = this.group.get('repoDescription').value.toString(); newRepo.issn = ''; newRepo.eissn = ''; @@ -279,9 +272,7 @@ export class DatasourceCreateFormComponent implements OnInit { newRepo.registeredby = this.authService.getUserEmail(); - /* THE BELOW FIELDS ARE NOT SET IN GWT CODE*/ - newRepo.eoscDatasourceType = this.mode; // TODO: delete this? - console.warn(newRepo.eoscDatasourceType); + newRepo.eoscDatasourceType = this.mode; // keep this newRepo.managed = true; const now = new Date(Date.now()); diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts b/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts index b3dc03e36..0897132e4 100755 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts @@ -309,8 +309,6 @@ export class DatasourceUpdateFormComponent implements OnInit { console.log('typology ', this.selectedRepo.typology); console.log(this.datasourceClasses); console.log(this.updateGroup.get('datasourceType').value); - // this.selectedRepo.eoscDatasourceType = this.datasourceClasses.get(this.updateGroup.get('datasourceType').value); - // console.warn(this.selectedRepo.eoscDatasourceType); this.selectedRepo.officialname = this.updateGroup.get('officialName').value.toString(); this.selectedRepo.description = this.updateGroup.get('repoDescription').value.toString(); this.selectedRepo.organizations[0].country = this.updateGroup.get('country').value; // countryCode