From e4d1fd5398286be2fdd6900d1977180d63b34f11 Mon Sep 17 00:00:00 2001 From: annampak Date: Fri, 19 Jan 2018 10:09:35 +0200 Subject: [PATCH] make public butto, save and finalize, dataset profile field --- .../dataset-wizard.component.html | 2 +- .../datasets/dataset-listing.component.html | 13 ++++++++++-- .../app/datasets/dataset-listing.component.ts | 4 ++++ .../src/app/form/dynamic-form.component.html | 10 ++++----- .../src/app/form/dynamic-form.component.ts | 21 ++++++++++++------- .../dataset-wizard/dataset-wizard.service.ts | 3 ++- dmp-frontend/src/assets/lang/en.json | 4 ++++ 7 files changed, 40 insertions(+), 17 deletions(-) diff --git a/dmp-frontend/src/app/dataset-wizard/dataset-wizard.component.html b/dmp-frontend/src/app/dataset-wizard/dataset-wizard.component.html index 57d67afeb..1062f5bee 100644 --- a/dmp-frontend/src/app/dataset-wizard/dataset-wizard.component.html +++ b/dmp-frontend/src/app/dataset-wizard/dataset-wizard.component.html @@ -13,7 +13,7 @@ --> - + {{profile.label}} diff --git a/dmp-frontend/src/app/datasets/dataset-listing.component.html b/dmp-frontend/src/app/datasets/dataset-listing.component.html index 3c4e24dbe..e7837f08e 100644 --- a/dmp-frontend/src/app/datasets/dataset-listing.component.html +++ b/dmp-frontend/src/app/datasets/dataset-listing.component.html @@ -67,11 +67,20 @@ {{'DATASET-LISTING.COLUMNS.ACTIONS' | translate}} - + + + + + + + - + + diff --git a/dmp-frontend/src/app/datasets/dataset-listing.component.ts b/dmp-frontend/src/app/datasets/dataset-listing.component.ts index 5ae82eabf..dff7bda1f 100644 --- a/dmp-frontend/src/app/datasets/dataset-listing.component.ts +++ b/dmp-frontend/src/app/datasets/dataset-listing.component.ts @@ -85,6 +85,10 @@ export class DatasetListingComponent implements OnInit { return defaultCriteria; } + makeItPublic(){ + + } + } export class DatasetDataSource extends DataSource { diff --git a/dmp-frontend/src/app/form/dynamic-form.component.html b/dmp-frontend/src/app/form/dynamic-form.component.html index 1d6fbc41b..a707b6a45 100644 --- a/dmp-frontend/src/app/form/dynamic-form.component.html +++ b/dmp-frontend/src/app/form/dynamic-form.component.html @@ -6,11 +6,11 @@ -
- - + + +
diff --git a/dmp-frontend/src/app/form/dynamic-form.component.ts b/dmp-frontend/src/app/form/dynamic-form.component.ts index ef9647a91..ca445111c 100644 --- a/dmp-frontend/src/app/form/dynamic-form.component.ts +++ b/dmp-frontend/src/app/form/dynamic-form.component.ts @@ -78,7 +78,6 @@ export class DynamicFormComponent implements OnInit { if (params && "page" in params) this.changeCurrentPage(params["page"]); }); - /* else{ this.addSection(); @@ -88,16 +87,22 @@ export class DynamicFormComponent implements OnInit { this.visibilityRulesService.formGroup = this.form; let rules:Rule[] = new JsonSerializer().fromJSONArray(TestModel.rules,Rule); this.visibilityRulesService.buildVisibilityRules(rules) */ + } + + submit(){ + this.datasetWizardService.saveDataset(this.dataModel.id, this.dataModel.status, this.form.value).subscribe(data => { + this.router.navigateByUrl("/datasets/" + this.dataModel.dmp.id); + }); } - submit() { + save(){ + this.dataModel.status= "0"; + this.submit(); } - - onSubmit(){ - this.datasetWizardService.saveDataset(this.dataModel.id, this.form.value).subscribe(data => { - this.router.navigateByUrl("/datasets/" + this.dataModel.dmp.id); - }); - + + saveFinalize() { + this.dataModel.status= "1"; + this.submit(); } toggleSidebar() { diff --git a/dmp-frontend/src/app/services/dataset-wizard/dataset-wizard.service.ts b/dmp-frontend/src/app/services/dataset-wizard/dataset-wizard.service.ts index c5306cade..46d89affe 100644 --- a/dmp-frontend/src/app/services/dataset-wizard/dataset-wizard.service.ts +++ b/dmp-frontend/src/app/services/dataset-wizard/dataset-wizard.service.ts @@ -43,7 +43,8 @@ export class DatasetWizardService { return this.http.post(this.actionUrl + 'createOrUpdate', datasetModel, { headers: this.headers }); } - public saveDataset(datasetId:String, formValue){ + public saveDataset(datasetId:String, datasetStatus:String, formValue){ + formValue.status = datasetStatus; return this.http.post(HostConfiguration.Server +'datasetprofile/save/'+datasetId, formValue, { headers: this.headers }) } } diff --git a/dmp-frontend/src/assets/lang/en.json b/dmp-frontend/src/assets/lang/en.json index 2a9758dc6..0f21c7123 100644 --- a/dmp-frontend/src/assets/lang/en.json +++ b/dmp-frontend/src/assets/lang/en.json @@ -85,6 +85,10 @@ "DATAREPOSITORIES": "Data Repositories", "REGISTRIES": "Registries", "SERVICES": "Services" + }, + "ACTIONS": { + "EDIT": "Edit", + "MAKE-IT-PUBLIC": "Make it public" } }, "PROJECT-EDITOR": {