fix emailing interface comments and cleanup

This commit is contained in:
andreas.mantas 2022-09-09 09:11:42 +00:00
parent c3d3dceb35
commit 4b00a98db2
3 changed files with 6 additions and 16 deletions

View File

@ -35,6 +35,7 @@ export class RepositoryService {
addInterface(datatype: string, repoId: string, registeredBy: string, comment: string, newInterface: RepositoryInterface): Observable<RepositoryInterface> {
let url;
comment = newInterface.comments; // temp fix for emailing comment
if (comment == null || comment === '') {
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}&registeredBy=${registeredBy}`;
} else {
@ -47,7 +48,7 @@ export class RepositoryService {
updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> {
let url;
console.log(comment);
comment = interfaceInfo.comments; // temp fix for emailing comment
if (comment == null || comment === '') {
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${registeredBy}`;
} else {

View File

@ -41,7 +41,6 @@ export class DatasourceCreateFormComponent implements OnInit {
countries: Country[] = [];
datasourceClasses: Map<string, string> = new Map<string, string>();
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());

View File

@ -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