automated commit

This commit is contained in:
annampak 2017-11-15 16:46:58 +02:00
commit 2936e1d37c
7 changed files with 185 additions and 183 deletions

View File

@ -8,13 +8,26 @@
</button>
-->
<div class="nav navbar-nav navbar-left">
<div class="dropdown" [ngClass]="{false:'invisible'}[tokenService.isLoggedIn() == true]">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"> Go To <span class="caret"></span> </button>
<ul class="dropdown-menu">
<li><a class="cursor" (click)="goToDMPs()">My DMPs</a></li>
<li><a class="cursor" (click)="goToProjects()">My Projects</a></li>
</ul>
</div>
<!--
<div class="dropdown" [ngClass]="{false:'invisible'}[tokenService.isLoggedIn() == true]">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"> Go To <span class="caret"></span> </button>
<ul class="dropdown-menu">
<li><a class="cursor" (click)="goToDMPs()">My DMPs</a></li>
<li><a class="cursor" (click)="goToProjects()">My Projects</a></li>
</ul>
</div>
-->
<li class="dropdown" [ngClass]="{false:'invisible'}[tokenService.isLoggedIn() == true]">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Quick Navigate
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a class="cursor" (click)="goToDMPs()">My DMPs</a></li>
<li><a class="cursor" (click)="goToProjects()">My Projects</a></li>
</ul>
</li>
</div>
</div>

View File

@ -56,4 +56,9 @@ tr.hover:hover > * {
.table-button {
font-size: 1em;
padding: 2px;
}
.centered-text{
text-align: center;
}

View File

@ -64,7 +64,7 @@ export class DmpComponent implements OnInit{
breadcrumbData: MenuItem[] = new Array<MenuItem>();
dmp : any;
dmp : any = null;
@Input() projectsDropDown:DropdownField;
@Input() statusDropDown: DropdownField;
@ -83,14 +83,22 @@ export class DmpComponent implements OnInit{
this.statusDropDown.options= [{key:'', value:null},{key:'0', value:"Active"},{key:'1', value:"Inactive"}, {key:'2', value:"Submitted"}, {key:'3', value:"Cancel"}]
//this.projects = [];
this.dmp = {
id: null,
label: '',
previous:'',
version:'',
profileData:''
//profile:{}
}
this.dmp = this.clearDmp();
}
clearDmp() {
this.dmp = {
id: null,
label: '',
previous:'',
version:'',
profileData:'',
//project: '',
//profile:{}
}
}
ngOnInit() {
@ -151,11 +159,9 @@ export class DmpComponent implements OnInit{
}
newDMP(){
console.log(this.dmp, this.dmp.projectsDropDownKey);
this.dmp.project = {"id" : this.dmp.project};
this.dmp["version"] = 1;
//this.dmp.profile = {};
this.serverService.createDmpForCurrentUser(this.dmp)
.subscribe(
@ -241,13 +247,9 @@ export class DmpComponent implements OnInit{
$("#newVersionDmpModal").modal("show");
}
newDmp(item){
this.dmp.label = "";
this.dmp.id = null;
this.dmp.version = "";
// this.dmp.profile = "";
this.dmp.profileData = "";
this.dmp.project = "";
newDmpForm(item){
this.dmp = this.clearDmp();
$("#newDmpModal").modal("show");
}
@ -263,6 +265,8 @@ export class DmpComponent implements OnInit{
deleteRow(dmp){
this.dmp = {"id": this.dmp.id}; //only id is needed to delete
this.serverService.deleteDmp(dmp).subscribe(
response => {
simple_notifier("success",null,"Successfully deleted the DMP");

View File

@ -66,10 +66,10 @@
<tr *ngFor="let dmp of mf.data" class="hover">
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{dmp?.id}}</td>
<td>{{dmp?.label}}</td>
<td>{{dmp?.version}}</td>
<td>{{dmp?.previous}}</td>
<td style="width:20px;">{{dmp?.version}}</td>
<td style="width:300px;">{{dmp?.previous}}</td>
<td>{{dmp?.project?.label}}</td>
<td>{{dmp?.description}}</td>
<td>{{(dmp?.description?.length > 20) ? (dmp?.description | slice:0:20)+'...':(dmp?.description) }}</td>
<td>{{dmp?.created | date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
<td>{{dmp?.status | statusToString }}</td>
<td>
@ -92,7 +92,7 @@
<tfoot>
<tr>
<td colspan="8">
<button type="button" class="btn btn-info btncustom" (click)="newDmp(item)">New Dmp</button>
<button type="button" class="btn btn-info btncustom" (click)="newDmpForm(item)">Create New</button>
<mfBootstrapPaginator [rowsOnPageSet]="[5,20,40]"></mfBootstrapPaginator>
</td>
</tr>
@ -104,8 +104,8 @@
<div class="modal fade" id="newDmpModal" tabindex="-1" role="dialog" aria-labelledby="newDmpModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">DMP</h5>
<div class="modal-header centered-text">
<h4 class="modal-title" id="exampleModalLabel"><b>{{ dmp?.id ? "Edit Data Management Plan" : "New Data Management Plan" }}</b></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@ -115,43 +115,43 @@
<div class="form-group">
<div class="form-group">
<label for="label-name" class="form-control-label">Label:</label>
<input type="text" class="form-control" id="label-name" [(ngModel)]="dmp.label" name="label">
<input type="text" class="form-control" id="label-name" [ngModel]="dmp?.label" (ngModelChange)="dmp.label=$event" name="label">
</div>
<label for="recipient-name" class="col-form-label">Project:</label>
<select class="form-control" id="projectsDropDownKey" [(ngModel)]="dmp.project" name="projectsDropDown">
<select class="form-control" id="projectsDropDownKey" [ngModel]="dmp?.project" (ngModelChange)="dmp.project=$event" name="projectsDropDown">
<option *ngFor="let opt of projectsDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
<div class="form-group">
<label for="status-name" class="col-form-label">Status:</label>
<select class="form-control" id="statusid" [(ngModel)]="dmp.status" name="statusDropDown" (change)="SelectDMPStatus(dmp, $event, oldValue);">
<select class="form-control" id="statusid" [ngModel]="dmp?.status" (ngModelChange)="dmp.status=$event" name="statusDropDown" (change)="SelectDMPStatus(dmp, $event, oldValue);">
<option *ngFor="let opt of statusDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
<div class="form-group">
<label for="label-name" class="form-control-label">Previous:</label>
<input type="text" class="form-control" id="label-previous" [(ngModel)]="dmp.previous" name="previous" disabled>
<input type="text" class="form-control" id="label-previous" [ngModel]="dmp?.previous" (ngModelChange)="dmp.previous=$event" name="previous" disabled>
</div>
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">Version:</label>
<input class="form-control" id="abbreviation-text" [(ngModel)]="dmp.version" name="version" disabled>
<input class="form-control" id="abbreviation-text" [ngModel]="dmp?.version" (ngModelChange)="dmp.version=$event" name="version" disabled>
</div>
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">Description:</label>
<textarea rows="3" class="form-control" id="abbreviation-text" [(ngModel)]="dmp.description" name="description"></textarea>
<textarea rows="3" class="form-control" id="abbreviation-text" [ngModel]="dmp?.description" (ngModelChange)="dmp.description=$event" name="description"></textarea>
</div>
<!--
<div class="form-group">
<label for="reference-text" class="form-control-label">Profile Data:</label>
<textarea class="form-control" id="reference-text" [(ngModel)]="dmp.profileData" name="profileData"></textarea>
<textarea class="form-control" id="reference-text" [(ngModel)]="dmp?.profileData" name="profileData"></textarea>
</div>
<div class="form-group">
<label for="start-date" class="form-control-label">Start Date:</label>
<input class="form-control" id="startDate-date" [(ngModel)]= "dmp.startDate" name = "startDate">
<input class="form-control" id="startDate-date" [(ngModel)]= "dmp?.startDate" name = "startDate">
</div>
<div class="form-group">
<label for="end-date" class="form-control-label">End Date:</label>
<input class="form-control" id="endDate-date" [(ngModel)]= "dmp.endDate" name = "endDate">
<input class="form-control" id="endDate-date" [(ngModel)]= "dmp?.endDate" name = "endDate">
</div>
-->
</form>
@ -179,11 +179,11 @@
<form #newProjectForm="ngForm" (ngSubmit)="SaveNewDmp()">
<div class="form-group">
<label for="label-name" class="form-control-label">Label:</label>
<input type="text" class="form-control" id="label-name" [(ngModel)]="dmp.label" name="label">
<input type="text" class="form-control" id="label-name" [ngModel]="dmp?.label" (ngModelChange)="dmp.label=$event" name="label">
</div>
<div class="form-group" hidden>
<label for="recipient-name" class="col-form-label">Project:</label>
<select class="form-control" [id]="projectsDropDownKey" [(ngModel)]="dmp.project" [name]="projectsDropDown" #datasetfield>
<select class="form-control" [id]="projectsDropDownKey" [ngModel]="dmp?.project" (ngModelChange)="dmp.project=$event" [name]="projectsDropDown" #datasetfield>
<option *ngFor="let opt of projectsDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
@ -191,11 +191,11 @@
<div class="form-group" hidden>
<label for="label-name" class="form-control-label">Previous:</label>
<input type="text" class="form-control" id="label-previous" [(ngModel)]="dmp.previous" name="previous">
<input type="text" class="form-control" id="label-previous" [ngModel]="dmp?.previous" (ngModelChange)="dmp.previous=$event" name="previous">
</div>
<div class="form-group" hidden>
<label for="abbreviation-text" class="form-control-label">Version:</label>
<input class="form-control" id="abbreviation-text" [(ngModel)]="dmp.version" name="version">
<input class="form-control" id="abbreviation-text" [ngModel]="dmp?.version" (ngModelChange)="dmp.version=$event" name="version">
</div>
</form>
</div>

View File

@ -11,11 +11,10 @@
<div *ngFor="let field of group.compositeFields.groupFields" >
<df-field [field]="field" [form]="form" [dataModel] = "dataModel"></df-field>
</div>
<div *ngIf="shouldIShow();">
<a (click)="addFieldSet(form)" style="cursor: default">
Add another fieldSet +
</a>
</div>
</div>

View File

@ -1,140 +1,129 @@
<div class="parent-div">
<div class=" child-div-left" [ngClass]="{true:'col-md-8 col-sm-9', false:'col-md-12 col-sm-12'}[expandedToc]">
<div class=" child-div-left" [ngClass]="{true:'col-md-8 col-sm-9', false:'col-md-12 col-sm-12'}[expandedToc]">
<div class="col-md-12 form-body-container" id="form-container">
<form novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
<div class="col-md-12 form-body-container" id="form-container">
<form novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
<div *ngFor = "let section of dataModel.sections; let i = index;">
<div *ngIf="section.groupFields.length>0 else sectionHeader">
<div *ngIf="shouldIShow(section);"><h3>{{section.title}}</h3></div>
<div *ngFor="let group of section.groupFields">
<div *ngIf="shouldIShow(group);" >
<df-group [group]="group" [dataModel]="dataModel" [form]="getSubForm(group.key)"></df-group>
</div>
</div>
<div *ngFor = "let section of dataModel.sections; let i = index;">
<div *ngIf="section.groupFields.length>0 else sectionHeader">
<div *ngIf="shouldIShow(section);"><h3>{{section.title}}</h3></div>
<div *ngFor="let group of section.groupFields">
<div *ngIf="shouldIShow(group);" >
<df-group [group]="group" [dataModel]="dataModel" [form]="getSubForm(group.key)"></df-group>
</div>
</div>
</div>
<ng-template *ngIf="shouldIShow(section);" #sectionHeader>
<h2>{{section.title}}</h2>
</ng-template>
</div>
<div *ngFor="let field of dataModel.fields">
<div [formGroup]="form" class="form-group">
<df-field [field]="field" [form]="form" [dataModel]="dataModel" ></df-field>
</div>
</div>
<!-- <div *ngFor="let group of dataModel.groups">
<df-group [group]="group" [dataModel]="dataModel" [form]="getSubForm(group.key)"></df-group>
</div> -->
</form>
</div>
<div class="col-md-12 form-footer-seperator" >
</div>
<div class="col-md-12 form-footer-container" >
<div >
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow= "" aria-valuemin="0" aria-valuemax="100" [ngStyle]="{'width': dirtyValues + '%'}">
<!-- {{dirtyValues}}% -->
</div>
</div>
</div>
<div>
<button type="button" class="btn btn-default btncustom" [disabled]="!form.valid || finalizeStatus" (click)="SaveFinalize();">Save</button>
<button type="button" class="btn btn-default btncustom" [disabled]="!form.valid || finalizeStatus" data-toggle="modal" data-target="#confirmModal">Finalize</button>
</div>
<div *ngIf="payLoad" class="form-row">
<strong>Saved the following values</strong><br>{{payLoad}}
<ng-template *ngIf="shouldIShow(section);" #sectionHeader>
<h2>{{section.title}}</h2>
</ng-template>
</div>
<div *ngFor="let field of dataModel.fields">
<div [formGroup]="form" class="form-group">
<df-field [field]="field" [form]="form" [dataModel]="dataModel" ></df-field>
</div>
<!--
<p>Form value: {{ form.value | json }}</p>
-->
<div class="text-center">
<!-- pagination -->
<ul *ngIf="pagination.pages && pagination.pages.length" class="pagination">
<li [ngClass]="{disabled:pagination.currentPage === 1}">
<a (click)="setPage(1)" class="cursor-link" >First</a>
</li>
<li [ngClass]="{disabled:pagination.currentPage === 1}">
<a (click)="setPage(pagination.currentPage - 1)" class="cursor-link">Previous</a>
</li>
<li *ngFor="let page of pagination.pages" [ngClass]="{active:pagination.currentPage === page}">
<a (click)="setPage(page)" class="cursor-link">{{page}}</a>
</li>
<li [ngClass]="{disabled:pagination.currentPage === pagination.totalPages}">
<a (click)="setPage(pagination.currentPage + 1)" class="cursor-link">Next</a>
</li>
<li [ngClass]="{disabled:pagination.currentPage === pagination.totalPages}">
<a (click)="setPage(pagination.totalPages)" class="cursor-link">Last</a>
</li>
</ul>
</div>
</div>
</div>
<div class="child-div-caret" (click)="toggleTOC()">
<i class="fa toc-toggler" [ngClass]="{true:'fa-arrow-right', false:'fa-arrow-left'}[expandedToc]" aria-hidden="true" ></i>
</div>
<div class="child-div-right" [ngClass]="{true:'col-md-4 col-sm-3', false:'shrink-width' }[expandedToc]" id="toc-container">
<toc [dataModel]="dataModel" (setPage)="setPage($event)"></toc>
</div>
<!-- <div *ngFor="let group of dataModel.groups">
<df-group [group]="group" [dataModel]="dataModel" [form]="getSubForm(group.key)"></df-group>
</div> -->
</form>
</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">&times;</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 class="col-md-12 form-footer-seperator" >
</div>
<div class="col-md-12 form-footer-container" >
<div >
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow= "" aria-valuemin="0" aria-valuemax="100" [ngStyle]="{'width': dirtyValues + '%'}">
<!-- {{dirtyValues}}% -->
</div>
</div>
</div>
<div>
<button type="button" class="btn btn-default btncustom" [disabled]="!form.valid || finalizeStatus" (click)="SaveFinalize();">Save</button>
<button type="button" class="btn btn-default btncustom" [disabled]="!form.valid || finalizeStatus" data-toggle="modal" data-target="#confirmModal">Finalize</button>
</div>
<div *ngIf="payLoad" class="form-row">
<strong>Saved the following values</strong><br>{{payLoad}}
</div>
<!--
<p>Form value: {{ form.value | json }}</p>
-->
<div class="text-center">
<!-- pagination -->
<ul *ngIf="pagination.pages && pagination.pages.length" class="pagination">
<li [ngClass]="{disabled:pagination.currentPage === 1}">
<a (click)="setPage(1)" class="cursor-link" >First</a>
</li>
<li [ngClass]="{disabled:pagination.currentPage === 1}">
<a (click)="setPage(pagination.currentPage - 1)" class="cursor-link">Previous</a>
</li>
<li *ngFor="let page of pagination.pages" [ngClass]="{active:pagination.currentPage === page}">
<a (click)="setPage(page)" class="cursor-link">{{page}}</a>
</li>
<li [ngClass]="{disabled:pagination.currentPage === pagination.totalPages}">
<a (click)="setPage(pagination.currentPage + 1)" class="cursor-link">Next</a>
</li>
<li [ngClass]="{disabled:pagination.currentPage === pagination.totalPages}">
<a (click)="setPage(pagination.totalPages)" class="cursor-link">Last</a>
</li>
</ul>
</div>
</div>
</div>
<div class="child-div-caret" (click)="toggleTOC()">
<i class="fa toc-toggler" [ngClass]="{true:'fa-arrow-right', false:'fa-arrow-left'}[expandedToc]" aria-hidden="true" ></i>
</div>
<div class="child-div-right" [ngClass]="{true:'col-md-4 col-sm-3', false:'shrink-width' }[expandedToc]" id="toc-container">
<toc [dataModel]="dataModel" (setPage)="setPage($event)"></toc>
</div>
</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">&times;</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>

View File

@ -98,7 +98,7 @@ export class DynamicFormComponent implements OnInit {
if(data.status == 2) this.finalizeStatus=true;
}
//η κληση για το dataset profile pou htan prin pio panw anexarthth
//the call for the dataset profile above - independent
this.serverService.getDatasetProfileByID(this.id).subscribe(
response => {
@ -211,7 +211,7 @@ export class DynamicFormComponent implements OnInit {
this.form.get(prop).setValue(flatList[prop].valueOf());
}
}
//this.form.get("namingConventionGroup.nonamingConventionA213").setValue("TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
}
ngAfterViewChecked(): void { //navigate to certain section of the page
@ -285,14 +285,6 @@ export class DynamicFormComponent implements OnInit {
//this.dataModel.groups = this.dataModel.groups.slice(this.pagination.startIndex, this.pagination.endIndex + 1);
}
signOut2() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
console.log('User signed out.');
localStorage.removeItem('currentUser');
});
this.tokenService.setToken(null); //kanonika prepei na mpei mesa sthn function.....
}
toggleTOC(){
this.expandedToc = !this.expandedToc;