Commit 71784dc4 authored by Open Source Developer's avatar Open Source Developer

a

parent 2cc27bf9
...@@ -2,7 +2,7 @@ export class AppSettings { ...@@ -2,7 +2,7 @@ export class AppSettings {
public static get API_ENDPOINT(): string { public static get API_ENDPOINT(): string {
return 'http://localhost/angular/eepal-front/drupal'; return 'http://localhost/angular/eepal-front/drupal';
/ return 'http://localhost/drupal-8.2.5'; // return 'http://localhost/drupal-8.2.5';
// return 'http://eepal.dev/drupal'; // return 'http://eepal.dev/drupal';
// return 'http://eduslim2.minedu.gov.gr/drupal'; // return 'http://eduslim2.minedu.gov.gr/drupal';
} }
......
...@@ -7,7 +7,6 @@ import { NgRedux, select } from 'ng2-redux'; ...@@ -7,7 +7,6 @@ import { NgRedux, select } from 'ng2-redux';
import { IAmkaFills } from '../../store/amkafill/amkafills.types'; import { IAmkaFills } from '../../store/amkafill/amkafills.types';
import { IAppState } from '../../store/store'; import { IAppState } from '../../store/store';
import { AmkaCheckService} from '../../services/amkacheck-service'; import { AmkaCheckService} from '../../services/amkacheck-service';
import { import {
FormBuilder, FormBuilder,
FormGroup, FormGroup,
...@@ -33,8 +32,7 @@ import {AppSettings} from '../../app.settings'; ...@@ -33,8 +32,7 @@ import {AppSettings} from '../../app.settings';
</button> </button>
</div> </div>
</div> </div>
</form>
</form>
` `
}) })
...@@ -73,9 +71,6 @@ import {AppSettings} from '../../app.settings'; ...@@ -73,9 +71,6 @@ import {AppSettings} from '../../app.settings';
saveSelected() { saveSelected() {
this._cas.checkstudentamka(this.formGroup.value)
.subscribe(res =>this.respond = res);
console.log(this.respond);
this._cfa.saveAmkaFills(this.formGroup.value); this._cfa.saveAmkaFills(this.formGroup.value);
this.router.navigate(['/epal-class-select']); this.router.navigate(['/epal-class-select']);
} }
......
...@@ -37,7 +37,11 @@ import {AppSettings} from '../../app.settings'; ...@@ -37,7 +37,11 @@ import {AppSettings} from '../../app.settings';
</button> </button>
</div> </div>
</div> </div>
<div *ngIf="emptyselection==true">
Παρακαλώ επιλέξτε μια τάξη
</div>
</form> </form>
` `
}) })
...@@ -47,7 +51,7 @@ import {AppSettings} from '../../app.settings'; ...@@ -47,7 +51,7 @@ import {AppSettings} from '../../app.settings';
public formGroup: FormGroup; public formGroup: FormGroup;
emptyselection = false;
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
private _cfa: EpalClassesActions, private _cfa: EpalClassesActions,
private _ngRedux: NgRedux<IAppState>, private _ngRedux: NgRedux<IAppState>,
...@@ -59,8 +63,6 @@ import {AppSettings} from '../../app.settings'; ...@@ -59,8 +63,6 @@ import {AppSettings} from '../../app.settings';
ngOnInit() { ngOnInit() {
// this._cfa.getEpalClasses()
this.epalclasses$ = this._ngRedux.select(state => { this.epalclasses$ = this._ngRedux.select(state => {
if (state.epalclasses.size > 0) { if (state.epalclasses.size > 0) {
state.epalclasses.reduce(({}, epalclass) => { state.epalclasses.reduce(({}, epalclass) => {
...@@ -74,9 +76,16 @@ import {AppSettings} from '../../app.settings'; ...@@ -74,9 +76,16 @@ import {AppSettings} from '../../app.settings';
} }
saveSelected() { saveSelected() {
this._cfa.saveEpalClassesSelected(this.formGroup.value);
this.router.navigate(['/region-schools-select']); if (this.formGroup.value.name == undefined) {
this.emptyselection = true;
} }
else
{
this._cfa.saveEpalClassesSelected(this.formGroup.value);
this.router.navigate(['/region-schools-select']);
}
} }
}
...@@ -15,4 +15,6 @@ export const STUDENTDATAFIELDS_SAVE = 'STUDENTDATAFIELDS_SAVE'; ...@@ -15,4 +15,6 @@ export const STUDENTDATAFIELDS_SAVE = 'STUDENTDATAFIELDS_SAVE';
export const EPALCLASSES_SAVE = 'EPALCLASSES_SAVE'; export const EPALCLASSES_SAVE = 'EPALCLASSES_SAVE';
export const AMKAFILL_SAVE = 'AMKAFILL_SAVE';
export const VALID_NAMES_PATTERN = '[Α-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$'; export const VALID_NAMES_PATTERN = '[Α-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$';
...@@ -2,16 +2,16 @@ import {Http,Response, RequestOptions, Headers} from '@angular/http'; ...@@ -2,16 +2,16 @@ import {Http,Response, RequestOptions, Headers} from '@angular/http';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import { IAmkaFill } from '../store/amkafill/amkafills.types';
@Injectable() @Injectable()
export class AmkaCheckService { export class AmkaCheckService {
private _url = "https://wso2.minedu.gov.gr/amka/v1.1/" ; private _url = "https://wso2.minedu.gov.gr/amka/v1.1/" ;
private respond :Object
constructor(private _http: Http) { constructor(private _http: Http) {
}; };
checkstudentamka(amka: any) { checkstudentamka(amka: any) {
let authToken = '7bed3fc5-f9f5-3613-abcd-3b08bab0f625'; let authToken = '7bed3fc5-f9f5-3613-abcd-3b08bab0f625';
let headers = new Headers({ 'Accept': 'application/json' }); let headers = new Headers({ 'Accept': 'application/json' });
headers.append('Authorization', `Bearer ${authToken}`); headers.append('Authorization', `Bearer ${authToken}`);
...@@ -20,8 +20,10 @@ export class AmkaCheckService { ...@@ -20,8 +20,10 @@ export class AmkaCheckService {
let parameter1 = 'ksdhkshf' ; let parameter1 = 'ksdhkshf' ;
return this._http.get(this._url+ amka.name +'/'+ parameter1 ,options) this._http.get(this._url+ amka.name +'/'+ parameter1 ,options)
.map(response => response.json() ); .map(response =><IAmkaFill[]>response.json() )
.subscribe(res =>this.respond = res);
return this.respond;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment