[Monitor Dashboard | Trunk]: Fix a bug when uploading logo from general component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@60026 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
61e9ec19be
commit
a6f99ef630
|
@ -242,10 +242,12 @@ export class EditStakeholderComponent implements OnDestroy {
|
|||
|
||||
public save(callback: Function, errorCallback: Function = null) {
|
||||
if (this.file) {
|
||||
this.stakeholderFb.get('alias').enable();
|
||||
this.subscriptions.push(this.utilsService.uploadPhoto(this.properties.utilsService + "/upload/stakeholder/" + encodeURIComponent(this.stakeholderFb.value.alias), this.file).subscribe(res => {
|
||||
this.deletePhoto();
|
||||
this.removePhoto();
|
||||
this.stakeholderFb.get('logoUrl').setValue(res.filename);
|
||||
console.debug(this.stakeholderFb.value);
|
||||
this.saveStakeholder(callback, errorCallback);
|
||||
}, error => {
|
||||
this.uploadError = "An error has been occurred during upload your image. Try again later";
|
||||
|
@ -269,7 +271,7 @@ export class EditStakeholderComponent implements OnDestroy {
|
|||
this.removePhoto();
|
||||
this.subscriptions.push(this.stakeholderService.buildStakeholder(this.properties.monitorServiceAPIURL,
|
||||
this.stakeholderFb.value).subscribe(stakeholder => {
|
||||
UIkit.notification(stakeholder.name + '\'s has been <b>successfully created</b>', {
|
||||
UIkit.notification(stakeholder.name + ' has been <b>successfully created</b>', {
|
||||
status: 'success',
|
||||
timeout: 6000,
|
||||
pos: 'bottom-right'
|
||||
|
@ -287,12 +289,11 @@ export class EditStakeholderComponent implements OnDestroy {
|
|||
}));
|
||||
} else {
|
||||
this.stakeholderFb.get('type').enable();
|
||||
this.stakeholderFb.get('alias').enable();
|
||||
this.stakeholderFb.get('index_id').enable();
|
||||
this.stakeholderFb.get('index_name').enable();
|
||||
this.stakeholderFb.get('index_shortName').enable();
|
||||
this.subscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, this.stakeholderFb.value).subscribe(stakeholder => {
|
||||
UIkit.notification(stakeholder.name + '\'s has been <b>successfully saved</b>', {
|
||||
UIkit.notification(stakeholder.name + ' has been <b>successfully saved</b>', {
|
||||
status: 'success',
|
||||
timeout: 6000,
|
||||
pos: 'bottom-right'
|
||||
|
|
Loading…
Reference in New Issue