Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
e-epal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Σταύρος Παπαδάκης
e-epal
Commits
2cc27bf9
Commit
2cc27bf9
authored
Feb 10, 2017
by
Open Source Developer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Student Amka
parent
ccf76590
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
230 additions
and
10 deletions
+230
-10
package.json
package.json
+11
-4
source/actions/amkafill.actions.ts
source/actions/amkafill.actions.ts
+21
-0
source/actions/index.ts
source/actions/index.ts
+3
-1
source/app.ts
source/app.ts
+3
-0
source/components/navbar/navbar.component.html
source/components/navbar/navbar.component.html
+5
-3
source/components/student-application-form/amka-fill.ts
source/components/student-application-form/amka-fill.ts
+83
-0
source/containers/main.routes.ts
source/containers/main.routes.ts
+5
-2
source/services/amkacheck-service.ts
source/services/amkacheck-service.ts
+27
-0
source/store/amkafill/amkafills.initial-state.ts
source/store/amkafill/amkafills.initial-state.ts
+7
-0
source/store/amkafill/amkafills.reducer.ts
source/store/amkafill/amkafills.reducer.ts
+22
-0
source/store/amkafill/amkafills.transformers.ts
source/store/amkafill/amkafills.transformers.ts
+12
-0
source/store/amkafill/amkafills.types.ts
source/store/amkafill/amkafills.types.ts
+11
-0
source/store/amkafill/index.js
source/store/amkafill/index.js
+6
-0
source/store/amkafill/index.ts
source/store/amkafill/index.ts
+10
-0
source/store/store.ts
source/store/store.ts
+4
-0
No files found.
package.json
View file @
2cc27bf9
...
...
@@ -20,13 +20,18 @@
"
babel-preset-env
"
:
"
^1.1.4
"
,
"
babel-preset-es2015
"
:
"
^6.18.0
"
,
"
babel-preset-stage-1
"
:
"
^6.16.0
"
,
"
node-sass
"
:
"
^4.0.0
"
,
"
sass-loader
"
:
"
^4.0.2
"
,
"
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
"
,
"
redux-logger"
:
"^2.7.4
"
,
"
url-loader
"
:
"
^0.5.7
"
,
"
webpack
"
:
"
^1.14.0
"
,
"
webpack-dashboard
"
:
"
^0.2.0
"
,
"
webpack-dev-server
"
:
"
^1.16.2
"
...
...
@@ -41,7 +46,8 @@
"
@angular/platform-browser-dynamic
"
:
"
^2.0.0
"
,
"
@angular/router
"
:
"
^3.2.0
"
,
"
@types/node
"
:
"
^6.0.60
"
,
"babel-polyfill"
:
"^6.20.0"
,
"
babel-polyfill
"
:
"
^6.20.0
"
,
"
bootstrap
"
:
"
^4.0.0-alpha.6
"
,
"
core-js
"
:
"
^2.4.1
"
,
"
css-loader
"
:
"
^0.25.0
"
,
"
d3
"
:
"
^3.5.16
"
,
...
...
@@ -50,6 +56,7 @@
"
file-loader
"
:
"
^0.9.0
"
,
"
html-webpack-plugin
"
:
"
^2.24.1
"
,
"
immutable
"
:
"
^3.8.1
"
,
"
jquery
"
:
"
^3.1.1
"
,
"
ng2-redux
"
:
"
^5.1.0
"
,
"
ng2-smart-table
"
:
"
^0.4.0-5
"
,
"
raw-loader
"
:
"
^0.5.1
"
,
...
...
source/actions/amkafill.actions.ts
0 → 100644
View file @
2cc27bf9
import
{
AMKAFILL_SAVE
}
from
'
../constants
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
NgRedux
}
from
'
ng2-redux
'
;
import
{
IAppState
}
from
'
../store
'
;
@
Injectable
()
export
class
AmkaFillsActions
{
constructor
(
private
_ngRedux
:
NgRedux
<
IAppState
>
)
{}
saveAmkaFills
=
(
amkaFills
)
=>
{
return
this
.
_ngRedux
.
dispatch
({
type
:
AMKAFILL_SAVE
,
payload
:
{
amkaFills
}
});
};
}
\ No newline at end of file
source/actions/index.ts
View file @
2cc27bf9
...
...
@@ -4,7 +4,8 @@ import { RegionSchoolsActions } from './regionschools.actions';
import
{
SectorCoursesActions
}
from
'
./sectorcourses.actions
'
;
import
{
StudentDataFieldsActions
}
from
'
./studentdatafields.actions
'
;
import
{
EpalClassesActions
}
from
'
./epalclass.actions
'
;
const
ACTION_PROVIDERS
=
[
CourseFieldsActions
,
SectorFieldsActions
,
RegionSchoolsActions
,
SectorCoursesActions
,
StudentDataFieldsActions
,
EpalClassesActions
];
import
{
AmkaFillsActions
}
from
'
./amkafill.actions
'
;
const
ACTION_PROVIDERS
=
[
CourseFieldsActions
,
SectorFieldsActions
,
RegionSchoolsActions
,
SectorCoursesActions
,
StudentDataFieldsActions
,
EpalClassesActions
,
AmkaFillsActions
];
export
{
CourseFieldsActions
,
...
...
@@ -13,5 +14,6 @@ export {
SectorCoursesActions
,
StudentDataFieldsActions
,
EpalClassesActions
,
AmkaFillsActions
,
ACTION_PROVIDERS
,
};
source/app.ts
View file @
2cc27bf9
...
...
@@ -27,6 +27,8 @@ import { APP_ROUTER_PROVIDERS, APP_DECLARATIONS } from './app.routes';
/* Here we import services */
import
{
HelperDataService
}
from
'
./services/helper-data-service
'
;
import
{
UserDataService
}
from
'
./services/user-data-service
'
;
import
{
AmkaCheckService
}
from
'
./services/amkacheck-service
'
;
import
{
ACTION_PROVIDERS
}
from
'
./actions
'
;
import
Home
from
'
./components/home
'
;
...
...
@@ -75,6 +77,7 @@ class MyLocalization extends NgLocalization {
// Service1, again services here
HelperDataService
,
UserDataService
,
AmkaCheckService
,
]
})
class
AppModule
{}
...
...
source/components/navbar/navbar.component.html
View file @
2cc27bf9
...
...
@@ -12,11 +12,13 @@
<li
class=
"nav-item"
[ngClass]=
"{active: path=='application-preview'}"
>
<a
class=
"nav-link"
[routerLink]=
"['/application-preview']"
[routerLinkActive]=
"['active']"
>
Προεπισκόπηση
</a>
</li>
<li
class=
"nav-item"
[ngClass]=
"{active: path=='pal-class-select'}"
>
<li
class=
"nav-item"
[ngClass]=
"{active: path=='epal-class-select'}"
>
<a
class=
"nav-link"
[routerLink]=
"['/epal-class-select']"
[routerLinkActive]=
"['active']"
>
Τάξη
</a>
</li>
<li
class=
"nav-item"
[ngClass]=
"{active: path=='amka-fill'}"
>
<a
class=
"nav-link"
[routerLink]=
"['/amka-fill']"
[routerLinkActive]=
"['active']"
>
ΑΜΚΑ ΜΑΘΗΤΗ
</a>
</li>
<li
class=
"nav-item"
[ngClass]=
"{active: path=='sector-fields-select'}"
>
<a
class=
"nav-link"
[routerLink]=
"['/sector-fields-select']"
[routerLinkActive]=
"['active']"
>
Τομεας
</a>
...
...
source/components/student-application-form/amka-fill.ts
0 → 100644
View file @
2cc27bf9
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
Observable
}
from
'
rxjs/Rx
'
;
import
{
Injectable
}
from
"
@angular/core
"
;
import
{
AmkaFillsActions
}
from
'
../../actions/amkafill.actions
'
;
import
{
NgRedux
,
select
}
from
'
ng2-redux
'
;
import
{
IAmkaFills
}
from
'
../../store/amkafill/amkafills.types
'
;
import
{
IAppState
}
from
'
../../store/store
'
;
import
{
AmkaCheckService
}
from
'
../../services/amkacheck-service
'
;
import
{
FormBuilder
,
FormGroup
,
FormControl
,
FormArray
}
from
'
@angular/forms
'
;
import
{
AppSettings
}
from
'
../../app.settings
'
;
@
Component
({
selector
:
'
amka-fill
'
,
template
:
`
<form [formGroup]="formGroup">
<div *ngFor="let amkafill$ of amkafills$ | async;"> </div>
<div class="form-group">
<label for="studentAmka">ΑΜΚΑ μαθητή</label><input class="form-control" type="text" formControlName="name">
</div>
<div class="row">
<div class="col-md-2 col-md-offset-5">
<button type="button" class="btn-primary btn-lg pull-center" (click)="saveSelected()">
Συνέχεια<span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
</div>
</form>
`
})
@
Injectable
()
export
default
class
AmkaFill
implements
OnInit
{
private
amkafills$
:
Observable
<
IAmkaFills
>
;
public
formGroup
:
FormGroup
;
private
respond
:
any
;
constructor
(
private
fb
:
FormBuilder
,
private
_cas
:
AmkaCheckService
,
private
_cfa
:
AmkaFillsActions
,
private
_ngRedux
:
NgRedux
<
IAppState
>
,
private
router
:
Router
)
{
this
.
formGroup
=
this
.
fb
.
group
({
name
:
[]
});
};
ngOnInit
()
{
// this._cfa.getEpalClasses()
console
.
log
(
this
.
formGroup
.
value
);
this
.
amkafills$
=
this
.
_ngRedux
.
select
(
state
=>
{
if
(
state
.
amkafills
.
size
>
0
)
{
state
.
amkafills
.
reduce
(({},
amkafill
)
=>
{
this
.
formGroup
.
setValue
(
amkafill
);
return
amkafill
;
},
{});
}
return
state
.
amkafills
;
});
}
saveSelected
()
{
this
.
_cas
.
checkstudentamka
(
this
.
formGroup
.
value
)
.
subscribe
(
res
=>
this
.
respond
=
res
);
console
.
log
(
this
.
respond
);
this
.
_cfa
.
saveAmkaFills
(
this
.
formGroup
.
value
);
this
.
router
.
navigate
([
'
/epal-class-select
'
]);
}
}
\ No newline at end of file
source/containers/main.routes.ts
View file @
2cc27bf9
...
...
@@ -14,6 +14,7 @@ import SectorFieldsSelect from '../components/student-application-form/sector.fi
import
RegionSchoolsSelect
from
'
../components/student-application-form/region.schools.select
'
;
import
SectorCoursesSelect
from
'
../components/student-application-form/sector.courses.select
'
;
import
ApplicationPreview
from
'
../components/student-application-form/application.preview
'
;
import
AmkaFill
from
'
../components/student-application-form/amka-fill
'
;
export
const
MainRoutes
:
Routes
=
[
{
path
:
''
,
component
:
Home
},
...
...
@@ -25,7 +26,8 @@ export const MainRoutes: Routes = [
{
path
:
'
sector-fields-select
'
,
component
:
SectorFieldsSelect
},
{
path
:
'
region-schools-select
'
,
component
:
RegionSchoolsSelect
},
{
path
:
'
sectorcourses-fields-select
'
,
component
:
SectorCoursesSelect
},
{
path
:
'
application-preview
'
,
component
:
ApplicationPreview
}
{
path
:
'
application-preview
'
,
component
:
ApplicationPreview
},
{
path
:
'
amka-fill
'
,
component
:
AmkaFill
}
];
export
const
MainDeclarations
=
[
...
...
@@ -39,5 +41,6 @@ export const MainDeclarations = [
RegionSchoolsSelect
,
SectorCoursesSelect
,
StudentApplicationMain
,
ApplicationPreview
ApplicationPreview
,
AmkaFill
];
source/services/amkacheck-service.ts
0 → 100644
View file @
2cc27bf9
import
{
Http
,
Response
,
RequestOptions
,
Headers
}
from
'
@angular/http
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Observable
}
from
"
rxjs/Observable
"
;
import
'
rxjs/add/operator/map
'
;
@
Injectable
()
export
class
AmkaCheckService
{
private
_url
=
"
https://wso2.minedu.gov.gr/amka/v1.1/
"
;
constructor
(
private
_http
:
Http
)
{
};
checkstudentamka
(
amka
:
any
)
{
let
authToken
=
'
7bed3fc5-f9f5-3613-abcd-3b08bab0f625
'
;
let
headers
=
new
Headers
({
'
Accept
'
:
'
application/json
'
});
headers
.
append
(
'
Authorization
'
,
`Bearer
${
authToken
}
`
);
let
options
=
new
RequestOptions
({
headers
:
headers
});
let
parameter1
=
'
ksdhkshf
'
;
return
this
.
_http
.
get
(
this
.
_url
+
amka
.
name
+
'
/
'
+
parameter1
,
options
)
.
map
(
response
=>
response
.
json
()
);
}
}
\ No newline at end of file
source/store/amkafill/amkafills.initial-state.ts
0 → 100644
View file @
2cc27bf9
import
{
List
}
from
'
immutable
'
;
import
{
IAmkaFill
}
from
'
./amkafills.types
'
;
export
const
INITIAL_STATE
=
List
<
IAmkaFill
>
();
source/store/amkafill/amkafills.reducer.ts
0 → 100644
View file @
2cc27bf9
import
{
IAmkaFills
,
IAmkaFill
}
from
'
./amkafills.types
'
;
import
{
INITIAL_STATE
}
from
'
./amkafills.initial-state
'
;
import
{
Seq
}
from
'
immutable
'
;
import
{
AMKAFILL_SAVE
}
from
'
../../constants
'
;
export
function
amkafillReducer
(
state
:
IAmkaFills
=
INITIAL_STATE
,
action
):
IAmkaFills
{
switch
(
action
.
type
)
{
case
AMKAFILL_SAVE
:
let
selectedAmkaFills
=
Array
<
IAmkaFill
>
();
selectedAmkaFills
.
push
(
<
IAmkaFill
>
{
name
:
action
.
payload
.
amkaFills
.
name
});
return
Seq
(
selectedAmkaFills
).
map
(
n
=>
n
).
toList
();
default
:
return
state
;
}
};
source/store/amkafill/amkafills.transformers.ts
0 → 100644
View file @
2cc27bf9
import
{
IAmkaFills
,
IAmkaFill
}
from
'
./amkafills.types
'
;
export
function
deimmutifyAmkaFills
(
state
:
IAmkaFills
):
IAmkaFill
[]
{
let
fetchedAmkaFills
=
new
Array
();
state
.
forEach
(
amkafill
=>
{
fetchedAmkaFills
.
push
(
<
IAmkaFill
>
{
name
:
amkafill
.
name
});
});
return
fetchedAmkaFills
;
};
source/store/amkafill/amkafills.types.ts
0 → 100644
View file @
2cc27bf9
import
{
List
}
from
'
immutable
'
;
export
interface
IAmkaFill
{
// id: number;
name
:
number
;
}
export
type
IAmkaFills
=
List
<
IAmkaFill
>
;
source/store/amkafill/index.js
0 → 100644
View file @
2cc27bf9
"
use strict
"
;
const
classfields_reducer_1
=
require
(
"
./classfields.reducer
"
);
exports
.
classFieldsReducer
=
classfields_reducer_1
.
classFieldsReducer
;
const
classfields_transformers_1
=
require
(
"
./classfields.transformers
"
);
exports
.
deimmutifyClassFields
=
classfields_transformers_1
.
deimmutifyClassFields
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsK0RBQTJEO0FBTXpELHNFQUFrQjtBQUxwQix5RUFBbUU7QUFNakUsaUZBQXFCIn0=
\ No newline at end of file
source/store/amkafill/index.ts
0 → 100644
View file @
2cc27bf9
import
{
IAmkaFill
,
IAmkaFills
}
from
'
./amkafills.types
'
;
import
{
amkafillReducer
}
from
'
./amkafills.reducer
'
;
import
{
deimmutifyAmkaFills
}
from
'
./amkafills.transformers
'
;
export
{
IAmkaFill
,
IAmkaFills
,
amkafillReducer
,
deimmutifyAmkaFills
,
};
source/store/store.ts
View file @
2cc27bf9
...
...
@@ -5,6 +5,7 @@ import * as regions from './regionschools';
import
*
as
sectors
from
'
./sectorcourses
'
;
import
*
as
studentDataFields
from
'
./studentdatafields
'
;
import
*
as
epalclasses
from
'
./epalclasses
'
;
import
*
as
amkafills
from
'
./amkafill
'
;
/*
* This is where we 'assemble' the full store out of its modules.
...
...
@@ -17,6 +18,7 @@ export interface IAppState {
sectors
?:
sectors
.
ISectors
;
studentDataFields
?:
studentDataFields
.
IStudentDataFields
;
epalclasses
?:
epalclasses
.
IEpalClasses
;
amkafills
?:
amkafills
.
IAmkaFills
;
};
export
const
rootReducer
=
combineReducers
<
IAppState
>
({
...
...
@@ -26,6 +28,7 @@ export const rootReducer = combineReducers<IAppState>({
sectors
:
sectors
.
sectorCoursesReducer
,
studentDataFields
:
studentDataFields
.
studentDataFieldsReducer
,
epalclasses
:
epalclasses
.
epalclassesReducer
,
amkafills
:
amkafills
.
amkafillReducer
,
});
export
function
deimmutify
(
state
:
IAppState
):
Object
{
...
...
@@ -36,5 +39,6 @@ export function deimmutify(state: IAppState): Object {
sectors
:
sectors
.
deimmutifySectorCourses
(
state
.
sectors
),
studentdataFields
:
studentDataFields
.
deimmutifyStudentDataFields
(
state
.
studentDataFields
),
epalclasses
:
epalclasses
.
deimmutifyEpalClasses
(
state
.
epalclasses
),
amkafills
:
amkafills
.
deimmutifyAmkaFills
(
state
.
amkafills
),
};
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment