Revision 62103
Added by Antonis Lempesis about 2 years ago
register-datasource-select-existing.component.ts | ||
---|---|---|
51 | 51 |
} else if (this.mode === 're3data') { |
52 | 52 |
this.sourceUrl = 'https://www.re3data.org/'; |
53 | 53 |
this.sourceTitle = 'Re3data'; |
54 |
} else if (this.mode === 'cris') { |
|
55 |
this.sourceUrl = 'https://eurocris.org'; |
|
56 |
this.sourceTitle = 'euroCris'; |
|
54 | 57 |
} |
55 | 58 |
this.getLatestUpdate(); |
56 | 59 |
} |
57 | 60 |
|
58 | 61 |
getCountries() { |
59 |
this.repoService.getCountries() |
|
60 |
.subscribe( |
|
61 |
countries => { |
|
62 |
// TODO: check again getCountries null return values |
|
63 |
/*/!* check for null values *!/ |
|
64 |
let nullVals = countries.filter(el => el.name === null); |
|
65 |
/!* remove null values from array *!/ |
|
66 |
for (let nullVal of nullVals) { |
|
67 |
let i = countries.findIndex(el => el === nullVal); |
|
68 |
/!* remove null value from array *!/ |
|
69 |
if (i !== -1) { countries.splice(i, 1); } |
|
70 |
}*/ |
|
62 |
this.repoService.getCountries().subscribe( |
|
63 |
countries => { |
|
64 |
// TODO: check again getCountries null return values |
|
65 |
/*/!* check for null values *!/ |
|
66 |
let nullVals = countries.filter(el => el.name === null); |
|
67 |
/!* remove null values from array *!/ |
|
68 |
for (let nullVal of nullVals) { |
|
69 |
let i = countries.findIndex(el => el === nullVal); |
|
70 |
/!* remove null value from array *!/ |
|
71 |
if (i !== -1) { countries.splice(i, 1); } |
|
72 |
}*/ |
|
71 | 73 |
|
72 |
/* sort countries array */
|
|
73 |
this.countries = countries.sort( function(a, b) {
|
|
74 |
if (a.name < b.name) {
|
|
75 |
return -1;
|
|
76 |
} else if (a.name > b.name) {
|
|
77 |
return 1;
|
|
78 |
} else {
|
|
79 |
return 0;
|
|
80 |
}
|
|
81 |
} );
|
|
82 |
},
|
|
83 |
error => {
|
|
84 |
this.alertMessage = noServiceMessage;
|
|
85 |
console.log(error);
|
|
86 |
});
|
|
74 |
/* sort countries array */ |
|
75 |
this.countries = countries.sort( function(a, b) { |
|
76 |
if (a.name < b.name) { |
|
77 |
return -1; |
|
78 |
} else if (a.name > b.name) { |
|
79 |
return 1; |
|
80 |
} else { |
|
81 |
return 0; |
|
82 |
} |
|
83 |
} ); |
|
84 |
}, |
|
85 |
error => { |
|
86 |
this.alertMessage = noServiceMessage; |
|
87 |
console.log(error); |
|
88 |
}); |
|
87 | 89 |
} |
88 | 90 |
|
89 | 91 |
getReposInCountry(i: number) { |
Also available in: Unified diff
merged branch cris-registration (r62082:HEAD)