Commit 8aeadb90 authored by Open Source Developer's avatar Open Source Developer
Browse files

commit

parent 71784dc4
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {
FormBuilder,
FormGroup,
FormControl,
FormArray
} from '@angular/forms';
@Component({ @Component({
selector: 'home', selector: 'home',
template: ` template: `
<div> <div>
<h4>e-EPAL και e-IEK application skeleton</h4> <h4>Στοιχεία Σύνδεσης</h4>
<form [formGroup]="formGroup">
<div class="form-group">
<label for="UserName">Όνομα Χρήστη</label><input class="form-control" type="text" formControlName="Username">
</div>
<div class="form-group">
<label for="Paswd">Κωδικός Ασφαλείας</label><input class="form-control" type="password" formControlName="Paswd">
</div>
<div class="row">
<div class="col-md-2 col-md-offset-5">
<button type="button" class="btn-primary btn-lg pull-center" (click)="checkvalidation()">
Συνέχεια<span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
<div *ngIf="emptyselection==true">
Παρακαλώ συμπληρώστε το ΑΜΚΑ του μαθητή
</div>
</div>
</form>
</div> </div>
` `
}) })
export default class Home { } export default class Home {
public formGroup: FormGroup;
constructor(private fb: FormBuilder) {
this.formGroup = this.fb.group({
Username: [],
Paswd : []
});
};
checkvalidation() {
if (this.fb.group.arguments == 'admin')
{
}
}
\ No newline at end of file
...@@ -14,14 +14,14 @@ import { ...@@ -14,14 +14,14 @@ import {
FormArray FormArray
} from '@angular/forms'; } from '@angular/forms';
import {AppSettings} from '../../app.settings'; import {AppSettings} from '../../app.settings';
@Component({ @Component({
selector: 'amka-fill', selector: 'amka-fill',
template: ` template: `
<form [formGroup]="formGroup"> <form [formGroup]="formGroup">
<div *ngFor="let amkafill$ of amkafills$ | async;"> </div>
<div class="form-group"> <div class="form-group">
<label for="studentAmka">ΑΜΚΑ μαθητή</label><input class="form-control" type="text" formControlName="name"> <label for="studentAmka">ΑΜΚΑ μαθητή</label><input class="form-control" type="text" formControlName="name">
</div> </div>
...@@ -31,6 +31,9 @@ import {AppSettings} from '../../app.settings'; ...@@ -31,6 +31,9 @@ import {AppSettings} from '../../app.settings';
Συνέχεια<span class="glyphicon glyphicon-menu-right"></span> Συνέχεια<span class="glyphicon glyphicon-menu-right"></span>
</button> </button>
</div> </div>
<div *ngIf="emptyselection==true">
Παρακαλώ συμπληρώστε το ΑΜΚΑ του μαθητή
</div>
</div> </div>
</form> </form>
` `
...@@ -41,6 +44,7 @@ import {AppSettings} from '../../app.settings'; ...@@ -41,6 +44,7 @@ import {AppSettings} from '../../app.settings';
public formGroup: FormGroup; public formGroup: FormGroup;
private respond: any; private respond: any;
emptyselection = false ;
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
private _cas: AmkaCheckService, private _cas: AmkaCheckService,
...@@ -54,8 +58,7 @@ import {AppSettings} from '../../app.settings'; ...@@ -54,8 +58,7 @@ import {AppSettings} from '../../app.settings';
ngOnInit() { ngOnInit() {
// this._cfa.getEpalClasses()
console.log(this.formGroup.value);
this.amkafills$ = this._ngRedux.select(state => { this.amkafills$ = this._ngRedux.select(state => {
if (state.amkafills.size > 0) { if (state.amkafills.size > 0) {
...@@ -71,8 +74,14 @@ import {AppSettings} from '../../app.settings'; ...@@ -71,8 +74,14 @@ import {AppSettings} from '../../app.settings';
saveSelected() { saveSelected() {
if (this.formGroup.value.name == undefined) {
this.emptyselection = true;
}
else
{
this._cfa.saveAmkaFills(this.formGroup.value); this._cfa.saveAmkaFills(this.formGroup.value);
this.router.navigate(['/epal-class-select']); this.router.navigate(['/epal-class-select']);
}
} }
} }
\ No newline at end of file
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Observable } from 'rxjs/Rx'; import { Observable } from 'rxjs/Rx';
import { Injectable } from "@angular/core"; import { Injectable } from "@angular/core";
...@@ -14,7 +14,6 @@ import { ...@@ -14,7 +14,6 @@ import {
} from '@angular/forms'; } from '@angular/forms';
import {AppSettings} from '../../app.settings'; import {AppSettings} from '../../app.settings';
@Component({ @Component({
selector: 'epal-class-select', selector: 'epal-class-select',
template: ` template: `
......
...@@ -4,6 +4,7 @@ import {Observable} from "rxjs/Observable"; ...@@ -4,6 +4,7 @@ import {Observable} from "rxjs/Observable";
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import { IAmkaFill } from '../store/amkafill/amkafills.types'; 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/" ;
......
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