minor changes

parent 453e9f33
...@@ -10,6 +10,7 @@ import { Router, ActivatedRoute, Params} from '@angular/router'; ...@@ -10,6 +10,7 @@ import { Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx'; import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types'; import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state'; import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state';
import { PDE_ROLE, DIDE_ROLE } from '../../constants';
import { import {
FormBuilder, FormBuilder,
...@@ -38,7 +39,7 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -38,7 +39,7 @@ import { API_ENDPOINT } from '../../app.settings';
<br><br> <br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(2)" [hidden]="minedu_userName == ''" > <button type="button" class="btn btn-alert" (click)="nav_to_reportpath(2)" [hidden]="minedu_userName == ''" >
<i class="fa fa-file-text"></i> <i class="fa fa-file-text"></i>
Συνολική Πληρότητα σχολικών μονάδων ΕΠΑΛ ανά τάξη Συνολική Πληρότητα σχολικών μονάδων ΕΠΑΛ ανά τάξη
</button> </button>
<br><br> <br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(3)" [hidden]="minedu_userName == ''" > <button type="button" class="btn btn-alert" (click)="nav_to_reportpath(3)" [hidden]="minedu_userName == ''" >
...@@ -87,7 +88,14 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -87,7 +88,14 @@ import { API_ENDPOINT } from '../../app.settings';
state.loginInfo.reduce(({}, loginInfoToken) => { state.loginInfo.reduce(({}, loginInfoToken) => {
this.minedu_userName = loginInfoToken.minedu_username; this.minedu_userName = loginInfoToken.minedu_username;
this.minedu_userPassword = loginInfoToken.minedu_userpassword; this.minedu_userPassword = loginInfoToken.minedu_userpassword;
return loginInfoToken; console.log("Role:");
console.log(loginInfoToken.auth_role);
if (loginInfoToken.auth_role == PDE_ROLE || loginInfoToken.auth_role == DIDE_ROLE) {
console.log("inside..");
this.minedu_userName = loginInfoToken.auth_token;
this.minedu_userPassword = loginInfoToken.auth_token;
}
return loginInfoToken;
}, {}); }, {});
} }
return state.loginInfo; return state.loginInfo;
......
...@@ -12,6 +12,7 @@ import { ILoginInfo } from '../../store/logininfo/logininfo.types'; ...@@ -12,6 +12,7 @@ import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { Ng2SmartTableModule, LocalDataSource } from 'ng2-smart-table'; import { Ng2SmartTableModule, LocalDataSource } from 'ng2-smart-table';
import {reportsSchema, TableColumn} from './reports-schema'; import {reportsSchema, TableColumn} from './reports-schema';
import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state'; import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state';
import { PDE_ROLE, DIDE_ROLE } from '../../constants';
import {csvCreator} from './csv-creator'; import {csvCreator} from './csv-creator';
import { import {
...@@ -31,11 +32,10 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -31,11 +32,10 @@ import { API_ENDPOINT } from '../../app.settings';
<div> <div>
<!--
<div <div
class = "loading" *ngIf="validCreator == 0" > class = "loading" *ngIf="validCreator == 0" >
</div> </div>
-->
<form [formGroup]="formGroup" #form> <form [formGroup]="formGroup" #form>
...@@ -45,8 +45,8 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -45,8 +45,8 @@ import { API_ENDPOINT } from '../../app.settings';
> Φίλτρο Επιλογής Περιφ/κής Δ/νσης - Δ/νσης Εκπ/σης - Σχολείου > Φίλτρο Επιλογής Περιφ/κής Δ/νσης - Δ/νσης Εκπ/σης - Σχολείου
</button> </button>
<div class="col-md-11 offset-md-1"> <div class="col-md-11 offset-md-1">
<label *ngIf = "enableRegionFilter"> Περιφερειακή Διεύθυνση </label> <label *ngIf = "enableRegionFilter && userLoggedIn == 'supervisor'"> Περιφερειακή Διεύθυνση </label>
<select #regsel class="form-control" (change)="checkregion(regsel)" *ngIf = "enableRegionFilter" formControlName="region"> <select #regsel class="form-control" (change)="checkregion(regsel)" *ngIf = "enableRegionFilter" [value] = "regionSelected" [hidden] = "userLoggedIn != 'supervisor'" formControlName="region">
<option value="0"></option> <option value="0"></option>
<option *ngFor="let RegionSelection$ of RegionSelections$ | async; let i=index" [value] = "RegionSelection$.id"> {{RegionSelection$.name}} </option> <option *ngFor="let RegionSelection$ of RegionSelections$ | async; let i=index" [value] = "RegionSelection$.id"> {{RegionSelection$.name}} </option>
</select> </select>
...@@ -158,6 +158,7 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -158,6 +158,7 @@ import { API_ENDPOINT } from '../../app.settings';
private courseSelected: number; private courseSelected: number;
private enableRegionFilter: boolean; private enableRegionFilter: boolean;
private enableCourseFilter: boolean; private enableCourseFilter: boolean;
private userLoggedIn: string;
columnMap: Map<string,TableColumn> = new Map<string,TableColumn>(); columnMap: Map<string,TableColumn> = new Map<string,TableColumn>();
@Input() settings: any; @Input() settings: any;
...@@ -214,7 +215,28 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -214,7 +215,28 @@ import { API_ENDPOINT } from '../../app.settings';
state.loginInfo.reduce(({}, loginInfoToken) => { state.loginInfo.reduce(({}, loginInfoToken) => {
this.minedu_userName = loginInfoToken.minedu_username; this.minedu_userName = loginInfoToken.minedu_username;
this.minedu_userPassword = loginInfoToken.minedu_userpassword; this.minedu_userPassword = loginInfoToken.minedu_userpassword;
return loginInfoToken;
this.userLoggedIn = loginInfoToken.auth_role;
if (loginInfoToken.auth_role == PDE_ROLE || loginInfoToken.auth_role == DIDE_ROLE) {
console.log("inside..");
this.minedu_userName = loginInfoToken.auth_token;
this.minedu_userPassword = loginInfoToken.auth_token;
/*
if (loginInfoToken.auth_role == PDE_ROLE)
this.userLoggedIn = "pde";
else if (loginInfoToken.auth_role == DIDE_ROLE)
this.userLoggedIn = "dide";
console.log(this.userLoggedIn);
*/
if (loginInfoToken.auth_role == PDE_ROLE) {
//CALL CONTROLLER THAT RETURNS ID OF PDE
this. regionSelected = 1;
this.showAdminList.next(true);
this.checkregion(this. regionSelected);
}
}
return loginInfoToken;
}, {}); }, {});
} }
return state.loginInfo; return state.loginInfo;
...@@ -346,13 +368,14 @@ toggleCourseFilter() { ...@@ -346,13 +368,14 @@ toggleCourseFilter() {
checkregion(regionId) { checkregion(regionId) {
this.regionSelected = regionId.value; if (typeof regionId.value != "undefined")
this.regionSelected = regionId.value;
this.adminAreaSelected = 0; this.adminAreaSelected = 0;
this.schSelected = 0; this.schSelected = 0;
//if (regionId.value != 0) { //if (regionId.value != 0) {
this.AdminAreaSelectionsSub = this._hds.getAdminAreas(this.minedu_userName, this.minedu_userPassword, regionId.value).subscribe(data => { this.AdminAreaSelectionsSub = this._hds.getAdminAreas(this.minedu_userName, this.minedu_userPassword, this.regionSelected).subscribe(data => {
this.AdminAreaSelections$.next(data); this.AdminAreaSelections$.next(data);
}, },
error => { error => {
...@@ -365,7 +388,7 @@ checkregion(regionId) { ...@@ -365,7 +388,7 @@ checkregion(regionId) {
} }
); );
this.SchoolSelectionsSub = this._hds.getSchoolsPerRegion(this.minedu_userName, this.minedu_userPassword, regionId.value).subscribe(data => { this.SchoolSelectionsSub = this._hds.getSchoolsPerRegion(this.minedu_userName, this.minedu_userPassword, this.regionSelected).subscribe(data => {
this.SchoolSelections$.next(data); this.SchoolSelections$.next(data);
}, },
error => { error => {
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
</li> </li>
</div> </div>
<!--
<div *ngIf="(loginInfo$ | async).size > 0" class="nav-item" > <div *ngIf="(loginInfo$ | async).size > 0" class="nav-item" >
<li *ngIf="authRole=='pde'" class="nav-item" > <li *ngIf="authRole=='pde'" class="nav-item" >
<a class="nav-link" [routerLink]="['/school/perfecture-view']" [routerLinkActive]="['active']"><b>Αναφορές</b></a> <a class="nav-link" [routerLink]="['/ministry/minister-reports']" [routerLinkActive]="['active']"><b>Αναφορές</b></a>
</li> </li>
</div> </div>
-->
</div> </div>
</ul> </ul>
......
...@@ -197,10 +197,15 @@ import {AppSettings} from '../../app.settings'; ...@@ -197,10 +197,15 @@ import {AppSettings} from '../../app.settings';
criteriaObj[i] =new StudentCriteriaChosen(null, null, this.studentCriteria[i]); criteriaObj[i] =new StudentCriteriaChosen(null, null, this.studentCriteria[i]);
aitisiObj['2'] = criteriaObj; aitisiObj['2'] = criteriaObj;
if (aitisiObj[0]['currentclass'] === "Β' Λυκείου" ) console.log("Debugging..");
console.log(aitisiObj[0]['currentclass']);
//if (aitisiObj[0]['currentclass'] === "Β' Λυκείου" )
if (aitisiObj[0]['currentclass'] === "2" )
aitisiObj['3'] = new StudentSectorChosen(null, this.sectorSelected); aitisiObj['3'] = new StudentSectorChosen(null, this.sectorSelected);
else if (aitisiObj[0]['currentclass'] === "Γ' Λυκείου" ) //else if (aitisiObj[0]['currentclass'] === "Γ' Λυκείου" )
else if (aitisiObj[0]['currentclass'] === "3" ) {
aitisiObj['3'] = new StudentCourseChosen(null, this.courseSelected); aitisiObj['3'] = new StudentCourseChosen(null, this.courseSelected);
}
//console.log(aitisiObj); //console.log(aitisiObj);
......
...@@ -44,6 +44,9 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -44,6 +44,9 @@ export class HelperDataService implements OnInit, OnDestroy {
this.authRole = loginInfoToken.auth_role; this.authRole = loginInfoToken.auth_role;
//this.minedu_userName = loginInfoToken.minedu_username; //this.minedu_userName = loginInfoToken.minedu_username;
//this.minedu_userPassword = loginInfoToken.minedu_userpassword; //this.minedu_userPassword = loginInfoToken.minedu_userpassword;
console.log("Auth details..");
console.log(this.authToken);
console.log(this.authRole);
return loginInfoToken; return loginInfoToken;
}, {}); }, {});
} }
...@@ -888,7 +891,7 @@ getCourses(username, userpassword, sectorid) { ...@@ -888,7 +891,7 @@ getCourses(username, userpassword, sectorid) {
getCapacityPerSchool(taxi, tomeas, specialit, schoolid) { getCapacityPerSchool(taxi, tomeas, specialit, schoolid) {
this.loginInfo$.getValue().forEach(loginInfoToken => { this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token; this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role; this.authRole = loginInfoToken.auth_role;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment