progress bar, change server url

This commit is contained in:
annampak 2018-01-10 10:17:22 +02:00
parent fa10688e98
commit 05dab7f674
7 changed files with 39 additions and 18 deletions

View File

@ -1,5 +1,5 @@
export const HostConfiguration = { export const HostConfiguration = {
Server: 'http://192.168.32.171:8080/', Server: 'http://192.168.32.96:8080/',
//CASHost: 'https://login-devel.uoa.gr/login', //CASHost: 'https://login-devel.uoa.gr/login',
//Service: 'http://elkefinman/login' //Service: 'http://elkefinman/login'
} }

View File

@ -1,7 +1,7 @@
<div [id]="compositeField.id" [formGroup]="form"> <div [id]="compositeField.id" [formGroup]="form">
<div *ngIf="compositeField.fields.length == 1" class="fieldset-component"> <div *ngIf="compositeField.fields.length == 1" class="fieldset-component">
<h5 *ngIf="compositeField.title">{{compositeField.title}}</h5> <h5 *ngIf="compositeField.title" style="font-weight:bold; color: #3a3737;">{{compositeField.title}}</h5>
<div class="content-left-margin"> <div class="content-left-margin">
<h5 *ngIf="compositeField.description">{{compositeField.description}}</h5> <h5 *ngIf="compositeField.description">{{compositeField.description}}</h5>
<h5 *ngIf="compositeField.extendedDescription" class="fieldset-extended-desc"> <h5 *ngIf="compositeField.extendedDescription" class="fieldset-extended-desc">
@ -14,7 +14,7 @@
<div *ngIf="compositeField.fields.length > 1" class="fieldset-component"> <div *ngIf="compositeField.fields.length > 1" class="fieldset-component">
<h5 *ngIf="compositeField.title">{{compositeField.title}}</h5> <h5 *ngIf="compositeField.title" style="font-weight:bold; color: #3a3737;">{{compositeField.title}}</h5>
<div class="content-left-margin"> <div class="content-left-margin">
<h5 *ngIf="compositeField.description">{{compositeField.description}}</h5> <h5 *ngIf="compositeField.description">{{compositeField.description}}</h5>
<h5 *ngIf="compositeField.extendedDescription" class="fieldset-extended-desc"> <h5 *ngIf="compositeField.extendedDescription" class="fieldset-extended-desc">

View File

@ -38,7 +38,7 @@
<mat-expansion-panel expanded=true> <mat-expansion-panel expanded=true>
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
<a data-toggle="collapse" href="#{{section.id}}" class="panel-title pull-left" style="padding-top: 7.5px;">{{path}} {{section.title}}</a> {{path}} {{section.title}}
</mat-panel-title> </mat-panel-title>
<mat-panel-description> <mat-panel-description>
<h3 *ngIf="section.description">{{section.description}}</h3> <h3 *ngIf="section.description">{{section.description}}</h3>

View File

@ -28,4 +28,18 @@ ng-sidebar-container {
.alignment-center{ .alignment-center{
text-align: center; text-align: center;
} }
.demo-progress-bar-container {
width: 100%;
}
.mat-progress-bar {
margin: 20px 0;
}

View File

@ -1,24 +1,25 @@
<div class="ui-g dynamic-formc full-width full-height"> <div class="ui-g dynamic-formc full-width full-height">
<mat-sidenav-container contentClass="scrollableContent"> <mat-sidenav-container contentClass="scrollableContent">
<mat-sidenav mode="push" position="right" [(opened)]="visibleSidebar"> <mat-sidenav mode="push" position="right" [(opened)]="visibleSidebar">
<table-of-content class="toc-container full-height" [model]="datasetProfileDefinitionModel"></table-of-content> <table-of-content class="toc-container full-height" [model]="datasetProfileDefinitionModel"></table-of-content>
</mat-sidenav> </mat-sidenav>
<mat-sidenav-content class="ui-g"> <mat-sidenav-content class="ui-g">
<button mat-raised-button color="primary" style="margin: 15px;" (click)="toggleSidebar()" icon="fa-arrow-left">Table Of Contents</button> <button mat-raised-button color="primary" style="margin: 15px;" (click)="toggleSidebar()" icon="fa-arrow-left">Table Of Contents</button>
<button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel.status != 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" <button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel.status != 1"
(click)="save();">Save</button> style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" (click)="save();">Save</button>
<button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel?.status != 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" <button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel?.status != 1"
(click)="submit();">Save and Finalize</button> style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" (click)="submit();">Save and Finalize</button>
<div class="ui-g-12"> <div class="ui-g-12">
<div class="alignment-center"> <div class="alignment-center">
<!-- <ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination> --> <!-- <ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination> -->
<progress-bar *ngIf="form" [formGroup]="form"></progress-bar>
</div> </div>
</div> </div>
<div class="ui-g-12"> <div class="ui-g-12">
<progress-bar *ngIf="form" [formGroup]="form"></progress-bar> <!-- <progress-bar *ngIf="form" [formGroup]="form"></progress-bar> -->
</div> </div>
<div class="col-md-12 form-body-container" id="form-container"> <div class="col-md-12 form-body-container" id="form-container">
<form *ngIf="form" novalidate [formGroup]="form" (ngSubmit)="onSubmit()"> <form *ngIf="form" novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
<div *ngFor="let section of datasetProfileDefinitionModel.sections; let i = index;"> <div *ngFor="let section of datasetProfileDefinitionModel.sections; let i = index;">
@ -28,6 +29,6 @@
</form> </form>
</div> </div>
</mat-sidenav-content> </mat-sidenav-content>
</mat-sidenav-container> </mat-sidenav-container>
</div> </div>
<!-- <p>Form value: {{ form.value | json }}</p> --> <!-- <p>Form value: {{ form.value | json }}</p> -->

View File

@ -1 +1,5 @@
<!-- <p-progressBar [value]="value" [style]="{'height': '30px'}" [styleClass]="'alwaysVisible'"></p-progressBar> --> <!-- <p-progressBar [value]="value" [style]="{'height': '30px'}" [styleClass]="'alwaysVisible'"></p-progressBar> -->
<div class="demo-progress-bar-container">
<mat-progress-bar mode="determinate" [value]="value" [color]="color"></mat-progress-bar>
</div>

View File

@ -11,7 +11,8 @@ import { FormGroup, FormControl, FormArray } from '@angular/forms'
}) })
export class ProgressBarComponent implements OnInit { export class ProgressBarComponent implements OnInit {
@Input() formGroup: FormGroup @Input() formGroup: FormGroup
@Input("progressValueAccuracy") public accuracy: number = 1 @Input("progressValueAccuracy") public accuracy: number = 1;
determinateProgressValue:number;
constructor(private visibilityRulesService: VisibilityRulesService) { } constructor(private visibilityRulesService: VisibilityRulesService) { }
@ -24,7 +25,7 @@ export class ProgressBarComponent implements OnInit {
this.calculateValueForProgressbar(); this.calculateValueForProgressbar();
}); });
} }
calculateValueForProgressbar(){ calculateValueForProgressbar(){
var progressSoFar = this.countFormControlsWithValue(this.formGroup); var progressSoFar = this.countFormControlsWithValue(this.formGroup);
var total = this.getFormControlDepthLength(this.formGroup); var total = this.getFormControlDepthLength(this.formGroup);
@ -52,7 +53,8 @@ export class ProgressBarComponent implements OnInit {
let value = 0; let value = 0;
Object.keys(form.controls).forEach(key => { Object.keys(form.controls).forEach(key => {
let control = form.controls[key] let control = form.controls[key]
if (control instanceof FormGroup) value += this.getFormControlDepthLength(control); if (control instanceof FormGroup)
{ value += this.getFormControlDepthLength(control);}
else if (control instanceof FormArray) { else if (control instanceof FormArray) {
let formArray = (<FormArray>control); let formArray = (<FormArray>control);
for (let i = 0; i < formArray.length; i++) { for (let i = 0; i < formArray.length; i++) {