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 f0867ab24..be5dc53cd 100644 --- a/dmp-frontend/src/app/dataset-wizard/dataset-wizard.component.html +++ b/dmp-frontend/src/app/dataset-wizard/dataset-wizard.component.html @@ -26,7 +26,7 @@ {{'DATASET-WIZARD.THIRD-STEP.TITLE' | translate}} - +
diff --git a/dmp-frontend/src/app/form/dynamic-form.component.html b/dmp-frontend/src/app/form/dynamic-form.component.html index 87f6f1153..d19c51b9b 100644 --- a/dmp-frontend/src/app/form/dynamic-form.component.html +++ b/dmp-frontend/src/app/form/dynamic-form.component.html @@ -30,4 +30,4 @@ -

Form value: {{ form.value | json }}

\ No newline at end of file + \ No newline at end of file diff --git a/dmp-frontend/src/app/form/dynamic-form.component.ts b/dmp-frontend/src/app/form/dynamic-form.component.ts index ec0debfd0..9b89a648b 100644 --- a/dmp-frontend/src/app/form/dynamic-form.component.ts +++ b/dmp-frontend/src/app/form/dynamic-form.component.ts @@ -13,6 +13,9 @@ import { Router, ActivatedRoute, ParamMap, Params } from '@angular/router'; import 'rxjs/add/operator/switchMap'; import { Location } from '@angular/common'; import {MatSidenavModule} from '@angular/material/sidenav'; +import { BaseHttpService } from '@app/utilities/cite-http-service-module/base-http.service'; +import { HostConfiguration } from '@app/app.constants'; +import { DatasetWizardService } from '@app/services/dataset-wizard/dataset-wizard.service'; declare function simple_notifier(type: string, title: string, message: string): any; @@ -45,7 +48,9 @@ export class DynamicFormComponent implements OnInit { constructor(private router: Router, private _location: Location, private route: ActivatedRoute, - private visibilityRulesService: VisibilityRulesService + private visibilityRulesService: VisibilityRulesService, + private http: BaseHttpService, + private datasetWizardService: DatasetWizardService, ) { this.datasetId = route.snapshot.params['id']; } @@ -87,10 +92,13 @@ export class DynamicFormComponent implements OnInit { } submit() { - //this.serverService.updateDataset(this.datasetId, this.form.value).subscribe() } - save(){ - debugger; + + save(){ + this.datasetWizardService.saveDataset(this.datasetId, this.form.value).subscribe(data => { + this.router.navigateByUrl("/datasets"); + }); + } 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 45ed56024..42757bb0d 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 @@ -41,4 +41,8 @@ export class DatasetWizardService { createDataset(datasetModel: DatasetWizardModel): Observable { return this.http.post(this.actionUrl + 'createOrUpdate', datasetModel, { headers: this.headers }); } + + public saveDataset(datasetId:String, formValue){ + return this.http.post(HostConfiguration.Server +'datasetprofile/save/'+datasetId, formValue, { headers: this.headers }) + } }