updated to latest versions. Fixing subscriptioning bug(WIP)

parent 8074c820
......@@ -12,57 +12,51 @@
"typings": "rimraf typings/ && typings install"
},
"devDependencies": {
"@types/d3": "^4.8.0",
"@types/node": "^6.0.48",
"@types/redux-logger": "^3.0.0",
"@types/systemjs": "^0.20.2",
"angular2-router-loader": "^0.3.4",
"angular2-template-loader": "^0.6.0",
"babel-core": "^6.20.0",
"babel-loader": "^6.2.9",
"babel-preset-env": "^1.1.4",
"babel-preset-es2015": "^6.18.0",
"babel-preset-stage-1": "^6.16.0",
"babili-webpack-plugin": "^0.1.1",
"bootstrap-loader": "^2.0.0-beta.20",
"css-loader": "^0.25.0",
"node-sass": "^4.5.0",
"redux-logger": "^2.7.4",
"resolve-url-loader": "^1.6.1",
"sass-loader": "^4.1.1",
"style-loader": "^0.13.1",
"to-string-loader": "^1.1.5",
"tslint": "^3.15.1",
"tslint-loader": "^2.1.5",
"typescript": "^2.0.10",
"url-loader": "^0.5.7",
"webpack": "^1.14.0",
"webpack-cleanup-plugin": "^0.5.1",
"webpack-closure-compiler": "^2.1.4",
"webpack-dashboard": "^0.2.0",
"webpack-dev-server": "^1.16.2"
},
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/platform-server": "^4.0.0",
"@angular/router": "^4.0.0",
"@angular-redux/store": "^6.5.7",
"@angular/animations": "^4.3.1",
"@angular/common": "^4.3.1",
"@angular/compiler": "^4.3.1",
"@angular/compiler-cli": "^4.3.1",
"@angular/core": "^4.3.1",
"@angular/forms": "^4.3.1",
"@angular/http": "^4.3.1",
"@angular/platform-browser": "^4.3.1",
"@angular/platform-browser-dynamic": "^4.3.1",
"@angular/platform-server": "^4.3.1",
"@angular/router": "^4.3.1",
"@ngui/auto-complete": "^0.13.3",
"@types/d3": "^4.10.0",
"@types/file-saver": "0.0.1",
"@types/jquery": "^2.0.48",
"@types/node": "^6.0.60",
"@types/node": "^6.0.85",
"@types/node-sass": "^3.10.32",
"babel-polyfill": "^6.20.0",
"babel-core": "^6.25.0",
"babel-loader": "^6.4.1",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"bootstrap": "^4.0.0-alpha.6",
"core-js": "^2.4.1",
"css-loader": "^0.25.0",
"d3": "^4.4.0",
"d3": "^4.10.0",
"es6-promise": "^4.0.5",
"es6-shim": "^0.35.0",
"file-loader": "^0.9.0",
......@@ -72,23 +66,24 @@
"html-webpack-plugin": "^2.24.1",
"immutable": "^3.8.1",
"jquery": "^3.2.1",
"mydatepicker": "^2.0.13",
"ng2-redux": "^5.1.0",
"mydatepicker": "^2.0.26",
"ng2-smart-table": "^1.2.1",
"ngx-cookie": "^1.0.0",
"ngx-uploader": "^2.2.5",
"raw-loader": "^0.5.1",
"redux": "^3.6.0",
"redux": "^3.7.2",
"redux-logger": "^2.10.2",
"reflect-metadata": "0.1.8",
"rimraf": "^2.4.3",
"roboto-fontface": "^0.7.0",
"roboto-fontface": "^0.7.1",
"rxjs": "^5.0.0-rc.3",
"style-loader": "^0.13.1",
"ts-loader": "^1.2.1",
"typed-immutable-record": "0.0.6",
"typescript": "^2.4.1",
"typescript": "^2.4.2",
"url-loader": "^0.5.7",
"webpack": "^1.13.3",
"zone.js": ">=0.6.26"
"webpack-closure-compiler": "^2.1.5",
"zone.js": "^0.8.14"
}
}
import { COURSEFIELDS_RECEIVED, COURSEFIELDS_SELECTED_SAVE } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
......
import { CRITERIA_RECEIVED, CRITERIA_SAVE, CRITERIA_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
......
import { EPALCLASSES_SAVE } from '../constants';
import { EPALCLASSES_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
......
import { LOGININFO_SAVE, PROFILE_SAVE, LOGININFO_RECEIVED, STATEMENTAGREE_SAVE } from '../constants';
import { LOGININFO_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
......
import { REGIONSCHOOLS_RECEIVED, REGIONSCHOOLS_SELECTED_SAVE, REGIONSCHOOLS_ORDER_SAVE, REGIONSCHOOLS_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
......
import { SECTORCOURSES_RECEIVED, SECTORCOURSES_SELECTED_SAVE, SECTORCOURSES_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
......
import { SECTORFIELDS_RECEIVED, SECTORFIELDS_SELECTED_SAVE, SECTORFIELDS_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
......
import { STUDENTDATAFIELDS_SAVE, STUDENTDATAFIELDS_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
//import { UserDataService } from '../services/user-data-service';
......
......@@ -3,7 +3,7 @@ import "babel-polyfill";
import "core-js/es6";
import "core-js/es7/reflect";
import { NgModule } from "@angular/core";
import { NgReduxModule, DevToolsExtension, NgRedux } from "ng2-redux";
import { NgReduxModule, DevToolsExtension, NgRedux } from "@angular-redux/store";
import {BrowserModule} from "@angular/platform-browser";
import { CookieModule } from "ngx-cookie";
import { MyDatePickerModule } from "mydatepicker";
......
......@@ -4,7 +4,7 @@ import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import {Observable} from "rxjs/Observable";
import {Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
......
......@@ -4,7 +4,7 @@ import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import {Observable} from "rxjs/Observable";
import {Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
......
......@@ -3,7 +3,7 @@ import {Router} from "@angular/router";
import { Injectable } from "@angular/core";
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { IAppState } from "../../store/store";
import { ILoginInfo, ILoginInfoToken } from "../../store/logininfo/logininfo.types";
import { HelperDataService } from "../../services/helper-data-service";
......
......@@ -2,7 +2,7 @@ import {Router, ActivatedRoute, Params} from '@angular/router';
import {OnInit, Component} from '@angular/core';
import { LoginInfoActions } from '../actions/logininfo.actions';
import { ILoginInfo } from '../store/logininfo/logininfo.types';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { Observable } from 'rxjs/Rx';
import { IAppState } from '../store/store';
import { HelperDataService } from '../services/helper-data-service';
......
......@@ -3,7 +3,7 @@ import { AppSettings } from "../../app.settings";
import { HelperDataService } from "../../services/helper-data-service";
import { Observable } from "rxjs/Observable";
import { Http, Headers, RequestOptions } from "@angular/http";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { IAppState } from "../../store/store";
import { Router, ActivatedRoute, Params } from "@angular/router";
import { BehaviorSubject, Subscription } from "rxjs/Rx";
......
......@@ -3,7 +3,7 @@ import { AppSettings } from "../../app.settings";
import { HelperDataService } from "../../services/helper-data-service";
import {Observable} from "rxjs/Observable";
import {Http, Headers, RequestOptions} from "@angular/http";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { IAppState } from "../../store/store";
import {Router, ActivatedRoute, Params} from "@angular/router";
import { BehaviorSubject, Subscription } from "rxjs/Rx";
......
......@@ -4,7 +4,7 @@ import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import { Observable } from "rxjs/Observable";
import { Http, Headers, RequestOptions } from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
......
......@@ -4,7 +4,7 @@ import { AppSettings } from "../../app.settings";
import { HelperDataService } from "../../services/helper-data-service";
import { Observable} from "rxjs/Observable";
import { Http, Headers, RequestOptions} from "@angular/http";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { IAppState } from "../../store/store";
import { Router, ActivatedRoute, Params} from "@angular/router";
import { BehaviorSubject, Subscription } from "rxjs/Rx";
......
......@@ -4,7 +4,7 @@ import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import { Observable} from "rxjs/Observable";
import { Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
......
......@@ -4,7 +4,7 @@ import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import { Observable} from "rxjs/Observable";
import { Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
......
......@@ -4,7 +4,7 @@ import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import { Observable} from "rxjs/Observable";
import { Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
......
......@@ -4,7 +4,7 @@ import { AppSettings } from "../../app.settings";
import { HelperDataService } from "../../services/helper-data-service";
import { Observable } from "rxjs/Observable";
import { Http, Headers, RequestOptions } from "@angular/http";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { IAppState } from "../../store/store";
import { Router, ActivatedRoute, Params } from "@angular/router";
import { BehaviorSubject, Subscription } from "rxjs/Rx";
......
......@@ -4,7 +4,7 @@ import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import { Observable} from "rxjs/Observable";
import { Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
......
......@@ -4,7 +4,7 @@ import { AppSettings } from "../../app.settings";
import { HelperDataService } from "../../services/helper-data-service";
import { Observable} from "rxjs/Observable";
import { Http, Headers, RequestOptions} from "@angular/http";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { IAppState } from "../../store/store";
import { Router, ActivatedRoute, Params} from "@angular/router";
import { BehaviorSubject, Subscription } from "rxjs/Rx";
......
......@@ -2,7 +2,7 @@ import { Router, Params} from '@angular/router';
import { OnInit, Component} from '@angular/core';
import { LoginInfoActions } from '../actions/logininfo.actions';
import { ILoginInfo } from '../store/logininfo/logininfo.types';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { Observable } from 'rxjs/Rx';
import { IAppState } from '../store/store';
import { HelperDataService } from '../services/helper-data-service';
......
......@@ -3,7 +3,7 @@ import {Router} from '@angular/router';
import { Injectable } from "@angular/core";
import { BehaviorSubject } from 'rxjs/Rx';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { ILoginInfo, ILoginInfoToken } from '../../store/logininfo/logininfo.types';
import { LoginInfoActions } from '../../actions/logininfo.actions';
......
......@@ -3,7 +3,7 @@ import { OnInit, OnDestroy, Component } from "@angular/core";
import { LoginInfoActions } from "../actions/logininfo.actions";
import { ILoginInfo } from "../store/logininfo/logininfo.types";
import { LOGININFO_INITIAL_STATE } from "../store/logininfo/logininfo.initial-state";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { BehaviorSubject, Subscription } from "rxjs/Rx";
import { IAppState } from "../store/store";
import { HelperDataService } from "../services/helper-data-service";
......
......@@ -2,7 +2,7 @@ import {Router} from '@angular/router';
import {OnInit, OnDestroy, Component, Injectable} from '@angular/core';
import { HelperDataService } from '../../services/helper-data-service';
import { BehaviorSubject } from 'rxjs/Rx';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { ILoginInfo, ILoginInfoToken } from '../../store/logininfo/logininfo.types';
import { LoginInfoActions } from '../../actions/logininfo.actions';
......
......@@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy } from "@angular/core";
import { BehaviorSubject, Subscription, Observable } from "rxjs/Rx";
import { Injectable } from "@angular/core";
import { Router } from "@angular/router";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { StudentDataFieldsActions } from "../../actions/studentdatafields.actions";
import { IStudentDataFields } from "../../store/studentdatafields/studentdatafields.types";
import { CriteriaActions } from "../../actions/criteria.actions";
......
......@@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router } from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { Injectable } from "@angular/core";
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { SectorFieldsActions } from '../../actions/sectorfields.actions';
import { SectorCoursesActions } from '../../actions/sectorcourses.actions';
......@@ -84,6 +84,7 @@ import { SECTOR_FIELDS_INITIAL_STATE } from '../../store/sectorfields/sectorfiel
private selectedSchools$: BehaviorSubject<Array<IRegionSchoolRecord>> = new BehaviorSubject(Array());
private sectorFields$: BehaviorSubject<ISectorFields>;
private epalclasses$: BehaviorSubject<IEpalClasses>;
private epalclassesSub: Subscription;
private sectorsSub: Subscription;
private regionsSub: Subscription;
private sectorFieldsSub: Subscription;
......@@ -153,7 +154,7 @@ import { SECTOR_FIELDS_INITIAL_STATE } from '../../store/sectorfields/sectorfiel
return state.sectorFields;
}).subscribe(this.sectorFields$);
this._ngRedux.select(state => {
this.epalclassesSub = this._ngRedux.select(state => {
state.epalclasses.reduce(({}, epalclass) => {
if (epalclass.name === "Α' Λυκείου")
this.classSelected = 1;
......@@ -179,16 +180,23 @@ import { SECTOR_FIELDS_INITIAL_STATE } from '../../store/sectorfields/sectorfiel
}
ngOnDestroy() {
if (this.regionsSub)
if (this.regionsSub) {
this.regionsSub.unsubscribe();
if (this.sectorsSub)
// this.regions$.unsubscribe();
}
if (this.sectorsSub) {
this.sectorsSub.unsubscribe();
if (this.sectorFieldsSub)
// this.sectors$.unsubscribe();
}
if (this.sectorFieldsSub) {
this.sectorFieldsSub.unsubscribe();
this.regions$.unsubscribe();
this.epalclasses$.unsubscribe();
this.sectors$.unsubscribe();
this.sectorFields$.unsubscribe();
// this.sectorFields$.unsubscribe();
}
if (this.epalclassesSub) {
this.epalclassesSub.unsubscribe();
// this.epalclasses$.unsubscribe();
}
}
}
......@@ -3,7 +3,7 @@ import { Router } from "@angular/router";
import { Http, Response, RequestOptions, Headers } from "@angular/http";
import { BehaviorSubject, Subscription } from "rxjs/Rx";
import { Injectable } from "@angular/core";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { IAppState } from "../../store/store";
import { IStudentDataFields } from "../../store/studentdatafields/studentdatafields.types";
import { IRegionRecord, IRegionRecords, IRegionSchoolRecord } from "../../store/regionschools/regionschools.types";
......@@ -106,7 +106,7 @@ import { HelperDataService } from "../../services/helper-data-service";
</button>
</div>
<div class="col-md-6">
<button type="button" *ngIf="(studentDataFields$ | async).size > 0 && (regions$ | async) && (regions$ | async).size > 0 && (epalclasses$ | async).size > 0 && (loginInfo$ | async).size > 0" class="btn-primary btn-lg pull-right isclickable" style="width: 9em;" (click)="submitNow()">
<button type="button" class="btn-primary btn-lg pull-right isclickable" style="width: 9em;" (click)="submitNow()">
<span style="font-size: 0.9em; font-weight: bold;">Υποβολή&nbsp;&nbsp;&nbsp;</span><i class="fa fa-forward"></i>
</button>
</div>
......@@ -177,6 +177,7 @@ import { HelperDataService } from "../../services/helper-data-service";
(<any>$("#studentFormSentNotice")).appendTo("body");
this.loginInfoSub = this._ngRedux.select(state => {
console.log("SELECTOR5");
if (state.loginInfo.size > 0) {
state.loginInfo.reduce(({ }, loginInfoToken) => {
this.authToken = loginInfoToken.auth_token;
......@@ -194,6 +195,7 @@ import { HelperDataService } from "../../services/helper-data-service";
}).subscribe(this.loginInfo$);
this.epalclassesSub = this._ngRedux.select(state => {
console.log("SELECTOR4");
if (state.epalclasses.size > 0) {
state.epalclasses.reduce(({ }, epalclass) => {
this.classSelected = epalclass.name;
......@@ -208,6 +210,7 @@ import { HelperDataService } from "../../services/helper-data-service";
}).subscribe(this.studentDataFields$);
this.regionsSub = this._ngRedux.select(state => {
console.log("SELECTOR3");
state.regions.reduce((prevRegion, region) => {
region.epals.reduce((prevEpal, epal) => {
if (epal.selected === true) {
......@@ -222,6 +225,7 @@ import { HelperDataService } from "../../services/helper-data-service";
}).subscribe(this.regions$);
this.sectorsSub = this._ngRedux.select(state => {
console.log("SELECTOR2");
state.sectors.reduce((prevSector, sector) => {
sector.courses.reduce((prevCourse, course) => {
if (course.selected === true) {
......@@ -235,6 +239,7 @@ import { HelperDataService } from "../../services/helper-data-service";
}).subscribe(this.sectors$);
this.sectorFieldsSub = this._ngRedux.select(state => {
console.log("SELECTOR");
state.sectorFields.reduce(({ }, sectorField) => {
if (sectorField.selected === true) {
this.sectorSelected = sectorField.id;
......@@ -248,23 +253,39 @@ import { HelperDataService } from "../../services/helper-data-service";
ngOnDestroy() {
(<any>$("#studentFormSentNotice")).remove();
if (this.studentDataFieldsSub) this.studentDataFieldsSub.unsubscribe();
if (this.regionsSub) this.regionsSub.unsubscribe();
if (this.sectorsSub) this.sectorsSub.unsubscribe();
if (this.sectorFieldsSub) this.sectorFieldsSub.unsubscribe();
if (this.epalclassesSub) this.epalclassesSub.unsubscribe();
if (this.loginInfoSub) this.loginInfoSub.unsubscribe();
this.regions$.unsubscribe();
this.epalclasses$.unsubscribe();
this.sectors$.unsubscribe();
this.sectorFields$.unsubscribe();
this.studentDataFields$.unsubscribe();
this.loginInfo$.unsubscribe();
if (this.studentDataFieldsSub) {
this.studentDataFieldsSub.unsubscribe();
// this.studentDataFields$.unsubscribe();
}
if (this.regionsSub) {
this.regionsSub.unsubscribe();
// this.regions$.unsubscribe();
}
if (this.sectorsSub) {
this.sectorsSub.unsubscribe();
// this.sectors$.unsubscribe();
}
if (this.sectorFieldsSub) {
this.sectorFieldsSub.unsubscribe();
// this.sectorFields$.unsubscribe();
}
if (this.epalclassesSub) {
this.epalclassesSub.unsubscribe();
// this.epalclasses$.unsubscribe();
}
if (this.loginInfoSub) {
this.loginInfoSub.unsubscribe();
// this.loginInfo$.unsubscribe();
}
}
submitNow() {
// αποστολή στοιχείων μαθητή στο entity: epal_student
// let aitisiObj: Array<Student | StudentEpalChosen[] | StudentCriteriaChosen[] | StudentCourseChosen | StudentSectorChosen > = [];
if (this.studentDataFields$.getValue().size === 0 || this.regions$.getValue().size === 0 || this.epalclasses$.getValue().size === 0 || this.loginInfo$.getValue().size === 0)
return;
let aitisiObj: Array<any> = [];
let epalObj: Array<StudentEpalChosen> = [];
......@@ -358,14 +379,14 @@ import { HelperDataService } from "../../services/helper-data-service";
let mHeader = "";
switch (errorCode) {
case 0:
mTitle = "Υποβολή Δήλωσης Προτίμησης";
mText = "Η υποβολή της δήλωσής σας πραγματοποιήθηκε. Μπορείτε να τη δείτε και να την εκτυπώσετε από την επιλογή 'Εμφάνιση - Εκτύπωση Δήλωσης Προτίμησης'. Από την επιλογή 'Υποβληθείσες Δηλώσεις' θα μπορείτε να ενημερωθείτε όταν υπάρξει εξέλιξη σχετική με τη δήλωση σας. Επίσης, θα λάβετε και ενημερωτικό email.";
mHeader = "modal-header-success";
this._eca.initEpalClasses();
this._sfa.initSectorFields();
this._rsa.initRegionSchools();
this._csa.initSectorCourses();
this._sdfa.initStudentDataFields();
mTitle = "Υποβολή Δήλωσης Προτίμησης";
mText = "Η υποβολή της δήλωσής σας πραγματοποιήθηκε. Μπορείτε να τη δείτε και να την εκτυπώσετε από την επιλογή 'Εμφάνιση - Εκτύπωση Δήλωσης Προτίμησης'. Από την επιλογή 'Υποβληθείσες Δηλώσεις' θα μπορείτε να ενημερωθείτε όταν υπάρξει εξέλιξη σχετική με τη δήλωση σας. Επίσης, θα λάβετε και ενημερωτικό email.";
mHeader = "modal-header-success";
break;
case 1000:
mTitle = "Αποτυχία Υποβολής Δήλωσης Προτίμησης";
......@@ -457,6 +478,7 @@ import { HelperDataService } from "../../services/helper-data-service";
this.showModal();
(<any>$(".loading")).remove();
this.showLoader.next(false);
},
error => {
(<any>$(".loading")).remove();
......@@ -466,7 +488,8 @@ import { HelperDataService } from "../../services/helper-data-service";
this.showModal();
this.showLoader.next(false);
console.log("Error HTTP POST Service");
});
}
);
}
......
......@@ -3,7 +3,7 @@ import { Router } from '@angular/router';
import { Observable } from 'rxjs/Rx';
import { Injectable } from "@angular/core";
import { CourseFieldsActions } from '../../actions/coursefields.actions';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { ICourseFields } from '../../store/coursefields/coursefields.types';
import { IAppState } from '../../store/store';
......
......@@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy } from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
......
......@@ -3,7 +3,7 @@ import { Router } from '@angular/router';
import { Observable, BehaviorSubject } from 'rxjs/Rx';
import { Injectable } from "@angular/core";
import { EpalClassesActions } from '../../actions/epalclass.actions';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IEpalClasses } from '../../store/epalclasses/epalclasses.types';
import { SectorFieldsActions } from '../../actions/sectorfields.actions';
import { RegionSchoolsActions } from '../../actions/regionschools.actions';
......
......@@ -7,7 +7,7 @@ import { BehaviorSubject, Subscription, Observable } from 'rxjs/Rx';
import { HelperDataService } from '../../services/helper-data-service';
import { ILoginInfo, ILoginInfoToken } from "../../store/logininfo/logininfo.types";
import { LOGININFO_INITIAL_STATE } from "../../store/logininfo/logininfo.initial-state";
import { NgRedux, select } from "ng2-redux";
import { NgRedux, select } from "@angular-redux/store";
import { IAppState } from "../../store/store";
import {
FormBuilder,
......
import { Component, OnInit, OnDestroy } from "@angular/core";
import { Injectable } from "@angular/core";
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IAppState } from '../../store/store';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
......
......@@ -3,7 +3,7 @@ import { Router } from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { Injectable } from "@angular/core";
import { RegionSchoolsActions } from '../../actions/regionschools.actions';
import { NgRedux, select } from 'ng2-redux';
import { NgRedux, select } from '@angular-redux/store';
import { IRegionRecord, IRegionRecords } from '../../store/regionschools/regionschools.types';
import { REGION_SCHOOLS_INITIAL_STATE } from '../../store/regionschools/regionschools.initial-state';
import { EPALCLASSES_INITIAL_STATE } from '../../store/epalclasses/epalclasses.initial-state';
......@@ -182,20 +182,21 @@ import {AppSettings} from '../../app.settings';
if (this.epalclassesSub) {
this.epalclassesSub.unsubscribe();
// this.epalclasses$.unsubscribe();
}
if (this.regionsSub) {
this.regionsSub.unsubscribe();
// this.regions$.unsubscribe();
}
if (this.sectorsSub) {
this.sectorsSub.unsubscribe();
// this.sectors$.unsubscribe();
}
if (this.sectorFieldsSub) {
this.sectorFieldsSub.unsubscribe();
// this.sectorFields$.unsubscribe();
}
if (this.sectorFields$) this.sectorFields$.unsubscribe();
if (this.sectors$) this.sectors$.unsubscribe();
if (this.regions$) this.regions$.unsubscribe();
if (this.epalclasses$) this.epalclasses$.unsubscribe();
}
public showModal():void {
......