Commit 926fddbb authored by Open Source Developer's avatar Open Source Developer

transfer

parent 0bb5c7e3
......@@ -30,22 +30,53 @@ class SubmitedApplications extends ControllerBase
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$studentId = $request->headers->get('id');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
$userid = $epalUser -> id();
if ($studentId ==="")
{
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('epaluser_id' => $userid));
//$epalStudent = reset($epalStudents);
$i = 0;
if ($epalStudents) {
$list = array();
foreach ($epalStudents as $object) {
$list[] = array('name' => $object -> name ->value,
$list[] = array(
'id' => $object -> id(),
'name' => $object -> name ->value,
'studentsurname' => $object -> studentsurname ->value);
$i++;
}
return $this->respondWithStatus(
$list
, Response::HTTP_OK);
}
else {
return $this->respondWithStatus([
'message' => t("EPAL user not found"),
], Response::HTTP_FORBIDDEN);
}
}
else
{
$studentIdNew = intval($studentId) ;
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('epaluser_id' => $userid, 'id'=> $studentIdNew));
$i = 0;
if ($epalStudents) {
$list = array();
foreach ($epalStudents as $object) {
$list[] = array(
'id' => $object -> id(),
'name' => $object -> name ->value,
'studentsurname' => $object -> studentsurname ->value);
$i++;
}
......@@ -60,14 +91,16 @@ class SubmitedApplications extends ControllerBase
], Response::HTTP_FORBIDDEN);
}
}
} else {
return $this->respondWithStatus([
'message' => t(" user not found"),
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
}
}
......
......@@ -17,8 +17,10 @@ import { BehaviorSubject, Subscription } from 'rxjs/Rx';
@Component({
selector: 'submited-preview',
template: `
<div *ngFor="let userdata$ of submitedapplic$ | async">
{{userdata$.name}}
lalalalalal
<div *ngFor="let UserData$ of SubmitedApplic$ | async">
{{UserData$.name}}
<button type="button" (click)="studentpreview(UserData$.id)"> Λεπτομέρειες </button>
</div>
......@@ -28,32 +30,30 @@ import { BehaviorSubject, Subscription } from 'rxjs/Rx';
@Injectable() export default class SubmitedPreview implements OnInit , OnDestroy{
private submitedapplic$: BehaviorSubject<any>;
private submitedusersSub: Subscription;
public studentid = 1 ;
private SubmitedApplic$: BehaviorSubject<any>;
private SubmitedUsersSub: Subscription;
public StudentId;
constructor(private _hds: HelperDataService,
private activatedRoute: ActivatedRoute,
private router: Router )
{
this.submitedapplic$ = new BehaviorSubject([{}]);
this.SubmitedApplic$ = new BehaviorSubject([{}]);
}
ngOnDestroy()
{
if (this.submitedusersSub)
this.submitedusersSub.unsubscribe();
if (this.SubmitedUsersSub)
this.SubmitedUsersSub.unsubscribe();
}
ngOnInit() {
this.submitedusersSub = this._hds.getSubmittedPreviw().subscribe(this.submitedapplic$);
this.submitedapplic$.subscribe( function (x) { console.log("I am in next"); console.log(x); }, function (err) { console.log('Error: ' + err); }, function () { console.log('Completed='); } );
this.SubmitedUsersSub = this._hds.getSubmittedPreviw().subscribe(this.SubmitedApplic$);
console.log(this.SubmitedApplic$);
}
......@@ -61,10 +61,9 @@ import { BehaviorSubject, Subscription } from 'rxjs/Rx';
studentpreview()
studentpreview(StudentId)
{
console.log(this.studentid);
this.router.navigate(['/submited-person', { id: this.studentid}]);
this.router.navigate(['/submited-person', {'id':StudentId}]);
}
......
import { Component, OnInit, ElementRef, ViewChild} from "@angular/core";
import { Component, OnInit, OnDestroy,ElementRef, ViewChild} from "@angular/core";
let jsPDF = require('jspdf');
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
......@@ -15,61 +15,66 @@ import { BehaviorSubject, Subscription } from 'rxjs/Rx';
@Component({
selector: 'submited-person',
selector: 'submited-student',
template: `
<h5 style="margin-top: 20px; line-height: 2em; ">Στοιχεία Μαθητή</h5>
<div *ngFor="let userdata$ of submitedapplic$ | async; ">
<ul class="list-group left-side-view" style="margin-bottom: 20px;">
<li class="list-group-item active">
Μαθητής: {{userdata$.name}}
</li>
</ul>
<div id = "target">
<div *ngFor="let StudentDetails$ of SubmitedDetails$ | async">
{{StudentDetails$.name}}
</div>
</div>
<button type="button" (click)="createPdf()">Εξαγωγή σε PDF</button>
`
})
@Injectable() export default class SubmitedPerson implements OnInit {
@Injectable() export default class SubmitedStudentDetails implements OnInit , OnDestroy{
public html2canvas: any;
private submitedapplic$: BehaviorSubject<any>;
private submitedusers$: Subscription;
public userid: number;
public authToken : string ;
private SubmitedDetails$: BehaviorSubject<any>;
private SubmitedDetailsSub: Subscription;
public StudentId: Number;
constructor(private _hds: HelperDataService,
public http: Http,
private _ngRedux: NgRedux<IAppState>,
private activatedRoute: ActivatedRoute )
private route: ActivatedRoute,
private router: Router )
{
this.submitedapplic$ = new BehaviorSubject({});
this.SubmitedDetails$ = new BehaviorSubject([{}]);
}
ngOnDestroy()
{
if (this.SubmitedDetailsSub)
this.SubmitedDetailsSub.unsubscribe();
}
ngOnInit() {
this.activatedRoute.queryParams.subscribe((params: Params) => {
if (params) {
this.userid = 1;
console.log("userid", this.userid, this.authToken);
}
});
this.getApplicationId();
this.SubmitedDetailsSub = this._hds.getStudentDetails(this.StudentId).subscribe(this.SubmitedDetails$);
}
getApplicationId()
{
this.route.params.subscribe(params => {this.StudentId = params['id'];});
}
createPdf()
{
html2canvas(document.getElementById("target")).then(function(canvas)
{
var img = canvas.toDataURL();
var doc = new jsPDF('p', 'mm');
doc.addImage(img, 'PNG', 10, 10);
doc.save('applications.pdf');
});
}
}
\ No newline at end of file
......@@ -335,21 +335,37 @@ transformUserSchema(userlogin:any,oauthtoken:string, oauthrole:string){
getSubmittedPreviw() {
this.loginInfo$.forEach(loginInfoToken => {
this.authToken = loginInfoToken.get(0).auth_token;
});
let headers = new Headers({
"Content-Type": "application/json",
"id": ""
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/subapplic`, options )
.map(response => response.json());
}
getStudentDetails(headerid)
{
let headerIdNew = headerid.toString();
this.loginInfo$.forEach(loginInfoToken => {
this.authToken = loginInfoToken.get(0).auth_token;
});
let headers = new Headers({
"Content-Type": "application/json",
"id": headerIdNew
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/subapplic`, options )
.map(response => response.json());
}
}
}
"use strict";
const immutable_1 = require("immutable");
// export const INITIAL_STATE = List<ICourseField>([new CourseFieldRecord({})]);
exports.INITIAL_STATE = immutable_1.List();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291cnNlZmllbGRzLmluaXRpYWwtc3RhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb3Vyc2VmaWVsZHMuaW5pdGlhbC1zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEseUNBQWlDO0FBR2pDLGdGQUFnRjtBQUNuRSxRQUFBLGFBQWEsR0FBRyxnQkFBSSxFQUFnQixDQUFDIn0=
\ No newline at end of file
"use strict";
const coursefields_initial_state_1 = require("./coursefields.initial-state");
const immutable_1 = require("immutable");
const constants_1 = require("../../constants");
function courseFieldsReducer(state = coursefields_initial_state_1.INITIAL_STATE, action) {
switch (action.type) {
case constants_1.COURSEFIELDS_RECEIVED:
let newCourseFields = Array();
let i = 0;
action.payload.courseFields.forEach(courseField => {
newCourseFields.push({ id: courseField.id, name: courseField.name, selected: false });
i++;
});
return immutable_1.Seq(newCourseFields).map(n => n).toList();
case constants_1.COURSEFIELDS_SELECTED_SAVE:
let selectedCourseFields = Array();
let ind = 0;
state.forEach(courseField => {
selectedCourseFields.push({ id: courseField.id, name: courseField.name, selected: action.payload.courseFieldsSelected[ind] });
ind++;
});
return immutable_1.Seq(selectedCourseFields).map(n => n).toList();
default: return state;
}
}
exports.courseFieldsReducer = courseFieldsReducer;
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291cnNlZmllbGRzLnJlZHVjZ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xXQUFXLENBQUMsSUFBSSxFQUFFLFFBQVEsRUFBRSxNQUFNLENBQUMsT0FBTyxDQUFDLG9CQUFvQixDQUFDLEdBQUcsQ0FBQyxFQUFDLENBQUMsQ0FBQztnQkFDMUksR0FBRyxFQUFFLENBQUM7WUFDVixDQUFDLENBQUMsQ0FBQztZQUNILE1BQU0sQ0FBQyxlQUFHLENBQUMsb0JBQW9CLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFDO1FBQzFELFNBQVMsTUFBTSxDQUFDLEtBQUssQ0FBQztJQUN4QixDQUFDO0FBQ0gsQ0FBQztBQXBCRCxrREFvQkM7QUFBQSxDQUFDIn0=
\ No newline at end of file
"use strict";
function deimmutifyCourseFields(state) {
let fetchedCourseFields = new Array();
state.forEach(courseField => {
fetchedCourseFields.push({ id: courseField.id, name: courseField.name, selected: courseField.selected });
});
return fetchedCourseFields;
}
exports.deimmutifyCourseFields = deimmutifyCourseFields;
;
/* export function reimmutifyCourseFields(plain): ICourseFields {
return List<ICourseField>(plain ? plain.map(CourseFieldRecord) : []);
} */
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291cnNlZmllbGRzLnRyYW5zZm9ybWVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNvdXJzZWZpZWxkcy50cmFuc2Zvcm1lcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUVBLGdDQUF1QyxLQUFvQjtJQUN2RCxJQUFJLG1CQUFtQixHQUFHLElBQUksS0FBSyxFQUFFLENBQUM7SUFDdEMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxXQUFXO1FBQ3JCLG1CQUFtQixDQUFDLElBQUksQ0FBZSxFQUFDLEVBQUUsRUFBRSxXQUFXLENBQUMsRUFBRSxFQUFFLElBQUksRUFBRSxXQUFXLENBQUMsSUFBSSxFQUFFLFFBQVEsRUFBRSxXQUFXLENBQUMsUUFBUSxFQUFDLENBQUMsQ0FBQztJQUN6SCxDQUFDLENBQUMsQ0FBQztJQUNILE1BQU0sQ0FBQyxtQkFBbUIsQ0FBQztBQUMvQixDQUFDO0FBTkQsd0RBTUM7QUFBQSxDQUFDO0FBRUY7O0lBRUkifQ==
\ No newline at end of file
"use strict";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291cnNlZmllbGRzLnR5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY291cnNlZmllbGRzLnR5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
\ No newline at end of file
"use strict";
const coursefields_reducer_1 = require("./coursefields.reducer");
exports.courseFieldsReducer = coursefields_reducer_1.courseFieldsReducer;
const coursefields_transformers_1 = require("./coursefields.transformers");
exports.deimmutifyCourseFields = coursefields_transformers_1.deimmutifyCourseFields;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsaUVBQTZEO0FBTTNELHlFQUFtQjtBQUxyQiwyRUFBcUU7QUFNbkUsb0ZBQXNCIn0=
\ No newline at end of file
"use strict";
const immutable_1 = require("immutable");
exports.CRITERIA_INITIAL_STATE = immutable_1.List();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JpdGVyaWEuaW5pdGlhbC1zdGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNyaXRlcmlhLmluaXRpYWwtc3RhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHlDQUFpQztBQUlwQixRQUFBLHNCQUFzQixHQUFHLGdCQUFJLEVBQWEsQ0FBQyJ9
\ No newline at end of file
"use strict";
const criteria_initial_state_1 = require("./criteria.initial-state");
const immutable_1 = require("immutable");
const constants_1 = require("../../constants");
function criteriaReducer(state = criteria_initial_state_1.CRITERIA_INITIAL_STATE, action) {
switch (action.type) {
case constants_1.CRITERIA_RECEIVED:
let newCriter = Array();
let i = 0;
action.payload.criteria.forEach(criteria => {
newCriter.push({ id: criteria.id, name: criteria.name, mutual_disabled_id: criteria.mutual_disabled_id, selected: false });
i++;
});
return immutable_1.Seq(newCriter).map(n => n).toList();
case constants_1.CRITERIA_SAVE:
let criter = Array();
let ind = 0;
state.forEach(criteria => {
criter.push({ id: criteria.id, name: criteria.name, mutual_disabled_id: criteria.mutual_disabled_id, selected: action.payload.criter[0][ind] });
ind++;
});
return immutable_1.Seq(criter).map(n => n).toList();
default: return state;
}
}
exports.criteriaReducer = criteriaReducer;
;
/*
case COURSEFIELDS_SELECTED_SAVE:
let selectedCourseFields = Array<ICourseField>();
let ind=0;
state.forEach(courseField => {
selectedCourseFields.push(<ICourseField>{id: courseField.id, name: courseField.name, selected: action.payload.courseFieldsSelected[ind]});
ind++;
});
return Seq(selectedCourseFields).map(n => n).toList();
default: return state;
*/
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JpdGVyaWEucmVkdWNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNyaXRlcmlhLnJlZHVjZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLHFFQUFrRTtBQUNsRSx5Q0FBZ0M7QUFFaEMsK0NBR3lCO0FBRXpCLHlCQUFnQyxRQUFpQiwrQ0FBc0IsRUFBRSxNQUFNO0lBQzdFLE1BQU0sQ0FBQyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO1FBQ3BCLEtBQUssNkJBQWlCO1lBQ2xCLElBQUksU0FBUyxHQUFHLEtBQUssRUFBYSxDQUF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DQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUM1QyxTQUFTLE1BQU0sQ0FBQyxLQUFLLENBQUM7SUFDeEIsQ0FBQztBQUNILENBQUM7QUF0QkQsMENBc0JDO0FBQUEsQ0FBQztBQUNGOzs7Ozs7Ozs7O0VBVUUifQ==
\ No newline at end of file
"use strict";
function deimmutifyCriteria(state) {
let fetchedCriteria = new Array();
state.forEach(criteria => {
fetchedCriteria.push({ id: criteria.id, name: criteria.name, mutual_disabled_id: criteria.mutual_disabled_id, selected: criteria.selected,
});
});
return fetchedCriteria;
}
exports.deimmutifyCriteria = deimmutifyCriteria;
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JpdGVyaWEudHJhbnNmb3JtZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY3JpdGVyaWEudHJhbnNmb3JtZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQSw0QkFBbUMsS0FBYztJQUM3QyxJQUFJLGVBQWUsR0FBRyxJQUFJLEtBQUssRUFBRSxDQUFDO0lBRWxDLEtBQUssQ0FBQyxPQUFPLENBQUMsUUFBUTtRQUNsQixlQUFlLENBQUMsSUFBSSxDQUFZLEVBQUMsRUFBRSxFQUFFLFFBQVEsQ0FBQyxFQUFFLEVBQUUsSUFBSSxFQUFFLFFBQVEsQ0FBQyxJQUFJLEVBQUcsa0JBQWtCLEVBQUUsUUFBUSxDQUFDLGtCQUFrQixFQUFFLFFBQVEsRUFBRSxRQUFRLENBQUMsUUFBUTtTQUNuSixDQUFDLENBQUM7SUFDUCxDQUFDLENBQUMsQ0FBQztJQUNILE1BQU0sQ0FBQyxlQUFlLENBQUM7QUFDM0IsQ0FBQztBQVJELGdEQVFDO0FBQUEsQ0FBQyJ9
\ No newline at end of file
"use strict";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JpdGVyaWEudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjcml0ZXJpYS50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
\ No newline at end of file
"use strict";
const criteria_reducer_1 = require("./criteria.reducer");
exports.criteriaReducer = criteria_reducer_1.criteriaReducer;
const criteria_transformers_1 = require("./criteria.transformers");
exports.deimmutifyCriteria = criteria_transformers_1.deimmutifyCriteria;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EseURBQXFEO0FBTW5ELDZEQUFlO0FBTGpCLG1FQUE2RDtBQU0zRCx3RUFBa0IifQ==
\ No newline at end of file
"use strict";
const immutable_1 = require("immutable");
exports.EPALCLASSES_INITIAL_STATE = immutable_1.List();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXBhbGNsYXNzZXMuaW5pdGlhbC1zdGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImVwYWxjbGFzc2VzLmluaXRpYWwtc3RhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHlDQUFpQztBQUlwQixRQUFBLHlCQUF5QixHQUFHLGdCQUFJLEVBQWMsQ0FBQyJ9
\ No newline at end of file
"use strict";
const epalclasses_initial_state_1 = require("./epalclasses.initial-state");
const immutable_1 = require("immutable");
const constants_1 = require("../../constants");
function epalclassesReducer(state = epalclasses_initial_state_1.EPALCLASSES_INITIAL_STATE, action) {
switch (action.type) {
case constants_1.EPALCLASSES_SAVE:
let selectedEpalClasses = Array();
selectedEpalClasses.push({ name: action.payload.epalClasses.name });
return immutable_1.Seq(selectedEpalClasses).map(n => n).toList();
default: return state;
}
}
exports.epalclassesReducer = epalclassesReducer;
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXBhbGNsYXNzZXMucmVkdWNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImVwYWxjbGFzc2VzLnJlZHVjZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLDJFQUF3RTtBQUN4RSx5Q0FBZ0M7QUFFaEMsK0NBQW1EO0FBRW5ELDRCQUFtQyxRQUFzQixxREFBeUIsRUFBRSxNQUFNO0lBR3hGLE1BQU0sQ0FBQyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO1FBR3BCLEtBQUssNEJBQWdCO1lBQ2pCLElBQUksbUJBQW1CLEdBQUcsS0FBSyxFQUFjLENBQUM7WUFFOUMsbUJBQW1CLENBQUMsSUFBSSxDQUFhLEVBQUUsSUFBSSxFQUFFLE1BQU0sQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLElBQUksRUFBQyxDQUFDLENBQUM7WUFHL0UsTUFBTSxDQUFDLGVBQUcsQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsTUFBTSxFQUFFLENBQUM7UUFDekQsU0FBUyxNQUFNLENBQUMsS0FBSyxDQUFDO0lBQ3hCLENBQUM7QUFDSCxDQUFDO0FBZkQsZ0RBZUM7QUFBQSxDQUFDIn0=
\ No newline at end of file
"use strict";
function deimmutifyEpalClasses(state) {
let fetchedEpalClasses = new Array();
state.forEach(epalclass => {
fetchedEpalClasses.push({ name: epalclass.name });
});
return fetchedEpalClasses;
}
exports.deimmutifyEpalClasses = deimmutifyEpalClasses;
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXBhbGNsYXNzZXMudHJhbnNmb3JtZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXBhbGNsYXNzZXMudHJhbnNmb3JtZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQSwrQkFBc0MsS0FBbUI7SUFDckQsSUFBSSxrQkFBa0IsR0FBRyxJQUFJLEtBQUssRUFBRSxDQUFDO0lBQ3JDLEtBQUssQ0FBQyxPQUFPLENBQUMsU0FBUztRQUNuQixrQkFBa0IsQ0FBQyxJQUFJLENBQWEsRUFBQyxJQUFJLEVBQUUsU0FBUyxDQUFDLElBQUksRUFBQyxDQUFDLENBQUM7SUFDaEUsQ0FBQyxDQUFDLENBQUM7SUFDSCxNQUFNLENBQUMsa0JBQWtCLENBQUM7QUFDOUIsQ0FBQztBQU5ELHNEQU1DO0FBQUEsQ0FBQyJ9
\ No newline at end of file
"use strict";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXBhbGNsYXNzZXMudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJlcGFsY2xhc3Nlcy50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
\ No newline at end of file
"use strict";
const epalclasses_reducer_1 = require("./epalclasses.reducer");
exports.epalclassesReducer = epalclasses_reducer_1.epalclassesReducer;
const epalclasses_transformers_1 = require("./epalclasses.transformers");
exports.deimmutifyEpalClasses = epalclasses_transformers_1.deimmutifyEpalClasses;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsK0RBQTJEO0FBTXpELHNFQUFrQjtBQUxwQix5RUFBbUU7QUFNakUsaUZBQXFCIn0=
\ No newline at end of file
"use strict";
// import * as persistState from 'redux-localstorage';
const createLogger = require("redux-logger");
const store_1 = require("./store");
exports.rootReducer = store_1.rootReducer;
exports.middleware = [
createLogger({
level: 'info',
collapsed: true,
stateTransformer: store_1.deimmutify
})
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsc0RBQXNEO0FBQ3RELDZDQUE2QztBQUM3QyxtQ0FBNkQ7QUFZM0QsMENBQVc7QUFvQkEsUUFBQSxVQUFVLEdBQUc7SUFDeEIsWUFBWSxDQUFDO1FBQ1gsS0FBSyxFQUFFLE1BQU07UUFDYixTQUFTLEVBQUUsSUFBSTtRQUNmLGdCQUFnQixFQUFFLGtCQUFVO0tBQzdCLENBQUM7Q0FDSCxDQUFDIn0=
\ No newline at end of file
"use strict";
const logininfo_reducer_1 = require("./logininfo.reducer");
exports.loginInfoReducer = logininfo_reducer_1.loginInfoReducer;
const logininfo_transformers_1 = require("./logininfo.transformers");
exports.deimmutifyLoginInfo = logininfo_transformers_1.deimmutifyLoginInfo;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsMkRBQXVEO0FBTXJELGdFQUFnQjtBQUxsQixxRUFBK0Q7QUFNN0QsMkVBQW1CIn0=
\ No newline at end of file
"use strict";
const immutable_1 = require("immutable");
// export const INITIAL_STATE = List<ICourseField>([new CourseFieldRecord({})]);
exports.LOGININFO_INITIAL_STATE = immutable_1.List();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW5pbmZvLmluaXRpYWwtc3RhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJsb2dpbmluZm8uaW5pdGlhbC1zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEseUNBQWlDO0FBR2pDLGdGQUFnRjtBQUNuRSxRQUFBLHVCQUF1QixHQUFHLGdCQUFJLEVBQW1CLENBQUMifQ==
\ No newline at end of file
"use strict";
const logininfo_initial_state_1 = require("./logininfo.initial-state");
const immutable_1 = require("immutable");
const constants_1 = require("../../constants");
function loginInfoReducer(state = logininfo_initial_state_1.LOGININFO_INITIAL_STATE, action) {
switch (action.type) {
case constants_1.LOGININFO_SAVE:
let loginInfoTokens = Array();
let i = 0;
action.payload.loginInfos.forEach(loginInfo => {
loginInfoTokens.push({ auth_token: loginInfo.auth_token, auth_role: loginInfo.auth_role, cu_name: loginInfo.cu_name });
i++;
});
return immutable_1.Seq(loginInfoTokens).map(n => n).toList();
case constants_1.LOGININFO_INIT:
return logininfo_initial_state_1.LOGININFO_INITIAL_STATE;
default:
return state;
}
}
exports.loginInfoReducer = loginInfoReducer;
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW5pbmZvLnJlZHVjZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJsb2dpbmluZm8ucmVkdWNlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsdUVBQW9FO0FBQ3BFLHlDQUFnQztBQUVoQywrQ0FHeUI7QUFFekIsMEJBQWlDLFFBQW9CLGlEQUF1QixFQUFFLE1BQU07SUFDbEYsTUFBTSxDQUFDLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDcEIsS0FBSywwQkFBYztZQUNyQixJQUFJLGVBQWUsR0FBRyxLQUFLLEVBQW1CLENBQUM7WUFDekMsSUFBSSxDQUFDLEdBQUMsQ0FBQyxDQUFDO1lBQ1IsTUFBTSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLFNBQVM7Z0JBQ3ZDLGVBQWUsQ0FBQyxJQUFJLENBQWtCLEVBQUMsVUFBVSxFQUFFLFNBQVMsQ0FBQyxVQUFVLEVBQUUsU0FBUyxFQUFFLFNBQVMsQ0FBQyxTQUFTLEVBQUUsT0FBTyxFQUFFLFNBQVMsQ0FBQyxPQUFPLEVBQUMsQ0FBQyxDQUFDO2dCQUN0SSxDQUFDLEVBQUUsQ0FBQztZQUNSLENBQUMsQ0FBQyxDQUFDO1lBQ0gsTUFBTSxDQUFDLGVBQUcsQ0FBQyxlQUFlLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFDO1FBRXJELEtBQUssMEJBQWM7WUFDZixNQUFNLENBQUMsaURBQXVCLENBQUM7UUFDbkM7WUFDSSxNQUFNLENBQUMsS0FBSyxDQUFDO0lBQ25CLENBQUM7QUFDSCxDQUFDO0FBaEJELDRDQWdCQztBQUFBLENBQUMifQ==
\ No newline at end of file
"use strict";
function deimmutifyLoginInfo(state) {
let fetchedLoginInfoTokens = new Array();
state.forEach(loginInfoToken => {
fetchedLoginInfoTokens.push({ auth_token: loginInfoToken.auth_token, auth_role: loginInfoToken.auth_role, cu_name: loginInfoToken.cu_name });
});
return fetchedLoginInfoTokens;
}
exports.deimmutifyLoginInfo = deimmutifyLoginInfo;
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW5pbmZvLnRyYW5zZm9ybWVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImxvZ2luaW5mby50cmFuc2Zvcm1lcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUVBLDZCQUFvQyxLQUFpQjtJQUNqRCxJQUFJLHNCQUFzQixHQUFHLElBQUksS0FBSyxFQUFFLENBQUM7SUFDekMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxjQUFjO1FBQ3hCLHNCQUFzQixDQUFDLElBQUksQ0FBa0IsRUFBQyxVQUFVLEVBQUUsY0FBYyxDQUFDLFVBQVUsRUFBRSxTQUFTLEVBQUUsY0FBYyxDQUFDLFNBQVMsRUFBRSxPQUFPLEVBQUUsY0FBYyxDQUFDLE9BQU8sRUFBQyxDQUFDLENBQUM7SUFDaEssQ0FBQyxDQUFDLENBQUM7SUFDSCxNQUFNLENBQUMsc0JBQXNCLENBQUM7QUFDbEMsQ0FBQztBQU5ELGtEQU1DO0FBQUEsQ0FBQyJ9
\ No newline at end of file
"use strict";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW5pbmZvLnR5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsibG9naW5pbmZvLnR5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
\ No newline at end of file
"use strict";
const regionschools_reducer_1 = require("./regionschools.reducer");
exports.regionSchoolsReducer = regionschools_reducer_1.regionSchoolsReducer;
const regionschools_transformers_1 = require("./regionschools.transformers");
exports.deimmutifyRegionSchools = regionschools_transformers_1.deimmutifyRegionSchools;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsbUVBQStEO0FBTzdELDRFQUFvQjtBQU50Qiw2RUFBdUU7QUFPckUsdUZBQXVCIn0=
\ No newline at end of file
"use strict";
const immutable_1 = require("immutable");
// export const INITIAL_STATE = List<ICourseField>([new CourseFieldRecord({})]);
exports.REGION_SCHOOLS_INITIAL_STATE = immutable_1.List();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnaW9uc2Nob29scy5pbml0aWFsLXN0YXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsicmVnaW9uc2Nob29scy5pbml0aWFsLXN0YXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSx5Q0FBaUM7QUFHakMsZ0ZBQWdGO0FBQ25FLFFBQUEsNEJBQTRCLEdBQUcsZ0JBQUksRUFBVyxDQUFDIn0=
\ No newline at end of file
"use strict";
const regionschools_initial_state_1 = require("./regionschools.initial-state");
const immutable_1 = require("immutable");
const constants_1 = require("../../constants");
function regionSchoolsReducer(state = regionschools_initial_state_1.REGION_SCHOOLS_INITIAL_STATE, action) {
switch (action.type) {
case constants_1.REGIONSCHOOLS_RECEIVED:
let newRegions = Array();
let i = 0;
action.payload.regions.forEach(region => {
newRegions.push({ region_id: region.region_id, region_name: region.region_name, epals: Array() });
region.epals.forEach(epal => {
newRegions[i].epals.push({ epal_id: epal.epal_id, epal_name: epal.epal_name, globalIndex: epal.globalIndex, selected: epal.selected, order_id: epal.order_id });
});
i++;
});
return immutable_1.Seq(newRegions).map(n => n).toList();
case constants_1.REGIONSCHOOLS_SELECTED_SAVE:
let ind = 0;
state.forEach(region => {
if (ind === action.payload.rIndex) {
region.epals[action.payload.sIndex].selected = action.payload.checked;
return state.withMutations(function (list) {
list.set(ind++, region);
});
}
ind++;
});
return state;
case constants_1.REGIONSCHOOLS_ORDER_SAVE:
let regionsWithOrders = Array();
let idx = 0, k = 0;