diff --git a/dmp-frontend/dist-20Nov.tar.gz b/dmp-frontend/dist-20Nov.tar.gz new file mode 100644 index 000000000..dee0d5840 Binary files /dev/null and b/dmp-frontend/dist-20Nov.tar.gz differ diff --git a/dmp-frontend/src/app/form/dynamic-form.component.html b/dmp-frontend/src/app/form/dynamic-form.component.html index 311dee99e..fa398c862 100644 --- a/dmp-frontend/src/app/form/dynamic-form.component.html +++ b/dmp-frontend/src/app/form/dynamic-form.component.html @@ -55,10 +55,12 @@ + + diff --git a/dmp-frontend/src/app/form/dynamic-form.component.ts b/dmp-frontend/src/app/form/dynamic-form.component.ts index f7f1e3591..74d5f70b9 100644 --- a/dmp-frontend/src/app/form/dynamic-form.component.ts +++ b/dmp-frontend/src/app/form/dynamic-form.component.ts @@ -15,6 +15,8 @@ import { TokenService, TokenProvider } from '../services/login/token.service'; import { ModalComponent } from '../modal/modal.component'; import { AutocompleteRemoteComponent } from './fields/autocomplete-remote/autocomplete-remote.component'; +import {Location} from '@angular/common'; + import { AngularDraggableModule } from 'angular2-draggable'; import {MenuItem} from 'primeng/primeng'; @@ -67,7 +69,7 @@ export class DynamicFormComponent implements OnInit { constructor(private qcs: FieldControlService, private serverService: ServerService, private dataModelService: dataModelBuilder, private router: Router, - private route: ActivatedRoute, private pagerService: PaginationService, private tokenService: TokenService) { + private _location: Location, private route: ActivatedRoute, private pagerService: PaginationService, private tokenService: TokenService) { this.form = this.qcs.toFormGroup(new Array(), new Array()); this.xml2jsonOBJ = new X2JS(); } @@ -224,13 +226,13 @@ export class DynamicFormComponent implements OnInit { } ngAfterViewChecked(): void { //navigate to certain section of the page - try { document.querySelector('#' + this.fragment).scrollIntoView(); } catch (e) { } } submitForm(final){ + debugger; this.serverService.getDatasetByID(this.datasetId).subscribe( (data) => { if (final) data.status = 2; @@ -242,9 +244,12 @@ export class DynamicFormComponent implements OnInit { this.serverService.setDataset(data).subscribe( (data) => { + console.log("Updated dataset"); - //simple_notifier("success",null,"Saved form progress"); - this.router.navigate(['/welcome'], { queryParams: { /*returnUrl: this.state.url*/ }}); + simple_notifier("success",null,"Saved form progress"); + if (final) + this._location.back(); + //this.router.navigate(['/welcome'], { queryParams: { /*returnUrl: this.state.url*/ }}); }, (err) => { simple_notifier("danger",null,"Could not save form progress");