9 |
9 |
import {Affiliation, Curator} from '../../openaireLibrary/utils/entities/CuratorInfo';
|
10 |
10 |
import {HelperFunctions} from '../../openaireLibrary/utils/HelperFunctions.class';
|
11 |
11 |
import {AlertModal} from '../../openaireLibrary/utils/modal/alert';
|
12 |
|
import {CuratorPhotoService} from '../../openaireLibrary/services/curatorPhoto.service';
|
|
12 |
import {UtilitiesService} from '../../openaireLibrary/services/utilities.service';
|
13 |
13 |
|
14 |
14 |
@Component({
|
15 |
15 |
selector: 'curator',
|
... | ... | |
40 |
40 |
private route: ActivatedRoute,
|
41 |
41 |
private _router: Router,
|
42 |
42 |
private curatorService: CuratorService,
|
43 |
|
private curatorPhotoService: CuratorPhotoService) {
|
|
43 |
private utilitiesService: UtilitiesService) {
|
44 |
44 |
}
|
45 |
45 |
|
46 |
46 |
|
... | ... | |
223 |
223 |
if (this.hasChanged && this.curator && this.curator.name && this.curator.name !== '') {
|
224 |
224 |
this.showLoading = true;
|
225 |
225 |
if (this.file) {
|
226 |
|
this.curatorPhotoService.uploadPhoto(this.properties.uploadService + '/' + this.curator._id, this.file).subscribe((res) => {
|
|
226 |
this.utilitiesService.uploadPhoto(this.properties.uploadService + '/' + this.curator._id, this.file).subscribe((res) => {
|
227 |
227 |
if (this.curator.photo && this.curator.photo !== '') {
|
228 |
|
this.curatorPhotoService.deletePhoto(this.properties.deleteUrl + '/' + this.curator.photo).subscribe();
|
|
228 |
this.utilitiesService.deletePhoto(this.properties.deleteUrl + '/' + this.curator.photo).subscribe();
|
229 |
229 |
}
|
230 |
230 |
this.curator.photo = res.filename;
|
231 |
231 |
this.curatorService.updateCurator(this.properties.adminToolsAPIURL + 'curator',
|
... | ... | |
268 |
268 |
|
269 |
269 |
addAffiliation() {
|
270 |
270 |
if (!this.isEmptyAffiliation()) {
|
271 |
|
if (this.index === -1) {
|
272 |
|
this.curator.affiliations.push(this.affiliation);
|
|
271 |
if(!HelperFunctions.isTiny(this.affiliation.logo_url)) {
|
|
272 |
this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.logo_url).subscribe((res)=> {
|
|
273 |
this.affiliation.logo_url = res;
|
|
274 |
if (this.index === -1) {
|
|
275 |
this.curator.affiliations.push(this.affiliation);
|
|
276 |
} else {
|
|
277 |
this.curator.affiliations[this.index] = this.affiliation;
|
|
278 |
}
|
|
279 |
this.change();
|
|
280 |
})
|
273 |
281 |
} else {
|
274 |
|
this.curator.affiliations[this.index] = this.affiliation;
|
|
282 |
if (this.index === -1) {
|
|
283 |
this.curator.affiliations.push(this.affiliation);
|
|
284 |
} else {
|
|
285 |
this.curator.affiliations[this.index] = this.affiliation;
|
|
286 |
}
|
|
287 |
this.change();
|
275 |
288 |
}
|
276 |
|
this.change();
|
277 |
289 |
}
|
278 |
290 |
}
|
279 |
291 |
|
[Trunk|Admin]: Curators edit personal info: On add affiliation transform logoUrl to tinyUrl.