field status-button save and describe etc

This commit is contained in:
annampak 2017-11-01 11:18:51 +02:00
parent 573e1fd92c
commit 65198e1907
4 changed files with 57 additions and 32 deletions

View File

@ -51,6 +51,7 @@ export class DatasetsComponent implements OnInit {
@Input() dmpIdforDatasets: string;
@Input() dmpLabelforDatasets: string;
dataset: any;
saveAndDescribe:boolean;
//@ViewChild(DataTable) projectsTable;
@ -84,10 +85,11 @@ export class DatasetsComponent implements OnInit {
this.datasetProfileDropDown = new DropdownField();
this.datasetProfileDropDown.options = [];
this.saveAndDescribe = false;
}
ngOnInit() {
ngOnInit() { debugger;
//this.projects = this.serverService.getDummyProjects();
this.datasets = [];
console.log(this.dmpIdforDatasets);debugger;
@ -123,7 +125,8 @@ export class DatasetsComponent implements OnInit {
this.serverService.createDatasetForDmp(this.dataset).subscribe(
response => {
console.log(response);
//if (this.saveAndDescribe == true)
//this.describeDataset(); PWS THA VRISKOUME TO ITEM GIA NA ANOIGEI TO SWSTO DATASET???
}
)
$("#newDatasetModal").modal("hide");
@ -143,7 +146,7 @@ export class DatasetsComponent implements OnInit {
this.CallDatasets();
}
SaveDataset(){debugger;
SaveDataset(){
if(this.dataset.id ==null)
this.SaveNewDataset();
else
@ -193,10 +196,10 @@ export class DatasetsComponent implements OnInit {
}
editRow(item) { debugger;
this.dataset.label = item.name;
this.dataset.uri = item.uriDataset;
this.dataset.dmp = item.dmp;
this.dataset.profile = item.profileId;
this.dataset.label = item.label;
this.dataset.uri = item.uri;
//this.dataset.dmp = item.dmp;
this.dataset.profile = item.profile.id;
this.dataset.id = item.id;
$("#newDatasetModal").modal("show");
}
@ -204,9 +207,18 @@ export class DatasetsComponent implements OnInit {
newDataset() {
this.dataset.label = "";
this.dataset.uri = "";
this.dataset.dmp =this.dmpIdforDatasets;
this.dataset.dmp =this.dmpLabelforDatasets;
this.dataset.profile = "";
$("#newDatasetModal").modal("show");
}
SaveDescribeDataset(){
this.saveAndDescribe = true;
this.SaveDataset();
}
describeDataset(item) {
this.ngZone.run(() => this.router.navigate(['dynamic-form', {id: item.profileId, datasetId:item.id, datasetProperties:item.properties}]));
}
}

View File

@ -23,9 +23,9 @@
<th>
<mfDefaultSorter by="label">Label</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="dmp">DMP</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="status">Status</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="uri">Uri</mfDefaultSorter>
</th>
@ -46,16 +46,16 @@
<td colspan="5">No elements</td>
</tr>
<tr *ngFor="let dmp of mf.data" class="hover">
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{dmp.id}}</td>
<td>{{dmp?.label}}</td>
<td>{{dmp?.version}}</td>
<td>{{dmp?.previous}}</td>
<td>{{dmp?.project?.label}}</td>
<td>{{dmp?.description}}</td>
<td><a class="editGridColumn" (click)="editRow(dmp, $event)"><i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit Dataset" id="editDataset"></i>
<tr *ngFor="let dataset of mf.data" class="hover">
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{dataset.id}}</td>
<td>{{dataset?.label}}</td>
<td>{{dataset?.status}}</td>
<td>{{dataset?.uri}}</td>
<td>{{dataset?.profile?.label}}</td>
<td>{{dataset?.description}}</td>
<td><a class="editGridColumn" (click)="editRow(dataset, $event)"><i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit Properties" id="editDataset"></i>
<i class="fa fa-eraser fa-fw" data-toggle="tooltip" title="delete Dataset"></i>
<i class="fa fa-table fa-fw" data-toggle="tooltip" title="describe dataset" id="describeDataset"></i></a></td>
<i class="fa fa-list-alt fa-fw" data-toggle="tooltip" title="describe dataset" id="describeDataset"></i></a></td>
</tr>
</tbody>
@ -94,29 +94,26 @@
</div>
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">DMP:</label>
<input class="form-control" id="abbreviation-text" [(ngModel)]= "dataset.dmp" name = "dmp">
<input class="form-control" id="abbreviation-text" [(ngModel)]= "dataset.dmp" name = "dmp" disabled>
</div>
<div class="form-group">
<label for="uri-text" class="form-control-label">Uri:</label>
<input class="form-control" id="uri-text" [(ngModel)]= "dataset.uri" name = "uri">
</div>
<div class="form-group">
<!-- <div class="form-group">
<label for="start-date" class="form-control-label">Properties:</label>
<input class="form-control" id="startDate-date" [(ngModel)]= "dataset.properties" name = "properties">
</div>
</div> -->
<!-- <div class="form-group">
<label for="end-date" class="form-control-label">End Date:</label>
<input class="form-control" id="endDate-date" [(ngModel)]= "dataset.endDate" name = "endDate">
</div> -->
<div class="form-group">
<label for="code-name" class="form-control-label">Code:</label>
<input type="text" class="form-control" id="code-name" disabled>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" (click)="SaveDataset();">Save Dmp</button>
<button type="submit" class="btn btn-primary" (click)="SaveDataset();">Save</button>
<button type="submit" class="btn btn-primary" (click)="SaveDescribeDataset();">Save and describe</button>
</div>
</div>
</div>

View File

@ -201,6 +201,8 @@ SaveUpdatesDmp(){
}
);
$("#newDmpModal").modal("hide");
$("#newVersionDmpModal").modal("hide");
}
SaveDmp(){ debugger;
@ -254,7 +256,7 @@ editRow(item, event){
newDmp(item){
this.dmp.label = "";
//this.dmp.previous = "";
this.dmp.id = null;
this.dmp.version = "";
// this.dmp.profile = "";
this.dmp.profileData = "";

View File

@ -34,6 +34,9 @@
<th>
<mfDefaultSorter by="description">Description</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="status">Status</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter>Actions </mfDefaultSorter>
</th>
@ -52,7 +55,8 @@
<td>{{dmp?.previous}}</td>
<td>{{dmp?.project?.label}}</td>
<td>{{dmp?.description}}</td>
<td><a class="editGridColumn" (click)="editRow(dmp, $event)"><i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit DMP" id="editDMP"></i>
<td>{{dmp?.status}}</td>
<td><a class="editGridColumn" (click)="editRow(dmp, $event)"><i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit properties" id="editDMP"></i>
<i class="fa fa-clone fa-fw" data-toggle="tooltip" title="create new version" id="changeVersionDMP"></i>
<i class="fa fa-eraser fa-fw" data-toggle="tooltip" title="delete DMP"></i>
<i class="fa fa-table fa-fw" data-toggle="tooltip" title="show dataset for this DMP" id="showDatasets"></i></a></td>
@ -92,13 +96,23 @@
<option *ngFor="let opt of projectsDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
<!-- <div class="form-group">
<label for="recipient-name" class="col-form-label">Status:</label>
<select class="form-control" [id]="statusDropDownKey" [(ngModel)]="dmp.status" [name]="statusDropDown" #datasetfield>
<option *ngFor="let opt of statusDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div> -->
<div class="form-group">
<label for="label-name" class="form-control-label">Previous:</label>
<input type="text" class="form-control" id="label-previous" [(ngModel)]="dmp.previous" name="previous">
<input type="text" class="form-control" id="label-previous" [(ngModel)]="dmp.previous" name="previous" disabled>
</div>
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">Version:</label>
<input class="form-control" id="abbreviation-text" [(ngModel)]="dmp.version" name="version">
<input class="form-control" id="abbreviation-text" [(ngModel)]="dmp.version" name="version" >
</div>
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">Description:</label>
<textarea class="form-control" id="abbreviation-text" [(ngModel)]="dmp.description" name="version" ></textarea>
</div>
<!-- <div class="form-group">
<label for="reference-text" class="form-control-label">Profile Data:</label>