Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Σταύρος Παπαδάκης
e-epal
Commits
b3b0fba0
Commit
b3b0fba0
authored
Jul 28, 2017
by
Χάρης Παπαδόπουλος
Browse files
Fixed typescript warnings. NgRedux.select() rewrite. Other fixes
parent
d91d67ab
Changes
124
Hide whitespace changes
Inline
Side-by-side
source/actions/coursefields.actions.ts
deleted
100644 → 0
View file @
d91d67ab
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
}
});
};
}
source/actions/criteria.actions.ts
deleted
100644 → 0
View file @
d91d67ab
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
:
{
}
});
};
}
source/actions/epalclass.actions.ts
View file @
b3b0fba0
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
>
)
{}
constructor
(
private
_ngRedux
:
NgRedux
<
IAppState
>
)
{
}
saveEpalClassesSelected
=
(
epalClasses
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
EPALCLASSES_SAVE
,
payload
:
{
epalClasses
}
});
};
saveEpalClassesSelected
=
(
epalClasses
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
EPALCLASSES_SAVE
,
payload
:
{
epalClasses
}
});
};
initEpalClasses
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
EPALCLASSES_INIT
,
payload
:
{
}
});
};
initEpalClasses
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
EPALCLASSES_INIT
,
payload
:
{
}
});
};
}
source/actions/index.ts
View file @
b3b0fba0
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
,
};
source/actions/logininfo.actions.ts
View file @
b3b0fba0
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
)
{}
getloginInfo
=
(
loginInfo
)
=>
{
return
this
.
_hds
.
getCurrentUser
(
loginInfo
.
auth_token
,
loginInfo
.
auth_role
).
then
(
loginInfos
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
LOGININFO_SAVE
,
payload
:
{
loginInfos
}
});
});
}
saveMinEduloginInfo
=
(
loginInfos
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
LOGININFO_SAVE
,
payload
:
{
loginInfos
constructor
(
private
_ngRedux
:
NgRedux
<
IAppState
>
,
private
_hds
:
HelperDataService
)
{
}
getloginInfo
=
(
loginInfo
)
=>
{
return
this
.
_hds
.
getCurrentUser
(
loginInfo
.
auth_token
,
loginInfo
.
auth_role
).
then
(
loginInfos
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
LOGININFO_SAVE
,
payload
:
{
loginInfos
}
});
});
}
});
};
saveProfile
=
(
profile
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
PROFILE_SAVE
,
payload
:
{
profile
}
});
};
saveStatementAgree
=
(
disclaimer_checked
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
STATEMENTAGREE_SAVE
,
payload
:
{
disclaimer_checked
}
});
};
initLoginInfo
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
LOGININFO_INIT
,
payload
:
{
}
});
};
saveMinEduloginInfo
=
(
loginInfos
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
LOGININFO_SAVE
,
payload
:
{
loginInfos
}
});
};
saveProfile
=
(
profile
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
PROFILE_SAVE
,
payload
:
{
profile
}
});
};
saveStatementAgree
=
(
disclaimer_checked
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
STATEMENTAGREE_SAVE
,
payload
:
{
disclaimer_checked
}
});
};
initLoginInfo
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
LOGININFO_INIT
,
payload
:
{
}
});
};
}
source/actions/regionschools.actions.ts
View file @
b3b0fba0
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
)
{}
constructor
(
private
_ngRedux
:
NgRedux
<
IAppState
>
,
private
_hds
:
HelperDataService
)
{
}
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
.
_ngRedux
.
dispatch
({
type
:
REGIONSCHOOLS_RECEIVED
,
payload
:
{
regions
}
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
.
_ngRedux
.
dispatch
({
type
:
REGIONSCHOOLS_RECEIVED
,
payload
:
{
regions
}
});
});
});
}
};
initRegionSchools
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
REGIONSCHOOLS_INIT
,
payload
:
{
}
});
};
}
};
/*
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
}
});
initRegionSchools
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
REGIONSCHOOLS_INIT
,
payload
:
{
}
});
//}
};
*/
};
saveRegionSchoolsSelected
=
(
checked
,
i
,
j
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
REGIONSCHOOLS_SELECTED_SAVE
,
payload
:
{
checked
:
checked
,
rIndex
:
i
,
sIndex
:
j
}
});
};
saveRegionSchoolsSelected
=
(
checked
,
i
,
j
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
REGIONSCHOOLS_SELECTED_SAVE
,
payload
:
{
checked
:
checked
,
rIndex
:
i
,
sIndex
:
j
}
});
};
saveRegionSchoolsOrder
=
(
selectedSchools
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
REGIONSCHOOLS_ORDER_SAVE
,
payload
:
{
selectedSchools
}
});
};
saveRegionSchoolsOrder
=
(
selectedSchools
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
REGIONSCHOOLS_ORDER_SAVE
,
payload
:
{
selectedSchools
}
});
};
}
source/actions/sectorcourses.actions.ts
View file @
b3b0fba0
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
)
{}
constructor
(
private
_ngRedux
:
NgRedux
<
IAppState
>
,
private
_hds
:
HelperDataService
)
{
}
getSectorCourses
=
(
reload
)
=>
{
const
{
sectors
}
=
this
.
_ngRedux
.
getState
();
//if (sectors.size === 0) {
if
(
reload
===
true
||
(
reload
===
false
&&
sectors
.
size
===
0
))
{
return
this
.
_hds
.
getSectorsWithCourses
().
then
(
sectors
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
SECTORCOURSES_RECEIVED
,
payload
:
{
sectors
}
getSectorCourses
=
(
reload
)
=>
{
const
{
sectors
}
=
this
.
_ngRedux
.
getState
();
// if (sectors.size === 0) {
if
(
reload
===
true
||
(
reload
===
false
&&
sectors
.
size
===
0
))
{
return
this
.
_hds
.
getSectorsWithCourses
().
then
(
sectors
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
SECTORCOURSES_RECEIVED
,
payload
:
{
sectors
}
});
});
});
}
};
initSectorCourses
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
SECTORCOURSES_INIT
,
payload
:
{
}
});
};
}
};
/*
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
}
});
initSectorCourses
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
SECTORCOURSES_INIT
,
payload
:
{
}
});
//}
};
*/
};
saveSectorCoursesSelected
=
(
sectorCoursesSelected
,
sectorSelected
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
SECTORCOURSES_SELECTED_SAVE
,
payload
:
{
sectorCoursesSelected
,
sectorSelected
}
});
};
saveSectorCoursesSelected
=
(
sectorCoursesSelected
,
sectorSelected
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
SECTORCOURSES_SELECTED_SAVE
,
payload
:
{
sectorCoursesSelected
,
sectorSelected
}
});
};
}
source/actions/sectorfields.actions.ts
View file @
b3b0fba0
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
({
...
...
source/actions/studentdatafields.actions.ts
View file @
b3b0fba0
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
>
)
{}
constructor
(
private
_ngRedux
:
NgRedux
<
IAppState
>
)
{
}
saveStudentDataFields
=
(
studentDataFields
)
=>
{
saveStudentDataFields
=
(
studentDataFields
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
STUDENTDATAFIELDS_SAVE
,
payload
:
{
studentDataFields
}
return
this
.
_ngRedux
.
dispatch
({
type
:
STUDENTDATAFIELDS_SAVE
,
payload
:
{
studentDataFields
}
});
});
};
};
initStudentDataFields
=
()
=>
{
initStudentDataFields
=
()
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
STUDENTDATAFIELDS_INIT
,
payload
:
{
...
...
source/app.routes.ts
View file @
b3b0fba0
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
...
MainRoutes
];
export
const
APP_DECLARATIONS
=
[
...
MainDeclarations
...
MainDeclarations
];