From 65198e1907d628919c9cfca04446f1e67d840ebe Mon Sep 17 00:00:00 2001 From: annampak Date: Wed, 1 Nov 2017 11:18:51 +0200 Subject: [PATCH] field status-button save and describe etc --- .../src/app/datasets/dataset.component.ts | 28 ++++++++++---- dmp-frontend/src/app/datasets/dataset.html | 37 +++++++++---------- dmp-frontend/src/app/dmps/dmp.component.ts | 4 +- dmp-frontend/src/app/dmps/dmps.html | 20 ++++++++-- 4 files changed, 57 insertions(+), 32 deletions(-) diff --git a/dmp-frontend/src/app/datasets/dataset.component.ts b/dmp-frontend/src/app/datasets/dataset.component.ts index 6df5d094c..adafd005f 100644 --- a/dmp-frontend/src/app/datasets/dataset.component.ts +++ b/dmp-frontend/src/app/datasets/dataset.component.ts @@ -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}])); + } + } diff --git a/dmp-frontend/src/app/datasets/dataset.html b/dmp-frontend/src/app/datasets/dataset.html index eeb3a2544..fab487b42 100644 --- a/dmp-frontend/src/app/datasets/dataset.html +++ b/dmp-frontend/src/app/datasets/dataset.html @@ -23,9 +23,9 @@ Label - - DMP - + + Status + Uri @@ -46,16 +46,16 @@ No elements - - {{dmp.id}} - {{dmp?.label}} - {{dmp?.version}} - {{dmp?.previous}} - {{dmp?.project?.label}} - {{dmp?.description}} - + + {{dataset.id}} + {{dataset?.label}} + {{dataset?.status}} + {{dataset?.uri}} + {{dataset?.profile?.label}} + {{dataset?.description}} + - + @@ -94,29 +94,26 @@
- +
-
+ -
- - -
diff --git a/dmp-frontend/src/app/dmps/dmp.component.ts b/dmp-frontend/src/app/dmps/dmp.component.ts index bfa99b21a..341ab8db9 100644 --- a/dmp-frontend/src/app/dmps/dmp.component.ts +++ b/dmp-frontend/src/app/dmps/dmp.component.ts @@ -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 = ""; diff --git a/dmp-frontend/src/app/dmps/dmps.html b/dmp-frontend/src/app/dmps/dmps.html index 999910788..c5910ed90 100644 --- a/dmp-frontend/src/app/dmps/dmps.html +++ b/dmp-frontend/src/app/dmps/dmps.html @@ -34,6 +34,9 @@ Description + + Status + Actions @@ -52,7 +55,8 @@ {{dmp?.previous}} {{dmp?.project?.label}} {{dmp?.description}} - + {{dmp?.status}} + @@ -92,13 +96,23 @@ +
- +
- + +
+
+ +