Commit 15c279c1 authored by Χάρης Παπαδόπουλος's avatar Χάρης Παπαδόπουλος
Browse files

Merge branch 'lock_actions' into 'develop'

false validator bug fix. CSS for labels

See merge request !129
parents 1595caef eb5c3883
...@@ -59,17 +59,24 @@ import { ...@@ -59,17 +59,24 @@ import {
}; };
private observableSource = (keyword: any): Observable<any[]> => { private observableSource = (keyword: any): Observable<any[]> => {
let url: string = 'https://mm.sch.gr/api/units?name='+keyword; let url: string = 'https://mm.sch.gr/api/units?name='+keyword;
if (keyword) { if (keyword) {
return this.http.get(url) return this.http.get(url)
.map(res => { .map(res => {
let json = res.json(); let json = res.json();
return json.data; let retArr = <any>Array();
}) for (var i=0; i<json.data.length; i++) {
} else { retArr[i] = {};
return Observable.of([]); retArr[i].registry_no = json.data[i].registry_no;
} retArr[i].name = json.data[i].name;
} retArr[i].unit_type_id = json.data[i].unit_type_id;
}
return retArr;
})
} else {
return Observable.of([]);
}
};
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
private _sdfa: StudentDataFieldsActions, private _sdfa: StudentDataFieldsActions,
...@@ -102,7 +109,7 @@ import { ...@@ -102,7 +109,7 @@ import {
relationtostudent: ['', this.checkChoice], relationtostudent: ['', this.checkChoice],
telnum: ['', [Validators.pattern(VALID_TELEPHONE_PATTERN),Validators.required]], telnum: ['', [Validators.pattern(VALID_TELEPHONE_PATTERN),Validators.required]],
graduation_year: ['', this.checkChoice], graduation_year: ['', this.checkChoice],
lastschool_schoolname: ['', [Validators.pattern(VALID_ADDRESS_PATTERN),Validators.required]], lastschool_schoolname: ['', [Validators.required]],
lastschool_schoolyear: ['', this.checkChoice], lastschool_schoolyear: ['', this.checkChoice],
lastschool_class: ['', this.checkChoice], lastschool_class: ['', this.checkChoice],
}); });
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import {ValidatorFn} from '@angular/forms'; import {ValidatorFn} from '@angular/forms';
import {AbstractControl} from '@angular/forms'; import {AbstractControl} from '@angular/forms';
export const COURSEFIELDS_RECEIVED = 'COURSEFIELDS_RECEIVED'; export const COURSEFIELDS_RECEIVED = 'COURSEFIELDS_RECEIVED';
export const COURSEFIELDS_SELECTED_SAVE = 'COURSEFIELDS_SELECTED_SAVE'; export const COURSEFIELDS_SELECTED_SAVE = 'COURSEFIELDS_SELECTED_SAVE';
...@@ -52,13 +51,6 @@ export const VALID_CAPACITY_PATTERN = '[0-9]*$'; ...@@ -52,13 +51,6 @@ export const VALID_CAPACITY_PATTERN = '[0-9]*$';
export const VALID_EMAIL_PATTERN = '[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}'; export const VALID_EMAIL_PATTERN = '[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}';
//YYYY-MM-DD FULL
//export const VALID_DATE_PATTERN = '(?:19|20)[0-9]{2}/(?:(?:0[1-9]|1[0-2])/(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))';
//MM-DD-YYYY FULL
//export const VALID_DATE_PATTERN = '(?:(?:0[1-9]|1[0-2])[\/\\-. ]?(?:0[1-9]|[12][0-9])|(?:(?:0[13-9]|1[0-2])[\/\\-. ]?30)|(?:(?:0[13578]|1[02])[\/\\-. ]?31))[\/\\-. ]?(?:19|20)[0-9]{2}';
//DD-MM-YYYY
export const VALID_DATE_PATTERN = '([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.](19|20)[0-9][0-9]'; export const VALID_DATE_PATTERN = '([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.](19|20)[0-9][0-9]';
export const SCHOOL_ROLE = 'director'; export const SCHOOL_ROLE = 'director';
......
...@@ -312,3 +312,11 @@ overflow-x: scroll; ...@@ -312,3 +312,11 @@ overflow-x: scroll;
.signout { .signout {
font-size: 0.8em; font-size: 0.8em;
} }
label {
font-weight: bold;
color: #777777;
font-size: 0.9em;
padding-bottom: 2px;
margin-bottom: 0px;
}
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