This commit is contained in:
Daniel Appelgren
2021-11-24 14:15:40 +01:00
parent 60d4ac4b2c
commit 078cb7a3e2
3 changed files with 5 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
import { RadiobuttonModel } from '@af/digi-ng/_form/form-radiobutton-group';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { AbstractControl, FormControl, FormGroup } from '@angular/forms';
import { EducationLength, EducationLevel, MainOccupation } from '@msfa-models/slutredovisning.model';
import { RequiredValidator } from '@msfa-validators/required.validator';
@@ -27,8 +27,6 @@ export class SlutredovisningFormStep0EducationComponent implements OnInit {
@Input() formData: SlutredovisningFormStep0EducationFormData;
EducationLevel = EducationLevel;
@Input() shouldValidate: boolean;
@Output() nextClick = new EventEmitter<SlutredovisningFormStep0EducationFormData>();
@Output() backClick = new EventEmitter<void>();
private educationLevelFormControlName: FormKeys = 'educationLevel';
private educationLengthFormControlName: FormKeys = 'educationLength';
@@ -87,7 +85,7 @@ export class SlutredovisningFormStep0EducationComponent implements OnInit {
[this.educationLevelFormControlName]: new FormControl(null, [
RequiredValidator('Utbildningsnivå är obligatoriskt'),
]),
[this.otherExplanationFormControlName]: new FormControl(null),
[this.otherExplanationFormControlName]: new FormControl(''),
[this.educationLengthFormControlName]: new FormControl(null, [
RequiredValidator('Utbildningens längd är obligatorisk'),
]),

View File

@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { AbstractControl, FormControl, FormGroup } from '@angular/forms';
import { MainOccupation } from '@msfa-models/slutredovisning.model';
import { RequiredValidator } from '@msfa-validators/required.validator';
@@ -21,9 +21,6 @@ export class SlutredovisningFormStep0OtherComponent implements OnInit {
@Input() formData: SlutredovisningFormStep0OtherFormData;
@Input() shouldValidate: boolean;
@Output() nextClick = new EventEmitter<SlutredovisningFormStep0OtherFormData>();
@Output() backClick = new EventEmitter<void>();
private otherExplanationFormControlName: FormKeys = 'otherExplanation';
formGroup: FormGroup | AbstractControl;
@@ -42,7 +39,7 @@ export class SlutredovisningFormStep0OtherComponent implements OnInit {
} else {
this.formGroup = new FormGroup({
[this.otherExplanationFormControlName]: new FormControl(
null,
'',
RequiredValidator('En beskrivning av Annat är obligatoriskt.')
),
});

View File

@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { AbstractControl, FormControl, FormGroup } from '@angular/forms';
import { MainOccupation, StillUnemployedReason } from '@msfa-models/slutredovisning.model';
import { SlutredovisningFormStep0StillUnemployed } from './slutredovisning-form-step0-still-unemployed.validator';
@@ -31,9 +31,6 @@ export class SlutredovisningFormStep0StillUnemployedComponent implements OnInit
@Input() formData: SlutredovisningFormStep0StillUnemployedFormData;
@Input() shouldValidate: boolean;
@Output() nextClick = new EventEmitter<SlutredovisningFormStep0StillUnemployedFormData>();
@Output() backClick = new EventEmitter<void>();
private stillUnemployedReasonFormControlName: FormKeys = 'reasonsGoalNotReached';
private stillUnemployedExplanationFormControlName: FormKeys = 'stillUnemployedExplanation';