automated changes

This commit is contained in:
annampak 2017-11-15 10:46:10 +02:00
commit 47b30e2402
22 changed files with 408 additions and 262 deletions

View File

@ -19,6 +19,8 @@
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/primeng/resources/themes/omega/theme.css" ,
"../node_modules/primeng/resources/primeng.css",
"./../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css"
],

View File

@ -6821,6 +6821,11 @@
"utila": "0.4.0"
}
},
"primeng": {
"version": "5.0.0-rc.0",
"resolved": "https://registry.npmjs.org/primeng/-/primeng-5.0.0-rc.0.tgz",
"integrity": "sha1-fb5YXppO84emPfSyyR3VbeXpJVI="
},
"process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",

View File

@ -38,6 +38,7 @@
"ng2-datepicker": "^2.1.3",
"ng4-loading-spinner": "^1.0.27",
"ngx-webstorage": "^1.8.0",
"primeng": "^5.0.0-rc.0",
"rxjs": "^5.4.2",
"zone.js": "^0.8.17"
},

View File

@ -10,14 +10,17 @@ import { DmpComponent } from './dmps/dmp.component';
import { AppComponent } from './app.component';
import { UserWorkspaceComponent } from './user-workspace/user-workspace.component';
import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component';
import { BreadcrumbService } from './services/breadcrumb.service';
const appRoutes: Routes = [
//{ path: 'dynamic-form/:id', component: DynamicFormComponent, canActivate: [AuthGuard] },
{ path: 'dynamic-form', component: DynamicFormComponent, canActivate: [AuthGuard] },
//{ path: 'dataset', component: DatasetsComponent },
{ path: 'login', component: MainSignInComponent},
//{ path: 'projects', component: ProjectsComponent},
//{ path: 'dmps', component: DmpComponent},
{ path: 'projects', component: ProjectsComponent},
{ path: 'dmps', component: DmpComponent},
{ path: 'workspace', component: UserWorkspaceComponent},
//{ path: '', component: EmptyComponent},
{ path: 'welcome', component: EmptyComponent},
{ path: '', redirectTo: '/login', pathMatch: 'full' },
{ path: '**', component: PageNotFoundComponent },
/*
@ -43,7 +46,7 @@ const appRoutes: Routes = [
RouterModule
],
providers: [
BreadcrumbService
]
})
export class AppRoutingModule { }

View File

@ -36,14 +36,22 @@
cursor: pointer;
}
.navbar {
-webkit-box-shadow: 0px 0px 12px 2px rgba(0,0,0,0.73);
-moz-box-shadow: 0px 0px 12px 2px rgba(0,0,0,0.73);
box-shadow: 0px 0px 12px 2px rgba(0,0,0,0.73);
margin-bottom: 5px;
}
.navbar-title
{
position: absolute;
.navbar-title {
/*
width: 100%;
position: absolute;
left: 0;
text-align: center;
*/
margin:0 auto;
text-align: center;
}
.navbar-toggle {
z-index:3;

View File

@ -1,24 +1,31 @@
<div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse">
<div class="nav navbar-nav navbar-left" >
<button class="btn btn-primary navbar-btn navbar-left" [ngClass]="{true:'visible', false:'invisible'}[tokenService.isLoggedIn() == true]" (click)='slideNav()'>
<nav class="navbar navbar-default shadowed">
<div class="col-md-5" >
<!--
<button class="btn btn-primary " [ngClass]="{true:'visible', false:'invisible'}[tokenService.isLoggedIn() == true]" (click)='slideNav()'>
<span style="font-size:20px;cursor:pointer" >&#9776;</span>
</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"> Quick Navigate <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>
<h3 class="navbar-title">Data Management Plans Creator</h3>
</div>
</div>
<div class="col-md-3" >
<h3 class="navbar-title">Data Management Plans Creator</h3>
</div>
<div class="col-md-4" >
<ul class="nav navbar-nav navbar-right">
<li class="dropdown" [ngClass]="{true:'invisible'}[loggedInAs == null]">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Quick links <span class="caret"></span></a>
@ -34,12 +41,18 @@
<li class="cursor" [ngClass]="{false:'invisible'}[tokenService.isLoggedIn() == true]" (click)="logout()"><a>Logout</a></li>
<li class="cursor" [ngClass]="{true:'invisible'}[tokenService.isLoggedIn() == true]" (click)="login()" ><a>Login</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</div>
</nav>
</div>
<!-- breadcrumb bar -->
<div *ngIf="breadcrumbData.length!=0" class="col-md-12">
<p-breadcrumb [model]="breadcrumbData" [home]="breadcrumbHome"></p-breadcrumb>
</div>
<div class="parent_div">
<div id="appSidebar" class="sidenav child_div_left">
@ -59,11 +72,9 @@
<router-outlet></router-outlet>
<!--this should be invisible -->
<app-main-sign-in [ngClass]="'invisible'"></app-main-sign-in>
</div>
</div>

View File

@ -5,6 +5,9 @@ import { JsonObjest } from '../app/entities/JsonObject.class';
import { TokenService, TokenProvider } from './services/login/token.service';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component';
import {BreadcrumbModule,MenuItem} from 'primeng/primeng';
import { BreadcrumbService } from './services/breadcrumb.service';
import { AutocompleteRemoteComponent } from './form/fields/autocomplete-remote/autocomplete-remote.component';
@ -22,22 +25,57 @@ export class AppComponent implements OnInit {
sliderExpanded : boolean = false;
constructor(private tokenService : TokenService, private router: Router) {
breadcrumbHome: MenuItem = {icon: 'fa fa-home'};
breadcrumbData: MenuItem[] = new Array<MenuItem>();
/*
breadcrumbData: MenuItem[] = [
{label:'Categories'},
{label:'Sports'},
{label:'Football'},
{label:'Countries'},
{label:'Spain'},
{label:'F.C. Barcelona'},
{label:'Squad'},
{label:'Lionel Messi', url: '/login'}
];
*/
constructor(private tokenService : TokenService, private router: Router, private breadcrumbService : BreadcrumbService) {
}
ngOnInit() {
this.breadcrumbService.breadcrumbDataEmitter.subscribe(
(data) => {
this.breadcrumbData = data;
}
);
this.breadcrumbService.breadcrumbHomeEmitter.subscribe(
(data) => {
this.breadcrumbHome = data;
}
);
}
clearbreadCrumb(){
this.breadcrumbData.length = 0;
}
slideNav(){
$("#appSidebar").toggleClass("expanded");
$("#appBody").toggleClass("expanded");
}
@ -58,5 +96,14 @@ export class AppComponent implements OnInit {
}
goToDMPs(){
this.router.navigate(['/dmps'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ }});
}
goToProjects(){
this.router.navigate(['/projects'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ }});
}
}

View File

@ -35,6 +35,7 @@ import { GlobalInterceptor } from './services/interceptor';
import { TabModule } from './tabs/tab.module';
import { AngularDraggableModule } from 'angular2-draggable';
import { BreadcrumbService } from './services/breadcrumb.service';
import { NativeLoginService } from './services/login/native-login.service';
import { GooggleSignInComponent } from './login/googgle-sign-in/googgle-sign-in.component';
import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component';
@ -42,24 +43,23 @@ import { NguiAutoCompleteModule } from '@ngui/auto-complete';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import {BreadcrumbModule,MenuItem} from 'primeng/primeng';
import { CommonModule } from '@angular/common';
import { DatasetTableFilterPipe } from './pipes/dataset-table-filter.pipe';
import { DatasetStatusFilterPipe } from './pipes/dataset-status-filter.pipe';
import { DatasetsComponent } from './datasets/dataset.component';
import { DatasetRoutingModule } from './datasets/dataset-routing.module';
import { DmpComponent } from './dmps/dmp.component';
import { DmpTableFilterPipe } from './pipes/dmp-table-filter.pipe';
import { DmpStatusFilterPipe } from './pipes/dmp-status-filter.pipe';
import { DmpVersionFilterPipe } from './pipes/dmp-version-filter.pipe';
import { DmpRoutingModule } from './dmps/dmp-routing.module';
import { ProjectTableFilterPipe } from './pipes/project-table-filter.pipe';
import { ProjectsComponent } from './projects/projects.component';
import { ProjectRoutingModule } from './projects/project-routing.module';
import { ProjectDetailComponent } from './projects/project.detail';
import { ModalComponent } from './modal/modal.component';
import { NgDatepickerModule } from 'ng2-datepicker';
@ -109,16 +109,14 @@ import { Ng4LoadingSpinnerModule } from 'ng4-loading-spinner';
HttpModule,
HttpClientModule,
TabModule,
DmpRoutingModule,
CommonModule,
DatasetRoutingModule,
ProjectRoutingModule,
AppRoutingModule,
AngularDraggableModule,
DataTableModule,
NgDatepickerModule,
Ng4LoadingSpinnerModule,
NguiAutoCompleteModule,
BreadcrumbModule,
SidebarModule.forRoot()
],
@ -127,7 +125,7 @@ import { Ng4LoadingSpinnerModule } from 'ng4-loading-spinner';
useClass: GlobalInterceptor,
multi: true,
},
ServerService, dataModelBuilder, GlobalVariables, AuthGuard, PaginationService, TokenService, LocalStorageService, RestBase, EestoreService,NativeLoginService
ServerService, BreadcrumbService, dataModelBuilder, GlobalVariables, AuthGuard, PaginationService, TokenService, LocalStorageService, RestBase, EestoreService,NativeLoginService
],
bootstrap: [AppComponent]
})

View File

@ -1,22 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DatasetsComponent } from './dataset.component';
//import { ProjectDetailComponent } from './project.detail';
import { DynamicFormComponent } from '../form/dynamic-form.component';
import { AuthGuard } from '../guards/auth.guard';
const datasetsRoutes: Routes = [
{ path: 'dataset', component: DatasetsComponent },
{ path: 'dynamic-form/:id', component: DynamicFormComponent, canActivate: [AuthGuard] }
];
@NgModule({
imports: [
RouterModule.forChild(datasetsRoutes)
],
exports: [
RouterModule
]
})
export class DatasetRoutingModule { }

View File

@ -41,10 +41,6 @@ export class DatasetsComponent implements OnInit {
public sortBy = "label";
public sortOrder = "asc";
//visibility rules for containers
tableVisible: boolean = true;
editorVisible: boolean = false;
// for tableIds
showIDs : boolean = false;

View File

@ -1,21 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DmpComponent } from './dmp.component';
import { DynamicFormComponent } from '../form/dynamic-form.component';
import { AuthGuard } from '../guards/auth.guard';
const projectsRoutes: Routes = [
//{ path: 'tabs/dmps', component: DmpComponent },
{ path: 'dynamic-form/:id', component: DynamicFormComponent, canActivate: [AuthGuard] }
];
@NgModule({
imports: [
RouterModule.forChild(projectsRoutes)
],
exports: [
RouterModule
]
})
export class DmpRoutingModule { }

View File

@ -16,6 +16,8 @@ import { FormGroup, FormControl } from '@angular/forms'; //na dw
import { NgForm } from '@angular/forms';
import { DatasetsComponent } from '../datasets/dataset.component';
import { StatusToString } from '../pipes/various/status-to-string';
import {MenuItem} from 'primeng/primeng';
import { BreadcrumbService } from '../services/breadcrumb.service';
declare var $ :any;
@ -31,55 +33,70 @@ declare function simple_notifier(type: string, title: string, message:string): a
export class DmpComponent implements OnInit{
// Start ALTERNATIVE
//whole dmp data model
tableData : any[] = new Array();
//organisation editor data model
editingOrganisation: any = {};
organisationEditorForm : any;
//required by the table
public filterQuery = "";
public rowsOnPage = 10;
public sortBy = "label";
public sortOrder = "asc";
//visibility rules for containers
tableVisible: boolean = true;
editorVisible: boolean = true;
// for tableIds
showIDs : boolean = false;
// END ALTERNATIVE
public stateConfig : any = {
"dmps" : {
"tableVisible" : true,
"selectedID" : null,
"selectedLabel" : null
},
"datasets" : {
"tableVisible" : false,
"selectedID" : null,
"selectedLabel" : null
}
}
breadcrumbHome: MenuItem = {icon: 'fa fa-home'};
/*
breadcrumbData: MenuItem[] = [];
*/
breadcrumbData: MenuItem[] = [
{label:'Categories'},
{label:'Sports'},
{label:'Football'},
{label:'Countries'},
{label:'Spain'},
{label:'F.C. Barcelona'},
{label:'Squad'},
{label:'Lionel Messi', url: 'https://en.wikipedia.org/wiki/Lionel_Messi'}
];
dmp:any;
@Input() dmpTableVisible: boolean;
@Input() dmpCount = 0;
@Input() projectsDropDown:DropdownField;
@Input() dataSetVisibe:boolean;
@Input() statusDropDown: DropdownField;
@Input() isSelected:boolean;
//@Input() projects: Project[];
dmpIdforDatasets: string;
dmpLabelforDatasets:string;
@ViewChild(DatasetsComponent) datasetsComponent:DatasetsComponent;
@ViewChild('isignOutBtn') isignOutBtn;
constructor(
private serverService: ServerService,
private route: ActivatedRoute,
private breadcrumbService : BreadcrumbService,
private router: Router){
this.projectsDropDown = new DropdownField();
this.projectsDropDown.options = [];
this.statusDropDown = new DropdownField();
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.dmpTableVisible = false;
this.dataSetVisibe = false;
this.isSelected=false;
this.dmp = {
id: null,
@ -110,6 +127,11 @@ export class DmpComponent implements OnInit{
simple_notifier("danger",null,"Could not load User's Projects");
}
)
this.breadcrumbService.setData(this.breadcrumbData);
this.breadcrumbService.setData(this.breadcrumbData);
}
@ -189,40 +211,30 @@ SaveDmp(){
selectDmp(item){
this.dmpIdforDatasets = item.id;
this.dmpLabelforDatasets = item.label;
if(this.dataSetVisibe == false)
this.dataSetVisibe = true;
this.stateConfig.dmps.selectedID = item.id;
this.stateConfig.dmps.selectedLabel = item.label;
if(this.stateConfig.datasets.tableVisible == false)
this.stateConfig.datasets.tableVisible = true;
else
this.datasetsComponent.getDatasetForDmpMethod(item.id);
}
editRow(item, elementId){
this.isSelected = true;
if (elementId == "editDMP"){
this.dmp.label = item.label;
this.dmp.previous = item.previous;
this.dmp.version = item.version;
this.dmp.profile = item.profile;
this.dmp.profileData = item.profileData;
this.dmp.id = item.id;
this.dmp = item;
this.dmp.project = item.project.id;
this.dmp.description = item.description;
this.dmp.status = item.status;
setTimeout(function() {
//setTimeout(function() {
$("#newDmpModal").modal("show");
},0);
//},0);
}
if(elementId == "changeVersionDMP"){
this.dmp.label = item.label;
this.dmp.previous = item.previous;
this.dmp.version = item.version;
this.dmp.profile = item.profile;
this.dmp.profileData = item.profileData;
this.dmp.id = item.id;
this.dmp = item;
this.dmp.project = item.project.id;
this.dmp.description = item.description;
$("#newVersionDmpModal").modal("show");
}

View File

@ -1,6 +1,10 @@
<meta name="google-signin-client_id" content="524432312250-vhgidft856v8qftsc81kls4c74v87d8o.apps.googleusercontent.com">
<!--
<div class="col-md-12 ">
<p-breadcrumb [model]="breadcrumbData" [home]="breadcrumbHome"></p-breadcrumb>
</div>
-->
<table class="table table-striped customTable" [mfData]="tableData | dmpTableFilter : filterQuery | dmpVersionFilter : versionFilter |dmpstatusFilter: statusFilter"
<table *ngIf="stateConfig.dmps.tableVisible" class="table table-striped customTable" [mfData]="tableData | dmpTableFilter : filterQuery | dmpVersionFilter : versionFilter |dmpstatusFilter: statusFilter"
#mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [(mfSortBy)]="sortBy" [(mfSortOrder)]="sortOrder">
<thead>
<tr class="rowFilter">
@ -70,14 +74,16 @@
<td>{{dmp?.description}}</td>
<td>{{dmp?.created | date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
<td>{{dmp?.status | statusToString }}</td>
<td><a href="#" class="editGridColumn" (click)="editRow(dmp, 'editDMP')"> <!--btn btn-primary btn-rounded css for button style -->
<td>
<a class="editGridColumn cursor-link" (click)="editRow(dmp, 'editDMP')"> <!--btn btn-primary btn-rounded css for button style -->
<i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit properties" id="editDMP"></i></a>
<a href="#" class="editGridColumn" (click)="editRow(dmp, 'changeVersionDMP')">
<a class="editGridColumn cursor-link" (click)="editRow(dmp, 'changeVersionDMP')">
<i class="fa fa-clone fa-fw" data-toggle="tooltip" title="create new version" id="changeVersionDMP"></i> </a>
<a href="#" class="editGridColumn" (click)="markDMPForDelete(dmp)">
<a class="editGridColumn cursor-link" (click)="markDMPForDelete(dmp)">
<i class="fa fa-eraser fa-fw" data-toggle="modal" data-target="#delete-dmp-confirm" title="delete DMP"></i> </a>
<a href="#" class="editGridColumn" (click)="editRow(dmp, 'showDatasets')">
<i class="fa fa-table fa-fw" data-toggle="tooltip" title="show dataset for this DMP" id="showDatasets"></i></a></td>
<a class="editGridColumn cursor-link" (click)="editRow(dmp, 'showDatasets')">
<i class="fa fa-table fa-fw" data-toggle="tooltip" title="show dataset for this DMP" id="showDatasets"></i></a>
</td>
</tr>
</tbody>
<tfoot>
@ -131,7 +137,8 @@
<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>
</div>
<!-- <div class="form-group">
<!--
<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>
</div>
@ -142,7 +149,8 @@
<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">
</div> -->
</div>
-->
</form>
</div>
<div class="modal-footer">
@ -154,7 +162,6 @@
</div>
<!--Modal for changing version-->
<div class="modal fade" id="newVersionDmpModal" tabindex="-1" role="dialog" aria-labelledby="newVersionDmpModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
@ -195,9 +202,9 @@
</div>
</div>
</div>
</div>
</div>
<div class="modal" tabindex="-1" id="messageForChangingStatus" role="dialog">
<div class="modal" tabindex="-1" id="messageForChangingStatus" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
@ -214,15 +221,18 @@
</div>
</div>
</div>
</div>
<!--Modal for DMPs-->
<!-- <modal *ngIf="item && show" [(show)]="show" [item]="item" [(dataSetVisibe)]="dataSetVisibe"></modal> -->
<!--DATASET TABLE-->
<datasets-table *ngIf="dataSetVisibe" [dmpIdforDatasets]="dmpIdforDatasets" [dmpLabelforDatasets]="dmpLabelforDatasets" [(dataSetVisibe)]="dataSetVisibe"></datasets-table>
</div>
<!--Modal for DMPs-->
<!-- <modal *ngIf="item && show" [(show)]="show" [item]="item" [(dataSetVisibe)]="stateConfig.datasets.tableVisible"></modal> -->
<!--DATASET TABLE-->
<datasets-table *ngIf="stateConfig.datasets.tableVisible" [dmpIdforDatasets]="stateConfig.dmps.selectedID" [dmpLabelforDatasets]="stateConfig.dmps.selectedLabel" [(dataSetVisibe)]="stateConfig.datasets.tableVisible"></datasets-table>
<!-- Confirmation module- do not delete -->
<confirmation [confirmationID]="'delete-dmp-confirm'" [confirmationTitle]="'Caution'" [confirmationDescr]="'This action will delete this DMP. Are you sure ? This is not revertable !'" (responseSender)="deleteDMP($event)"></confirmation>
<!-- Confirmation module- do not delete -->
<confirmation [confirmationID]="'delete-dmp-confirm'" [confirmationTitle]="'Caution'" [confirmationDescr]="'This action will delete this DMP. Are you sure you want to delete this DMP ? This is not revertable !'"
(responseSender)="deleteDMP($event)"></confirmation>

View File

@ -1,3 +1,11 @@
.hide{
display:none;
}
.show {
display:block;
}
.btncustom{
background-color:#337ab7;
color:white;
@ -5,27 +13,85 @@
}
.parent-div {
height: calc(100vh - 80px);
height: calc(100vh - 60px); /* is height of window minus heigh of header bar */
width:100%;
}
.child-div-left{
-webkit-box-shadow: 0px 0px 9px 2px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 9px 2px rgba(0,0,0,0.75);
box-shadow: 0px 0px 9px 2px rgba(0,0,0,0.75);
padding:0px;
height: 100%;
-webkit-transition: width 0.5s; /* For Safari 3.1 to 6.0 */
transition: width 0.5s;
}
.child-div-caret{
position: absolute;
left: 98%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 9999;
font-size: 2em;
cursor: pointer;
}
.child-div-right {
overflow-y: scroll;
height: 100%;
-webkit-transition: 0.5s; /* For Safari 3.1 to 6.0 */
transition: width 0.5s;
}
.shrink-width{
width: 0px;
/*visibility:hidden;*/
}
.form-body-container{
height: calc(100vh - 80px - 130px);
padding-bottom: 10px;
height: calc(100vh - 85px - 138px); /* is height of window minus heigh of app header bar minus height of form footer bar */
overflow-y:scroll;
}
.form-footer-container {
height: 130px;
.form-footer-seperator{
border-style: solid;
border-width: 1px;
border-color: rgb(112, 112, 112);
/*
-webkit-box-shadow: 0px 0px 11px 1px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 11px 1px rgba(0,0,0,0.75);
box-shadow: 0px 0px 11px 1px rgba(0,0,0,0.75);
*/
/*border-width: thin;*/
width:100%;
}
.form-footer-container {
/*
-webkit-box-shadow: 0px -3px 5px 0px rgba(128,128,128,1);
-moz-box-shadow: 0px -3px 5px 0px rgba(128,128,128,1);
box-shadow: 0px -3px 5px 0px rgba(128,128,128,1);
*/
height: 138px;
}
.progress{
margin-top: 8px;
margin-bottom: 0px;
}

View File

@ -1,9 +1,7 @@
<div class="parent-div">
<div class="col-md-8 col-sm-9 child-div-left" >
<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">
@ -38,8 +36,20 @@
</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>
@ -90,7 +100,12 @@
<div class="col-md-4 col-sm-3 child-div-right" id="toc-container">
<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>

View File

@ -61,7 +61,6 @@ export class DynamicFormComponent implements OnInit {
private fragment: string;
xml2jsonOBJ: any;
expandedForm : boolean = false;
expandedToc : boolean = true;
@ -234,7 +233,7 @@ export class DynamicFormComponent implements OnInit {
(data) => {
console.log("Updated dataset");
//simple_notifier("success",null,"Saved form progress");
this.router.navigate(['/workspace'], { queryParams: { /*returnUrl: this.state.url*/ }});
this.router.navigate(['/welcome'], { queryParams: { /*returnUrl: this.state.url*/ }});
},
(err) => {
simple_notifier("danger",null,"Could not save form progress");
@ -295,4 +294,8 @@ export class DynamicFormComponent implements OnInit {
this.tokenService.setToken(null); //kanonika prepei na mpei mesa sthn function.....
}
toggleTOC(){
this.expandedToc = !this.expandedToc;
}
}

View File

@ -1,3 +1,10 @@
.cursor-hand{
cursor: pointer;
}
.toc-toggler {
position: absolute;
left: 0%;
top: 50%;
transform: translate(-50%, -50%);
}

View File

@ -1,4 +1,4 @@
<body data-spy="scroll" data-target="#toc">
<body data-spy="scroll" data-target="#toc">
<nav id="toc" data-toggle="toc">
<ul class="nav flex-column">
<li class="nav-item">
@ -40,4 +40,4 @@
</li>
</ul>
</nav>
</body>
</body>

View File

@ -39,7 +39,7 @@ export class MainSignInComponent implements OnInit {
this.createProjectEditorForm();
//debugger;
if(this.tokenService.isLoggedIn()){
this.router.navigate(['workspace'], { queryParams: { /*returnUrl: this.state.url*/ }});
this.router.navigate(['/welcome'], { queryParams: { /*returnUrl: this.state.url*/ }});
}
}
@ -53,7 +53,7 @@ export class MainSignInComponent implements OnInit {
simple_notifier("success",null,"Successful login");
this.tokenService.login(response['token'], TokenProvider.native, this.creds.username, response['email']);
this.router.navigate(['/workspace'], { queryParams: { /*returnUrl: this.state.url*/ }});
this.router.navigate(['/welcome'], { queryParams: { /*returnUrl: this.state.url*/ }});
},
err => {
simple_notifier("danger",null,"Failed to login");

View File

@ -1,22 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ProjectsComponent } from './projects.component';
import { ProjectDetailComponent } from './project.detail';
import { DynamicFormComponent } from '../form/dynamic-form.component';
import { AuthGuard } from '../guards/auth.guard';
const projectsRoutes: Routes = [
// { path: 'tabs/projects', component: ProjectsComponent }, // canActivate: [AuthGuard]
{ path: 'dynamic-form/:id', component: DynamicFormComponent, canActivate: [AuthGuard] }
];
@NgModule({
imports: [
RouterModule.forChild(projectsRoutes)
],
exports: [
RouterModule
]
})
export class ProjectRoutingModule { }

View File

@ -0,0 +1,23 @@
import { Injectable, EventEmitter } from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {MenuItem} from 'primeng/primeng';
@Injectable()
export class BreadcrumbService {
breadcrumbHomeEmitter : EventEmitter<MenuItem> = new EventEmitter<MenuItem>();
breadcrumbDataEmitter : EventEmitter<Array<MenuItem>> = new EventEmitter<Array<MenuItem>>();
setData(breadcrumbData : Array<MenuItem>){
this.breadcrumbDataEmitter.emit(breadcrumbData);
}
setHome(breadcrumbHome: MenuItem) {
this.breadcrumbHomeEmitter.emit(breadcrumbHome);
}
}

View File

@ -1,6 +1,7 @@
import { Injectable, Inject} from '@angular/core';
import { Observable } from 'rxjs';
import {LocalStorageService} from 'ngx-webstorage';
import {Router} from '@angular/router';
import 'rxjs/add/operator/map';
import { DOCUMENT } from '@angular/platform-browser';
@ -13,7 +14,7 @@ declare function sign_out_google(): any;
@Injectable()
export class TokenService {
constructor (private storage : LocalStorageService, @Inject(DOCUMENT) private document) {
constructor (private storage : LocalStorageService, @Inject(DOCUMENT) private document, private router : Router) {
//var csrfToken : string = jQuery(document).find('meta[name="csrf-token"]').attr('content');
//this.setCSRFToken(csrfToken);
}
@ -83,6 +84,7 @@ export class TokenService {
logout(){
debugger;
//set the log out actions here
this.setLoggedIn(false);
this.setEmail(null);
@ -95,7 +97,9 @@ export class TokenService {
this.setProvider(null);
window.location.reload();
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
//window.location.reload();
}