save and finalize message and redirect
This commit is contained in:
parent
ca656416a8
commit
edad8a7cc9
|
@ -29,7 +29,7 @@
|
|||
|
||||
<div>
|
||||
<button type="submit" class="btn btn-default btncustom" [disabled]="!form.valid">Save</button>
|
||||
<button type="submit" class="btn btn-default btncustom" [disabled]="!form.valid">Finalize</button>
|
||||
<button type="button" class="btn btn-default btncustom" [disabled]="!form.valid" data-toggle="modal" data-target="#confirmModal">Finalize</button>
|
||||
</div>
|
||||
|
||||
<div *ngIf="payLoad" class="form-row">
|
||||
|
@ -102,3 +102,23 @@
|
|||
<a href="#" (click)="signOut2();">Sign out</a>
|
||||
</div>
|
||||
|
||||
<!--Modal for Confirmation -->
|
||||
<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="newVersionDmpModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Confirmation Message</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure you want to save and finalize?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" (click)="SaveFinalize();">Save and Finalize</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -12,17 +12,18 @@ import { DataModel } from '../entities/DataModel';
|
|||
import { GroupBase } from './dynamic-form-group/group-base';
|
||||
import { PaginationService } from '../../app/services/pagination.service';
|
||||
import { TokenService, TokenProvider } from '../services/login/token.service';
|
||||
import { ModalComponent } from '../modal/modal.component';
|
||||
|
||||
import { AngularDraggableModule } from 'angular2-draggable';
|
||||
|
||||
import './../../assets/xml2json.min.js';
|
||||
declare var X2JS: any;
|
||||
|
||||
|
||||
var flatten = require('flat');
|
||||
declare var $ :any;
|
||||
|
||||
|
||||
import * as $ from '../../../node_modules/jquery/dist/jquery'
|
||||
//import * as $ from '../../../node_modules/jquery/dist/jquery'
|
||||
|
||||
import * as scroll from '../../assets/jquery.scrollTo.min.js';
|
||||
|
||||
|
@ -220,9 +221,7 @@ export class DynamicFormComponent implements OnInit {
|
|||
} catch (e) { }
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
|
||||
|
||||
submitForm(){
|
||||
this.serverService.getDatasetByID(this.datasetId).subscribe(
|
||||
(data) => {
|
||||
|
||||
|
@ -231,8 +230,8 @@ export class DynamicFormComponent implements OnInit {
|
|||
data.properties = JSON.stringify(this.form.value);
|
||||
|
||||
this.serverService.setDataset(data).subscribe((data) => {
|
||||
console.log("Updated dataset");
|
||||
|
||||
console.log("Updated dataset");
|
||||
this.router.navigate(['/workspace'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
//VALE EDW NA SE PIGAINEI PISW KAI NA SOU VGAZEI ENA MHNYMA SUCCESS... (to success tha to valw egw an thes)
|
||||
|
||||
},
|
||||
|
@ -243,11 +242,19 @@ export class DynamicFormComponent implements OnInit {
|
|||
(err) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
this.submitForm();
|
||||
|
||||
this.payLoad = JSON.stringify(this.form.value);
|
||||
}
|
||||
|
||||
SaveFinalize(){
|
||||
$("#confirmModal").modal("hide");
|
||||
this.submitForm();
|
||||
}
|
||||
|
||||
shouldIShow(element) { //pagination , pages are declared in xml for every groupfield
|
||||
|
||||
if (this.pagination.currentPage == element.page){
|
||||
|
|
Loading…
Reference in New Issue