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
52fe44e2
Commit
52fe44e2
authored
Apr 21, 2017
by
Χάρης Παπαδόπουλος
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schools-order-select bug fixes. Removed redundant code
parent
7711ae37
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
81 deletions
+20
-81
source/app.settings.ts
source/app.settings.ts
+4
-4
source/components/navbar/navbar.component.ts
source/components/navbar/navbar.component.ts
+0
-4
source/components/student-application-form/application.preview.ts
...omponents/student-application-form/application.preview.ts
+2
-2
source/components/student-application-form/region.schools.select.ts
...ponents/student-application-form/region.schools.select.ts
+0
-5
source/components/student-application-form/schools-order-select.ts
...mponents/student-application-form/schools-order-select.ts
+14
-26
source/services/helper-data-service.ts
source/services/helper-data-service.ts
+0
-40
No files found.
source/app.settings.ts
View file @
52fe44e2
//
export const API_ENDPOINT = 'http://eduslim2.minedu.gov.gr/drupal';
export
const
API_ENDPOINT
=
'
http://eduslim2.minedu.gov.gr/drupal
'
;
export
const
API_ENDPOINT
=
'
http://eduslim2.minedu.gov.gr/angular/eepal-front/drupal
'
;
//
export const API_ENDPOINT = 'http://eduslim2.minedu.gov.gr/angular/eepal-front/drupal';
export
class
AppSettings
{
export
class
AppSettings
{
public
static
get
API_ENDPOINT
():
string
{
public
static
get
API_ENDPOINT
():
string
{
//
return 'http://eduslim2.minedu.gov.gr/drupal';
return
'
http://eduslim2.minedu.gov.gr/drupal
'
;
return
'
http://eduslim2.minedu.gov.gr/angular/eepal-front/drupal
'
;
//
return 'http://eduslim2.minedu.gov.gr/angular/eepal-front/drupal';
}
}
}
}
source/components/navbar/navbar.component.ts
View file @
52fe44e2
...
@@ -44,7 +44,6 @@ import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial
...
@@ -44,7 +44,6 @@ import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
cuName
=
loginInfoToken
.
cu_name
;
this
.
cuName
=
loginInfoToken
.
cu_name
;
console
.
log
(
loginInfoToken
.
cu_name
);
return
loginInfoToken
;
return
loginInfoToken
;
},
{})
},
{})
}
}
...
@@ -62,13 +61,10 @@ import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial
...
@@ -62,13 +61,10 @@ import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial
oauthSignOut
()
{
oauthSignOut
()
{
this
.
_hds
.
signOut
().
then
(
data
=>
{
this
.
_hds
.
signOut
().
then
(
data
=>
{
this
.
_ata
.
initLoginInfo
();
this
.
_ata
.
initLoginInfo
();
console
.
log
(
this
.
authRole
);
if
(
this
.
authRole
===
'
director
'
)
{
if
(
this
.
authRole
===
'
director
'
)
{
console
.
log
(
"
director
"
);
this
.
router
.
navigate
([
'
/school
'
]);
this
.
router
.
navigate
([
'
/school
'
]);
}
}
else
if
(
this
.
authRole
===
'
student
'
)
{
else
if
(
this
.
authRole
===
'
student
'
)
{
console
.
log
(
"
applicant
"
);
this
.
router
.
navigate
([
''
]);
this
.
router
.
navigate
([
''
]);
}
}
this
.
authToken
=
''
;
this
.
authToken
=
''
;
...
...
source/components/student-application-form/application.preview.ts
View file @
52fe44e2
...
@@ -233,10 +233,10 @@ import { STUDENT_DATA_FIELDS_INITIAL_STATE } from '../../store/studentdatafields
...
@@ -233,10 +233,10 @@ import { STUDENT_DATA_FIELDS_INITIAL_STATE } from '../../store/studentdatafields
}
}
showValues
()
{
showValues
()
{
console
.
log
(
this
.
epalclasses$
);
/*
console.log(this.epalclasses$);
console.log(this.studentDataFields$);
console.log(this.studentDataFields$);
console.log(this.regions$);
console.log(this.regions$);
console
.
log
(
this
.
sectors$
);
console.log(this.sectors$);
*/
}
}
}
}
source/components/student-application-form/region.schools.select.ts
View file @
52fe44e2
...
@@ -122,7 +122,6 @@ import {AppSettings} from '../../app.settings';
...
@@ -122,7 +122,6 @@ import {AppSettings} from '../../app.settings';
}
}
ngOnDestroy
()
{
ngOnDestroy
()
{
console
.
log
(
"
on destroy
"
);
if
(
this
.
epalclassesSub
)
{
if
(
this
.
epalclassesSub
)
{
this
.
epalclassesSub
.
unsubscribe
();
this
.
epalclassesSub
.
unsubscribe
();
}
}
...
@@ -172,8 +171,6 @@ import {AppSettings} from '../../app.settings';
...
@@ -172,8 +171,6 @@ import {AppSettings} from '../../app.settings';
}
}
this
.
regionActiveId
=
Number
(
region
.
region_id
);
this
.
regionActiveId
=
Number
(
region
.
region_id
);
this
.
regionActive
=
numreg
-
1
;
this
.
regionActive
=
numreg
-
1
;
//console.log("HERE1: ");
//console.log(this.regionActive);
}
}
if
(
Number
(
region
.
region_id
)
===
this
.
regionActiveId
)
{
if
(
Number
(
region
.
region_id
)
===
this
.
regionActiveId
)
{
if
(
region
.
epals
.
length
<
this
.
regionSizeLimit
)
if
(
region
.
epals
.
length
<
this
.
regionSizeLimit
)
...
@@ -203,7 +200,6 @@ import {AppSettings} from '../../app.settings';
...
@@ -203,7 +200,6 @@ import {AppSettings} from '../../app.settings';
state
.
sectorFields
.
reduce
(({},
sectorField
)
=>
{
state
.
sectorFields
.
reduce
(({},
sectorField
)
=>
{
if
(
sectorField
.
selected
===
true
)
{
if
(
sectorField
.
selected
===
true
)
{
this
.
courseActive
=
sectorField
.
id
;
this
.
courseActive
=
sectorField
.
id
;
console
.
log
(
epalClass
);
this
.
_rsa
.
getRegionSchools
(
2
,
this
.
courseActive
,
false
);
this
.
_rsa
.
getRegionSchools
(
2
,
this
.
courseActive
,
false
);
}
}
return
sectorField
;
return
sectorField
;
...
@@ -218,7 +214,6 @@ import {AppSettings} from '../../app.settings';
...
@@ -218,7 +214,6 @@ import {AppSettings} from '../../app.settings';
sector
.
courses
.
reduce
((
prevCourse
,
course
)
=>
{
sector
.
courses
.
reduce
((
prevCourse
,
course
)
=>
{
if
(
course
.
selected
===
true
)
{
if
(
course
.
selected
===
true
)
{
this
.
courseActive
=
parseInt
(
course
.
course_id
);
this
.
courseActive
=
parseInt
(
course
.
course_id
);
console
.
log
(
epalClass
);
this
.
_rsa
.
getRegionSchools
(
3
,
this
.
courseActive
,
false
);
this
.
_rsa
.
getRegionSchools
(
3
,
this
.
courseActive
,
false
);
}
}
return
course
;
return
course
;
...
...
source/components/student-application-form/schools-order-select.ts
View file @
52fe44e2
...
@@ -7,12 +7,6 @@ import { RegionSchoolsActions } from '../../actions/regionschools.actions';
...
@@ -7,12 +7,6 @@ import { RegionSchoolsActions } from '../../actions/regionschools.actions';
import
{
IRegions
}
from
'
../../store/regionschools/regionschools.types
'
;
import
{
IRegions
}
from
'
../../store/regionschools/regionschools.types
'
;
import
{
REGION_SCHOOLS_INITIAL_STATE
}
from
'
../../store/regionschools/regionschools.initial-state
'
;
import
{
REGION_SCHOOLS_INITIAL_STATE
}
from
'
../../store/regionschools/regionschools.initial-state
'
;
import
{
IAppState
}
from
'
../../store/store
'
;
import
{
IAppState
}
from
'
../../store/store
'
;
import
{
FormBuilder
,
FormGroup
,
FormControl
}
from
'
@angular/forms
'
;
import
{
AppSettings
}
from
'
../../app.settings
'
;
import
{
AppSettings
}
from
'
../../app.settings
'
;
@
Component
({
@
Component
({
...
@@ -26,12 +20,11 @@ import {AppSettings} from '../../app.settings';
...
@@ -26,12 +20,11 @@ import {AppSettings} from '../../app.settings';
Καθορίστε εδώ την επιθυμητή σειρά προτίμησης των σχολείων πατώντας τα αντίστοιχα βέλη δεξιά από τα ονόματα των σχολείων.
Καθορίστε εδώ την επιθυμητή σειρά προτίμησης των σχολείων πατώντας τα αντίστοιχα βέλη δεξιά από τα ονόματα των σχολείων.
Αν συμφωνείτε με την υπάρχουσα σειρά προτίμησης, πατήστε <i>Συνέχεια</i>.</p>
Αν συμφωνείτε με την υπάρχουσα σειρά προτίμησης, πατήστε <i>Συνέχεια</i>.</p>
<form [formGroup]="formGroup">
<ul class="list-group main-view">
<ul class="list-group main-view">
<div *ngFor="let schoolField$ of schoolNames$ | async; let i=index; let isOdd=odd; let isEven=even">
<div *ngFor="let schoolField$ of schoolNames$ | async; let i=index; let isOdd=odd; let isEven=even">
<li class="list-group-item" [class.oddout]="isOdd" [class.evenout]="isEven">
<li class="list-group-item" [class.oddout]="isOdd" [class.evenout]="isEven">
Προτίμηση {{i+1}}: {{schoolField$}}
Προτίμηση {{i+1}}: {{schoolField$}}
<
div (click)="changeOrder(i,'up')" *ngIf = "i !== 0" class="fa fa-arrow-circle-up isclickable pull-right" style="font-size: 2em;"></div
>
<
i (click)="changeOrder(i,'up')" *ngIf = "i !== 0" class="fa fa-arrow-circle-up isclickable pull-right" style="font-size: 2em;"></i
>
</li>
</li>
</div>
</div>
</ul>
</ul>
...
@@ -47,13 +40,11 @@ import {AppSettings} from '../../app.settings';
...
@@ -47,13 +40,11 @@ import {AppSettings} from '../../app.settings';
</button>
</button>
</div>
</div>
</div>
</div>
</form>
`
`
})
})
@
Injectable
()
export
default
class
SchoolsOrderSelect
implements
OnInit
,
OnDestroy
{
@
Injectable
()
export
default
class
SchoolsOrderSelect
implements
OnInit
,
OnDestroy
{
public
formGroup
:
FormGroup
;
//
public formGroup: FormGroup;
private
numSelected$
:
BehaviorSubject
<
number
>
=
new
BehaviorSubject
(
0
);
private
numSelected$
:
BehaviorSubject
<
number
>
=
new
BehaviorSubject
(
0
);
private
schoolNames$
:
BehaviorSubject
<
Array
<
string
>>
=
new
BehaviorSubject
(
Array
());
private
schoolNames$
:
BehaviorSubject
<
Array
<
string
>>
=
new
BehaviorSubject
(
Array
());
private
schoolSelectedIds$
:
BehaviorSubject
<
Array
<
number
>>
=
new
BehaviorSubject
(
Array
());
private
schoolSelectedIds$
:
BehaviorSubject
<
Array
<
number
>>
=
new
BehaviorSubject
(
Array
());
...
@@ -61,41 +52,43 @@ import {AppSettings} from '../../app.settings';
...
@@ -61,41 +52,43 @@ import {AppSettings} from '../../app.settings';
private
regions$
:
BehaviorSubject
<
IRegions
>
;
private
regions$
:
BehaviorSubject
<
IRegions
>
;
private
regionsSub
:
Subscription
;
private
regionsSub
:
Subscription
;
constructor
(
private
fb
:
FormBuilder
,
constructor
(
private
_cfa
:
RegionSchoolsActions
,
private
_cfa
:
RegionSchoolsActions
,
private
_ngRedux
:
NgRedux
<
IAppState
>
,
private
_ngRedux
:
NgRedux
<
IAppState
>
,
private
router
:
Router
)
{
private
router
:
Router
)
{
this
.
formGroup
=
this
.
fb
.
group
({
});
this
.
regions$
=
new
BehaviorSubject
(
REGION_SCHOOLS_INITIAL_STATE
);
this
.
regions$
=
new
BehaviorSubject
(
REGION_SCHOOLS_INITIAL_STATE
);
};
};
ngOnInit
()
{
ngOnInit
()
{
this
.
regionsSub
=
this
.
_ngRedux
.
select
(
state
=>
{
this
.
regionsSub
=
this
.
_ngRedux
.
select
(
state
=>
{
let
numSelected
=
0
;
let
numSelected
=
0
;
let
idx
=
-
1
;
let
idx
=
-
1
;
let
nm
=
1
;
let
nm
=
0
;
let
schoolNames
=
new
Array
();
let
schoolNames
=
new
Array
();
let
schoolSelectedIds
=
new
Array
();
let
schoolSelectedIds
=
new
Array
();
let
schoolArrayOrders
=
new
Array
();
let
schoolArrayOrders
=
new
Array
();
let
maxOrderId
=
3
;
state
.
regions
.
reduce
((
prevRegion
,
region
)
=>
{
state
.
regions
.
reduce
((
prevRegion
,
region
)
=>
{
region
.
epals
.
reduce
((
prevEpal
,
epal
)
=>
{
region
.
epals
.
reduce
((
prevEpal
,
epal
)
=>
{
++
idx
;
++
idx
;
if
(
epal
.
selected
===
true
)
{
if
(
epal
.
selected
===
true
)
{
numSelected
++
;
numSelected
++
;
schoolArrayOrders
[
idx
]
=
nm
;
nm
++
;
if
(
epal
.
order_id
===
0
)
{
if
(
epal
.
order_id
===
0
)
{
schoolNames
[
idx
]
=
epal
.
epal_name
;
schoolArrayOrders
[
idx
]
=
maxOrderId
;
schoolSelectedIds
[
idx
]
=
idx
;
maxOrderId
--
;
schoolNames
[
nm
]
=
epal
.
epal_name
;
schoolSelectedIds
[
nm
]
=
idx
;
}
}
else
{
else
{
schoolArrayOrders
[
nm
]
=
epal
.
order_id
;
schoolNames
[
epal
.
order_id
-
1
]
=
epal
.
epal_name
;
schoolNames
[
epal
.
order_id
-
1
]
=
epal
.
epal_name
;
schoolSelectedIds
[
epal
.
order_id
-
1
]
=
idx
;
schoolSelectedIds
[
epal
.
order_id
-
1
]
=
idx
;
}
}
nm
++
;
}
else
{
}
else
{
schoolArrayOrders
[
idx
]
=
0
;
schoolArrayOrders
[
idx
]
=
0
;
...
@@ -113,12 +106,9 @@ import {AppSettings} from '../../app.settings';
...
@@ -113,12 +106,9 @@ import {AppSettings} from '../../app.settings';
return
state
.
regions
;
return
state
.
regions
;
}).
subscribe
(
this
.
regions$
);
}).
subscribe
(
this
.
regions$
);
}
}
ngOnDestroy
()
{
ngOnDestroy
()
{
console
.
log
(
"
on destroy
"
);
if
(
this
.
regionsSub
)
{
if
(
this
.
regionsSub
)
{
this
.
regionsSub
.
unsubscribe
();
this
.
regionsSub
.
unsubscribe
();
}
}
...
@@ -152,7 +142,5 @@ import {AppSettings} from '../../app.settings';
...
@@ -152,7 +142,5 @@ import {AppSettings} from '../../app.settings';
navigateBack
()
{
navigateBack
()
{
this
.
router
.
navigate
([
'
/region-schools-select
'
]);
this
.
router
.
navigate
([
'
/region-schools-select
'
]);
}
}
}
}
source/services/helper-data-service.ts
View file @
52fe44e2
...
@@ -74,8 +74,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -74,8 +74,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
// "Accept": "*/*",
// "Accept": "*/*",
...
@@ -103,8 +101,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -103,8 +101,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
// "Accept": "*/*",
// "Accept": "*/*",
...
@@ -114,7 +110,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -114,7 +110,6 @@ export class HelperDataService implements OnInit, OnDestroy {
// let options = new RequestOptions({ headers: headers, withCredentials: true });
// let options = new RequestOptions({ headers: headers, withCredentials: true });
let
options
=
new
RequestOptions
({
headers
:
headers
});
let
options
=
new
RequestOptions
({
headers
:
headers
});
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
"
verificationCode=
"
+
verificationCode
);
this
.
http
.
post
(
`
${
AppSettings
.
API_ENDPOINT
}
/epal/user/verifyvercode`
,
{
verificationCode
:
verificationCode
},
options
)
this
.
http
.
post
(
`
${
AppSettings
.
API_ENDPOINT
}
/epal/user/verifyvercode`
,
{
verificationCode
:
verificationCode
},
options
)
.
map
(
response
=>
response
.
json
())
.
map
(
response
=>
response
.
json
())
.
subscribe
(
data
=>
{
.
subscribe
(
data
=>
{
...
@@ -133,8 +128,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -133,8 +128,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
});
});
...
@@ -160,8 +153,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -160,8 +153,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
@@ -195,8 +186,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -195,8 +186,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
@@ -229,8 +218,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -229,8 +218,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
@@ -273,8 +260,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -273,8 +260,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
@@ -350,8 +335,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -350,8 +335,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
"
X-CSRF-Token
"
:
"
LU92FaWYfImfZxfldkF5eVnssdHoV7Aa9fg8K1bWYUc
"
,
"
X-CSRF-Token
"
:
"
LU92FaWYfImfZxfldkF5eVnssdHoV7Aa9fg8K1bWYUc
"
,
...
@@ -418,8 +401,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -418,8 +401,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
@@ -439,7 +420,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -439,7 +420,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
createAuthorizationHeader
(
headers
);
this
.
createAuthorizationHeader
(
headers
);
let
options
=
new
RequestOptions
({
headers
:
headers
,
withCredentials
:
true
});
let
options
=
new
RequestOptions
({
headers
:
headers
,
withCredentials
:
true
});
let
logoutRoute
=
'
/oauth/logout
'
;
let
logoutRoute
=
'
/oauth/logout
'
;
console
.
log
(
this
.
authRole
);
if
(
this
.
authRole
===
'
director
'
)
if
(
this
.
authRole
===
'
director
'
)
logoutRoute
=
'
/cas/logout
'
;
logoutRoute
=
'
/cas/logout
'
;
...
@@ -467,8 +447,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -467,8 +447,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
"
id
"
:
""
"
id
"
:
""
...
@@ -486,8 +464,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -486,8 +464,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
});
});
...
@@ -504,8 +480,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -504,8 +480,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
});
});
...
@@ -522,8 +496,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -522,8 +496,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
});
});
...
@@ -540,8 +512,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -540,8 +512,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
});
});
...
@@ -562,9 +532,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -562,9 +532,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
...
@@ -578,13 +545,10 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -578,13 +545,10 @@ export class HelperDataService implements OnInit, OnDestroy {
saveConfirmStudents
(
students
)
{
saveConfirmStudents
(
students
)
{
console
.
log
(
students
,
"
hds
"
);
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
});
});
...
@@ -609,13 +573,10 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -609,13 +573,10 @@ export class HelperDataService implements OnInit, OnDestroy {
saveCapacity
(
taxi
,
tomeas
,
specialit
,
capacity
,
schoolid
)
{
saveCapacity
(
taxi
,
tomeas
,
specialit
,
capacity
,
schoolid
)
{
console
.
log
(
taxi
,
capacity
,
"
hds
"
);
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json
"
,
});
});
...
@@ -654,7 +615,6 @@ export class HelperDataService implements OnInit, OnDestroy {
...
@@ -654,7 +615,6 @@ export class HelperDataService implements OnInit, OnDestroy {
resolve
(
data
);
resolve
(
data
);
},
},
error
=>
{
error
=>
{
//console.log("Error Sending Ministry Credentials");
reject
(
"
Error Sending Ministry Credentials
"
);
reject
(
"
Error Sending Ministry Credentials
"
);
},
},
()
=>
console
.
log
(
""
));
()
=>
console
.
log
(
""
));
...
...
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