minor changes

parent 453e9f33
......@@ -10,6 +10,7 @@ import { Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state';
import { PDE_ROLE, DIDE_ROLE } from '../../constants';
import {
FormBuilder,
......@@ -38,7 +39,7 @@ import { API_ENDPOINT } from '../../app.settings';
<br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(2)" [hidden]="minedu_userName == ''" >
<i class="fa fa-file-text"></i>
Συνολική Πληρότητα σχολικών μονάδων ΕΠΑΛ ανά τάξη
Συνολική Πληρότητα σχολικών μονάδων ΕΠΑΛ ανά τάξη
</button>
<br><br>
<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';
state.loginInfo.reduce(({}, loginInfoToken) => {
this.minedu_userName = loginInfoToken.minedu_username;
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;
......
......@@ -12,6 +12,7 @@ import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { Ng2SmartTableModule, LocalDataSource } from 'ng2-smart-table';
import {reportsSchema, TableColumn} from './reports-schema';
import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state';
import { PDE_ROLE, DIDE_ROLE } from '../../constants';
import {csvCreator} from './csv-creator';
import {
......@@ -31,11 +32,10 @@ import { API_ENDPOINT } from '../../app.settings';
<div>
<!--
<div
class = "loading" *ngIf="validCreator == 0" >
</div>
-->
<form [formGroup]="formGroup" #form>
......@@ -45,8 +45,8 @@ import { API_ENDPOINT } from '../../app.settings';
> Φίλτρο Επιλογής Περιφ/κής Δ/νσης - Δ/νσης Εκπ/σης - Σχολείου
</button>
<div class="col-md-11 offset-md-1">
<label *ngIf = "enableRegionFilter"> Περιφερειακή Διεύθυνση </label>
<select #regsel class="form-control" (change)="checkregion(regsel)" *ngIf = "enableRegionFilter" formControlName="region">
<label *ngIf = "enableRegionFilter && userLoggedIn == 'supervisor'"> Περιφερειακή Διεύθυνση </label>
<select #regsel class="form-control" (change)="checkregion(regsel)" *ngIf = "enableRegionFilter" [value] = "regionSelected" [hidden] = "userLoggedIn != 'supervisor'" formControlName="region">
<option value="0"></option>
<option *ngFor="let RegionSelection$ of RegionSelections$ | async; let i=index" [value] = "RegionSelection$.id"> {{RegionSelection$.name}} </option>
</select>
......@@ -158,6 +158,7 @@ import { API_ENDPOINT } from '../../app.settings';
private courseSelected: number;
private enableRegionFilter: boolean;
private enableCourseFilter: boolean;
private userLoggedIn: string;
columnMap: Map<string,TableColumn> = new Map<string,TableColumn>();
@Input() settings: any;
......@@ -214,7 +215,28 @@ import { API_ENDPOINT } from '../../app.settings';
state.loginInfo.reduce(({}, loginInfoToken) => {
this.minedu_userName = loginInfoToken.minedu_username;
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;
......@@ -346,13 +368,14 @@ toggleCourseFilter() {
checkregion(regionId) {
this.regionSelected = regionId.value;
if (typeof regionId.value != "undefined")
this.regionSelected = regionId.value;
this.adminAreaSelected = 0;
this.schSelected = 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);
},
error => {
......@@ -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);
},
error => {
......
......@@ -44,13 +44,12 @@
</li>
</div>
<!--
<div *ngIf="(loginInfo$ | async).size > 0" 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>
</div>
-->
</div>
</ul>
......
......@@ -197,10 +197,15 @@ import {AppSettings} from '../../app.settings';
criteriaObj[i] =new StudentCriteriaChosen(null, null, this.studentCriteria[i]);
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);
else if (aitisiObj[0]['currentclass'] === "Γ' Λυκείου" )
//else if (aitisiObj[0]['currentclass'] === "Γ' Λυκείου" )
else if (aitisiObj[0]['currentclass'] === "3" ) {
aitisiObj['3'] = new StudentCourseChosen(null, this.courseSelected);
}
//console.log(aitisiObj);
......
......@@ -44,6 +44,9 @@ export class HelperDataService implements OnInit, OnDestroy {
this.authRole = loginInfoToken.auth_role;
//this.minedu_userName = loginInfoToken.minedu_username;
//this.minedu_userPassword = loginInfoToken.minedu_userpassword;
console.log("Auth details..");
console.log(this.authToken);
console.log(this.authRole);
return loginInfoToken;
}, {});
}
......@@ -888,7 +891,7 @@ getCourses(username, userpassword, sectorid) {
getCapacityPerSchool(taxi, tomeas, specialit, schoolid) {
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
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