minor bug fixed regarding minimum number of apps per user

parent 951175d6
......@@ -193,9 +193,14 @@
<select class="form-control" formControlName="relationtostudent">
<option value="">Παρακαλώ επιλέξτε...</option>
<!-- [selected] = "(numAppSelf | async) !== 0" -->
<option *ngIf = "(numAppChildren | async) < (numChildren | async)" value="Γονέας/Κηδεμόνας">Γονέας/Κηδεμόνας</option>
<option *ngIf = "(!appUpdate | async) && (numAppChildren | async) < (numChildren | async)" value="Γονέας/Κηδεμόνας">Γονέας/Κηδεμόνας</option>
<!-- [selected] = "(numAppChildren | async) === (numChildren | async)" -->
<option *ngIf = "(numAppSelf | async) === 0" value="Μαθητής">Μαθητής</option>
<option *ngIf = "(!appUpdate | async) && (numAppSelf | async) === 0" value="Μαθητής">Μαθητής</option>
<option *ngIf = "(appUpdate | async)" [selected]="true" value={{reltostud.value}}>{{reltostud.value}}</option>
<option *ngIf = "(appUpdate | async) && (reltostud.value != 'Γονέας/Κηδεμόνας') && (numAppChildren | async) < (numChildren | async)" value="Γονέας/Κηδεμόνας">Γονέας/Κηδεμόνας</option>
<option *ngIf = "(appUpdate | async) && (reltostud.value != 'Μαθητής') && (numAppSelf | async) === 0" value="Μαθητής">Μαθητής</option>
</select>
<div class="alert alert-danger" *ngIf="studentDataGroup.get('relationtostudent').dirty && studentDataGroup.get('relationtostudent').hasError('status')">
......
......@@ -56,6 +56,7 @@ import {
private previousSector: BehaviorSubject<string>;
private previousCourse: BehaviorSubject<string>;
private previousSchools: BehaviorSubject<string>;
private reltostud: BehaviorSubject<string>;
private numAppSelf: BehaviorSubject<number>;
private numAppChildren: BehaviorSubject<number>;
private numChildren: BehaviorSubject<number>;
......@@ -108,10 +109,12 @@ import {
this.previousSector = new BehaviorSubject("");
this.previousCourse = new BehaviorSubject("");
this.previousSchools = new BehaviorSubject("");
this.reltostud = new BehaviorSubject("");
this.numAppSelf = new BehaviorSubject(0);
this.numAppChildren = new BehaviorSubject(0);
this.numChildren = new BehaviorSubject(0);
this.epalUserData$ = new BehaviorSubject(<any>{ userEmail: "", userName: "", userSurname: "", userFathername: "", userMothername: "" , representRole: "" });
this.epalUserData$ = new BehaviorSubject(<any>{ userEmail: "", userName: "", userSurname: "", userFathername: "", userMothername: "" ,
representRole: "", numAppSelf: 0, numAppChildren: 0, numChildren: 0 });
this.studentDataFields$ = new BehaviorSubject(STUDENT_DATA_FIELDS_INITIAL_STATE);
this.studentDataGroup = this.fb.group({
......@@ -175,12 +178,12 @@ import {
ecs.reduce(({}, datamode,i) => {
this.appId.next(datamode.get("appid"));
this.appUpdate.next(datamode.get("app_update"));
this.previousClass.next(datamode.get("currentclass"));
this.previousSector.next(datamode.get("sector_name"));
this.previousCourse.next(datamode.get("course_name"));
this.previousSchools.next(datamode.get("epal_name_choice"));
this.reltostud.next(datamode.get("relationtostudent"));
if (datamode.get("edit") === true) {
this.dataEdit.next(true);
this.lastSchName.next(datamode.get("lastschool_schoolname"));
......@@ -271,7 +274,8 @@ import {
if (this.appUpdate.getValue() === true) {
this._cfa.saveDataModeSelected({edit: false, app_update: true, appid: this.appId.getValue(),
currentclass: this.previousClass.getValue(), sector_name: this.previousSector.getValue(),
course_name: this.previousCourse.getValue(), epal_name_choice: this.previousSchools.getValue()
course_name: this.previousCourse.getValue(), epal_name_choice: this.previousSchools.getValue(),
relationtostudent: this.reltostud.getValue()
});
}
else {
......
......@@ -43,7 +43,9 @@ import { HelperDataService } from "../../services/helper-data-service";
userEmail: ["", [Validators.pattern(VALID_EMAIL_PATTERN), Validators.required]],
representRole: ["", []],
});
this.epalUserData$ = new BehaviorSubject(<any>{ userEmail: "", userName: "", userSurname: "", userFathername: "", userMothername: "" , representRole: "" });
//this.epalUserData$ = new BehaviorSubject(<any>{ userEmail: "", userName: "", userSurname: "", userFathername: "", userMothername: "" , representRole: "" });
this.epalUserData$ = new BehaviorSubject(<any>{ userEmail: "", userName: "", userSurname: "", userFathername: "", userMothername: "" ,
representRole: "", numAppSelf: 0, numAppChildren: 0, numChildren: 0 });
this.showLoader = new BehaviorSubject(false);
this.modalTitle = new BehaviorSubject("");
this.modalText = new BehaviorSubject("");
......
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