added messages to project

This commit is contained in:
Nikolaos Laskaris 2017-11-07 14:15:50 +02:00
parent ff856c6d14
commit ce7e1c739b
2 changed files with 18 additions and 9 deletions

View File

@ -8,7 +8,7 @@
<input class="form-control" [(ngModel)]="filterQuery" placeholder='Filter' /> <input class="form-control" [(ngModel)]="filterQuery" placeholder='Filter' />
</th> </th>
<th> <th>
<button class="btn btn-default" (click)="getProjects()"> <button class="btn btn-default" (click)="getProjects('false')">
<span class="glyphicon glyphicon-refresh"></span> <span class="glyphicon glyphicon-refresh"></span>
</button> </button>
</th> </th>

View File

@ -22,6 +22,8 @@ import { ProjectTableFilterPipe } from '../pipes/project-table-filter.pipe';
declare var $ :any; declare var $ :any;
import '../../assets/custom.js';
declare function simple_notifier(type: string, title: string, message:string): any;
@Component({ @Component({
@ -118,14 +120,15 @@ getEmptyProject(){
} }
getProjects(){ getProjects(muted? : boolean){
this.serverService.getProjectsOfUser().subscribe( this.serverService.getProjectsOfUser().subscribe(
response => { response => {
this.tableData = response; this.tableData = response;
console.log(this.tableData) if(muted && muted!=true)
simple_notifier("success",null,"Updated projects table");
}, },
err => { err => {
simple_notifier("danger",null,"Could not retrieve projects");
} }
); );
} }
@ -142,13 +145,17 @@ getDMPs(){
params.key = dmp.id; params.key = dmp.id;
params.value = dmp.label; params.value = dmp.label;
this.datasetDropDown.options.push(params); this.datasetDropDown.options.push(params);
}); },
error => {
}
);
} }
) )
} }
showDatasets(){debugger; //dmpId, event showDatasets(){ //dmpId, event
//this.dataSetVisibe = true; //this.dataSetVisibe = true;
} }
@ -165,8 +172,10 @@ SaveProject(){
action.subscribe( action.subscribe(
response =>{ response =>{
this.getProjects(); this.getProjects();
console.log("response"); simple_notifier("success",null, (this.project.id == null) ? "Created" : "Updated" +" projects table");
console.log(response); },
error => {
simple_notifier("danger",null, "Could not "+ (this.project.id == null) ? "create" : "update" + " projects table");
} }
); );