Merge branch 'edge_v4' into 'develop_v4'

Fixed typescript warnings. NgRedux.select() rewrite. Other fixes

See merge request !238
parents 57384d1c b3b0fba0
import { COURSEFIELDS_RECEIVED, COURSEFIELDS_SELECTED_SAVE } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
@Injectable()
export class CourseFieldsActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
getCourseFields = () => {
const { courseFields } = this._ngRedux.getState();
if (courseFields.size === 0) {
return this._hds.getCourseFields().then(courseFields => {
return this._ngRedux.dispatch({
type: COURSEFIELDS_RECEIVED,
payload: {
courseFields
}
});
});
}
};
saveCourseFieldsSelected = (courseFieldsSelected) => {
return this._ngRedux.dispatch({
type: COURSEFIELDS_SELECTED_SAVE,
payload: {
courseFieldsSelected
}
});
};
}
import { CRITERIA_RECEIVED, CRITERIA_SAVE, CRITERIA_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
@Injectable()
export class CriteriaActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
getCriteria = (reload) => {
const { criter } = this._ngRedux.getState();
//if (sectorFields.size === 0) {
if (reload === true || (reload === false && criter.size === 0)) {
return this._hds.getCriteria().then(criteria => {
return this._ngRedux.dispatch({
type: CRITERIA_RECEIVED,
payload: {
criteria
}
});
});
}
};
saveCriteria = (criter) => {
return this._ngRedux.dispatch({
type: CRITERIA_SAVE,
payload: {
criter
}
});
};
initCriteria = () => {
return this._ngRedux.dispatch({
type: CRITERIA_INIT,
payload: {
}
});
};
}
import { EPALCLASSES_SAVE } from '../constants';
import { EPALCLASSES_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { EPALCLASSES_SAVE } from "../constants";
import { EPALCLASSES_INIT } from "../constants";
import { Injectable } from "@angular/core";
import { NgRedux } from "@angular-redux/store";
import { IAppState } from "../store";
@Injectable()
export class EpalClassesActions {
constructor(
private _ngRedux: NgRedux<IAppState>) {}
private _ngRedux: NgRedux<IAppState>) { }
saveEpalClassesSelected = (epalClasses) => {
......
import { CourseFieldsActions } from './coursefields.actions';
import { SectorFieldsActions } from './sectorfields.actions';
import { RegionSchoolsActions } from './regionschools.actions';
import { SectorCoursesActions } from './sectorcourses.actions';
import { StudentDataFieldsActions } from './studentdatafields.actions';
import { EpalClassesActions } from './epalclass.actions';
import { LoginInfoActions} from './logininfo.actions';
import { CriteriaActions} from './criteria.actions';
import { SectorFieldsActions } from "./sectorfields.actions";
import { RegionSchoolsActions } from "./regionschools.actions";
import { SectorCoursesActions } from "./sectorcourses.actions";
import { StudentDataFieldsActions } from "./studentdatafields.actions";
import { EpalClassesActions } from "./epalclass.actions";
import { LoginInfoActions} from "./logininfo.actions";
const ACTION_PROVIDERS = [ CourseFieldsActions, SectorFieldsActions, RegionSchoolsActions, SectorCoursesActions, StudentDataFieldsActions,
EpalClassesActions, LoginInfoActions, CriteriaActions];
const ACTION_PROVIDERS = [SectorFieldsActions, RegionSchoolsActions, SectorCoursesActions, StudentDataFieldsActions,
EpalClassesActions, LoginInfoActions];
export {
CourseFieldsActions,
SectorFieldsActions,
RegionSchoolsActions,
SectorCoursesActions,
StudentDataFieldsActions,
EpalClassesActions,
LoginInfoActions,
CriteriaActions,
ACTION_PROVIDERS,
SectorFieldsActions,
RegionSchoolsActions,
SectorCoursesActions,
StudentDataFieldsActions,
EpalClassesActions,
LoginInfoActions,
ACTION_PROVIDERS,
};
import { LOGININFO_SAVE, PROFILE_SAVE, LOGININFO_RECEIVED, STATEMENTAGREE_SAVE } from '../constants';
import { LOGININFO_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
import { LOGININFO_SAVE, PROFILE_SAVE, LOGININFO_RECEIVED, STATEMENTAGREE_SAVE } from "../constants";
import { LOGININFO_INIT } from "../constants";
import { Injectable } from "@angular/core";
import { NgRedux } from "@angular-redux/store";
import { IAppState } from "../store";
import { HelperDataService } from "../services/helper-data-service";
@Injectable()
export class LoginInfoActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
private _hds: HelperDataService) { }
getloginInfo = (loginInfo) => {
return this._hds.getCurrentUser(loginInfo.auth_token, loginInfo.auth_role).then (loginInfos => {
return this._hds.getCurrentUser(loginInfo.auth_token, loginInfo.auth_role).then(loginInfos => {
return this._ngRedux.dispatch({
type: LOGININFO_SAVE,
payload: {
......@@ -21,7 +21,7 @@ export class LoginInfoActions {
}
});
});
}
}
saveMinEduloginInfo = (loginInfos) => {
return this._ngRedux.dispatch({
......@@ -30,25 +30,25 @@ export class LoginInfoActions {
loginInfos
}
});
};
};
saveProfile = (profile) => {
saveProfile = (profile) => {
return this._ngRedux.dispatch({
type: PROFILE_SAVE,
payload: {
profile
}
});
};
};
saveStatementAgree = (disclaimer_checked) => {
saveStatementAgree = (disclaimer_checked) => {
return this._ngRedux.dispatch({
type: STATEMENTAGREE_SAVE,
payload: {
disclaimer_checked
}
});
};
};
initLoginInfo = () => {
......
import { REGIONSCHOOLS_RECEIVED, REGIONSCHOOLS_SELECTED_SAVE, REGIONSCHOOLS_ORDER_SAVE, REGIONSCHOOLS_INIT } from '../constants';
import { Injectable } from '@angular/core';
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 "@angular-redux/store";
import { IAppState } from "../store";
import { HelperDataService } from "../services/helper-data-service";
@Injectable()
export class RegionSchoolsActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
private _hds: HelperDataService) { }
getRegionSchools = (classActive,courseActive, reload) => {
getRegionSchools = (classActive, courseActive, reload) => {
const { regions } = this._ngRedux.getState();
if (reload === true || (reload === false && regions.size === 0)) {
return this._hds.getRegionsWithSchools(classActive,courseActive).then(regions => {
return this._hds.getRegionsWithSchools(classActive, courseActive).then(regions => {
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_RECEIVED,
payload: {
......@@ -32,22 +32,6 @@ export class RegionSchoolsActions {
});
};
/*
getRegionSchools_Reload = (courseActive) => {
const { regions } = this._ngRedux.getState();
//if (regions.size === 0) {
return this._hds.getRegionsWithSchools(courseActive).then(regions => {
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_RECEIVED,
payload: {
regions
}
});
});
//}
};
*/
saveRegionSchoolsSelected = (checked, i, j) => {
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_SELECTED_SAVE,
......
import { SECTORCOURSES_RECEIVED, SECTORCOURSES_SELECTED_SAVE, SECTORCOURSES_INIT } from '../constants';
import { Injectable } from '@angular/core';
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 "@angular-redux/store";
import { IAppState } from "../store";
import { HelperDataService } from "../services/helper-data-service";
@Injectable()
export class SectorCoursesActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
private _hds: HelperDataService) { }
getSectorCourses = (reload) => {
const { sectors } = this._ngRedux.getState();
//if (sectors.size === 0) {
// if (sectors.size === 0) {
if (reload === true || (reload === false && sectors.size === 0)) {
return this._hds.getSectorsWithCourses().then(sectors => {
return this._ngRedux.dispatch({
......@@ -33,23 +33,7 @@ export class SectorCoursesActions {
});
};
/*
getSectorCourses_Reload = () => {
const { sectors } = this._ngRedux.getState();
//if (sectors.size === 0) {
return this._hds.getSectorsWithCourses().then(sectors => {
return this._ngRedux.dispatch({
type: SECTORCOURSES_RECEIVED,
payload: {
sectors
}
});
});
//}
};
*/
saveSectorCoursesSelected = (sectorCoursesSelected,sectorSelected) => {
saveSectorCoursesSelected = (sectorCoursesSelected, sectorSelected) => {
return this._ngRedux.dispatch({
type: SECTORCOURSES_SELECTED_SAVE,
payload: {
......
import { SECTORFIELDS_RECEIVED, SECTORFIELDS_SELECTED_SAVE, SECTORFIELDS_INIT } from '../constants';
import { Injectable } from '@angular/core';
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 "@angular-redux/store";
import { IAppState } from "../store";
import { HelperDataService } from "../services/helper-data-service";
@Injectable()
export class SectorFieldsActions {
......@@ -12,7 +12,7 @@ export class SectorFieldsActions {
getSectorFields = (reload) => {
const { sectorFields } = this._ngRedux.getState();
//if (sectorFields.size === 0) {
// if (sectorFields.size === 0) {
if (reload === true || (reload === false && sectorFields.size === 0)) {
return this._hds.getSectorFields().then(sectorFields => {
return this._ngRedux.dispatch({
......
import { STUDENTDATAFIELDS_SAVE, STUDENTDATAFIELDS_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from '@angular-redux/store';
import { IAppState } from '../store';
//import { UserDataService } from '../services/user-data-service';
import { STUDENTDATAFIELDS_SAVE, STUDENTDATAFIELDS_INIT } from "../constants";
import { Injectable } from "@angular/core";
import { NgRedux } from "@angular-redux/store";
import { IAppState } from "../store";
@Injectable()
export class StudentDataFieldsActions {
constructor(
private _ngRedux: NgRedux<IAppState>) {}
private _ngRedux: NgRedux<IAppState>) { }
saveStudentDataFields = (studentDataFields) => {
......
import { RouterModule } from '@angular/router';
import { RouterModule } from "@angular/router";
import { MainRoutes, MainDeclarations }
from './containers/main.routes';
from "./containers/main.routes";
export const routes = [
...MainRoutes
......
export const API_ENDPOINT = '';
export const API_ENDPOINT_PARAMS = '';
export const API_ENDPOINT = "";
export const API_ENDPOINT_PARAMS = "";
export class AppSettings {
public static get API_ENDPOINT(): string {
return '';
return "";
}
public static get API_ENDPOINT_PARAMS(): string {
return '';
return "";
}
}
......@@ -26,7 +26,6 @@ import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
import Main from "./containers/main";
import { APP_ROUTER_PROVIDERS, APP_DECLARATIONS } from "./app.routes";
/* Here we import services */
import {HelperDataService} from "./services/helper-data-service";
import {LoaderService} from "./services/Spinner.service";
import {AuthService} from "./services/auth.service";
......@@ -78,7 +77,7 @@ class MyLocalization extends NgLocalization {
Main, FooterComponent, HeaderComponent, NavbarComponent, MainComponent,
APP_DECLARATIONS,
],
bootstrap: [ Main ],
bootstrap: [Main],
providers: [
{ provide: APP_BASE_HREF, useValue: "/" },
{ provide: LocationStrategy, useClass: HashLocationStrategy },
......@@ -100,7 +99,7 @@ class MyLocalization extends NgLocalization {
ReportsAuthGuard
]
})
class AppModule {}
class AppModule { }
// enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
import { Component, OnInit, OnDestroy, ElementRef, ViewChild} from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
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 '@angular-redux/store';
import { IAppState } from '../../store/store';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { VALID_CAPACITY_PATTERN} from '../../constants';
import {maxValue} from '../../constants';
import {minValue} from '../../constants';
import {Http, Headers, RequestOptions} from "@angular/http";
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";
import { ILoginInfo } from "../../store/logininfo/logininfo.types";
import { VALID_CAPACITY_PATTERN} from "../../constants";
import {maxValue} from "../../constants";
import {minValue} from "../../constants";
import {
......@@ -20,9 +20,9 @@ import {
FormControl,
FormArray,
Validators,
} from '@angular/forms';
} from "@angular/forms";
@Component({
selector: 'director-classcapacity',
selector: "director-classcapacity",
template: `
<div class = "loading" *ngIf="(showLoader | async) === true"></div>
<div style="min-height: 500px;">
......@@ -92,7 +92,7 @@ import {
@Injectable() export default class DirectorClassCapacity implements OnInit, OnDestroy {
public formGroup: FormGroup;
private formGroup: FormGroup;
private CapacityPerCourse$: BehaviorSubject<any>;
private CapacityPerCourseSub: Subscription;
......@@ -124,12 +124,11 @@ import {
public showModal(popupMsgId): void {
(<any>$(popupMsgId)).modal('show');
(<any>$(popupMsgId)).modal("show");
}
public hideModal(popupMsgId): void {
//(<any>$('#distributionWaitingNotice')).modal('hide');
(<any>$(popupMsgId)).modal('hide');
(<any>$(popupMsgId)).modal("hide");
}
public onHidden(popupMsgId): void {
......@@ -142,7 +141,7 @@ import {
}
ngOnInit() {
(<any>$('#checksaved1')).appendTo("body");
(<any>$("#checksaved1")).appendTo("body");
this.CapacityPerCourseSub = this._hds.FindCapacityPerSchool().subscribe(x => {
this.CapacityPerCourse$.next(x);
......@@ -156,7 +155,7 @@ import {
handleChange(e: Event) {
this.newvalue = e.target['value'];
this.newvalue = e.target["value"];
}
saveCapacity(spec, sect, taxi, oldvalue, ind) {
......
import { Component, OnInit, OnDestroy, ElementRef, ViewChild} from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
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 '@angular-redux/store';
import { IAppState } from '../../store/store';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { VALID_CAPACITY_PATTERN} from '../../constants';
import {maxValue} from '../../constants';
import {minValue} from '../../constants';
import {Http, Headers, RequestOptions} from "@angular/http";
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";
import { ILoginInfo } from "../../store/logininfo/logininfo.types";
import { VALID_CAPACITY_PATTERN} from "../../constants";
import {maxValue} from "../../constants";
import {minValue} from "../../constants";
import {
......@@ -20,9 +20,9 @@ import {
FormControl,
FormArray,
Validators,
} from '@angular/forms';
} from "@angular/forms";
@Component({
selector: 'director-classcapacity',
selector: "director-classcapacity",
template: `
......@@ -284,7 +284,7 @@ import {
@Injectable() export default class DirectorClassCapacity implements OnInit, OnDestroy {
public formGroup: FormGroup;
private formGroup: FormGroup;
private CoursesPerSchool$: BehaviorSubject<any>;
private CoursesPerSchoolSub: Subscription;
......@@ -323,28 +323,28 @@ import {
public showConfirmModal(): void {
(<any>$('#applicationDeleteConfirm')).modal('show');
(<any>$("#applicationDeleteConfirm")).modal("show");
}
public showErrorModal(): void {
(<any>$('#applicationDeleteError')).modal('show');
(<any>$("#applicationDeleteError")).modal("show");
}
public hideConfirmModal(): void {
(<any>$('#applicationDeleteConfirm')).modal('hide');
(<any>$("#applicationDeleteConfirm")).modal("hide");
}
public hideErrorModal(): void {
(<any>$('#applicationDeleteError')).modal('hide');
(<any>$("#applicationDeleteError")).modal("hide");
}
public showModal(popupMsgId): void {
(<any>$(popupMsgId)).modal('show');
(<any>$(popupMsgId)).modal("show");
}
public hideModal(popupMsgId): void {
(<any>$(popupMsgId)).modal('hide');
(<any>$(popupMsgId)).modal("hide");
}
public onHidden(popupMsgId): void {
......@@ -353,16 +353,16 @@ import {
ngOnDestroy() {
(<any>$('#applicationDeleteConfirm')).remove();
(<any>$('#applicationDeleteError')).remove();
(<any>$("#applicationDeleteConfirm")).remove();
(<any>$("#applicationDeleteError")).remove();
}
ngOnInit() {
(<any>$('#checksaved')).appendTo("body");
(<any>$('#dangermodal')).appendTo("body");
(<any>$('#emptyselection')).appendTo("body");
(<any>$('#applicationDeleteConfirm')).appendTo("body");
(<any>$('#applicationDeleteError')).appendTo("body");
(<any>$("#checksaved")).appendTo("body");
(<any>$("#dangermodal")).appendTo("body");
(<any>$("#emptyselection")).appendTo("body");
(<any>$("#applicationDeleteConfirm")).appendTo("body");
(<any>$("#applicationDeleteError")).appendTo("body");
this.showLoader.next(true);
this.CoursesPerSchoolSub = this._hds.FindCoursesPerSchool().subscribe(x => {
this.CoursesPerSchool$.next(x);
......@@ -399,7 +399,7 @@ import {
setActive(ind) {
this.StudentActive = -1;
if (this.courseActive == ind) {
if (this.courseActive === ind) {
ind = -1;
}
this.courseActive = ind;
......@@ -407,7 +407,7 @@ import {
setActiveStudent(ind) {
this.opened = true;
if (this.StudentActive == ind) {
if (this.StudentActive === ind) {
ind = -1;
}
this.StudentActive = ind;
......@@ -415,7 +415,7 @@ import {
setActiveStudentnew(ind) {
this.opened = false;
if (this.StudentActive == ind) {
if (this.StudentActive === ind) {
ind = -1;
}
this.StudentActive = ind;
......@@ -424,14 +424,14 @@ import {
confirmStudent(student, cb, ind) {
var rtype;
if (cb.value == 1)
rtype = '1';
if (cb.value == 2)
rtype = '0';
if (cb.value == 3)
let rtype;
if (cb.value === 1)
rtype = "1";
if (cb.value === 2)
rtype = "0";
if (cb.value === 3)
rtype = null;