Add valid condition in progress calculatiion of a form
This commit is contained in:
parent
dd6a2a0df7
commit
aec7126fd3
|
@ -51,7 +51,7 @@ export class FormProgressIndicationComponent extends BaseComponent implements On
|
|||
let valueCurent = 0;
|
||||
if (formControl instanceof FormGroup) {
|
||||
if (this.checkFormsIfIsFieldsAndVisible(formControl) && this.checkIfIsRequired((formControl as FormGroup))) {
|
||||
if (this.haseValue(formControl))
|
||||
if (this.hasValue(formControl))
|
||||
valueCurent++;
|
||||
}
|
||||
if (this.chechFieldIfIsFieldSetAndVisible((formControl as FormGroup)) && this.checkIfIsRequired((formControl as FormGroup))) {
|
||||
|
@ -69,11 +69,8 @@ export class FormProgressIndicationComponent extends BaseComponent implements On
|
|||
}
|
||||
return valueCurent;
|
||||
}
|
||||
private haseValue(formGroup: FormGroup): boolean {
|
||||
if (formGroup.get('value').value != null && formGroup.get('value').value !== '' && this.visibilityRulesService.checkElementVisibility(formGroup.get('id').value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
private hasValue(formGroup: FormGroup): boolean {
|
||||
return formGroup.get('value').valid && formGroup.get('value').value != null && formGroup.get('value').value !== '' && this.visibilityRulesService.checkElementVisibility(formGroup.get('id').value);
|
||||
}
|
||||
|
||||
private compositeFieldsGetChildsForProgress(formGroup: FormGroup): number {
|
||||
|
|
|
@ -158,7 +158,6 @@ export class FormSectionComponent extends BaseComponent implements OnInit, OnCha
|
|||
|
||||
const outerRules = (this.visibilityRulesService.getVisibilityDependency(target) as VisibilityRuleSource[]).filter(x => x.sourceControlId === element.id);
|
||||
const updatedRules = outerRules.map(x => {
|
||||
console.log(idMappings, element);
|
||||
return {...x, sourceControlId: idMappings.find(y => y.old === element.id).new};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue