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_SAVE } from "../constants";
import { EPALCLASSES_INIT } from '../constants'; import { EPALCLASSES_INIT } from "../constants";
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { NgRedux } from '@angular-redux/store'; import { NgRedux } from "@angular-redux/store";
import { IAppState } from '../store'; import { IAppState } from "../store";
@Injectable() @Injectable()
export class EpalClassesActions { export class EpalClassesActions {
constructor( constructor(
private _ngRedux: NgRedux<IAppState>) {} private _ngRedux: NgRedux<IAppState>) { }
saveEpalClassesSelected = (epalClasses) => { saveEpalClassesSelected = (epalClasses) => {
return this._ngRedux.dispatch({ return this._ngRedux.dispatch({
type: EPALCLASSES_SAVE, type: EPALCLASSES_SAVE,
payload: { payload: {
epalClasses epalClasses
} }
}); });
}; };
initEpalClasses = () => { initEpalClasses = () => {
return this._ngRedux.dispatch({ return this._ngRedux.dispatch({
type: EPALCLASSES_INIT, type: EPALCLASSES_INIT,
payload: { payload: {
} }
}); });
}; };
} }
import { CourseFieldsActions } from './coursefields.actions'; import { SectorFieldsActions } from "./sectorfields.actions";
import { SectorFieldsActions } from './sectorfields.actions'; import { RegionSchoolsActions } from "./regionschools.actions";
import { RegionSchoolsActions } from './regionschools.actions'; import { SectorCoursesActions } from "./sectorcourses.actions";
import { SectorCoursesActions } from './sectorcourses.actions'; import { StudentDataFieldsActions } from "./studentdatafields.actions";
import { StudentDataFieldsActions } from './studentdatafields.actions'; import { EpalClassesActions } from "./epalclass.actions";
import { EpalClassesActions } from './epalclass.actions'; import { LoginInfoActions} from "./logininfo.actions";
import { LoginInfoActions} from './logininfo.actions';
import { CriteriaActions} from './criteria.actions';
const ACTION_PROVIDERS = [ CourseFieldsActions, SectorFieldsActions, RegionSchoolsActions, SectorCoursesActions, StudentDataFieldsActions, const ACTION_PROVIDERS = [SectorFieldsActions, RegionSchoolsActions, SectorCoursesActions, StudentDataFieldsActions,
EpalClassesActions, LoginInfoActions, CriteriaActions]; EpalClassesActions, LoginInfoActions];
export { export {
CourseFieldsActions, SectorFieldsActions,
SectorFieldsActions, RegionSchoolsActions,
RegionSchoolsActions, SectorCoursesActions,
SectorCoursesActions, StudentDataFieldsActions,
StudentDataFieldsActions, EpalClassesActions,
EpalClassesActions, LoginInfoActions,
LoginInfoActions, ACTION_PROVIDERS,
CriteriaActions,
ACTION_PROVIDERS,
}; };
import { LOGININFO_SAVE, PROFILE_SAVE, LOGININFO_RECEIVED, STATEMENTAGREE_SAVE } from '../constants'; import { LOGININFO_SAVE, PROFILE_SAVE, LOGININFO_RECEIVED, STATEMENTAGREE_SAVE } from "../constants";
import { LOGININFO_INIT } from '../constants'; import { LOGININFO_INIT } from "../constants";
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { NgRedux } from '@angular-redux/store'; import { NgRedux } from "@angular-redux/store";
import { IAppState } from '../store'; import { IAppState } from "../store";
import { HelperDataService } from '../services/helper-data-service'; import { HelperDataService } from "../services/helper-data-service";
@Injectable() @Injectable()
export class LoginInfoActions { export class LoginInfoActions {
constructor( constructor(
private _ngRedux: NgRedux<IAppState>, private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {} private _hds: HelperDataService) { }
getloginInfo = (loginInfo) => { 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({ return this._ngRedux.dispatch({
type: LOGININFO_SAVE, type: LOGININFO_SAVE,
payload: { payload: {
loginInfos loginInfos
} }
}); });
}); });
}
saveMinEduloginInfo = (loginInfos) => {
return this._ngRedux.dispatch({
type: LOGININFO_SAVE,
payload: {
loginInfos
} }
});
}; saveMinEduloginInfo = (loginInfos) => {
return this._ngRedux.dispatch({
saveProfile = (profile) => { type: LOGININFO_SAVE,
return this._ngRedux.dispatch({ payload: {
type: PROFILE_SAVE, loginInfos
payload: { }
profile });
} };
});
}; saveProfile = (profile) => {
return this._ngRedux.dispatch({
saveStatementAgree = (disclaimer_checked) => { type: PROFILE_SAVE,
return this._ngRedux.dispatch({ payload: {
type: STATEMENTAGREE_SAVE, profile
payload: { }
disclaimer_checked });
} };
});
}; saveStatementAgree = (disclaimer_checked) => {
return this._ngRedux.dispatch({
type: STATEMENTAGREE_SAVE,
initLoginInfo = () => { payload: {
return this._ngRedux.dispatch({ disclaimer_checked
type: LOGININFO_INIT, }
payload: { });
} };
});
};
initLoginInfo = () => {
return this._ngRedux.dispatch({
type: LOGININFO_INIT,
payload: {
}
});
};
} }
import { REGIONSCHOOLS_RECEIVED, REGIONSCHOOLS_SELECTED_SAVE, REGIONSCHOOLS_ORDER_SAVE, REGIONSCHOOLS_INIT } from '../constants'; import { REGIONSCHOOLS_RECEIVED, REGIONSCHOOLS_SELECTED_SAVE, REGIONSCHOOLS_ORDER_SAVE, REGIONSCHOOLS_INIT } from "../constants";
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { NgRedux } from '@angular-redux/store'; import { NgRedux } from "@angular-redux/store";
import { IAppState } from '../store'; import { IAppState } from "../store";
import { HelperDataService } from '../services/helper-data-service'; import { HelperDataService } from "../services/helper-data-service";
@Injectable() @Injectable()
export class RegionSchoolsActions { export class RegionSchoolsActions {
constructor( constructor(
private _ngRedux: NgRedux<IAppState>, private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {} private _hds: HelperDataService) { }
getRegionSchools = (classActive,courseActive, reload) => { getRegionSchools = (classActive, courseActive, reload) => {
const { regions } = this._ngRedux.getState(); const { regions } = this._ngRedux.getState();
if (reload === true || (reload === false && regions.size === 0)) { 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({ return this._ngRedux.dispatch({
type: REGIONSCHOOLS_RECEIVED, type: REGIONSCHOOLS_RECEIVED,
payload: { payload: {
regions regions
} }
});
}); });
}); }
} };
};
initRegionSchools = () => {
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_INIT,
payload: {
}
});
};
/* initRegionSchools = () => {
getRegionSchools_Reload = (courseActive) => { return this._ngRedux.dispatch({
const { regions } = this._ngRedux.getState(); type: REGIONSCHOOLS_INIT,
//if (regions.size === 0) { payload: {
return this._hds.getRegionsWithSchools(courseActive).then(regions => { }
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_RECEIVED,
payload: {
regions
}
});
}); });
//} };
};
*/
saveRegionSchoolsSelected = (checked, i, j) => { saveRegionSchoolsSelected = (checked, i, j) => {
return this._ngRedux.dispatch({ return this._ngRedux.dispatch({
type: REGIONSCHOOLS_SELECTED_SAVE, type: REGIONSCHOOLS_SELECTED_SAVE,
payload: { payload: {
checked: checked, checked: checked,
rIndex: i, rIndex: i,
sIndex: j sIndex: j
} }
}); });
}; };
saveRegionSchoolsOrder = (selectedSchools) => { saveRegionSchoolsOrder = (selectedSchools) => {
return this._ngRedux.dispatch({ return this._ngRedux.dispatch({
type: REGIONSCHOOLS_ORDER_SAVE, type: REGIONSCHOOLS_ORDER_SAVE,
payload: { payload: {
selectedSchools selectedSchools
} }
}); });
}; };
} }
import { SECTORCOURSES_RECEIVED, SECTORCOURSES_SELECTED_SAVE, SECTORCOURSES_INIT } from '../constants'; import { SECTORCOURSES_RECEIVED, SECTORCOURSES_SELECTED_SAVE, SECTORCOURSES_INIT } from "../constants";
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { NgRedux } from '@angular-redux/store'; import { NgRedux } from "@angular-redux/store";
import { IAppState } from '../store'; import { IAppState } from "../store";
import { HelperDataService } from '../services/helper-data-service'; import { HelperDataService } from "../services/helper-data-service";
@Injectable() @Injectable()
export class SectorCoursesActions { export class SectorCoursesActions {
constructor( constructor(
private _ngRedux: NgRedux<IAppState>, private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {} private _hds: HelperDataService) { }
getSectorCourses = (reload) => { getSectorCourses = (reload) => {
const { sectors } = this._ngRedux.getState(); const { sectors } = this._ngRedux.getState();
//if (sectors.size === 0) { // if (sectors.size === 0) {
if (reload === true || (reload === false && sectors.size === 0)) { if (reload === true || (reload === false && sectors.size === 0)) {
return this._hds.getSectorsWithCourses().then(sectors => { return this._hds.getSectorsWithCourses().then(sectors => {
return this._ngRedux.dispatch({ return this._ngRedux.dispatch({
type: SECTORCOURSES_RECEIVED, type: SECTORCOURSES_RECEIVED,
payload: { payload: {
sectors sectors
} }
});
}); });
}); }
} };
};
initSectorCourses = () => {
return this._ngRedux.dispatch({
type: SECTORCOURSES_INIT,
payload: {
}
});
};
/* initSectorCourses = () => {
getSectorCourses_Reload = () => { return this._ngRedux.dispatch({
const { sectors } = this._ngRedux.getState(); type: SECTORCOURSES_INIT,
//if (sectors.size === 0) { payload: {
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({ return this._ngRedux.dispatch({
type: SECTORCOURSES_SELECTED_SAVE, type: SECTORCOURSES_SELECTED_SAVE,
payload: { payload: {
sectorCoursesSelected, sectorCoursesSelected,
sectorSelected sectorSelected
} }
}); });
}; };
} }
import { SECTORFIELDS_RECEIVED, SECTORFIELDS_SELECTED_SAVE, SECTORFIELDS_INIT } from '../constants'; import { SECTORFIELDS_RECEIVED, SECTORFIELDS_SELECTED_SAVE, SECTORFIELDS_INIT } from "../constants";
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { NgRedux } from '@angular-redux/store'; import { NgRedux } from "@angular-redux/store";
import { IAppState } from '../store'; import { IAppState } from "../store";
import { HelperDataService } from '../services/helper-data-service'; import { HelperDataService } from "../services/helper-data-service";
@Injectable() @Injectable()
export class SectorFieldsActions { export class SectorFieldsActions {
...@@ -12,7 +12,7 @@ export class SectorFieldsActions { ...@@ -12,7 +12,7 @@ export class SectorFieldsActions {
getSectorFields = (reload) => { getSectorFields = (reload) => {
const { sectorFields } = this._ngRedux.getState(); const { sectorFields } = this._ngRedux.getState();
//if (sectorFields.size === 0) { // if (sectorFields.size === 0) {
if (reload === true || (reload === false && sectorFields.size === 0)) { if (reload === true || (reload === false && sectorFields.size === 0)) {
return this._hds.getSectorFields().then(sectorFields => { return this._hds.getSectorFields().then(sectorFields => {
return this._ngRedux.dispatch({ return this._ngRedux.dispatch({
......
import { STUDENTDATAFIELDS_SAVE, STUDENTDATAFIELDS_INIT } from '../constants'; import { STUDENTDATAFIELDS_SAVE, STUDENTDATAFIELDS_INIT } from "../constants";
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { NgRedux } from '@angular-redux/store'; import { NgRedux } from "@angular-redux/store";
import { IAppState } from '../store'; import { IAppState } from "../store";
//import { UserDataService } from '../services/user-data-service';
@Injectable() @Injectable()
export class StudentDataFieldsActions { export class StudentDataFieldsActions {
constructor( constructor(
private _ngRedux: NgRedux<IAppState>) {} private _ngRedux: NgRedux<IAppState>) { }
saveStudentDataFields = (studentDataFields) => { saveStudentDataFields = (studentDataFields) => {
return this._ngRedux.dispatch({ return this._ngRedux.dispatch({
type: STUDENTDATAFIELDS_SAVE, type: STUDENTDATAFIELDS_SAVE,
payload: { payload: {
studentDataFields studentDataFields
} }
}); });
}; };
initStudentDataFields = () => { initStudentDataFields = () => {
return this._ngRedux.dispatch({ return this._ngRedux.dispatch({
type: STUDENTDATAFIELDS_INIT, type: STUDENTDATAFIELDS_INIT,
payload: { payload: {
......
import { RouterModule } from '@angular/router'; import { RouterModule } from "@angular/router";
import { MainRoutes, MainDeclarations } import { MainRoutes, MainDeclarations }
from './containers/main.routes'; from "./containers/main.routes";
export const routes = [ export const routes = [
...MainRoutes ...MainRoutes
]; ];
export const APP_DECLARATIONS = [ export const APP_DECLARATIONS = [
...MainDeclarations ...MainDeclarations
]; ];
export const APP_ROUTER_PROVIDERS = RouterModule.forRoot(routes); export const APP_ROUTER_PROVIDERS = RouterModule.forRoot(routes);
export const API_ENDPOINT = ''; export const API_ENDPOINT = "";
export const API_ENDPOINT_PARAMS = ''; export const API_ENDPOINT_PARAMS = "";
export class AppSettings { export class AppSettings {
public static get API_ENDPOINT(): string { public static get API_ENDPOINT(): string {
return ''; return "";
} }
public static get API_ENDPOINT_PARAMS(): string { public static get API_ENDPOINT_PARAMS(): string {
return ''; return "";
} }
} }
...@@ -9,24 +9,23 @@ import { CookieModule } from "ngx-cookie"; ...@@ -9,24 +9,23 @@ import { CookieModule } from "ngx-cookie";
import { MyDatePickerModule } from "mydatepicker"; import { MyDatePickerModule } from "mydatepicker";
import { NguiAutoCompleteModule } from "@ngui/auto-complete"; import { NguiAutoCompleteModule } from "@ngui/auto-complete";
import { import {
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
} from "@angular/forms"; } from "@angular/forms";
import {RouterModule} from "@angular/router"; import {RouterModule} from "@angular/router";
import { HttpModule } from "@angular/http"; import { HttpModule } from "@angular/http";
import { import {
APP_BASE_HREF, APP_BASE_HREF,
HashLocationStrategy, HashLocationStrategy,
LocationStrategy, LocationStrategy,